Skip to content

Instantly share code, notes, and snippets.

@deuszx
Created November 23, 2022 11:35
Show Gist options
  • Save deuszx/95e1933f98832e17b520c631bcd7fd58 to your computer and use it in GitHub Desktop.
Save deuszx/95e1933f98832e17b520c631bcd7fd58 to your computer and use it in GitHub Desktop.
ink! metadata for the blender contract deployed under 5ExdeNmh3c7kXpx9uE4M9T63z19KZNAPSyGMfE5zPXeBUryj on Aleph Zero Smartnet.
{
"source": {
"hash": "0x95f94206c32dde536c2fab06b55730fd0ae0c64437c00db3d993079f7b54d549",
"language": "ink! 3.4.0",
"compiler": "rustc 1.67.0-nightly"
},
"contract": {
"name": "blender",
"version": "0.1.0",
"authors": [
"Cardinal Cryptography"
],
"repository": "https://github.com/aleph-zero-foundation/aleph-node",
"homepage": "https://alephzero.org/",
"license": "Apache 2.0"
},
"V3": {
"spec": {
"constructors": [
{
"args": [
{
"label": "max_leaves",
"type": {
"displayName": [
"u32"
],
"type": 1
}
}
],
"docs": [
"Instantiate the contract. Set the caller as the owner."
],
"label": "new",
"payable": false,
"selector": "0x9bae9d5e"
}
],
"docs": [],
"events": [
{
"args": [
{
"docs": [],
"indexed": true,
"label": "token_id",
"type": {
"displayName": [
"TokenId"
],
"type": 11
}
},
{
"docs": [],
"indexed": false,
"label": "value",
"type": {
"displayName": [
"TokenAmount"
],
"type": 3
}
},
{
"docs": [],
"indexed": false,
"label": "leaf_idx",
"type": {
"displayName": [
"u32"
],
"type": 1
}
},
{
"docs": [],
"indexed": false,
"label": "note",
"type": {
"displayName": [
"Note"
],
"type": 2
}
}
],
"docs": [],
"label": "Deposited"
},
{
"args": [
{
"docs": [],
"indexed": true,
"label": "token_id",
"type": {
"displayName": [
"TokenId"
],
"type": 11
}
},
{
"docs": [],
"indexed": false,
"label": "value",
"type": {
"displayName": [
"TokenAmount"
],
"type": 3
}
},
{
"docs": [],
"indexed": true,
"label": "recipient",
"type": {
"displayName": [
"AccountId"
],
"type": 12
}
},
{
"docs": [],
"indexed": false,
"label": "leaf_idx",
"type": {
"displayName": [
"u32"
],
"type": 1
}
},
{
"docs": [],
"indexed": false,
"label": "new_note",
"type": {
"displayName": [
"Note"
],
"type": 2
}
}
],
"docs": [],
"label": "Withdrawn"
},
{
"args": [
{
"docs": [],
"indexed": true,
"label": "token_id",
"type": {
"displayName": [
"TokenId"
],
"type": 11
}
},
{
"docs": [],
"indexed": false,
"label": "token_address",
"type": {
"displayName": [
"AccountId"
],
"type": 12
}
}
],
"docs": [],
"label": "TokenRegistered"
}
],
"messages": [
{
"args": [
{
"label": "token_id",
"type": {
"displayName": [
"TokenId"
],
"type": 11
}
},
{
"label": "value",
"type": {
"displayName": [
"TokenAmount"
],
"type": 3
}
},
{
"label": "note",
"type": {
"displayName": [
"Note"
],
"type": 2
}
},
{
"label": "proof",
"type": {
"displayName": [
"Vec"
],
"type": 13
}
}
],
"docs": [
" Trigger deposit action (see ADR for detailed description)."
],
"label": "deposit",
"mutates": true,
"payable": false,
"returnType": {
"displayName": [
"Result"
],
"type": 14
},
"selector": "0x00000001"
},
{
"args": [
{
"label": "token_id",
"type": {
"displayName": [
"TokenId"
],
"type": 11
}
},
{
"label": "value",
"type": {
"displayName": [
"TokenAmount"
],
"type": 3
}
},
{
"label": "recipient",
"type": {
"displayName": [
"AccountId"
],
"type": 12
}
},
{
"label": "fee_for_caller",
"type": {
"displayName": [
"Option"
],
"type": 20
}
},
{
"label": "merkle_root",
"type": {
"displayName": [
"MerkleRoot"
],
"type": 2
}
},
{
"label": "nullifier",
"type": {
"displayName": [
"Nullifier"
],
"type": 3
}
},
{
"label": "new_note",
"type": {
"displayName": [
"Note"
],
"type": 2
}
},
{
"label": "proof",
"type": {
"displayName": [
"Vec"
],
"type": 13
}
}
],
"docs": [
" Trigger withdraw action (see ADR for detailed description)."
],
"label": "withdraw",
"mutates": true,
"payable": false,
"returnType": {
"displayName": [
"Result"
],
"type": 14
},
"selector": "0x00000002"
},
{
"args": [],
"docs": [
" Read the current root of the Merkle tree with notes."
],
"label": "current_merkle_root",
"mutates": false,
"payable": false,
"returnType": {
"displayName": [
"MerkleRoot"
],
"type": 2
},
"selector": "0x00000003"
},
{
"args": [
{
"label": "leaf_idx",
"type": {
"displayName": [
"u32"
],
"type": 1
}
}
],
"docs": [
" Retrieve the path from the leaf to the root. `None` if the leaf does not exist."
],
"label": "merkle_path",
"mutates": false,
"payable": false,
"returnType": {
"displayName": [
"Option"
],
"type": 21
},
"selector": "0x00000004"
},
{
"args": [
{
"label": "nullifier",
"type": {
"displayName": [
"Nullifier"
],
"type": 3
}
}
],
"docs": [
" Check whether `nullifier` has been already used."
],
"label": "contains_nullifier",
"mutates": false,
"payable": false,
"returnType": {
"displayName": [
"bool"
],
"type": 23
},
"selector": "0x00000005"
},
{
"args": [
{
"label": "relation",
"type": {
"displayName": [
"Relation"
],
"type": 24
}
},
{
"label": "vk",
"type": {
"displayName": [
"Vec"
],
"type": 13
}
}
],
"docs": [
" Register a verifying key for one of the `Relation`.",
"",
" For owner use only."
],
"label": "register_vk",
"mutates": true,
"payable": false,
"returnType": {
"displayName": [
"Result"
],
"type": 14
},
"selector": "0x00000008"
},
{
"args": [
{
"label": "token_id",
"type": {
"displayName": [
"TokenId"
],
"type": 11
}
}
],
"docs": [
" Check if there is a token address registered at `token_id`."
],
"label": "registered_token_address",
"mutates": false,
"payable": false,
"returnType": {
"displayName": [
"Option"
],
"type": 25
},
"selector": "0x00000009"
},
{
"args": [
{
"label": "token_id",
"type": {
"displayName": [
"TokenId"
],
"type": 11
}
},
{
"label": "token_address",
"type": {
"displayName": [
"AccountId"
],
"type": 12
}
}
],
"docs": [
" Register a token contract (`token_address`) at `token_id`.",
"",
" For owner use only."
],
"label": "register_new_token",
"mutates": true,
"payable": false,
"returnType": {
"displayName": [
"Result"
],
"type": 14
},
"selector": "0x0000000a"
}
]
},
"storage": {
"struct": {
"fields": [
{
"layout": {
"cell": {
"key": "0x0000000000000000000000000000000000000000000000000000000000000000",
"ty": 0
}
},
"name": "notes"
},
{
"layout": {
"cell": {
"key": "0x0100000000000000000000000000000000000000000000000000000000000000",
"ty": 1
}
},
"name": "next_free_leaf"
},
{
"layout": {
"cell": {
"key": "0x0200000000000000000000000000000000000000000000000000000000000000",
"ty": 1
}
},
"name": "max_leaves"
},
{
"layout": {
"cell": {
"key": "0x0300000000000000000000000000000000000000000000000000000000000000",
"ty": 7
}
},
"name": "merkle_roots"
},
{
"layout": {
"cell": {
"key": "0x0400000000000000000000000000000000000000000000000000000000000000",
"ty": 9
}
},
"name": "nullifiers"
},
{
"layout": {
"cell": {
"key": "0x0500000000000000000000000000000000000000000000000000000000000000",
"ty": 10
}
},
"name": "registered_tokens"
},
{
"layout": {
"struct": {
"fields": [
{
"layout": {
"cell": {
"key": "0xb36ee29c00000000000000000000000000000000000000000000000000000000",
"ty": 12
}
},
"name": "owner"
},
{
"layout": {
"enum": {
"dispatchKey": "0xb46ee29c00000000000000000000000000000000000000000000000000000000",
"variants": {
"0": {
"fields": [
{
"layout": {
"cell": {
"key": "0xb56ee29c00000000000000000000000000000000000000000000000000000000",
"ty": 8
}
},
"name": null
}
]
},
"1": {
"fields": []
}
}
}
},
"name": "_reserved"
}
]
}
},
"name": "ownable"
}
]
}
},
"types": [
{
"id": 0,
"type": {
"def": {
"composite": {
"fields": [
{
"name": "offset_key",
"type": 4,
"typeName": "Key"
}
]
}
},
"params": [
{
"name": "K",
"type": 1
},
{
"name": "V",
"type": 2
}
],
"path": [
"ink_storage",
"lazy",
"mapping",
"Mapping"
]
}
},
{
"id": 1,
"type": {
"def": {
"primitive": "u32"
}
}
},
{
"id": 2,
"type": {
"def": {
"array": {
"len": 4,
"type": 3
}
}
}
},
{
"id": 3,
"type": {
"def": {
"primitive": "u64"
}
}
},
{
"id": 4,
"type": {
"def": {
"composite": {
"fields": [
{
"type": 5,
"typeName": "[u8; 32]"
}
]
}
},
"path": [
"ink_primitives",
"Key"
]
}
},
{
"id": 5,
"type": {
"def": {
"array": {
"len": 32,
"type": 6
}
}
}
},
{
"id": 6,
"type": {
"def": {
"primitive": "u8"
}
}
},
{
"id": 7,
"type": {
"def": {
"composite": {
"fields": [
{
"name": "offset_key",
"type": 4,
"typeName": "Key"
}
]
}
},
"params": [
{
"name": "K",
"type": 2
},
{
"name": "V",
"type": 8
}
],
"path": [
"ink_storage",
"lazy",
"mapping",
"Mapping"
]
}
},
{
"id": 8,
"type": {
"def": {
"tuple": []
}
}
},
{
"id": 9,
"type": {
"def": {
"composite": {
"fields": [
{
"name": "offset_key",
"type": 4,
"typeName": "Key"
}
]
}
},
"params": [
{
"name": "K",
"type": 3
},
{
"name": "V",
"type": 8
}
],
"path": [
"ink_storage",
"lazy",
"mapping",
"Mapping"
]
}
},
{
"id": 10,
"type": {
"def": {
"composite": {
"fields": [
{
"name": "offset_key",
"type": 4,
"typeName": "Key"
}
]
}
},
"params": [
{
"name": "K",
"type": 11
},
{
"name": "V",
"type": 12
}
],
"path": [
"ink_storage",
"lazy",
"mapping",
"Mapping"
]
}
},
{
"id": 11,
"type": {
"def": {
"primitive": "u16"
}
}
},
{
"id": 12,
"type": {
"def": {
"composite": {
"fields": [
{
"type": 5,
"typeName": "[u8; 32]"
}
]
}
},
"path": [
"ink_env",
"types",
"AccountId"
]
}
},
{
"id": 13,
"type": {
"def": {
"sequence": {
"type": 6
}
}
}
},
{
"id": 14,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 8
}
],
"index": 0,
"name": "Ok"
},
{
"fields": [
{
"type": 15
}
],
"index": 1,
"name": "Err"
}
]
}
},
"params": [
{
"name": "T",
"type": 8
},
{
"name": "E",
"type": 15
}
],
"path": [
"Result"
]
}
},
{
"id": 15,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 16,
"typeName": "OwnableError"
}
],
"index": 0,
"name": "InsufficientPermission"
},
{
"index": 1,
"name": "TooManyNotes"
},
{
"index": 2,
"name": "UnknownMerkleRoot"
},
{
"index": 3,
"name": "NullifierAlreadyUsed"
},
{
"index": 4,
"name": "TooHighFee"
},
{
"fields": [
{
"type": 17,
"typeName": "SnarcosError"
}
],
"index": 5,
"name": "ChainExtension"
},
{
"fields": [
{
"type": 18,
"typeName": "PSP22Error"
}
],
"index": 6,
"name": "Psp22"
},
{
"fields": [
{
"type": 19,
"typeName": "String"
}
],
"index": 7,
"name": "InkEnv"
},
{
"index": 8,
"name": "TokenIdAlreadyRegistered"
},
{
"index": 9,
"name": "TokenIdNotRegistered"
}
]
}
},
"path": [
"blender",
"error",
"BlenderError"
]
}
},
{
"id": 16,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "CallerIsNotOwner"
},
{
"index": 1,
"name": "NewOwnerIsZero"
}
]
}
},
"path": [
"openbrush_contracts",
"traits",
"errors",
"ownable",
"OwnableError"
]
}
},
{
"id": 17,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "IdentifierAlreadyInUse"
},
{
"index": 1,
"name": "VerificationKeyTooLong"
},
{
"index": 2,
"name": "UnknownVerificationKeyIdentifier"
},
{
"index": 3,
"name": "DeserializingProofFailed"
},
{
"index": 4,
"name": "DeserializingPublicInputFailed"
},
{
"index": 5,
"name": "DeserializingVerificationKeyFailed"
},
{
"index": 6,
"name": "VerificationFailed"
},
{
"index": 7,
"name": "IncorrectProof"
},
{
"index": 8,
"name": "UnknownError"
}
]
}
},
"path": [
"snarcos_extension",
"SnarcosError"
]
}
},
{
"id": 18,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 13,
"typeName": "String"
}
],
"index": 0,
"name": "Custom"
},
{
"index": 1,
"name": "InsufficientBalance"
},
{
"index": 2,
"name": "InsufficientAllowance"
},
{
"index": 3,
"name": "ZeroRecipientAddress"
},
{
"index": 4,
"name": "ZeroSenderAddress"
},
{
"fields": [
{
"type": 13,
"typeName": "String"
}
],
"index": 5,
"name": "SafeTransferCheckFailed"
}
]
}
},
"path": [
"openbrush_contracts",
"traits",
"errors",
"psp22",
"PSP22Error"
]
}
},
{
"id": 19,
"type": {
"def": {
"primitive": "str"
}
}
},
{
"id": 20,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "None"
},
{
"fields": [
{
"type": 3
}
],
"index": 1,
"name": "Some"
}
]
}
},
"params": [
{
"name": "T",
"type": 3
}
],
"path": [
"Option"
]
}
},
{
"id": 21,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "None"
},
{
"fields": [
{
"type": 22
}
],
"index": 1,
"name": "Some"
}
]
}
},
"params": [
{
"name": "T",
"type": 22
}
],
"path": [
"Option"
]
}
},
{
"id": 22,
"type": {
"def": {
"sequence": {
"type": 2
}
}
}
},
{
"id": 23,
"type": {
"def": {
"primitive": "bool"
}
}
},
{
"id": 24,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "Deposit"
},
{
"index": 1,
"name": "Withdraw"
}
]
}
},
"path": [
"blender",
"contract",
"blender",
"Relation"
]
}
},
{
"id": 25,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "None"
},
{
"fields": [
{
"type": 12
}
],
"index": 1,
"name": "Some"
}
]
}
},
"params": [
{
"name": "T",
"type": 12
}
],
"path": [
"Option"
]
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment