ERC5805
Inherits: IERC5805, StatefulERC712
Author: M^0 Labs
State Variables
DELEGATION_TYPEHASH
Returns the EIP712 typehash used in the encoding of the digest for the delegateBySig function.
Keeping this constant, despite delegateBySig
param name differences, to ensure max EIP-5805 compatibility. keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)")
Functions
delegate
Allows a calling account to change its voting power delegation to delegatee
.
Parameters
delegatee_
address
delegateBySig
Changes the signing account's voting power delegation to delegatee
.
Parameters
delegatee_
address
nonce_
uint256
expiry_
uint256
v_
uint8
r_
bytes32
s_
bytes32
_checkAndIncrementNonce
Reverts if a given nonce_
is reused for account_
, then increments the nonce in storage.
Parameters
account_
address
The address of the account the nonce is being verified for.
nonce_
uint256
The nonce being used by the account.
_delegate
Delegate voting power from delegator_
to newDelegatee_
.
Parameters
delegator_
address
The address of the account delegating voting power.
newDelegatee_
address
The address of the account receiving voting power.
_getDelegationDigest
Returns the digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
delegatee_
address
The address of the delegatee to delegate to.
nonce_
uint256
The nonce of the account delegating.
expiry_
uint256
The timestamp until which the signature is still valid.
Returns
<none>
bytes32
The digest to be signed.