diff --git a/src/accountV3/accountV3.cairo b/src/accountV3/accountV3.cairo index 785bc58..3d948be 100644 --- a/src/accountV3/accountV3.cairo +++ b/src/accountV3/accountV3.cairo @@ -175,7 +175,7 @@ pub mod AccountV3 { assert(self.is_valid_signer(caller), Errors::UNAUTHORIZED); // cannot make this call when the account is lock - let (is_locked, _) = self.lockable.is_locked(); + let (is_locked, _) = self.lockable._is_locked(); assert(is_locked != true, Errors::ACCOUNT_LOCKED); // execute calls @@ -196,7 +196,7 @@ pub mod AccountV3 { assert(self.signatory._base_signer_validation(caller), Errors::UNAUTHORIZED); // cannot make this call when the account is lock - let (is_locked, _) = self.lockable.is_locked(); + let (is_locked, _) = self.lockable._is_locked(); assert(is_locked != true, Errors::ACCOUNT_LOCKED); // upgrade account @@ -217,12 +217,12 @@ pub mod AccountV3 { assert(self.is_valid_signer(caller), Errors::UNAUTHORIZED); // lock account - self.lockable.lock(lock_until); + self.lockable._lock(lock_until); } // @notice returns the lock status of an account fn is_locked(self: @ContractState) -> (bool, u64) { - self.lockable.is_locked() + self.lockable._is_locked() } } @@ -240,7 +240,7 @@ pub mod AccountV3 { permissions: Array ) { // set permissions - self.permissionable.set_permission(permissioned_addresses, permissions) + self.permissionable._set_permission(permissioned_addresses, permissions) } // @notice returns if a user has permission or not @@ -249,7 +249,7 @@ pub mod AccountV3 { fn has_permission( self: @ContractState, owner: ContractAddress, permissioned_address: ContractAddress ) -> bool { - self.permissionable.has_permission(owner, permissioned_address) + self.permissionable._has_permission(owner, permissioned_address) } } } diff --git a/src/components/lockable/lockable.cairo b/src/components/lockable/lockable.cairo index d79b76a..30233d1 100644 --- a/src/components/lockable/lockable.cairo +++ b/src/components/lockable/lockable.cairo @@ -74,13 +74,13 @@ pub mod LockableComponent { > of LockablePrivateTrait { // @notice locks an account // @param lock_until time at which this account will no longer be locked - fn lock(ref self: ComponentState, lock_until: u64) { + fn _lock(ref self: ComponentState, lock_until: u64) { let current_timestamp = get_block_timestamp(); assert( lock_until <= current_timestamp + YEAR_TO_SECONDS, Errors::EXCEEDS_MAX_LOCK_TIME ); - let (lock_status, _) = self.is_locked(); + let (lock_status, _) = self._is_locked(); assert(lock_status != true, Errors::LOCKED_ACCOUNT); // update account state @@ -100,7 +100,7 @@ pub mod LockableComponent { } // @notice returns the lock status of an account - fn is_locked(self: @ComponentState) -> (bool, u64) { + fn _is_locked(self: @ComponentState) -> (bool, u64) { let unlock_timestamp = self.lock_until.read(); let current_time = get_block_timestamp(); if (current_time < unlock_timestamp) { diff --git a/src/components/permissionable/permissionable.cairo b/src/components/permissionable/permissionable.cairo index 2e7aa22..f530a29 100644 --- a/src/components/permissionable/permissionable.cairo +++ b/src/components/permissionable/permissionable.cairo @@ -68,7 +68,7 @@ pub mod PermissionableComponent { // @notice sets permission for an account // @permissioned_addresses array of addresses who's permission is to be updated // @param permssions permission value - fn set_permission( + fn _set_permission( ref self: ComponentState, permissioned_addresses: Array, permissions: Array @@ -105,7 +105,7 @@ pub mod PermissionableComponent { // @notice returns if a user has permission or not // @param owner tokenbound account owner // @param permissioned_address address to check permission for - fn has_permission( + fn _has_permission( self: @ComponentState, owner: ContractAddress, permissioned_address: ContractAddress diff --git a/src/components/presets/account_preset.cairo b/src/components/presets/account_preset.cairo index 050871d..7b022cf 100644 --- a/src/components/presets/account_preset.cairo +++ b/src/components/presets/account_preset.cairo @@ -115,7 +115,7 @@ pub mod AccountPreset { assert(self.is_valid_signer(caller), 'Account: unauthorized'); // cannot make this call when the account is lock - let (is_locked, _) = self.lockable.is_locked(); + let (is_locked, _) = self.lockable._is_locked(); assert(is_locked != true, 'Account: locked'); // execute calls @@ -134,7 +134,7 @@ pub mod AccountPreset { assert(self.is_valid_signer(caller), 'Account: unauthorized'); // cannot make this call when the account is lock - let (is_locked, _) = self.lockable.is_locked(); + let (is_locked, _) = self.lockable._is_locked(); assert(is_locked != true, 'Account: locked'); // upgrade account @@ -153,11 +153,11 @@ pub mod AccountPreset { assert(self.is_valid_signer(caller), 'Account: unauthorized'); // lock account - self.lockable.lock(lock_until); + self.lockable._lock(lock_until); } fn is_locked(self: @ContractState) -> (bool, u64) { - self.lockable.is_locked() + self.lockable._is_locked() } } @@ -172,13 +172,13 @@ pub mod AccountPreset { permissions: Array ) { // set permissions - self.permissionable.set_permission(permissioned_addresses, permissions) + self.permissionable._set_permission(permissioned_addresses, permissions) } fn has_permission( self: @ContractState, owner: ContractAddress, permissioned_address: ContractAddress ) -> bool { - self.permissionable.has_permission(owner, permissioned_address) + self.permissionable._has_permission(owner, permissioned_address) } } } diff --git a/src/components/signatory/signatory.cairo b/src/components/signatory/signatory.cairo index 0061893..4481151 100644 --- a/src/components/signatory/signatory.cairo +++ b/src/components/signatory/signatory.cairo @@ -68,7 +68,7 @@ pub mod SignatoryComponent { // check if signer has permissions let permission = get_dep_component!(self, Permissionable); - let is_permissioned = permission.has_permission(owner, signer); + let is_permissioned = permission._has_permission(owner, signer); // validate if (signer == owner) {