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
Name | Type | Description |
---|---|---|
|
|
delegateBySig
Changes the signing account's voting power delegation to delegatee
.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
_checkAndIncrementNonce
Reverts if a given nonce_
is reused for account_
, then increments the nonce in storage.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account the nonce is being verified for. |
|
| The nonce being used by the account. |
_delegate
Delegate voting power from delegator_
to newDelegatee_
.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account delegating voting power. |
|
| 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
Name | Type | Description |
---|---|---|
|
| The address of the delegatee to delegate to. |
|
| The nonce of the account delegating. |
|
| The timestamp until which the signature is still valid. |
Returns
Name | Type | Description |
---|---|---|
|
| The digest to be signed. |