ERC721AFacet
ERC721AFacet
_Implementation of the ERC721 Non-Fungible Token Standard, including the Metadata extension. Optimized for lower gas during batch mints.
Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) starting from _startTokenId().
Assumptions:
An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
The maximum token ID cannot exceed 2**256 - 1 (max value of uint256)._
totalSupply
function totalSupply() public view virtual returns (uint256)_Returns the total number of tokens in existence. Burned tokens will reduce the count. To get the total number of tokens minted, please see {totalMinted}.
balanceOf
function balanceOf(address owner) public view virtual returns (uint256)Returns the number of tokens in owner's account.
name
function name() public view virtual returns (string)Returns the token collection name.
symbol
Returns the token collection symbol.
ownerOf
_Returns the owner of the tokenId token.
Requirements:
tokenIdmust exist._
approve
_Gives permission to to to transfer tokenId token to another account. See {ERC721A-_approve}.
Requirements:
The caller must own the token or be an approved operator._
getApproved
_Returns the account approved for tokenId token.
Requirements:
tokenIdmust exist._
setApprovalForAll
_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
operatorcannot be the caller.
Emits an {ApprovalForAll} event._
isApprovedForAll
_Returns if the operator is allowed to manage all of the assets of owner.
See {setApprovalForAll}._
transferFrom
_Transfers tokenId from from to to.
Requirements:
fromcannot be the zero address.tocannot be the zero address.tokenIdtoken must be owned byfrom.If the caller is not
from, it must be approved to move this token by either {approve} or {setApprovalForAll}.
Emits a {Transfer} event._
safeTransferFrom
Equivalent to safeTransferFrom(from, to, tokenId, '').
safeTransferFrom
_Safely transfers tokenId token from from to to.
Requirements:
fromcannot be the zero address.tocannot be the zero address.tokenIdtoken must exist and be owned byfrom.If the caller is not
from, it must be approved to move this token by either {approve} or {setApprovalForAll}.If
torefers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
Emits a {Transfer} event._
_afterTokenTransfers
_Hook that is called after a set of serially-ordered token IDs have been transferred. This includes minting. And also called after one token has been burned.
startTokenId - the first token ID to be transferred. quantity - the amount to be transferred.
Calling conditions:
When
fromandtoare both non-zero,from'stokenIdhas been transferred toto.When
fromis zero,tokenIdhas been minted forto.When
tois zero,tokenIdhas been burned byfrom.fromandtoare never both zero._
_beforeTokenTransfers
_Hook that is called before a set of serially-ordered token IDs are about to be transferred. This includes minting. And also called before burning one token.
startTokenId - the first token ID to be transferred. quantity - the amount to be transferred.
Calling conditions:
When
fromandtoare both non-zero,from'stokenIdwill be transferred toto.When
fromis zero,tokenIdwill be minted forto.When
tois zero,tokenIdwill be burned byfrom.fromandtoare never both zero._
Was this helpful?