🔒Account Lock
The Account Lock contract is used to provide the account guardians with essential functions to perform account locking operations on the smart wallet accounts they may be guarding.
Only a single instance of the Account Lock contract is deployed.
You can refer to the Guardian smart wallet architecture to understand the high-level inter-dependencies between various contracts.
Usage
On the client side:
Use the AccountGuardian
contract address directly on the client side to interact with the deployed contract.
In smart-contract projects:
Functions
Triggered by a guardian to create a lock request for an account they may be guarding.
Can only be called by a verified account guardian, allotted by the smart wallet owner as a guardian.
Params:
account
address of the smart wallet account to be locked.
Returns:
bytes32
the account lock request hash.
Triggered by a guardian to create an unlock request for a locked account.
Can only be called by a verified account guardian, allotted by the smart wallet owner as a guardian.
Params:
account
address of the locked smart wallet account to be unlocked.
Returns:
bytes32
the account's unlock request hash.
Records guardian's signature on the lock request of an account, it may be guarding. It updates the lockRequestToGuardianToSignature
mapping.
Can only be called by a verified account guardian, allotted by the smart wallet owner as a guardian.
Params:
lockRequest
Active lock request of an account.
signature
Guardian's signature on the lock request
Records the guardian's signature on the unlock request of a locked account. It updates the unLockRequestToGuardianToSignature
mapping.
Can only be called by a verified account guardian, allotted by the smart wallet owner as a guardian.
Params:
unLockRequest
Active lock request of an account.
signature
Guardian's signature on the lock request
This function is used to evaluate if consensus was achieved on an active lock/unlock request of an account. This will return true
if the majority of the account guardians sign the lock/unlock request for the account.
Can only be called by a verified account guardian, allotted by the smart wallet owner as a guardian.
Params:
account
An account whose lock request consensus is being evaluated.
Returns:
bool
Returns a boolean flag representing the result of the lock request consensus.
Returns a boolean indicating if a lock request for the account already exists.
Params:
account
Account for which active lock request is being checked
Returns:
bool
Returns a boolean indicating whether there is an active lock request for the account or not.
Returns a boolean indicating if an unlock request for the account already exists.
Params:
account
Account for which active unlock request is being checked.
Returns:
bool
Returns a boolean indicating whether there is an active unlock request for the account or not.
Returns all the lock requests of the sender (guardian).
Can only be called by a verified account guardian, allotted by the smart wallet owner as a guardian.
Returns:
bytes32[]
Array of all active lock requests of all accounts the guardian is guarding.
Returns all the unlock requests of the sender (guardian).
Can only be called by a verified account guardian, allotted by the smart wallet owner as a guardian.
Returns:
bytes32[]
Array of all active unlock requests of all accounts the guardian is guarding.
Last updated