ERC-1155 Functions
balanceOf(address account, uint256 id) → uint256external
Returns the amount of tokens of token type id owned by account.
Requirements:
accountcannot be the zero address.
balanceOfBatch(address[] accounts, uint256[] ids) → uint256[]external
Batched version of balanceOf.
Requirements:
accountsandidsmust have the same length.
setApprovalForAll(address operator, bool approved)external
Grants or revokes permission to operator to transfer the caller’s tokens, according to approved,
Emits an ApprovalForAll event.
Requirements:
operatorcannot be the caller.
isApprovedForAll(address account, address operator) → boolexternal
Returns true if operator is approved to transfer account's tokens.
See setApprovalForAll.
safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)external
Transfers amount tokens of token type id from from to to.
Emits a TransferSingle event.
Requirements:
tocannot be the zero address.If the caller is not
from, it must be have been approved to spendfrom's tokens viasetApprovalForAll.frommust have a balance of tokens of typeidof at leastamount.If
torefers to a smart contract, it must implementIERC1155Receiver.onERC1155Receivedand return the acceptance magic value.
safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data)external
Batched version of safeTransferFrom.
Emits a TransferBatch event.
Requirements:
idsandamountsmust have the same length.If
torefers to a smart contract, it must implementIERC1155Receiver.onERC1155BatchReceivedand return the acceptance magic value.
_mint(address account, uint256 id, uint256 amount, bytes data)internal
Creates amount tokens of token type id, and assigns them to account.
Emits a TransferSingle event.
Requirements:
accountcannot be the zero address.If
accountrefers to a smart contract, it must implementIERC1155Receiver.onERC1155Receivedand return the acceptance magic value.
_mintBatch(address to, uint256[] ids, uint256[] amounts, bytes data)internal
Batched version of _mint.
Requirements:
idsandamountsmust have the same length.If
torefers to a smart contract, it must implementIERC1155Receiver.onERC1155BatchReceivedand return the acceptance magic value.
_burn(address account, uint256 id, uint256 amount)internal
Destroys amount tokens of token type id from account
Requirements:
accountcannot be the zero address.accountmust have at leastamounttokens of token typeid.
_burnBatch(address account, uint256[] ids, uint256[] amounts)internal
Batched version of _burn.
Requirements:
idsandamountsmust have the same length.
Last updated