Skip to main content

IGuardian

IGuardian

Dev note

Contract module which provides access control mechanism, where there is an account (an guardian) that can be granted exclusive access to specific functions.

The initial guardian is specified at deployment time in the constructor for Guardian. This can later be changed with {transferGuardian} and {acceptGuardian}.

This module is used through inheritance. It will make available all functions from parent (Guardian).

Modified from the OpenZeppelin Contracts library (5.0.0)

Addresses

ChainAddress

Functions

transferGuardian

function transferGuardian(address newGuardian) external
Dev note

Starts the guardianship transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current guardian.

acceptGuardian

function acceptGuardian() external
Dev note

The new guardian accepts the guardianship transfer.

pendingGuardian

function pendingGuardian() external view returns (address)
Dev note

Returns the address of the pending guardian.

guardian

function guardian() external view returns (address)
Dev note

Returns the address of the current guardian.

Events

GuardianTransferStarted

event GuardianTransferStarted(address previousGuardian, address newGuardian)

GuardianTransferred

event GuardianTransferred(address previousGuardian, address newGuardian)

Errors

GuardianUnauthorizedAccount

error GuardianUnauthorizedAccount(address account)
Dev note

The caller account is not authorized to perform an operation.

GuardianInvalidAddress

error GuardianInvalidAddress(address guardian)
Dev note

The guardian is not a valid guardian account. (eg. address(0))