IGuardian
IGuardian
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
Chain | Address |
---|
Functions
transferGuardian
function transferGuardian(address newGuardian) external
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
The new guardian accepts the guardianship transfer.
pendingGuardian
function pendingGuardian() external view returns (address)
Returns the address of the pending guardian.
guardian
function guardian() external view returns (address)
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)
The caller account is not authorized to perform an operation.
GuardianInvalidAddress
error GuardianInvalidAddress(address guardian)
The guardian is not a valid guardian account. (eg. address(0)
)