Skip to main content

ERC721Permit

ERC721Permit

PERMIT_TYPEHASH

bytes32 PERMIT_TYPEHASH

The EIP-712 typehash for the permit struct used by the contract

constructor

constructor(string name_, string symbol_, string version_) public

permit

function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external

Approve the spender to transfer the given tokenId

Parameters

NameTypeDescription
spenderaddressThe address to approve
tokenIduint256The tokenId to approve
deadlineuint256The deadline for the signature
vuint8The recovery id of the signature
rbytes32The r value of the signature
sbytes32The s value of the signature

DOMAIN_SEPARATOR

function DOMAIN_SEPARATOR() public view returns (bytes32)

The EIP-712 domain separator for this contract

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

nonces

function nonces(uint256 id) external view returns (uint256)

_getAndIncrementNonce

function _getAndIncrementNonce(uint256 tokenId) internal returns (uint256 nonce)

_ownerOf

function _ownerOf(uint256 tokenId) internal view returns (address)

_Returns the owner of the tokenId. Does NOT revert if token doesn't exist

IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the core ERC721 logic MUST be matched with the use of {increaseBalance} to keep balances consistent with ownership. The invariant to preserve is that for any address a the value returned by balanceOf(a) must be equal to the number of tokens such that _ownerOf(tokenId) is a.

_setOwner

function _setOwner(uint256 tokenId, address owner) internal

Override this function to set owner