TZIP-16
{
"interfaces": [
"TZIP-012",
"TZIP-016",
"TZIP-021"
],
"name": "Wrap protocol FA2 tokens",
"homepage": "https://github.com/bender-labs/wrap-tz-contracts",
"license": {
"name": "MIT"
},
"permissions": {
"operator": "owner-or-operator-transfer",
"receiver": "owner-no-hook",
"sender": "owner-no-hook",
"custom": {
"tag": "PAUSABLE_TOKENS"
}
},
"views": [
{
"name": "get_balance",
"description": "get_balance as defined in tzip-12",
"pure": true,
"implementations": [
{
"michelsonStorageView": {
"returnType": {
"prim": "nat"
},
"code": [
{
"prim": "UNPAIR"
},
{
"prim": "SWAP"
},
{
"prim": "DUP"
},
{
"prim": "DUG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "CAR"
},
{
"prim": "CDR"
},
{
"prim": "CDR"
},
{
"prim": "CAR"
},
{
"prim": "SWAP"
},
{
"prim": "DUP"
},
{
"prim": "DUG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "CDR"
},
{
"prim": "MEM"
},
{
"prim": "NOT"
},
{
"prim": "IF",
"args": [
[
{
"prim": "DROP",
"args": [
{
"int": "2"
}
]
},
{
"prim": "PUSH",
"args": [
{
"prim": "string"
},
{
"string": "FA2_TOKEN_UNDEFINED"
}
]
},
{
"prim": "FAILWITH"
}
],
[
{
"prim": "SWAP"
},
{
"prim": "CAR"
},
{
"prim": "CDR"
},
{
"prim": "CAR"
},
{
"prim": "CAR"
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "nat"
},
{
"int": "0"
}
]
}
],
[
]
]
}
]
]
}
],
"parameter": {
"prim": "pair",
"args": [
{
"prim": "address",
"annots": [
"%owner"
]
},
{
"prim": "nat",
"annots": [
"%token_id"
]
}
]
}
}
}
]
},
{
"name": "total_supply",
"description": "get_total supply as defined in tzip-12",
"pure": true,
"implementations": [
{
"michelsonStorageView": {
"returnType": {
"prim": "nat"
},
"code": [
{
"prim": "UNPAIR"
},
{
"prim": "SWAP"
},
{
"prim": "CAR"
},
{
"prim": "CDR"
},
{
"prim": "CDR"
},
{
"prim": "CDR"
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "string"
},
{
"string": "FA2_TOKEN_UNDEFINED"
}
]
},
{
"prim": "FAILWITH"
}
],
[
]
]
}
],
"parameter": {
"prim": "nat"
}
}
}
]
},
{
"name": "is_operator",
"description": "is_operator as defined in tzip-12",
"pure": true,
"implementations": [
{
"michelsonStorageView": {
"returnType": {
"prim": "bool"
},
"code": [
{
"prim": "UNPAIR"
},
{
"prim": "SWAP"
},
{
"prim": "CAR"
},
{
"prim": "CDR"
},
{
"prim": "CAR"
},
{
"prim": "CDR"
},
{
"prim": "SWAP"
},
{
"prim": "DUP"
},
{
"prim": "DUG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "CDR"
},
{
"prim": "CDR"
},
{
"prim": "DUP",
"args": [
{
"int": "3"
}
]
},
{
"prim": "CDR"
},
{
"prim": "CAR"
},
{
"prim": "PAIR"
},
{
"prim": "DIG",
"args": [
{
"int": "2"
}
]
},
{
"prim": "CAR"
},
{
"prim": "PAIR"
},
{
"prim": "MEM"
}
],
"parameter": {
"prim": "pair",
"args": [
{
"prim": "address",
"annots": [
"%owner"
]
},
{
"prim": "pair",
"args": [
{
"prim": "address",
"annots": [
"%operator"
]
},
{
"prim": "nat",
"annots": [
"%token_id"
]
}
]
}
]
}
}
}
]
},
{
"name": "token_metadata",
"description": "token_metadata as defined in tzip-12",
"pure": true,
"implementations": [
{
"michelsonStorageView": {
"returnType": {
"prim": "pair",
"args": [
{
"prim": "nat"
},
{
"prim": "map",
"args": [
{
"prim": "string"
},
{
"prim": "bytes"
}
]
}
]
},
"code": [
{
"prim": "UNPAIR"
},
{
"prim": "SWAP"
},
{
"prim": "CAR"
},
{
"prim": "CDR"
},
{
"prim": "CDR"
},
{
"prim": "CAR"
},
{
"prim": "SWAP"
},
{
"prim": "GET"
},
{
"prim": "IF_NONE",
"args": [
[
{
"prim": "PUSH",
"args": [
{
"prim": "string"
},
{
"string": "FA2_TOKEN_UNDEFINED"
}
]
},
{
"prim": "FAILWITH"
}
],
[
]
]
}
],
"parameter": {
"prim": "nat"
}
}
}
]
}
]
}