IDropERC721
Thirdweb's 'Drop' contracts are distribution mechanisms for tokens. The DropERC721
contract is a distribution mechanism for ERC721 tokens. A minter wallet (i.e. holder of MINTER_ROLE
) can (lazy)mint 'n' tokens at once by providing a single base URI for all tokens being lazy minted. The URI for each of the 'n' tokens lazy minted is the provided base URI + {tokenId}
of the respective token. (e.g. "ipsf://Qmece.../1"). A minter can choose to lazy mint 'delayed-reveal' tokens. More on 'delayed-reveal' tokens in this article. A contract admin (i.e. holder of DEFAULT_ADMIN_ROLE
) can create claim conditions with non-overlapping time windows, and accounts can claim the tokens according to restrictions defined in the claim condition that is active at the time of the transaction.
Methods
approve
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
to
address
undefined
tokenId
uint256
undefined
balanceOf
Returns the number of tokens in owner
's account.
Parameters
owner
address
undefined
Returns
balance
uint256
undefined
claim
Parameters
receiver
address
undefined
quantity
uint256
undefined
currency
address
undefined
pricePerToken
uint256
undefined
allowlistProof
IDropERC721.AllowlistProof
undefined
data
bytes
undefined
getApproved
Returns the account approved for tokenId
token. Requirements: - tokenId
must exist.
Parameters
tokenId
uint256
undefined
Returns
operator
address
undefined
isApprovedForAll
Returns if the operator
is allowed to manage all of the assets of owner
. See {setApprovalForAll}
Parameters
owner
address
undefined
operator
address
undefined
Returns
_0
bool
undefined
lazyMint
Lets an account with MINTER_ROLE
lazy mint 'n' NFTs. The URIs for each token is the provided _baseURIForTokens
+ {tokenId}
.
Parameters
amount
uint256
The amount of NFTs to lazy mint.
baseURIForTokens
string
The URI for the NFTs to lazy mint. If lazy minting 'delayed-reveal' NFTs, the is a URI for NFTs in the un-revealed state.
encryptedBaseURI
bytes
If lazy minting 'delayed-reveal' NFTs, this is the result of encrypting the URI of the NFTs in the revealed state.
ownerOf
Returns the owner of the tokenId
token. Requirements: - tokenId
must exist.
Parameters
tokenId
uint256
undefined
Returns
owner
address
undefined
safeTransferFrom
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 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
from
address
undefined
to
address
undefined
tokenId
uint256
undefined
safeTransferFrom
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
from
address
undefined
to
address
undefined
tokenId
uint256
undefined
data
bytes
undefined
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 operator
cannot be the caller. Emits an {ApprovalForAll} event.
Parameters
operator
address
undefined
_approved
bool
undefined
setClaimConditions
Parameters
phases
IDropClaimCondition.ClaimCondition[]
undefined
resetClaimEligibility
bool
undefined
supportsInterface
Returns true if this contract implements the interface defined by interfaceId
. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
Parameters
interfaceId
bytes4
undefined
Returns
_0
bool
undefined
transferFrom
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
from
address
undefined
to
address
undefined
tokenId
uint256
undefined
Events
Approval
Parameters
owner indexed
address
undefined
approved indexed
address
undefined
tokenId indexed
uint256
undefined
ApprovalForAll
Parameters
owner indexed
address
undefined
operator indexed
address
undefined
approved
bool
undefined
ClaimConditionsUpdated
Emitted when new claim conditions are set.
Parameters
claimConditions
IDropClaimCondition.ClaimCondition[]
undefined
MaxTotalSupplyUpdated
Emitted when the global max supply of tokens is updated.
Parameters
maxTotalSupply
uint256
undefined
NFTRevealed
Emitted when the URI for a batch of 'delayed-reveal' NFTs is revealed.
Parameters
endTokenId
uint256
undefined
revealedURI
string
undefined
TokensClaimed
Emitted when tokens are claimed.
Parameters
claimConditionIndex indexed
uint256
undefined
claimer indexed
address
undefined
receiver indexed
address
undefined
startTokenId
uint256
undefined
quantityClaimed
uint256
undefined
TokensLazyMinted
Emitted when tokens are lazy minted.
Parameters
startTokenId
uint256
undefined
endTokenId
uint256
undefined
baseURI
string
undefined
encryptedBaseURI
bytes
undefined
Transfer
Parameters
from indexed
address
undefined
to indexed
address
undefined
tokenId indexed
uint256
undefined
Last updated