TZIP-16
{
"name": "Versum Items",
"version": "FA2-mutez-no_toknat-self_transfer",
"description": "Versum's fungible, non-fungible and semi-fungible tokens contract: Versum Items",
"interfaces": [
"TZIP-012-2020-12-24",
"TZIP-012",
"TZIP-016",
"TZIP-021"
],
"authors": [
"Versum Studios"
],
"homepage": "https://github.com/versumstudios/",
"views": [
{
"name": "get_balance",
"pure": true,
"description": "This is the `get_balance` view defined in TZIP-12.",
"implementations": [
{
"michelsonStorageView": {
"parameter": {
"prim": "pair",
"args": [
{
"prim": "address",
"annots": [
"%owner"
]
},
{
"prim": "nat",
"annots": [
"%token_id"
]
}
]
},
"returnType": {
"prim": "nat"
},
"code": [
{
"prim": "UNPAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "DROP"
},
{
"prim": "SWAP"
},
{
"prim": "DUP"
},
{
"prim": "DUG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "GET",
"args": [
{
"int": "9"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "DUP"
},
{
"prim": "DUG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "CDR"
},
{
"prim": "MEM"
},
{
"prim": "IF",
"args": [
[
],
[
{
"prim": "PUSH",
"args": [
{
"prim": "string"
},
{
"string": "FA2_TOKEN_UNDEFINED"
}
]
},
{
"prim": "FAILWITH"
}
]
]
},
{
"prim": "SWAP"
},
{
"prim": "CAR"
},
{
"prim": "GET",
"args": [
{
"int": "5"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "int"
},
{
"int": "502"
}
]
},
{
"prim": "FAILWITH"
}
],
[
]
]
}
]
}
}
]
},
{
"name": "does_token_exist",
"pure": true,
"description": "Ask whether a token ID is exists.",
"implementations": [
{
"michelsonStorageView": {
"parameter": {
"prim": "nat"
},
"returnType": {
"prim": "bool"
},
"code": [
{
"prim": "UNPAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "DROP"
},
{
"prim": "SWAP"
},
{
"prim": "GET",
"args": [
{
"int": "9"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "MEM"
}
]
}
}
]
},
{
"name": "count_tokens",
"pure": true,
"description": "Get how many tokens are in this FA2 contract.
",
"implementations": [
{
"michelsonStorageView": {
"returnType": {
"prim": "nat"
},
"code": [
{
"prim": "CAR"
},
{
"prim": "CAR"
},
{
"prim": "CAR"
},
{
"prim": "CAR"
},
{
"prim": "GET",
"args": [
{
"int": "4"
}
]
},
{
"prim": "SIZE"
}
]
}
}
]
},
{
"name": "all_tokens",
"pure": true,
"description": "
This view is specified (but optional) in the standard.
This contract is built with assume_consecutive_token_ids =
False, so we convert the set of tokens from the storage to a list
to fit the expected type of TZIP-16.
",
"implementations": [
{
"michelsonStorageView": {
"returnType": {
"prim": "list",
"args": [
{
"prim": "nat"
}
]
},
"code": [
{
"prim": "CAR"
},
{
"prim": "CAR"
},
{
"prim": "CAR"
},
{
"prim": "CAR"
},
{
"prim": "GET",
"args": [
{
"int": "4"
}
]
},
{
"prim": "NIL",
"args": [
{
"prim": "nat"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "ITER",
"args": [
[
{
"prim": "CONS"
}
]
]
},
{
"prim": "NIL",
"args": [
{
"prim": "nat"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "ITER",
"args": [
[
{
"prim": "CONS"
}
]
]
}
]
}
}
]
},
{
"name": "is_operator",
"pure": true,
"implementations": [
{
"michelsonStorageView": {
"parameter": {
"prim": "pair",
"args": [
{
"prim": "address",
"annots": [
"%owner"
]
},
{
"prim": "pair",
"args": [
{
"prim": "address",
"annots": [
"%operator"
]
},
{
"prim": "nat",
"annots": [
"%token_id"
]
}
]
}
]
},
"returnType": {
"prim": "bool"
},
"code": [
{
"prim": "UNPAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "DROP"
},
{
"prim": "SWAP"
},
{
"prim": "GET",
"args": [
{
"int": "3"
}
]
},
{
"prim": "GET",
"args": [
{
"int": "5"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "DUP"
},
{
"prim": "GET",
"args": [
{
"int": "4"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "DUP"
},
{
"prim": "GET",
"args": [
{
"int": "3"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "CAR"
},
{
"prim": "PAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "MEM"
}
]
}
}
]
},
{
"name": "total_supply",
"pure": true,
"implementations": [
{
"michelsonStorageView": {
"parameter": {
"prim": "nat"
},
"returnType": {
"prim": "nat"
},
"code": [
{
"prim": "UNPAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "DROP"
},
{
"prim": "SWAP"
},
{
"prim": "GET",
"args": [
{
"int": "10"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "int"
},
{
"int": "527"
}
]
},
{
"prim": "FAILWITH"
}
],
[
]
]
}
]
}
}
]
},
{
"name": "token_metadata",
"pure": true,
"description": "Get Token Metadata",
"implementations": [
{
"michelsonStorageView": {
"parameter": {
"prim": "nat"
},
"returnType": {
"prim": "pair",
"args": [
{
"prim": "nat",
"annots": [
"%token_id"
]
},
{
"prim": "map",
"args": [
{
"prim": "string"
},
{
"prim": "bytes"
}
],
"annots": [
"%token_info"
]
}
]
},
"code": [
{
"prim": "UNPAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "DROP"
},
{
"prim": "SWAP"
},
{
"prim": "GET",
"args": [
{
"int": "9"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "int"
},
{
"int": "554"
}
]
},
{
"prim": "FAILWITH"
}
],
[
]
]
}
]
}
}
]
},
{
"name": "splits",
"pure": true,
"description": "Get token royalty splits.",
"implementations": [
{
"michelsonStorageView": {
"parameter": {
"prim": "nat"
},
"returnType": {
"prim": "list",
"args": [
{
"prim": "pair",
"args": [
{
"prim": "address",
"annots": [
"%address"
]
},
{
"prim": "nat",
"annots": [
"%pct"
]
}
]
}
]
},
"code": [
{
"prim": "UNPAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "DROP"
},
{
"prim": "SWAP"
},
{
"prim": "GET",
"args": [
{
"int": "7"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "int"
},
{
"int": "3069"
}
]
},
{
"prim": "FAILWITH"
}
],
[
]
]
},
{
"prim": "GET",
"args": [
{
"int": "8"
}
]
}
]
}
}
]
},
{
"name": "minter",
"pure": true,
"description": "Get token minter.",
"implementations": [
{
"michelsonStorageView": {
"parameter": {
"prim": "nat"
},
"returnType": {
"prim": "address"
},
"code": [
{
"prim": "UNPAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "DROP"
},
{
"prim": "SWAP"
},
{
"prim": "GET",
"args": [
{
"int": "7"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "int"
},
{
"int": "3075"
}
]
},
{
"prim": "FAILWITH"
}
],
[
]
]
},
{
"prim": "GET",
"args": [
{
"int": "3"
}
]
},
{
"prim": "CAR"
}
]
}
}
]
},
{
"name": "infusions",
"pure": true,
"description": "Get token infusions.",
"implementations": [
{
"michelsonStorageView": {
"parameter": {
"prim": "nat"
},
"returnType": {
"prim": "list",
"args": [
{
"prim": "pair",
"args": [
{
"prim": "address",
"annots": [
"%token_address"
]
},
{
"prim": "list",
"args": [
{
"prim": "pair",
"args": [
{
"prim": "nat",
"annots": [
"%amount"
]
},
{
"prim": "nat",
"annots": [
"%token_id"
]
}
]
}
],
"annots": [
"%token_id_amounts"
]
}
]
}
]
},
"code": [
{
"prim": "UNPAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "DROP"
},
{
"prim": "SWAP"
},
{
"prim": "GET",
"args": [
{
"int": "7"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "int"
},
{
"int": "3087"
}
]
},
{
"prim": "FAILWITH"
}
],
[
]
]
},
{
"prim": "CAR"
},
{
"prim": "GET",
"args": [
{
"int": "3"
}
]
}
]
}
}
]
},
{
"name": "royalty",
"pure": true,
"description": "Get token minter.",
"implementations": [
{
"michelsonStorageView": {
"parameter": {
"prim": "nat"
},
"returnType": {
"prim": "nat"
},
"code": [
{
"prim": "UNPAIR",
"args": [
{
"int": "3"
}
]
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "DROP"
},
{
"prim": "SWAP"
},
{
"prim": "GET",
"args": [
{
"int": "7"
}
]
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "int"
},
{
"int": "3081"
}
]
},
{
"prim": "FAILWITH"
}
],
[
]
]
},
{
"prim": "GET",
"args": [
{
"int": "7"
}
]
}
]
}
}
]
},
{
"name": "next_token_id",
"pure": true,
"description": "Get token infusions.",
"implementations": [
{
"michelsonStorageView": {
"returnType": {
"prim": "nat"
},
"code": [
{
"prim": "CAR"
},
{
"prim": "GET",
"args": [
{
"int": "5"
}
]
},
{
"prim": "GET",
"args": [
{
"int": "4"
}
]
}
]
}
}
]
}
],
"permissions": {
"operator": "owner-or-operator-transfer",
"receiver": "owner-no-hook",
"sender": "owner-no-hook"
},
"fa2-smartpy": {
"configuration": {
"add_mutez_transfer": true,
"allow_self_transfer": true,
"assume_consecutive_token_ids": false,
"force_layouts": true,
"lazy_entry_points": false,
"name": "FA2-mutez-no_toknat-self_transfer",
"non_fungible": false,
"readable": true,
"single_asset": false,
"store_total_supply": true,
"support_operator": true,
"use_token_metadata_offchain_view": true
}
}
}