๐ฎโโ๏ธGuardian Contract
The Guardian contract provides the account guardians with essential functions to onboard themselves to the Guardian smart wallet system along with providing guardian-related information to the other contracts to help them carry out their functions related to the "Guardian" stakeholder.
Since the Guardian contract handles a guardianโs system-level operations, only a single instance of this contract is deployed.
For account-specific guardian operations, check out theAccountGuardian
contract.
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 Guardian contract address directly on the client side to interact with the deployed guardian contract.
In smart-contract projects:
Functions
This function will add the sender as a verified guardian to Guardian Smart Wallet's guardian list.
Will check if an address is a verified guardian in Guardian Smart Wallet's system.
Params:
isVerified
the address to be checked for a verified guardian.
Returns:
bool
Boolean value indicates if an address is a verified guardian or not.
Removes the sender as a verified guardian.
Used to maintain a record of each account and it's guardian contract instance(accountGuardian
)
Params
account
Address of the account that got initialized
accountGuardian
Address of the guardian contract of the account
Creates a mapping of smart wallet accounts to their respective guardians
Params
guardian
Guardian to be added to account
account
An account whose guardian list is to be updated.
Returns:
address[]
Array of verified guardian addresses
Returns the list of verified guardians in the Guardian Smart Wallet system
Can only be called by the dApp owner.
Returns the accountGuardian
contract address of a smart wallet account.
Params:
account
The account whoโs Account Guardian contract instance address is required.
Returns:
address
address of the Account Guardian contact instance
Returns the list of accounts a guardian is guarding.
Params
guardian
Guardian whose account list has to be returned.
Returns
address[]
The array of addresses the guardian is guarding.
Returns the address of the Account Recovery contract of an account. It will be used by guardians to get the account recovery request and send the signature back to the Account Recovery contract.
Params:
account
The address of the account for which its recovery contract is requested
Returns:
address
The address of the Account Recovery Contract of a smart wallet account
A checker function to check if an address is a guardian for the account.
Params:
account
Account address for which the guardian is being checked.
guardian
The guardian address that is being checked for being a guardian of the account.
Returns:
bool
Boolean to indicate if the guardian
address is guarding the account
Last updated