IERC3009
Inherits: IStatefulERC712
Author: M^0 Labs
The interface as defined by EIP-3009: https://eips.ethereum.org/EIPS/eip-3009
Functions
transferWithAuthorization
Execute a transfer with a signed authorization.
Parameters
Name | Type | Description |
---|---|---|
|
| Payer's address (Authorizer). |
|
| Payee's address. |
|
| Amount to be transferred. |
|
| The time after which this is valid (unix time). |
|
| The time before which this is valid (unix time). |
|
| Unique nonce. |
|
| A byte array ECDSA/secp256k1 signature (encoded r, s, v). |
transferWithAuthorization
Execute a transfer with a signed authorization.
Parameters
Name | Type | Description |
---|---|---|
|
| Payer's address (Authorizer). |
|
| Payee's address. |
|
| Amount to be transferred. |
|
| The time after which this is valid (unix time). |
|
| The time before which this is valid (unix time). |
|
| Unique nonce. |
|
| An ECDSA/secp256k1 signature parameter. |
|
| An ECDSA/secp256k1 short signature parameter. |
transferWithAuthorization
Execute a transfer with a signed authorization.
Parameters
Name | Type | Description |
---|---|---|
|
| Payer's address (Authorizer). |
|
| Payee's address. |
|
| Amount to be transferred. |
|
| The time after which this is valid (unix time). |
|
| The time before which this is valid (unix time). |
|
| Unique nonce. |
|
| v of the signature. |
|
| r of the signature. |
|
| s of the signature. |
receiveWithAuthorization
Receive a transfer with a signed authorization from the payer.
This has an additional check to ensure that the payee's address matches the caller of this function to prevent front-running attacks. (See security considerations)
Parameters
Name | Type | Description |
---|---|---|
|
| Payer's address (Authorizer). |
|
| Payee's address. |
|
| Amount to be transferred. |
|
| The time after which this is valid (unix time). |
|
| The time before which this is valid (unix time). |
|
| Unique nonce. |
|
| A byte array ECDSA/secp256k1 signature (encoded r, s, v). |
receiveWithAuthorization
Receive a transfer with a signed authorization from the payer.
This has an additional check to ensure that the payee's address matches the caller of this function to prevent front-running attacks. (See security considerations)
Parameters
Name | Type | Description |
---|---|---|
|
| Payer's address (Authorizer). |
|
| Payee's address. |
|
| Amount to be transferred. |
|
| The time after which this is valid (unix time). |
|
| The time before which this is valid (unix time). |
|
| Unique nonce. |
|
| An ECDSA/secp256k1 signature parameter. |
|
| An ECDSA/secp256k1 short signature parameter. |
receiveWithAuthorization
Receive a transfer with a signed authorization from the payer.
This has an additional check to ensure that the payee's address matches the caller of this function to prevent front-running attacks. (See security considerations)
Parameters
Name | Type | Description |
---|---|---|
|
| Payer's address (Authorizer). |
|
| Payee's address. |
|
| Amount to be transferred. |
|
| The time after which this is valid (unix time). |
|
| The time before which this is valid (unix time). |
|
| Unique nonce. |
|
| v of the signature. |
|
| r of the signature. |
|
| s of the signature. |
cancelAuthorization
Attempt to cancel an authorization.
Parameters
Name | Type | Description |
---|---|---|
|
| Authorizer's address. |
|
| Nonce of the authorization. |
|
| A byte array ECDSA/secp256k1 signature (encoded r, s, v). |
cancelAuthorization
Attempt to cancel an authorization.
Parameters
Name | Type | Description |
---|---|---|
|
| Authorizer's address. |
|
| Nonce of the authorization. |
|
| An ECDSA/secp256k1 signature parameter. |
|
| An ECDSA/secp256k1 short signature parameter. |
cancelAuthorization
Attempt to cancel an authorization.
Parameters
Name | Type | Description |
---|---|---|
|
| Authorizer's address. |
|
| Nonce of the authorization. |
|
| v of the signature. |
|
| r of the signature. |
|
| s of the signature. |
authorizationState
Returns the state of an authorization.
Nonces are randomly generated 32-byte data unique to the authorizer's address
Parameters
Name | Type | Description |
---|---|---|
|
| Authorizer's address. |
|
| Nonce of the authorization. |
Returns
Name | Type | Description |
---|---|---|
|
| True if the nonce is used. |
TRANSFER_WITH_AUTHORIZATION_TYPEHASH
Returns transferWithAuthorization
typehash.
RECEIVE_WITH_AUTHORIZATION_TYPEHASH
Returns receiveWithAuthorization
typehash.
CANCEL_AUTHORIZATION_TYPEHASH
Returns cancelAuthorization
typehash.
Events
AuthorizationCanceled
Emitted when an authorization has been canceled.
Parameters
Name | Type | Description |
---|---|---|
|
| Authorizer's address. |
|
| Nonce of the canceled authorization. |
AuthorizationUsed
Emitted when an authorization has been used.
Parameters
Name | Type | Description |
---|---|---|
|
| Authorizer's address. |
|
| Nonce of the used authorization. |
Errors
AuthorizationAlreadyUsed
Emitted when an authorization has already been used.
Parameters
Name | Type | Description |
---|---|---|
|
| Authorizer's address. |
|
| Nonce of the used authorization. |
AuthorizationExpired
Emitted when an authorization is expired.
Parameters
Name | Type | Description |
---|---|---|
|
| Timestamp at which the transaction was submitted. |
|
| Timestamp before which the authorization would have been valid. |
AuthorizationNotYetValid
Emitted when an authorization is not yet valid.
Parameters
Name | Type | Description |
---|---|---|
|
| Timestamp at which the transaction was submitted. |
|
| Timestamp after which the authorization will be valid. |
CallerMustBePayee
Emitted when the caller of receiveWithAuthorization
is not the payee.
Parameters
Name | Type | Description |
---|---|---|
|
| Caller's address. |
|
| Payee's address. |