ERC-1155 Functions
Last updated
Last updated
balanceOf(address account, uint256 id) → uint256
external
Returns the amount of tokens of token type id
owned by account
.
Requirements:
account
cannot be the zero address.
balanceOfBatch(address[] accounts, uint256[] ids) → uint256[]
external
Batched version of .
Requirements:
accounts
and ids
must 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 event.
Requirements:
operator
cannot be the caller.
isApprovedForAll(address account, address operator) → bool
external
Returns true if operator
is approved to transfer account
's tokens.
See .
safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)
external
Transfers amount
tokens of token type id
from from
to to
.
Requirements:
to
cannot be the zero address.
from
must have a balance of tokens of type id
of at least amount
.
safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data)
external
Requirements:
ids
and amounts
must have the same length.
_mint(address account, uint256 id, uint256 amount, bytes data)
internal
Creates amount
tokens of token type id
, and assigns them to account
.
Requirements:
account
cannot be the zero address.
_mintBatch(address to, uint256[] ids, uint256[] amounts, bytes data)
internal
Requirements:
ids
and amounts
must have the same length.
_burn(address account, uint256 id, uint256 amount)
internal
Destroys amount
tokens of token type id
from account
Requirements:
account
cannot be the zero address.
account
must have at least amount
tokens of token type id
.
_burnBatch(address account, uint256[] ids, uint256[] amounts)
internal
Requirements:
ids
and amounts
must have the same length.
Emits a event.
If the caller is not from
, it must be have been approved to spend from
's tokens via .
If to
refers to a smart contract, it must implement and return the acceptance magic value.
Batched version of .
Emits a event.
If to
refers to a smart contract, it must implement and return the acceptance magic value.
Emits a event.
If account
refers to a smart contract, it must implement and return the acceptance magic value.
Batched version of .
If to
refers to a smart contract, it must implement and return the acceptance magic value.
Batched version of .