Skip to main content

IDropERC721_V3

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. "ipfs://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

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 balance)

Returns the number of tokens in owner's account.

Parameters

NameTypeDescription
owneraddressundefined

Returns

NameTypeDescription
balanceuint256undefined

claim

function claim(address receiver, uint256 quantity, address currency, uint256 pricePerToken, bytes32[] proofs, uint256 proofMaxQuantityPerTransaction) external payable

Lets an account claim a given quantity of NFTs.

Parameters

NameTypeDescription
receiveraddressThe receiver of the NFTs to claim.
quantityuint256The quantity of NFTs to claim.
currencyaddressThe currency in which to pay for the claim.
pricePerTokenuint256The price per token to pay for the claim.
proofsbytes32[]The proof of the claimer's inclusion in the merkle root allowlist of the claim conditions that apply.
proofMaxQuantityPerTransactionuint256(Optional) The maximum number of NFTs an address included in an allowlist can claim.

getApproved

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

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

Parameters

NameTypeDescription
tokenIduint256undefined

Returns

NameTypeDescription
operatoraddressundefined

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

lazyMint

function lazyMint(uint256 amount, string baseURIForTokens, bytes encryptedBaseURI) external nonpayable

Lets an account with MINTER_ROLE lazy mint 'n' NFTs. The URIs for each token is the provided _baseURIForTokens + {tokenId}.

Parameters

NameTypeDescription
amountuint256The amount of NFTs to lazy mint.
baseURIForTokensstringThe URI for the NFTs to lazy mint. If lazy minting 'delayed-reveal' NFTs, the is a URI for NFTs in the un-revealed state.
encryptedBaseURIbytesIf lazy minting 'delayed-reveal' NFTs, this is the result of encrypting the URI of the NFTs in the revealed state.

ownerOf

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

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

Parameters

NameTypeDescription
tokenIduint256undefined

Returns

NameTypeDescription
owneraddressundefined

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 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

setClaimConditions

function setClaimConditions(IDropClaimCondition_V2.ClaimCondition[] phases, bool resetClaimEligibility) external nonpayable

Parameters

NameTypeDescription
phasesIDropClaimCondition_V2.ClaimCondition[]undefined
resetClaimEligibilityboolundefined

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

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

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

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

ClaimConditionsUpdated

event ClaimConditionsUpdated(IDropClaimCondition_V2.ClaimCondition[] claimConditions)

Emitted when new claim conditions are set.

Parameters

NameTypeDescription
claimConditionsIDropClaimCondition_V2.ClaimCondition[]undefined

MaxTotalSupplyUpdated

event MaxTotalSupplyUpdated(uint256 maxTotalSupply)

Emitted when the global max supply of tokens is updated.

Parameters

NameTypeDescription
maxTotalSupplyuint256undefined

MaxWalletClaimCountUpdated

event MaxWalletClaimCountUpdated(uint256 count)

Emitted when the global max wallet claim count is updated.

Parameters

NameTypeDescription
countuint256undefined

NFTRevealed

event NFTRevealed(uint256 endTokenId, string revealedURI)

Emitted when the URI for a batch of 'delayed-reveal' NFTs is revealed.

Parameters

NameTypeDescription
endTokenIduint256undefined
revealedURIstringundefined

TokensClaimed

event TokensClaimed(uint256 indexed claimConditionIndex, address indexed claimer, address indexed receiver, uint256 startTokenId, uint256 quantityClaimed)

Emitted when tokens are claimed.

Parameters

NameTypeDescription
claimConditionIndex indexeduint256undefined
claimer indexedaddressundefined
receiver indexedaddressundefined
startTokenIduint256undefined
quantityClaimeduint256undefined

TokensLazyMinted

event TokensLazyMinted(uint256 startTokenId, uint256 endTokenId, string baseURI, bytes encryptedBaseURI)

Emitted when tokens are lazy minted.

Parameters

NameTypeDescription
startTokenIduint256undefined
endTokenIduint256undefined
baseURIstringundefined
encryptedBaseURIbytesundefined

Transfer

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

Parameters

NameTypeDescription
from indexedaddressundefined
to indexedaddressundefined
tokenId indexeduint256undefined

WalletClaimCountUpdated

event WalletClaimCountUpdated(address indexed wallet, uint256 count)

Emitted when the wallet claim count for an address is updated.

Parameters

NameTypeDescription
wallet indexedaddressundefined
countuint256undefined