๐Ÿ‘ฎโ€โ™‚๏ธ
Guardian Smart Wallet Contracts
  • ๐Ÿ‘‹Welcome
  • ๐Ÿ”ญOverview
    • โœจOur Features
      • Smart Wallets
      • Social Account Locking
      • Social Account Recovery
    • ๐Ÿš€Getting Started
    • ๐Ÿ’กArchitecture
  • ๐Ÿ“—Guides
    • ๐Ÿ’ฐSmart Account (Account Factory)
    • ๐Ÿ‘ฎโ€โ™‚๏ธGuardian Contract
    • ๐ŸคAccount Guardian
    • ๐Ÿ”’Account Lock
    • ๐Ÿ”Account Recovery
Powered by GitBook
On this page
  • Usage
  • Functions

Was this helpful?

  1. Guides

Account Guardian

PreviousGuardian ContractNextAccount Lock

Last updated 1 year ago

Was this helpful?

The Account Guardian contract allows smart wallet account holders to manage their account guardians.

Since the Account Guardian contract handles individual accounts' guardian operations, a new instance of the Account Guardian contract is deployed on every new smart wallet account.

You can refer to the 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:

import {AccountGuardian} from "@guardian-wallet/contracts/utils/AccountGuardian.sol"

Functions

function addGuardian(address guardian)

Add guardians for your smart wallet.

Can only be called by the smart wallet account, AccountLock and AccountRecovery.

Params:

guardian the verified guardian address being added as an account guardian.


function removeGuardian(address guardian)

A user will be able to remove allotted guardian(s) from their smart-wallet guardian list. The address should be a registered guardian for the account.

Can only be called by the smart wallet account, AccountLock and AccountRecovery.

Params:

guardian address of the guardian the user wishes to remove.


function getAllGuardians() -> address[] memory

Returns a list of all added account guardians for the senderโ€™s smart wallet account.

Can only be called by the smart wallet account, AccountLock and AccountRecovery.

Returns

address[] List of account guardians of the senderโ€™s smart wallet.


function isAccountGuardian(address guardian) -> bool

Returns a boolean value indicating if the guardian is the senderโ€™s guardian or not.

Can only be called by the smart wallet account, AccountLock and AccountRecovery.

Params:

guardian guardian to be checked for

Returns:

bool Bool flag indicating if the guardian is guarding the account


function getTotalGuardians() -> uint256

This will return the number of guardians allotted for a smart wallet account. Will be used when creating shards of the account's private key.

Returns:

uint256 No. of allotted account guardians


๐Ÿ“—
๐Ÿค
Guardian smart wallet architecture