Skip to main content
Helpful?

IERC721Permit_v4

Git Source | Generated with forge doc

Extension to ERC721 that includes a permit function for signature based approvals

Functions

permit

Approve of a specific token ID for spending by spender via signature

payable so it can be multicalled with NATIVE related actions

function permit(address spender, uint256 tokenId, uint256 deadline, uint256 nonce, bytes calldata signature)
external
payable;

Parameters

NameTypeDescription
spenderaddressThe account that is being approved
tokenIduint256The ID of the token that is being approved for spending
deadlineuint256The deadline timestamp by which the call must be mined for the approve to work
nonceuint256a unique value, for an owner, to prevent replay attacks; an unordered nonce where the top 248 bits correspond to a word and the bottom 8 bits calculate the bit position of the word
signaturebytesConcatenated data from a valid secp256k1 signature from the holder, i.e. abi.encodePacked(r, s, v)

permitForAll

Set an operator with full permission to an owner's tokens via signature

payable so it can be multicalled with NATIVE related actions

function permitForAll(
address owner,
address operator,
bool approved,
uint256 deadline,
uint256 nonce,
bytes calldata signature
) external payable;

Parameters

NameTypeDescription
owneraddressThe address that is setting the operator
operatoraddressThe address that will be set as an operator for the owner
approvedboolThe permission to set on the operator
deadlineuint256The deadline timestamp by which the call must be mined for the approve to work
nonceuint256a unique value, for an owner, to prevent replay attacks; an unordered nonce where the top 248 bits correspond to a word and the bottom 8 bits calculate the bit position of the word
signaturebytesConcatenated data from a valid secp256k1 signature from the holder, i.e. abi.encodePacked(r, s, v)

Errors

SignatureDeadlineExpired

error SignatureDeadlineExpired();

NoSelfPermit

error NoSelfPermit();

Unauthorized

error Unauthorized();
Helpful?