ERC1155
A smart contract interface standard for fungible and non-fungible tokens. A multi token standard.
Our docs are now available at dune.com/docs. We'll keep this around as a reference, but we won't update them and eventually plan to deprecate.

ERC1155 definition

The ERC1155 standard interface is a multi token standard. It can include any combination of fungible and non-fungible tokens and can therefore be used for a wide range of use cases. Most commonly ERC1155 smart contracts are used today to reflect in-game items and currencies, digital collectibles, art and membership passes, but they really can be used for anything since they combine all properties of ERC20 and ERC721 tokens in a single smart contract. Using a single smart contract for all types of tokens that may exist within a given project saves on gas and complexity during usage and deployment.
Each id in an ERC1155 smart contract can have a different value of tokens that exist. A non-fungible token will simply have the value 1. Fungible tokens will have a value > 1. All ERC1155 tokens are distinct and lack the decimal property of ERC20 tokens. In usage, this lack of decimal property can easily be corrected for in the frontend of where ever you are dealing with these tokens.
For more reading, check out the proposal for the standard, the ethereum.org docs or the open Zeppelin docs.
Methods
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external;
/* transfers a quantity(_value) of a specific token type(_id) from an address(_from) to a receiver(_to)*/
function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external;
/* transfers multiple token types in different quantities as specified in the _ids and _values arrays. Can only have one sender and one receiver.*/
function balanceOf(address _owner, uint256 _id) external view returns (uint256);
/* returns the quantity of tokens for a specific token type for a specific owner */
function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory);
/*returns the balance of mutiple owners and multiple token types */
function setApprovalForAll(address _operator, bool _approved) external;
/* sets the approval for a certain operator for all token types(Ids) */
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
/* returns whether a operator is approved for all */
function uri(uint256 _id) external view returns (string memory);
/* returns the uri of the specified id
Events
event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value);
/* gets emitted after a successful safeTransferFrom call */
event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values);
/* gets emitted after a successful safeBtachTransferFrom call */
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
/* gets emitted after a successful setApprovalForAll call */
event URI(string _value, uint256 indexed _id);
/* gets emmitted when the URI gets changed

Tables in Dune

We decode all events of all ERC1155 contracts into the respective event tables.

erc1155."ERC1155_evt_Transfer_Single"

This event gets emitted when a single type of token within one erc1155 contract is transferred using the safeTransferFrom function.
operator
bytea
the address of the account/contract that is approved to make the transfer and has initiated this transaction
from
bytea
the sender of the ERC1155 token
to
bytea
the receiver of the ERC1155 token
id
numeric
The Token ID property of this class of token
value
numeric
the amount of tokens that have been transferred for a specific id
contract_address
bytea
the contract_address of this ERC1155 smart contract
evt_tx_hash
bytea
the transaction hash in which this event got emitted
evt_index
bigint
this logs index position in the block (cumulative amount of logs ordered by execution)
evt_block_time
timestamp with time zone
the time at which the block that contains this event log got mined
evt_block_number
bigint
the length of the blockchain

erc1155."ERC1155_evt_TransferBatch"

This event gets emitted when multiple types of tokens within one erc1155 contract are transferred using the safeBatchTransferFrom function.
operator
bytea
the address of the account/contract that is approved to make the transfer and has initiated this transaction
from
bytea
the sender of the ERC1155 token
to
bytea
the receiver of the ERC1155 token
id
ARRAY
an array that contains the token id properties of the tokens that have been moved in this transaction
value
ARRAY
an array that contains the token value properties of the tokens that have been moved in this transaction
contract_address
bytea
the contract_address of this ERC1155 smart contract
evt_tx_hash
bytea
the transaction hash in which this event got emitted
evt_index
bigint
this logs index position in the block (cumulative amount of logs ordered by execution)
evt_block_time
timestamp with time zone
the time at which the block that contains this event log got mined
evt_block_number
bigint
the length of the blockchain

ERC1155_evt_URI

This event gets emitted when the URI of a token type gets changed. This can be done using multiple functions, as long as the conform to the
value
text
the new URI
id
numeric
the id of the token's URI that got changed
contract_address
bytea
the contract_address of this ERC1155 smart contract
evt_tx_hash
bytea
the transaction hash in which this event got emitted
evt_index
bigint
this logs index position in the block (cumulative amount of
evt_block_time
timestamp with time zone
the time at which the block that contains this event log got mined
evt_block_number
bigint
the length of the blockchain
Copy link
On this page
ERC1155 definition
Tables in Dune