token_idMUST have their own:
token_configMUST be an enum that includes at least these two variants:
metadataMUST be the following struct:
structthat fits their use case.
token_idcan have 1 or more supply of
tokens, which are indistinguishable from one another (hence fungible). Non-fungible
token_ids MUST have a total supply of 1, and MUST only be minted once.
has_admin: boolwhich allows the instantiator to instantiate a no-admin contract. If
has_admin == false, there MUST be no admin. Any admin input MUST be ignored by the contract.
initial_balancesinput SHOULD allow an arbitrary number of
tokens to be created at instantiation. This design makes it convenient to instantiate permissionless contracts with no admin, curators and minters, as all the required tokens can be minted upon instantiation.
remove_adminfunction is enforced in SNIP1155 standards in order to encourage permissionless designs. Users MUST be able to query
contract_infoto get proof on whether an admin role exists.
curatorsMUST be able to curate new
token_ids and mints initial balances. They MUST NOT be able to mint additional tokens of existing token_ids, unless they are also minters.
mintersare specific to each token_id. They MUST be able to mint incremental fungible tokens of existing token_ids if the token_id configuration allows this. They MUST NOT be able to mint the initial token balances. Minters of a given token_id can change the public and private metadata if the token_config of the token_id allows this (applies to both fungible tokens and nfts). Minters MUST NOT be able to mint additional non-fungible tokens of existing token_ids.
token_id, but different rules MAY be implemented in additional specifications.
token_ids. The curator MUST be able to configure the token_id and set initial balances. A curator MUST NOT be able to curate a
token_idthat already exists.
CurateTokenIdsMUST be able to create multiple
token_ids and set multiple initial balances in a single transaction. Therefore,
BatchCurateTokenIdsis not necesary.
token_ids if the configuration allows it to. If a token_id is an NFT, minters MUST NOT be able to mint additional tokens; NFTs SHALL only be minted at most once. The token configuration SHOULD specify whether minters are allowed to mint additional tokens (for fungible tokens).
MintTokensMUST be able to mint multiple tokens across multiple
token_ids in a single transaction. Therefore,
BatchMintTokensis not necessary.
token_idconfiguration allows it to. The base specification does not allow any address to burn tokens they do not own, but this feature is OPTIONAL.
BurnTokensMUST be able to burn multiple tokens across multiple
token_ids in a single transaction. Therefore,
BatchBurnTokensis not necessary.
nullvalues can be used for either
private_metadatafields in order to leave the existing metadata unchanged.
token_idfrom one address to another. If the transaction caller is not the current owner of the token, a successful transaction MUST require that the caller has the required transfer allowances.
Transferinterface more closely reflects SNIP721 than SNIP20. SNIP20's
TransferFromfunctions can both be performed using SNIP1155's
Transfer. If the recipient has registered itself with a
RegisterReceivemessage, this function MUST also send an inter-contract message ("callback") to the recipient. It is also RECOMMENDED that
Sendincludes an optional code hash input, so the recipient contract does not need to have to first
Sendinterface more closely reflects SNIP721 than SNIP20. SNIP20's
SendFromfunctions can both be performed using SNIP1155's
Sendactions in a single transaction. Multiple
token_ids and recipients MUST be allowed in a batch, including a mix of NFTs and fungible tokens of the same SNIP1155 contract.
BatchSendMUST allow different callback messages to be sent for each
GivePermissionis used by an address to grant other addresses permissions to transfer or view private information of its tokens. This function MUST allow the transaction caller to set the
token_ids that fall in scope of a given approval (unlike in CW1155, where approvals are global). Permissions MUST include the ability for a token owner to allow another address to:
GivePermissioncan be used to set a specific transfer allowance limit. It is OPTIONAL to additionally include
DecreaseAllowancemessages, as these are familiar SNIP20 interfaces.
expirationcan be one of the three variants below
GivePermissionis used for this purpose instead.
AddCuratorsadd one or more curators to the list of curators, while
RemoveCuratorsremove one or more curators from the list of curators. Note that a single SNIP1155 contract instance share a consistent list of curators.
AddMintersadd one or more minters to the list of minters for a given token_id, while
RemoveMintersremove one or more minters from the list of minters for a given token_id.
admin; if there is no admin, it MUST return
token_id_private_info, except that
viewing_key_erroris returned with a custom message:
generic_errwith a custom message in most cases.
AllBalances. Functionally, this query searches through an address's transaction history (effectively calling transaction_history) to produce a list of token_ids, before searching for balances of each unique token_id. In order to avoid situations where query computation is too large, users have the option to specify the page and page size of the
transaction_historysearch; this is unlikely to be necessary for straight queries, but may be useful for contract-to-contract interactions. If these two fields are ignored, the query will return the full list of
(token_id, balance)for the address, where it has some balance currently or at some point in the past. Returns in ascending alphabetical order of
CurateTokenIds), burning, and transferring (including transfers from
tx_actioncan be one of the following variants
token_id_public_info, except that the
private_metadatafield MUST include the private metadata if it exists.
code_hashsent in this message, and use it when calling the
BatchSendfunction is called, the SNIP1155 sends a callback to a registered address. When doing so, the SNIP1155 contract MUST call the
Snip1155Receivehandle function of the recipient contract. The callback message is in the following format: