_startTokenId().
The _sequentialUpTo() function can be overriden to enable spot mints
(i.e. non-consecutive mints) for tokenIds greater than _sequentialUpTo().
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).
State Variables
_BITMASK_ADDRESS_DATA_ENTRY
_BITPOS_NUMBER_MINTED
_BITPOS_NUMBER_BURNED
_BITPOS_AUX
_BITMASK_AUX_COMPLEMENT
_BITPOS_START_TIMESTAMP
_BITMASK_BURNED
_BITPOS_NEXT_INITIALIZED
_BITMASK_NEXT_INITIALIZED
_BITPOS_EXTRA_DATA
_BITMASK_EXTRA_DATA_COMPLEMENT
_BITMASK_ADDRESS
_MAX_MINT_ERC2309_QUANTITY_LIMIT
_TRANSFER_EVENT_SIGNATURE
_currentIndex
_burnCounter
_name
_symbol
_packedOwnerships
_packedAddressData
_tokenApprovals
_operatorApprovals
_spotMinted
Functions
constructor
_startTokenId
Returns the starting token ID for sequential mints. Override this function to change the starting token ID for sequential mints. Note: The value returned must never change after any tokens have been minted._sequentialUpTo
Returns the maximum token ID (inclusive) for sequential mints. Override this function to return a value less than 2**256 - 1, but greater than_startTokenId(), to enable spot (non-sequential) mints.
Note: The value returned must never change after any tokens have been minted.
_nextTokenId
Returns the next token ID to be minted.totalSupply
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._totalMinted
Returns the total amount of tokens minted in the contract._totalBurned
Returns the total number of tokens burned._totalSpotMinted
Returns the total number of tokens that are spot-minted.balanceOf
Returns the number of tokens inowner’s account.
_numberMinted
Returns the number of tokens minted byowner.
_numberBurned
Returns the number of tokens burned by or on behalf ofowner.
_getAux
Returns the auxiliary data forowner. (e.g. number of whitelist mint slots used).
_setAux
Sets the auxiliary data forowner. (e.g. number of whitelist mint slots used).
If there are multiple variables, please pack them into a uint64.
supportsInterface
Returns true if this contract implements the interface defined byinterfaceId. See the corresponding
EIP section
to learn more about how these ids are created.
This function call must use less than 30000 gas.
name
Returns the token collection name.symbol
Returns the token collection symbol.tokenURI
Returns the Uniform Resource Identifier (URI) fortokenId token.
_baseURI
Base URI for computing tokenURI. If set, the resulting URI for each token will be the concatenation of thebaseURI and the tokenId. Empty
by default, it can be overridden in child contracts.
ownerOf
*Returns the owner of thetokenId token.
Requirements:
tokenIdmust exist.*
_ownershipOf
Gas spent here starts off proportional to the maximum mint batch size. It gradually moves to O(1) as tokens get transferred around over time._ownershipAt
Returns the unpackedTokenOwnership struct at index.
_ownershipIsInitialized
Returns whether the ownership slot atindex is initialized.
An uninitialized slot does not necessarily mean that the slot has no owner.
_initializeOwnershipAt
Initializes the ownership slot minted atindex for efficiency purposes.
_packedOwnershipOf
Returns the packed ownership data oftokenId.
_unpackedOwnership
Returns the unpackedTokenOwnership struct from packed.
_packOwnershipData
Packs ownership data into a single uint256._nextInitializedFlag
Returns thenextInitialized flag set if quantity equals 1.
approve
*Gives permission toto 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 fortokenId token.
Requirements:
tokenIdmust exist.*
setApprovalForAll
*Approve or removeoperator as an operator for the caller.
Operators can call transferFrom or
for any token owned by the caller.
Requirements:
- The
operatorcannot be the caller. Emits an event.*
isApprovedForAll
Returns if theoperator is allowed to manage all of the assets of owner.
See setApprovalForAll.
_exists
Returns whethertokenId exists.
Tokens can be managed by their owner or approved accounts via approve or .
Tokens start existing when they are minted. See {\_mint}.
_packedOwnershipExists
Returns whetherpacked represents a token that exists.
_isSenderApprovedOrOwner
Returns whethermsgSender is equal to approvedAddress or owner.
_getApprovedSlotAndValue
Returns the storage slot and value for the approved address oftokenId casted to a uint256.
transferFrom
*TransferstokenId 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 . Emits a event.*
safeTransferFrom
Equivalent tosafeTransferFrom(from, to, tokenId, '').
safeTransferFrom
*Safely transferstokenId 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 event.*
_batchTransferFrom
Equivalent to_batchTransferFrom(from, to, tokenIds).
_batchTransferFrom
*TransferstokenIds in batch from from to to.
Requirements:
fromcannot be the zero address.tocannot be the zero address.tokenIdstokens must be owned byfrom.tokenIdsmust be strictly ascending.- If
byis notfrom, it must be approved to move these tokens by either approve or .byis the address that to check token approval for. If token approval check is not needed, pass inaddress(0)forby. Emits a event for each transfer.*
_safeBatchTransferFrom
*Safely transferstokenIds in batch from from to to.
Requirements:
fromcannot be the zero address.tocannot be the zero address.tokenIdstokens must be owned byfrom.- If
byis notfrom, it must be approved to move these tokens by either approve or{setApprovalForAll}. - If
torefers to a smart contract, it must implement{IERC721Receiver-onERC721Received}, which is called for each transferred token.byis the address that to check token approval for. If token approval check is not needed, pass inaddress(0)forby. Emits a event for each transfer.*
_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.*
_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.*
_checkContractOnERC721Received
Private function to invoke IERC721Receiver-onERC721Received on a target contract.from - Previous owner of the given token ID.
to - Target address that will receive the token.
tokenId - Token ID to be transferred.
_data - Optional data to send along with the call.
Returns whether the call correctly returned the expected magic value.
_mint
*Mintsquantity tokens and transfers them to to.
Requirements:
tocannot be the zero address.quantitymust be greater than 0. Emits a event for each mint.*
_mintERC2309
*Mintsquantity tokens and transfers them to to.
This function is intended for efficient minting only during contract creation.
It emits only one as defined in
ERC2309,
instead of a sequence of event(s).
Calling this function outside of contract creation WILL make your contract
non-compliant with the ERC721 standard.
For full ERC721 compliance, substituting ERC721 event(s) with the ERC2309
event is only permissible during contract creation.
Requirements:
tocannot be the zero address.quantitymust be greater than 0. Emits a event.*
_safeMint
*Safely mintsquantity tokens and transfers them to to.
Requirements:
- If
torefers to a smart contract, it must implement IERC721Receiver-onERC721Received, which is called for each safe transfer. quantitymust be greater than 0. See{\_mint}. Emits a event for each mint.*
_safeMint
Equivalent to_safeMint(to, quantity, '').
_mintSpot
*Mints a single token attokenId.
Note: A spot-minted tokenId that has been burned can be re-minted again.
Requirements:
tocannot be the zero address.tokenIdmust be greater than_sequentialUpTo().tokenIdmust not exist. Emits a event for each mint.*
_safeMintSpot
*Safely mints a single token attokenId.
Note: A spot-minted tokenId that has been burned can be re-minted again.
Requirements:
- If
torefers to a smart contract, it must implement IERC721Receiver-onERC721Received. tokenIdmust be greater than_sequentialUpTo().tokenIdmust not exist. See{\_mintSpot}. Emits a{Transfer}event.*
_safeMintSpot
Equivalent to_safeMintSpot(to, tokenId, '').
_approve
Equivalent to_approve(to, tokenId, false).
_approve
*Gives permission toto 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:
tokenIdmust exist. Emits an event.*
_burn
Equivalent to_burn(tokenId, false).
_burn
*DestroystokenId.
The approval is cleared when the token is burned.
Requirements:
tokenIdmust exist. Emits a event.*
_batchBurn
*DestroystokenIds.
Approvals are not cleared when tokenIds are burned.
Requirements:
tokenIdsmust exist.tokenIdsmust be strictly ascending.bymust be approved to burn these tokens by either approve or .byis the address that to check token approval for. If token approval check is not needed, pass inaddress(0)forby. Emits a event for each token burned.*
_setExtraDataAt
Directly sets the extra data for the ownership dataindex.
_extraData
*Called during each token transfer to set the 24bitextraData field.
Intended to be overridden by the cosumer contract.
previousExtraData - the value of extraData before transfer.
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.*
_nextExtraData
Returns the next extra data for the packed ownership data. The returned result is shifted into position._mdataERC721A
Returns a memory pointer to the start ofa’s data.
_mloadERC721A
Returns the uint256 atp in memory.
_orERC721A
Branchless boolean or._msgSenderERC721A
Returns the message sender (defaults tomsg.sender).
If you are writing GSN compatible contracts, you need to override this function.