IERC3009

Git Source

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.

function transferWithAuthorization(
    address from,
    address to,
    uint256 value,
    uint256 validAfter,
    uint256 validBefore,
    bytes32 nonce,
    bytes memory signature
) external;

Parameters

transferWithAuthorization

Execute a transfer with a signed authorization.

function transferWithAuthorization(
    address from,
    address to,
    uint256 value,
    uint256 validAfter,
    uint256 validBefore,
    bytes32 nonce,
    bytes32 r,
    bytes32 vs
) external;

Parameters

transferWithAuthorization

Execute a transfer with a signed authorization.

function transferWithAuthorization(
    address from,
    address to,
    uint256 value,
    uint256 validAfter,
    uint256 validBefore,
    bytes32 nonce,
    uint8 v,
    bytes32 r,
    bytes32 s
) external;

Parameters

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)

function receiveWithAuthorization(
    address from,
    address to,
    uint256 value,
    uint256 validAfter,
    uint256 validBefore,
    bytes32 nonce,
    bytes memory signature
) external;

Parameters

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)

function receiveWithAuthorization(
    address from,
    address to,
    uint256 value,
    uint256 validAfter,
    uint256 validBefore,
    bytes32 nonce,
    bytes32 r,
    bytes32 vs
) external;

Parameters

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)

function receiveWithAuthorization(
    address from,
    address to,
    uint256 value,
    uint256 validAfter,
    uint256 validBefore,
    bytes32 nonce,
    uint8 v,
    bytes32 r,
    bytes32 s
) external;

Parameters

cancelAuthorization

Attempt to cancel an authorization.

function cancelAuthorization(address authorizer, bytes32 nonce, bytes memory signature) external;

Parameters

cancelAuthorization

Attempt to cancel an authorization.

function cancelAuthorization(address authorizer, bytes32 nonce, bytes32 r, bytes32 vs) external;

Parameters

cancelAuthorization

Attempt to cancel an authorization.

function cancelAuthorization(address authorizer, bytes32 nonce, uint8 v, bytes32 r, bytes32 s) external;

Parameters

authorizationState

Returns the state of an authorization.

Nonces are randomly generated 32-byte data unique to the authorizer's address

function authorizationState(address authorizer, bytes32 nonce) external view returns (bool);

Parameters

Returns

TRANSFER_WITH_AUTHORIZATION_TYPEHASH

Returns transferWithAuthorization typehash.

function TRANSFER_WITH_AUTHORIZATION_TYPEHASH() external view returns (bytes32);

RECEIVE_WITH_AUTHORIZATION_TYPEHASH

Returns receiveWithAuthorization typehash.

function RECEIVE_WITH_AUTHORIZATION_TYPEHASH() external view returns (bytes32);

CANCEL_AUTHORIZATION_TYPEHASH

Returns cancelAuthorization typehash.

function CANCEL_AUTHORIZATION_TYPEHASH() external view returns (bytes32);

Events

AuthorizationCanceled

Emitted when an authorization has been canceled.

event AuthorizationCanceled(address indexed authorizer, bytes32 indexed nonce);

Parameters

AuthorizationUsed

Emitted when an authorization has been used.

event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce);

Parameters

Errors

AuthorizationAlreadyUsed

Emitted when an authorization has already been used.

error AuthorizationAlreadyUsed(address authorizer, bytes32 nonce);

Parameters

AuthorizationExpired

Emitted when an authorization is expired.

error AuthorizationExpired(uint256 timestamp, uint256 validBefore);

Parameters

AuthorizationNotYetValid

Emitted when an authorization is not yet valid.

error AuthorizationNotYetValid(uint256 timestamp, uint256 validAfter);

Parameters

CallerMustBePayee

Emitted when the caller of receiveWithAuthorization is not the payee.

error CallerMustBePayee(address caller, address payee);

Parameters

Copyright 2024 M^0 Foundation