Inherits: IERC3009, StatefulERC712
Author: M^0 Labs
Inherits from ERC712 and StatefulERC712.
Returns transferWithAuthorization
typehash.
keccak256("TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)")
Returns receiveWithAuthorization
typehash.
keccak256("ReceiveWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)")
Returns cancelAuthorization
typehash.
keccak256("CancelAuthorization(address authorizer,bytes32 nonce)")
Returns the state of an authorization.
Nonces are randomly generated 32-byte data unique to the authorizer's address
Construct the ERC3009 contract.
Parameters
name_
string
The name of the contract.
Execute a transfer with a signed authorization.
Parameters
from_
address
to_
address
value_
uint256
validAfter_
uint256
validBefore_
uint256
nonce_
bytes32
signature_
bytes
Execute a transfer with a signed authorization.
Parameters
from_
address
to_
address
value_
uint256
validAfter_
uint256
validBefore_
uint256
nonce_
bytes32
r_
bytes32
vs_
bytes32
Execute a transfer with a signed authorization.
Parameters
from_
address
to_
address
value_
uint256
validAfter_
uint256
validBefore_
uint256
nonce_
bytes32
v_
uint8
r_
bytes32
s_
bytes32
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
from_
address
to_
address
value_
uint256
validAfter_
uint256
validBefore_
uint256
nonce_
bytes32
signature_
bytes
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
from_
address
to_
address
value_
uint256
validAfter_
uint256
validBefore_
uint256
nonce_
bytes32
r_
bytes32
vs_
bytes32
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
from_
address
to_
address
value_
uint256
validAfter_
uint256
validBefore_
uint256
nonce_
bytes32
v_
uint8
r_
bytes32
s_
bytes32
Attempt to cancel an authorization.
Parameters
authorizer_
address
nonce_
bytes32
signature_
bytes
Attempt to cancel an authorization.
Parameters
authorizer_
address
nonce_
bytes32
r_
bytes32
vs_
bytes32
Attempt to cancel an authorization.
Parameters
authorizer_
address
nonce_
bytes32
v_
uint8
r_
bytes32
s_
bytes32
Common transfer function used by transferWithAuthorization
and _receiveWithAuthorization
.
Parameters
from_
address
Payer's address (Authorizer).
to_
address
Payee's address.
value_
uint256
Amount to be transferred.
validAfter_
uint256
The time after which this is valid (unix time).
validBefore_
uint256
The time before which this is valid (unix time).
nonce_
bytes32
Unique nonce.
Common receive function used by receiveWithAuthorization
.
Parameters
from_
address
Payer's address (Authorizer).
to_
address
Payee's address.
value_
uint256
Amount to be transferred.
validAfter_
uint256
The time after which this is valid (unix time).
validBefore_
uint256
The time before which this is valid (unix time).
nonce_
bytes32
Unique nonce.
Common cancel function used by cancelAuthorization
.
Parameters
authorizer_
address
Authorizer's address.
nonce_
bytes32
Nonce of the authorization.
Internal ERC20 transfer function that needs to be implemented by the inheriting contract.
Parameters
sender_
address
The sender's address.
recipient_
address
The recipient's address.
amount_
uint256
The amount to be transferred.
Returns the internal EIP-712 digest of a transferWithAuthorization call.
Parameters
from_
address
Payer's address (Authorizer).
to_
address
Payee's address.
value_
uint256
Amount to be transferred.
validAfter_
uint256
The time after which this is valid (unix time).
validBefore_
uint256
The time before which this is valid (unix time).
nonce_
bytes32
Unique nonce.
Returns
<none>
bytes32
The internal EIP-712 digest.
Returns the internal EIP-712 digest of a receiveWithAuthorization call.
Parameters
from_
address
Payer's address (Authorizer).
to_
address
Payee's address.
value_
uint256
Amount to be transferred.
validAfter_
uint256
The time after which this is valid (unix time).
validBefore_
uint256
The time before which this is valid (unix time).
nonce_
bytes32
Unique nonce.
Returns
<none>
bytes32
The internal EIP-712 digest.
Returns the internal EIP-712 digest of a cancelAuthorization call.
Parameters
authorizer_
address
Authorizer's address.
nonce_
bytes32
Nonce of the authorization.
Returns
<none>
bytes32
The internal EIP-712 digest.
Reverts if the authorization is already used.
Parameters
authorizer_
address
The authorizer's address.
nonce_
bytes32
The nonce of the authorization.