Skip to content

Commit

Permalink
chore: refactor components
Browse files Browse the repository at this point in the history
  • Loading branch information
Darlington02 committed Aug 28, 2024
1 parent e2115ec commit e16439b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
Binary file modified .DS_Store
Binary file not shown.
23 changes: 9 additions & 14 deletions src/components/lockable/lockable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ pub mod LockableComponent {
ILockable, ILockableDispatcher, ILockableDispatcherTrait
};

// *************************************************************************
// STORAGE
// *************************************************************************
#[storage]
pub struct Storage {
lock_until: u64
}

// *************************************************************************
// EVENTS
// *************************************************************************
#[event]
#[derive(Drop, starknet::Event)]
pub enum Event {
Expand Down Expand Up @@ -51,11 +57,11 @@ pub mod LockableComponent {
pub const LOCKED_ACCOUNT: felt252 = 'Account: Locked';
}

// *************************************************************************
// CONSTANTS
// *************************************************************************
pub const YEAR_DAYS_SECONDS: u64 = 31536000;


// storage that store the token_id and the lock_util perioed

// *************************************************************************
// EXTERNAL FUNCTIONS
// *************************************************************************
Expand All @@ -78,7 +84,6 @@ pub mod LockableComponent {
);

let (lock_status, _) = self.is_locked();

assert(lock_status != true, Errors::LOCKED_ACCOUNT);

// update account state
Expand Down Expand Up @@ -110,13 +115,3 @@ pub mod LockableComponent {
}
}
}
// let unlock_timestamp = self.account_unlock_timestamp.read();
// let current_time = get_block_timestamp();
// if (current_time < unlock_timestamp) {
// let time_until_unlocks = unlock_timestamp - current_time;
// return (true, time_until_unlocks);
// } else {
// return (false, 0_u64);
// }


0 comments on commit e16439b

Please sign in to comment.