Skip to main content

IERC721A

Interface of an ERC721A compliant contract.

Methods​

approve​

function approve(address to, uint256 tokenId) external nonpayable

Gives permission to to to transfer tokenId token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - The caller must own the token or be an approved operator. - tokenId must exist. Emits an {Approval} event.

Parameters​

NameTypeDescription
toaddressundefined
tokenIduint256undefined

balanceOf​

function balanceOf(address owner) external view returns (uint256)

Returns the number of tokens in owner's account.

Parameters​

NameTypeDescription
owneraddressundefined

Returns​

NameTypeDescription
_0uint256undefined

getApproved​

function getApproved(uint256 tokenId) external view returns (address)

Returns the account approved for tokenId token. Requirements: - tokenId must exist.

Parameters​

NameTypeDescription
tokenIduint256undefined

Returns​

NameTypeDescription
_0addressundefined

isApprovedForAll​

function isApprovedForAll(address owner, address operator) external view returns (bool)

Returns if the operator is allowed to manage all of the assets of owner. See {setApprovalForAll}

Parameters​

NameTypeDescription
owneraddressundefined
operatoraddressundefined

Returns​

NameTypeDescription
_0boolundefined

name​

function name() external view returns (string)

A descriptive name for a collection of NFTs in this contract

Returns​

NameTypeDescription
_0stringundefined

ownerOf​

function ownerOf(uint256 tokenId) external view returns (address)

Returns the owner of the tokenId token. Requirements: - tokenId must exist.

Parameters​

NameTypeDescription
tokenIduint256undefined

Returns​

NameTypeDescription
_0addressundefined

safeTransferFrom​

function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable

Safely transfers tokenId token from from to to, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. Requirements: - from cannot be the zero address. - to cannot be the zero address. - tokenId token must exist and be owned by from. - If the caller is not from, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. - If to refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.

Parameters​

NameTypeDescription
fromaddressundefined
toaddressundefined
tokenIduint256undefined

safeTransferFrom​

function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable

Safely transfers tokenId token from from to to. Requirements: - from cannot be the zero address. - to cannot be the zero address. - tokenId token must exist and be owned by from. - If the caller is not from, it must be approved to move this token by either {approve} or {setApprovalForAll}. - If to refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.

Parameters​

NameTypeDescription
fromaddressundefined
toaddressundefined
tokenIduint256undefined
databytesundefined

setApprovalForAll​

function setApprovalForAll(address operator, bool _approved) external nonpayable

Approve or remove operator as an operator for the caller. Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. Requirements: - The operator cannot be the caller. Emits an {ApprovalForAll} event.

Parameters​

NameTypeDescription
operatoraddressundefined
_approvedboolundefined

symbol​

function symbol() external view returns (string)

An abbreviated name for NFTs in this contract

Returns​

NameTypeDescription
_0stringundefined

tokenURI​

function tokenURI(uint256 _tokenId) external view returns (string)

A distinct Uniform Resource Identifier (URI) for a given asset.

Throws if _tokenId is not a valid NFT. URIs are defined in RFC 3986. The URI may point to a JSON file that conforms to the "ERC721 Metadata JSON Schema".

Parameters​

NameTypeDescription
_tokenIduint256undefined

Returns​

NameTypeDescription
_0stringundefined

totalSupply​

function totalSupply() external view returns (uint256)

Returns the total amount of tokens stored by the contract. Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.

Returns​

NameTypeDescription
_0uint256undefined

transferFrom​

function transferFrom(address from, address to, uint256 tokenId) external nonpayable

Transfers tokenId token from from to to. WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. Requirements: - from cannot be the zero address. - to cannot be the zero address. - tokenId token must be owned by from. - If the caller is not from, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event.

Parameters​

NameTypeDescription
fromaddressundefined
toaddressundefined
tokenIduint256undefined

Events​

Approval​

event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)

Parameters​

NameTypeDescription
owner indexedaddressundefined
approved indexedaddressundefined
tokenId indexeduint256undefined

ApprovalForAll​

event ApprovalForAll(address indexed owner, address indexed operator, bool approved)

Parameters​

NameTypeDescription
owner indexedaddressundefined
operator indexedaddressundefined
approvedboolundefined

Transfer​

event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)

Parameters​

NameTypeDescription
from indexedaddressundefined
to indexedaddressundefined
tokenId indexeduint256undefined

Errors​

ApprovalCallerNotOwnerNorApproved​

error ApprovalCallerNotOwnerNorApproved()

The caller must own the token or be an approved operator.

ApprovalQueryForNonexistentToken​

error ApprovalQueryForNonexistentToken()

The token does not exist.

ApprovalToCurrentOwner​

error ApprovalToCurrentOwner()

The caller cannot approve to the current owner.

ApproveToCaller​

error ApproveToCaller()

The caller cannot approve to their own address.

BalanceQueryForZeroAddress​

error BalanceQueryForZeroAddress()

Cannot query the balance for the zero address.

MintToZeroAddress​

error MintToZeroAddress()

Cannot mint to the zero address.

MintZeroQuantity​

error MintZeroQuantity()

The quantity of tokens minted must be more than zero.

OwnerQueryForNonexistentToken​

error OwnerQueryForNonexistentToken()

The token does not exist.

TransferCallerNotOwnerNorApproved​

error TransferCallerNotOwnerNorApproved()

The caller must own the token or be an approved operator.

TransferFromIncorrectOwner​

error TransferFromIncorrectOwner()

The token must be owned by from.

TransferToNonERC721ReceiverImplementer​

error TransferToNonERC721ReceiverImplementer()

Cannot safely transfer to a contract that does not implement the ERC721Receiver interface.

TransferToZeroAddress​

error TransferToZeroAddress()

Cannot transfer to the zero address.

URIQueryForNonexistentToken​

error URIQueryForNonexistentToken()

The token does not exist.