IDropERC1155_V2
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
balanceOf
function balanceOf(address account, uint256 id) external view returns (uint256)
Returns the amount of tokens of token type id
owned by account
. Requirements: - account
cannot be the zero address.
Parameters
Name | Type | Description |
---|
account | address | undefined |
id | uint256 | undefined |
Returns
Name | Type | Description |
---|
_0 | uint256 | undefined |
balanceOfBatch
function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[])
xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. Requirements: - accounts
and ids
must have the same length.
Parameters
Name | Type | Description |
---|
accounts | address[] | undefined |
ids | uint256[] | undefined |
Returns
Name | Type | Description |
---|
_0 | uint256[] | undefined |
claim
function claim(address receiver, uint256 tokenId, uint256 quantity, address currency, uint256 pricePerToken, bytes32[] proofs, uint256 proofMaxQuantityPerTransaction) external payable
Lets an account claim a given quantity of NFTs.
Parameters
Name | Type | Description |
---|
receiver | address | The receiver of the NFTs to claim. |
tokenId | uint256 | The unique ID of the token to claim. |
quantity | uint256 | The quantity of NFTs to claim. |
currency | address | The currency in which to pay for the claim. |
pricePerToken | uint256 | The price per token to pay for the claim. |
proofs | bytes32[] | The proof of the claimer's inclusion in the merkle root allowlist of the claim conditions that apply. |
proofMaxQuantityPerTransaction | uint256 | (Optional) The maximum number of NFTs an address included in an allowlist can claim. |
isApprovedForAll
function isApprovedForAll(address account, address operator) external view returns (bool)
Returns true if operator
is approved to transfer account
's tokens. See {setApprovalForAll}.
Parameters
Name | Type | Description |
---|
account | address | undefined |
operator | address | undefined |
Returns
Name | Type | Description |
---|
_0 | bool | undefined |
lazyMint
function lazyMint(uint256 amount, string baseURIForTokens) external nonpayable
Lets an account with MINTER_ROLE
lazy mint 'n' NFTs. The URIs for each token is the provided _baseURIForTokens
+ {tokenId}
.
Parameters
Name | Type | Description |
---|
amount | uint256 | The amount of NFTs to lazy mint. |
baseURIForTokens | string | The URI for the NFTs to lazy mint. |
safeBatchTransferFrom
function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable
xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. Emits a {TransferBatch} event. Requirements: - ids
and amounts
must have the same length. - If to
refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.
Parameters
Name | Type | Description |
---|
from | address | undefined |
to | address | undefined |
ids | uint256[] | undefined |
amounts | uint256[] | undefined |
data | bytes | undefined |
safeTransferFrom
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable
Transfers amount
tokens of token type id
from from
to to
. Emits a {TransferSingle} event. Requirements: - to
cannot be the zero address. - If the caller is not from
, it must have been approved to spend from
's tokens via {setApprovalForAll}. - from
must have a balance of tokens of type id
of at least amount
. - If to
refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value.
Parameters
Name | Type | Description |
---|
from | address | undefined |
to | address | undefined |
id | uint256 | undefined |
amount | uint256 | undefined |
data | bytes | undefined |
setApprovalForAll
function setApprovalForAll(address operator, bool approved) external nonpayable
Grants or revokes permission to operator
to transfer the caller's tokens, according to approved
, Emits an {ApprovalForAll} event. Requirements: - operator
cannot be the caller.
Parameters
Name | Type | Description |
---|
operator | address | undefined |
approved | bool | undefined |
setClaimConditions
function setClaimConditions(uint256 tokenId, IDropClaimCondition_V2.ClaimCondition[] phases, bool resetClaimEligibility) external nonpayable
Parameters
Name | Type | Description |
---|
tokenId | uint256 | undefined |
phases | IDropClaimCondition_V2.ClaimCondition[] | undefined |
resetClaimEligibility | bool | undefined |
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
Name | Type | Description |
---|
interfaceId | bytes4 | undefined |
Returns
Name | Type | Description |
---|
_0 | bool | undefined |
Events
ApprovalForAll
event ApprovalForAll(address indexed account, address indexed operator, bool approved)
Parameters
Name | Type | Description |
---|
account indexed | address | undefined |
operator indexed | address | undefined |
approved | bool | undefined |
ClaimConditionsUpdated
event ClaimConditionsUpdated(uint256 indexed tokenId, IDropClaimCondition_V2.ClaimCondition[] claimConditions)
Emitted when new claim conditions are set for a token.
Parameters
Name | Type | Description |
---|
tokenId indexed | uint256 | undefined |
claimConditions | IDropClaimCondition_V2.ClaimCondition[] | undefined |
MaxTotalSupplyUpdated
event MaxTotalSupplyUpdated(uint256 tokenId, uint256 maxTotalSupply)
Emitted when the global max supply of a token is updated.
Parameters
Name | Type | Description |
---|
tokenId | uint256 | undefined |
maxTotalSupply | uint256 | undefined |
MaxWalletClaimCountUpdated
event MaxWalletClaimCountUpdated(uint256 tokenId, uint256 count)
Emitted when the max wallet claim count for a given tokenId is updated.
Parameters
Name | Type | Description |
---|
tokenId | uint256 | undefined |
count | uint256 | undefined |
SaleRecipientForTokenUpdated
event SaleRecipientForTokenUpdated(uint256 indexed tokenId, address saleRecipient)
Emitted when the sale recipient for a particular tokenId is updated.
Parameters
Name | Type | Description |
---|
tokenId indexed | uint256 | undefined |
saleRecipient | address | undefined |
TokensClaimed
event TokensClaimed(uint256 indexed claimConditionIndex, uint256 indexed tokenId, address indexed claimer, address receiver, uint256 quantityClaimed)
Emitted when tokens are claimed.
Parameters
Name | Type | Description |
---|
claimConditionIndex indexed | uint256 | undefined |
tokenId indexed | uint256 | undefined |
claimer indexed | address | undefined |
receiver | address | undefined |
quantityClaimed | uint256 | undefined |
TokensLazyMinted
event TokensLazyMinted(uint256 startTokenId, uint256 endTokenId, string baseURI)
Emitted when tokens are lazy minted.
Parameters
Name | Type | Description |
---|
startTokenId | uint256 | undefined |
endTokenId | uint256 | undefined |
baseURI | string | undefined |
TransferBatch
event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values)
Parameters
Name | Type | Description |
---|
operator indexed | address | undefined |
from indexed | address | undefined |
to indexed | address | undefined |
ids | uint256[] | undefined |
values | uint256[] | undefined |
TransferSingle
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value)
Parameters
Name | Type | Description |
---|
operator indexed | address | undefined |
from indexed | address | undefined |
to indexed | address | undefined |
id | uint256 | undefined |
value | uint256 | undefined |
URI
event URI(string value, uint256 indexed id)
Parameters
Name | Type | Description |
---|
value | string | undefined |
id indexed | uint256 | undefined |
WalletClaimCountUpdated
event WalletClaimCountUpdated(uint256 tokenId, address indexed wallet, uint256 count)
Emitted when the wallet claim count for a given tokenId and address is updated.
Parameters
Name | Type | Description |
---|
tokenId | uint256 | undefined |
wallet indexed | address | undefined |
count | uint256 | undefined |