ERC1155
Inherits: IERC1155
Title: ERC1155
Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC1155/ERC1155.sol)
Stateless Diamond facet for the ERC-1155 Multi-Token Standard.
All logic lives in ERC1155Lib. This contract is a pure delegator.
safeTransferFrom/safeBatchTransferFrom are the movement selectors a movement-replacing extension
replaces; only one such extension per diamond (D25, #234).
Notes:
- lattice-version: 0.1.0
- lattice-source: OpenZeppelin v5.6.1
Functions
uri
Returns the URI for token type id.
function uri(uint256 id) public view virtual returns (string memory);Parameters
| Name | Type | Description |
|---|---|---|
| id | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
balanceOf
Returns the amount of tokens of token type id owned by account.
function balanceOf(address account, uint256 id) public view virtual returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| account | address | |
| id | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
balanceOfBatch
Batched version of balanceOf.
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
public
view
virtual
returns (uint256[] memory);Parameters
| Name | Type | Description |
|---|---|---|
| accounts | address[] | |
| ids | uint256[] |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256[] |
isApprovedForAll
Returns true if operator is approved to transfer account's tokens.
function isApprovedForAll(address account, address operator) public view virtual returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| account | address | |
| operator | address |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
setApprovalForAll
Grants or revokes permission to operator to transfer the caller's tokens.
function setApprovalForAll(address operator, bool approved) public virtual;Parameters
| Name | Type | Description |
|---|---|---|
| operator | address | |
| approved | bool |
safeTransferFrom
Transfers value amount of an id from from to to.
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) public virtual;Parameters
| Name | Type | Description |
|---|---|---|
| from | address | |
| to | address | |
| id | uint256 | |
| value | uint256 | |
| data | bytes |
safeBatchTransferFrom
Batched version of safeTransferFrom.
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) public virtual;Parameters
| Name | Type | Description |
|---|---|---|
| from | address | |
| to | address | |
| ids | uint256[] | |
| values | uint256[] | |
| data | bytes |
exportSelectors
ERC-8153 selector export: this facet's cuttable selectors, tightly packed (4 bytes each).
Excludes exportSelectors() itself (0x0ef22643) - it is never cut into a diamond. Order matches
forge inspect ERC1155 methodIdentifiers (alphabetical by signature); kept in exact parity by
ExportSelectorsParityTest. Chunks:
balanceOf(address,uint256) 0x00fdd58e
balanceOfBatch(address[],uint256[]) 0x4e1273f4
isApprovedForAll(address,address) 0xe985e9c5
safeBatchTransferFrom(address,address,uint256[],uint256[],bytes) 0x2eb2c2d6
safeTransferFrom(address,address,uint256,uint256,bytes) 0xf242432a
setApprovalForAll(address,bool) 0xa22cb465
uri(uint256) 0x0e89341c
function exportSelectors() external pure virtual returns (bytes memory selectors);Returns
| Name | Type | Description |
|---|---|---|
| selectors | bytes |