Skip to main content

IERC1155

Required interface of an ERC1155 compliant contract, as defined in the https://eips.ethereum.org/EIPS/eip-1155[EIP].

Available since v3.1.

Functions

mint

No description

Diamond mint

Declaration

  function mint(
) external

Modifiers:

No modifiers

balanceOf

No description

Returns the amount of tokens of token type id owned by account.

Requirements:

  • account cannot be the zero address.

Declaration

  function balanceOf(
) external returns (uint256)

Modifiers:

No modifiers

balanceOfBatch

No description

xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.

Requirements:

  • accounts and ids must have the same length.

Declaration

  function balanceOfBatch(
) external returns (uint256[])

Modifiers:

No modifiers

setApprovalForAll

No description

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.

Declaration

  function setApprovalForAll(
) external

Modifiers:

No modifiers

isApprovedForAll

No description

Returns true if operator is approved to transfer account's tokens.

See {setApprovalForAll}.

Declaration

  function isApprovedForAll(
) external returns (bool)

Modifiers:

No modifiers

safeTransferFrom

No description

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

Declaration

  function safeTransferFrom(
) external

Modifiers:

No modifiers

safeBatchTransferFrom

No description

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.

Declaration

  function safeBatchTransferFrom(
) external

Modifiers:

No modifiers

Events

TransferSingle

No description

Emitted when value tokens of token type id are transferred from from to to by operator.

TransferBatch

No description

Equivalent to multiple {TransferSingle} events, where operator, from and to are the same for all transfers.

ApprovalForAll

No description

Emitted when account grants or revokes permission to operator to transfer their tokens, according to approved.

URI

No description

Emitted when the URI for token type id changes to value, if it is a non-programmatic URI.

If an {URI} event was emitted for id, the standard https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that value will equal the value returned by {IERC1155MetadataURI-uri}.