diff --git a/README.md b/README.md index b44c7e0b..ec97b5a1 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,13 @@ In addition, you'll create a one-time account internally during the game, which You need Rust and Yarn. +### Setup + +``` +yarn install +cp common/js/src/envs/local.example.json common/js/src/envs/local.json +``` + ### Start chain ``` @@ -59,7 +66,6 @@ make dev ``` cd chain/scripts -yarn install yarn seed-data:dev ``` @@ -69,6 +75,5 @@ yarn seed-data:dev ``` cd front -yarn install yarn dev ``` diff --git a/chain/pallets/game/src/lib.rs b/chain/pallets/game/src/lib.rs index 247ba9ac..8596e2df 100644 --- a/chain/pallets/game/src/lib.rs +++ b/chain/pallets/game/src/lib.rs @@ -140,7 +140,7 @@ pub mod pallet { ensure_root(origin)?; let bases = check_and_build_emo_bases( - >::get().unwrap_or_else(emo::Bases::new), + >::get(), new_bases, &fixed_base_ids, &built_base_ids, diff --git a/common/js/.gitignore b/common/js/.gitignore new file mode 100644 index 00000000..f6b79d76 --- /dev/null +++ b/common/js/.gitignore @@ -0,0 +1 @@ +/src/envs/local.json diff --git a/common/js/src/env.ts b/common/js/src/env.ts new file mode 100644 index 00000000..1b6cd2c1 --- /dev/null +++ b/common/js/src/env.ts @@ -0,0 +1,23 @@ +import localEnv from "./envs/local.json" +import stagingEnv from "./envs/staging.json" +import productionEnv from "./envs/production.json" + +type Env = typeof productionEnv +export type EnvContract = Env["contract"] + +export const getEnv = (envName: any): Env => { + if (!envName) { + throw new Error(`no envName: ${envName}`) + } + + switch (envName) { + case "local": + return localEnv + case "staging": + return stagingEnv + case "production": + return productionEnv + default: + throw new Error(`undefined env: ${envName}`) + } +} diff --git a/common/js/src/envs.json b/common/js/src/envs.json deleted file mode 100644 index 577c4e09..00000000 --- a/common/js/src/envs.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "local": { - "chainEndpoint": "ws://127.0.0.1:9944", - "contract": { - "endpoint": "ws://127.0.0.1:9988", - "storageAddress": "5GSgjWHFDhk8qoSfNRZtnEkYBPghrHnxfAQKRXjvbkTySPdS", - "forwarderAddress": "5CyqT9HEYUX3sYq6JykjaqGdrjMxArH4e2FvwVr5aqxCciBz" - } - }, - "staging": { - "chainEndpoint": "wss://node-6769173380176625664.jm.onfinality.io/ws", - "contract": { - "endpoint": "", - "storageAddress": "", - "forwarderAddress": "" - } - }, - "production": { - "chainEndpoint": "wss://proto0.open-emoji-battler.community/", - "contract": { - "endpoint": "", - "storageAddress": "", - "forwarderAddress": "" - } - } -} diff --git a/common/js/src/envs/local.example.json b/common/js/src/envs/local.example.json new file mode 100644 index 00000000..4733037e --- /dev/null +++ b/common/js/src/envs/local.example.json @@ -0,0 +1,8 @@ +{ + "chainEndpoint": "ws://127.0.0.1:9944", + "contract": { + "endpoint": "ws://127.0.0.1:9988", + "storageAddress": "", + "forwarderAddress": "" + } +} diff --git a/common/js/src/envs/production.json b/common/js/src/envs/production.json new file mode 100644 index 00000000..74280c11 --- /dev/null +++ b/common/js/src/envs/production.json @@ -0,0 +1,8 @@ +{ + "chainEndpoint": "wss://proto0.open-emoji-battler.community/", + "contract": { + "endpoint": "", + "storageAddress": "", + "forwarderAddress": "" + } +} diff --git a/common/js/src/envs/staging.json b/common/js/src/envs/staging.json new file mode 100644 index 00000000..9bab8882 --- /dev/null +++ b/common/js/src/envs/staging.json @@ -0,0 +1,8 @@ +{ + "chainEndpoint": "", + "contract": { + "endpoint": "", + "storageAddress": "", + "forwarderAddress": "" + } +} diff --git a/common/js/src/index.ts b/common/js/src/index.ts index c9daecdc..3ed438eb 100644 --- a/common/js/src/index.ts +++ b/common/js/src/index.ts @@ -6,3 +6,4 @@ export * from "./pow" export * from "./utils" export * from "./interfaces" export * from "./contract" +export * from "./env" diff --git a/common/js/src/scriptUtils.ts b/common/js/src/scriptUtils.ts index c41d7f93..94c70248 100644 --- a/common/js/src/scriptUtils.ts +++ b/common/js/src/scriptUtils.ts @@ -2,7 +2,7 @@ import { Keyring } from "@polkadot/keyring" import { cryptoWaitReady } from "@polkadot/util-crypto" import { createType } from "./api" -import { getEnv } from "./utils" +import { getEnv } from "./env" export const getChainEndpointAndKeyringPair = async (envName: string, mnemonic: string) => { const endpoint = getEnv(envName).chainEndpoint diff --git a/common/js/src/utils.ts b/common/js/src/utils.ts index 9aada508..283156c0 100644 --- a/common/js/src/utils.ts +++ b/common/js/src/utils.ts @@ -10,20 +10,6 @@ import { base64 } from "./pow/optimized.wrap" import { getWasmSolver } from "./pow/wasm" import * as definitions from "./interfaces/definitions" -import envs from "./envs.json" -type EnvNames = keyof typeof envs -export type EnvContract = (typeof envs)[EnvNames]["contract"] -export const getEnv = (envName: any) => { - if (!envName) { - throw new Error(`no envName: ${envName}`) - } - const env = envs[envName as EnvNames] - if (!env) { - throw new Error(`undefined env: ${envName}`) - } - return env -} - export const buildTypes = () => { let types: RegistryTypes = { AccountInfo: "AccountInfoWithDualRefCount", diff --git a/common/rs/.gitignore b/common/rs/.gitignore new file mode 100644 index 00000000..5a44eef0 --- /dev/null +++ b/common/rs/.gitignore @@ -0,0 +1 @@ +/Cargo.lock diff --git a/common/rs/Cargo.lock b/common/rs/Cargo.lock deleted file mode 100644 index ba765ecd..00000000 --- a/common/rs/Cargo.lock +++ /dev/null @@ -1,1196 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "anyhow" -version = "1.0.53" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" - -[[package]] -name = "array-init" -version = "2.0.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6945cc5422176fc5e602e590c2878d2c2acd9a4fe20a4baa7c28022521698ec6" - -[[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.4.12" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" -dependencies = [ - "nodrop", -] - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitvec" -version = "0.20.4" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b94ba84325db59637ffc528bbe8c7f86c02c57cff5c0e2b9b00f9a851f42f309" -dependencies = [ - "digest", -] - -[[package]] -name = "blake2-rfc" -version = "0.2.18" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" -dependencies = [ - "arrayvec 0.4.12", - "constant_time_eq", -] - -[[package]] -name = "block-buffer" -version = "0.10.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] - -[[package]] -name = "bumpalo" -version = "3.9.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" - -[[package]] -name = "byte-slice-cast" -version = "1.2.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1d30c751592b77c499e7bce34d99d67c2c11bdc0574e9a488ddade14150a4698" - -[[package]] -name = "cast" -version = "0.2.7" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" -dependencies = [ - "rustc_version", -] - -[[package]] -name = "cc" -version = "1.0.72" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "bitflags", - "textwrap", - "unicode-width", -] - -[[package]] -name = "codec_types_derive" -version = "0.1.0" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "common" -version = "0.1.0" -dependencies = [ - "anyhow", - "blake2-rfc", - "codec_types_derive", - "criterion", - "hex", - "ink_metadata", - "ink_primitives", - "ink_storage", - "libm", - "parity-scale-codec", - "rand", - "rand_pcg", - "scale-info", - "sp-std", -] - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "cpufeatures" -version = "0.2.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" -dependencies = [ - "libc", -] - -[[package]] -name = "criterion" -version = "0.3.5" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" -dependencies = [ - "atty", - "cast", - "clap", - "criterion-plot", - "csv", - "itertools", - "lazy_static", - "num-traits", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_cbor", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.4.4" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" -dependencies = [ - "cast", - "itertools", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.6" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.6" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" -dependencies = [ - "cfg-if", - "lazy_static", -] - -[[package]] -name = "crypto-common" -version = "0.1.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" -dependencies = [ - "generic-array", -] - -[[package]] -name = "csv" -version = "1.1.6" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" -dependencies = [ - "bstr", - "csv-core", - "itoa 0.4.8", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "digest" -version = "0.10.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" -dependencies = [ - "block-buffer", - "crypto-common", - "generic-array", - "subtle", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - -[[package]] -name = "generic-array" -version = "0.14.5" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.3" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "impl-serde" -version = "0.3.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ink_allocator" -version = "3.0.0-rc8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "252dfca0640dbf5927945aacdda0b6ff8c8ee51b317b37958dd6a06c13016a36" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "ink_env" -version = "3.0.0-rc8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4b9965157c1f970869e34e8c00d141d89286e093f3096ef4310dc111fff5d626" -dependencies = [ - "arrayref", - "blake2", - "cfg-if", - "derive_more", - "ink_allocator", - "ink_metadata", - "ink_prelude", - "ink_primitives", - "num-traits", - "parity-scale-codec", - "paste", - "rand", - "rlibc", - "scale-info", - "secp256k1", - "sha2", - "sha3", - "static_assertions", -] - -[[package]] -name = "ink_metadata" -version = "3.0.0-rc8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e0e2c335905d3454f2eb01fd3c3678e60f4c391b3b4180350206a9e35a9837e8" -dependencies = [ - "derive_more", - "impl-serde", - "ink_prelude", - "ink_primitives", - "scale-info", - "serde", -] - -[[package]] -name = "ink_prelude" -version = "3.0.0-rc8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "622cecf655344080352db5099a366eeb1d84f93cbe3980e204fff61af66de976" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "ink_primitives" -version = "3.0.0-rc8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6303fbbe30b4c6bbe01ff36cce29e37961095574260d5958017ce9346834c77e" -dependencies = [ - "cfg-if", - "ink_prelude", - "parity-scale-codec", - "scale-info", -] - -[[package]] -name = "ink_storage" -version = "3.0.0-rc8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6181ac6e3a74e681e8d5474565ed857d6279278d675ac58b5fcaa9a9d4504ba0" -dependencies = [ - "array-init", - "cfg-if", - "criterion", - "derive_more", - "ink_env", - "ink_metadata", - "ink_prelude", - "ink_primitives", - "ink_storage_derive", - "parity-scale-codec", - "scale-info", -] - -[[package]] -name = "ink_storage_derive" -version = "3.0.0-rc8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "537d9afcb6cf564f4ed257c0a6c1b5b5d7f2440adbad5dc08f0c8942b52aec73" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" - -[[package]] -name = "js-sys" -version = "0.3.55" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "keccak" -version = "0.1.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.112" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" - -[[package]] -name = "libm" -version = "0.2.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memchr" -version = "2.4.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "parity-scale-codec" -version = "2.3.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" -dependencies = [ - "arrayvec 0.7.2", - "bitvec", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "2.3.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "paste" -version = "1.0.6" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" - -[[package]] -name = "plotters" -version = "0.3.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" - -[[package]] -name = "plotters-svg" -version = "0.3.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" -dependencies = [ - "plotters-backend", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.16" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - -[[package]] -name = "proc-macro-crate" -version = "1.1.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" -dependencies = [ - "thiserror", - "toml", -] - -[[package]] -name = "proc-macro2" -version = "1.0.36" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.14" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.6.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" - -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_pcg" -version = "0.3.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rayon" -version = "1.5.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" -dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", -] - -[[package]] -name = "regex" -version = "1.5.4" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - -[[package]] -name = "regex-syntax" -version = "0.6.25" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - -[[package]] -name = "rlibc" -version = "1.0.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "ryu" -version = "1.0.9" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scale-info" -version = "1.0.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "5c55b744399c25532d63a0d2789b109df8d46fc93752d46b0782991a931a782f" -dependencies = [ - "bitvec", - "cfg-if", - "derive_more", - "parity-scale-codec", - "scale-info-derive", - "serde", -] - -[[package]] -name = "scale-info-derive" -version = "1.0.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "secp256k1" -version = "0.21.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ab7883017d5b21f011ef8040ea9c6c7ac90834c0df26a69e4c0b06276151f125" -dependencies = [ - "secp256k1-sys", -] - -[[package]] -name = "secp256k1-sys" -version = "0.4.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" -dependencies = [ - "cc", -] - -[[package]] -name = "semver" -version = "1.0.4" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" - -[[package]] -name = "serde" -version = "1.0.133" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.133" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.74" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142" -dependencies = [ - "itoa 1.0.1", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha3" -version = "0.10.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "31f935e31cf406e8c0e96c2815a5516181b7004ae8c5f296293221e9b1e356bd" -dependencies = [ - "digest", - "keccak", -] - -[[package]] -name = "sp-std" -version = "3.0.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "35391ea974fa5ee869cb094d5b437688fbf3d8127d64d1b9fed5822a1ed39b12" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.85" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "1.0.30" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.30" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "toml" -version = "0.5.8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" -dependencies = [ - "serde", -] - -[[package]] -name = "typenum" -version = "1.15.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" - -[[package]] -name = "unicode-width" -version = "0.1.9" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wasm-bindgen" -version = "0.2.78" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.78" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.78" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.78" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.78" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" - -[[package]] -name = "web-sys" -version = "0.3.55" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" diff --git a/common/rs/src/mtc/emo_bases.rs b/common/rs/src/mtc/emo_bases.rs index b3b179f1..0ce25fdd 100644 --- a/common/rs/src/mtc/emo_bases.rs +++ b/common/rs/src/mtc/emo_bases.rs @@ -2,12 +2,14 @@ use crate::codec_types::*; use sp_std::prelude::*; pub fn check_and_build_emo_bases( - mut bases: emo::Bases, + bases_opt: Option, new_bases: emo::Bases, fixed_base_ids: &[u16], built_base_ids: &[u16], force_bases_update: bool, ) -> Result { + let mut bases = bases_opt.unwrap_or_else(emo::Bases::new); + if force_bases_update { bases = new_bases; } else { diff --git a/contract/.gitignore b/contract/.gitignore index 5ea235ad..8d40f1d2 100644 --- a/contract/.gitignore +++ b/contract/.gitignore @@ -1 +1 @@ -/astar-collator +/node-data/ diff --git a/contract/README.md b/contract/README.md index bfb69cc2..9639d72a 100644 --- a/contract/README.md +++ b/contract/README.md @@ -1,6 +1,3 @@ -1. Get an astar chain binary: /~https://github.com/PlasmNetwork/Astar -2. Run: - -``` -./astar-collator --dev --tmp --ws-port 9988 -``` +1. Install node: /~https://github.com/paritytech/substrate-contracts-node +2. Run node: `substrate-contracts-node --dev --base-path=./node-data -lerror,runtime::contracts=debug --ws-port 9988` +3. Deploy: `cd deploy && ./dev.sh` diff --git a/contract/deploy/202109210_init/forwarder.json b/contract/deploy/202109210_init/forwarder.json index eeac87ad..1ea951a0 100644 --- a/contract/deploy/202109210_init/forwarder.json +++ b/contract/deploy/202109210_init/forwarder.json @@ -1 +1,397 @@ -{"source":{"hash":"0x565ea2ef7ac57ef9337a63f12bff3f5c167cf22aea5976bb45824d524d81bbc2","language":"ink! 3.0.0-rc8","compiler":"rustc 1.60.0-nightly"},"contract":{"name":"forwarder","version":"0.1.0","authors":["Open Emoji Battler"],"license":"Apache-2.0"},"V3":{"spec":{"constructors":[{"args":[{"label":"logic_account_id","type":{"displayName":["AccountId"],"type":0}}],"docs":[],"label":"new","payable":false,"selector":"0x9bae9d5e"}],"docs":[],"events":[],"messages":[{"args":[{"label":"deck_emo_base_ids","type":{"displayName":[],"type":4}}],"docs":[],"label":"start_mtc","mutates":true,"payable":false,"returnType":null,"selector":"0x04bfdb29"},{"args":[{"label":"player_operations","type":{"displayName":["StdVec"],"type":6}}],"docs":[],"label":"finish_mtc_shop","mutates":true,"payable":false,"returnType":null,"selector":"0xfbd3f532"},{"args":[],"docs":[],"label":"get_logic_account_id","mutates":false,"payable":false,"returnType":{"displayName":["AccountId"],"type":0},"selector":"0x6fc06073"},{"args":[],"docs":[],"label":"get_logic","mutates":false,"payable":false,"returnType":{"displayName":["LogicRef"],"type":9},"selector":"0x0ef7da6f"},{"args":[{"label":"new_account_id","type":{"displayName":["AccountId"],"type":0}}],"docs":[],"label":"change_logic_account_id","mutates":true,"payable":false,"returnType":null,"selector":"0x4ca6a149"},{"args":[],"docs":[],"label":"get_allowed_accounts","mutates":false,"payable":false,"returnType":{"displayName":["StdVec"],"type":3},"selector":"0xc35cfacd"},{"args":[{"label":"account_id","type":{"displayName":["AccountId"],"type":0}}],"docs":[],"label":"allow_account","mutates":true,"payable":false,"returnType":null,"selector":"0x815c22c2"},{"args":[{"label":"account_id","type":{"displayName":["AccountId"],"type":0}}],"docs":[],"label":"disallow_account","mutates":true,"payable":false,"returnType":null,"selector":"0xbb8bad9e"}]},"storage":{"struct":{"fields":[{"layout":{"cell":{"key":"0x0000000000000000000000000000000000000000000000000000000000000000","ty":0}},"name":"logic_account_id"},{"layout":{"cell":{"key":"0x0100000000000000000000000000000000000000000000000000000000000000","ty":3}},"name":"allowed_accounts"}]}},"types":[{"id":0,"type":{"def":{"composite":{"fields":[{"type":1,"typeName":"[u8; 32]"}]}},"path":["ink_env","types","AccountId"]}},{"id":1,"type":{"def":{"array":{"len":32,"type":2}}}},{"id":2,"type":{"def":{"primitive":"u8"}}},{"id":3,"type":{"def":{"sequence":{"type":0}}}},{"id":4,"type":{"def":{"array":{"len":6,"type":5}}}},{"id":5,"type":{"def":{"primitive":"u16"}}},{"id":6,"type":{"def":{"sequence":{"type":7}}}},{"id":7,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"mtc_emo_id","type":5,"typeName":"u16"},{"name":"index","type":2,"typeName":"u8"}],"index":0,"name":"Buy"},{"fields":[{"name":"index","type":2,"typeName":"u8"}],"index":1,"name":"Sell"},{"fields":[{"name":"indexes","type":8,"typeName":"Vec"}],"index":2,"name":"Move"},{"index":3,"name":"NextCatalogLine"},{"index":4,"name":"Upgrade"}]}},"path":["common","codec_types","mtc","shop","PlayerOperation"]}},{"id":8,"type":{"def":{"sequence":{"type":2}}}},{"id":9,"type":{"def":{"composite":{"fields":[{"name":"inner","type":10,"typeName":"::Type"}]}},"path":["logic","contract","LogicRef"]}},{"id":10,"type":{"def":{"composite":{"fields":[{"name":"account_id","type":0,"typeName":"AccountId"}]}},"path":["logic","contract","CallBuilder"]}}]}} +{ + "source": { + "hash": "0x8f36361e851299bdfaa7f27314c0f335cc1d1435f3842df6a58540f48fafefbc", + "language": "ink! 3.0.0-rc8", + "compiler": "rustc 1.60.0-nightly" + }, + "contract": { + "name": "forwarder", + "version": "0.1.0", + "authors": [ + "Open Emoji Battler" + ], + "license": "Apache-2.0" + }, + "V3": { + "spec": { + "constructors": [ + { + "args": [ + { + "label": "logic_account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "new", + "payable": false, + "selector": "0x9bae9d5e" + } + ], + "docs": [], + "events": [], + "messages": [ + { + "args": [ + { + "label": "deck_emo_base_ids", + "type": { + "displayName": [], + "type": 4 + } + } + ], + "docs": [], + "label": "start_mtc", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x04bfdb29" + }, + { + "args": [ + { + "label": "player_operations", + "type": { + "displayName": [ + "Vec" + ], + "type": 6 + } + } + ], + "docs": [], + "label": "finish_mtc_shop", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xfbd3f532" + }, + { + "args": [], + "docs": [], + "label": "get_logic_account_id", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "AccountId" + ], + "type": 0 + }, + "selector": "0x6fc06073" + }, + { + "args": [], + "docs": [], + "label": "get_logic", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "LogicRef" + ], + "type": 9 + }, + "selector": "0x0ef7da6f" + }, + { + "args": [ + { + "label": "new_account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "change_logic_account_id", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x4ca6a149" + }, + { + "args": [], + "docs": [], + "label": "get_allowed_accounts", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Vec" + ], + "type": 3 + }, + "selector": "0xc35cfacd" + }, + { + "args": [ + { + "label": "account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "allow_account", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x815c22c2" + }, + { + "args": [ + { + "label": "account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "disallow_account", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xbb8bad9e" + } + ] + }, + "storage": { + "struct": { + "fields": [ + { + "layout": { + "cell": { + "key": "0x0000000000000000000000000000000000000000000000000000000000000000", + "ty": 0 + } + }, + "name": "logic_account_id" + }, + { + "layout": { + "cell": { + "key": "0x0100000000000000000000000000000000000000000000000000000000000000", + "ty": 3 + } + }, + "name": "allowed_accounts" + } + ] + } + }, + "types": [ + { + "id": 0, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 1, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_env", + "types", + "AccountId" + ] + } + }, + { + "id": 1, + "type": { + "def": { + "array": { + "len": 32, + "type": 2 + } + } + } + }, + { + "id": 2, + "type": { + "def": { + "primitive": "u8" + } + } + }, + { + "id": 3, + "type": { + "def": { + "sequence": { + "type": 0 + } + } + } + }, + { + "id": 4, + "type": { + "def": { + "array": { + "len": 6, + "type": 5 + } + } + } + }, + { + "id": 5, + "type": { + "def": { + "primitive": "u16" + } + } + }, + { + "id": 6, + "type": { + "def": { + "sequence": { + "type": 7 + } + } + } + }, + { + "id": 7, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "mtc_emo_id", + "type": 5, + "typeName": "u16" + }, + { + "name": "index", + "type": 2, + "typeName": "u8" + } + ], + "index": 0, + "name": "Buy" + }, + { + "fields": [ + { + "name": "index", + "type": 2, + "typeName": "u8" + } + ], + "index": 1, + "name": "Sell" + }, + { + "fields": [ + { + "name": "indexes", + "type": 8, + "typeName": "Vec" + } + ], + "index": 2, + "name": "Move" + }, + { + "index": 3, + "name": "NextCatalogLine" + }, + { + "index": 4, + "name": "Upgrade" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "shop", + "PlayerOperation" + ] + } + }, + { + "id": 8, + "type": { + "def": { + "sequence": { + "type": 2 + } + } + } + }, + { + "id": 9, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "inner", + "type": 10, + "typeName": "::Type" + } + ] + } + }, + "path": [ + "logic", + "contract", + "LogicRef" + ] + } + }, + { + "id": 10, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "account_id", + "type": 0, + "typeName": "AccountId" + } + ] + } + }, + "path": [ + "logic", + "contract", + "CallBuilder" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/contract/deploy/202109210_init/logic.json b/contract/deploy/202109210_init/logic.json index 793ada61..60c22a76 100644 --- a/contract/deploy/202109210_init/logic.json +++ b/contract/deploy/202109210_init/logic.json @@ -1 +1,1833 @@ -{"source":{"hash":"0xa2d36328ba1fec76fca8cc2bb6c28f89b6a4f927055c93cd9cff8b1be55e4aed","language":"ink! 3.0.0-rc8","compiler":"rustc 1.60.0-nightly"},"contract":{"name":"logic","version":"0.1.0","authors":["Open Emoji Battler"],"license":"Apache-2.0"},"V3":{"spec":{"constructors":[{"args":[{"label":"storage_account_id","type":{"displayName":["AccountId"],"type":0}}],"docs":[],"label":"new","payable":false,"selector":"0x9bae9d5e"}],"docs":[],"events":[],"messages":[{"args":[],"docs":[],"label":"get_storage_account_id","mutates":false,"payable":false,"returnType":{"displayName":["AccountId"],"type":0},"selector":"0xff14d9a8"},{"args":[],"docs":[],"label":"get_root_account_id","mutates":false,"payable":false,"returnType":{"displayName":["AccountId"],"type":0},"selector":"0x3d2fa9ca"},{"args":[{"label":"new_root_account_id","type":{"displayName":["AccountId"],"type":0}}],"docs":[],"label":"set_root_account_id","mutates":true,"payable":false,"returnType":null,"selector":"0x1fb27db2"},{"args":[{"label":"new_bases","type":{"displayName":["emo","Bases"],"type":4}},{"label":"fixed_base_ids","type":{"displayName":["StdVec"],"type":40}},{"label":"built_base_ids","type":{"displayName":["StdVec"],"type":40}},{"label":"force_bases_update","type":{"displayName":["bool"],"type":20}}],"docs":[],"label":"update_emo_bases","mutates":true,"payable":false,"returnType":null,"selector":"0xd1bd8ea7"},{"args":[{"label":"caller","type":{"displayName":["AccountId"],"type":0}},{"label":"deck_emo_base_ids","type":{"displayName":[],"type":41}}],"docs":[],"label":"start_mtc","mutates":true,"payable":false,"returnType":null,"selector":"0x04bfdb29"},{"args":[{"label":"caller","type":{"displayName":["AccountId"],"type":0}},{"label":"player_operations","type":{"displayName":["StdVec"],"type":42}}],"docs":[],"label":"finish_mtc_shop","mutates":true,"payable":false,"returnType":null,"selector":"0xfbd3f532"},{"args":[],"docs":[],"label":"get_allowed_accounts","mutates":false,"payable":false,"returnType":{"displayName":["StdVec"],"type":3},"selector":"0xc35cfacd"},{"args":[{"label":"account_id","type":{"displayName":["AccountId"],"type":0}}],"docs":[],"label":"allow_account","mutates":true,"payable":false,"returnType":null,"selector":"0x815c22c2"},{"args":[{"label":"account_id","type":{"displayName":["AccountId"],"type":0}}],"docs":[],"label":"disallow_account","mutates":true,"payable":false,"returnType":null,"selector":"0xbb8bad9e"}]},"storage":{"struct":{"fields":[{"layout":{"cell":{"key":"0x0000000000000000000000000000000000000000000000000000000000000000","ty":0}},"name":"storage_account_id"},{"layout":{"cell":{"key":"0x0100000000000000000000000000000000000000000000000000000000000000","ty":3}},"name":"allowed_accounts"},{"layout":{"cell":{"key":"0x0200000000000000000000000000000000000000000000000000000000000000","ty":0}},"name":"root_account_id"}]}},"types":[{"id":0,"type":{"def":{"composite":{"fields":[{"type":1,"typeName":"[u8; 32]"}]}},"path":["ink_env","types","AccountId"]}},{"id":1,"type":{"def":{"array":{"len":32,"type":2}}}},{"id":2,"type":{"def":{"primitive":"u8"}}},{"id":3,"type":{"def":{"sequence":{"type":0}}}},{"id":4,"type":{"def":{"composite":{"fields":[{"type":5,"typeName":"BTreeMap"}]}},"path":["common","codec_types","emo","Bases"]}},{"id":5,"type":{"def":{"composite":{"fields":[{"type":38}]}},"params":[{"name":"K","type":6},{"name":"V","type":7}],"path":["BTreeMap"]}},{"id":6,"type":{"def":{"primitive":"u16"}}},{"id":7,"type":{"def":{"composite":{"fields":[{"name":"id","type":6,"typeName":"u16"},{"name":"typ","type":8,"typeName":"emo::Typ"},{"name":"codepoint","type":9,"typeName":"u32"},{"name":"grade","type":2,"typeName":"u8"},{"name":"attack","type":6,"typeName":"u16"},{"name":"health","type":6,"typeName":"u16"},{"name":"abilities","type":10,"typeName":"Vec"}]}},"path":["common","codec_types","emo","Base"]}},{"id":8,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Human"},{"index":1,"name":"Nature"},{"index":2,"name":"Food"},{"index":3,"name":"Object"}]}},"path":["common","codec_types","emo","Typ"]}},{"id":9,"type":{"def":{"primitive":"u32"}}},{"id":10,"type":{"def":{"sequence":{"type":11}}}},{"id":11,"type":{"def":{"variant":{"variants":[{"fields":[{"type":12,"typeName":"emo::ability::shop::Shop"}],"index":0,"name":"Shop"},{"fields":[{"type":28,"typeName":"emo::ability::battle::Battle"}],"index":1,"name":"Battle"}]}},"path":["common","codec_types","emo","ability","Ability"]}},{"id":12,"type":{"def":{"variant":{"variants":[{"fields":[{"type":13,"typeName":"emo::ability::shop::Pre"}],"index":0,"name":"Pre"},{"fields":[{"type":22,"typeName":"emo::ability::shop::Peri"}],"index":1,"name":"Peri"},{"fields":[{"type":27,"typeName":"emo::ability::shop::Special"}],"index":2,"name":"Special"}]}},"path":["common","codec_types","emo","ability","shop","Shop"]}},{"id":13,"type":{"def":{"variant":{"variants":[{"fields":[{"type":14,"typeName":"emo::ability::shop::NormalAction"}],"index":0,"name":"Normal"},{"fields":[{"type":21,"typeName":"emo::ability::shop::RandomAction"}],"index":1,"name":"Random"}]}},"path":["common","codec_types","emo","ability","shop","Pre"]}},{"id":14,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"base_id","type":6,"typeName":"u16"}],"index":0,"name":"SetEmo"},{"fields":[{"name":"target","type":15,"typeName":"emo::ability::Target"},{"name":"attack","type":6,"typeName":"u16"},{"name":"health","type":6,"typeName":"u16"}],"index":1,"name":"IncreaseStats"},{"fields":[{"name":"target","type":15,"typeName":"emo::ability::Target"},{"name":"count_condition","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"attack","type":6,"typeName":"u16"},{"name":"health","type":6,"typeName":"u16"}],"index":2,"name":"IncreaseStatsByEmoCount"},{"fields":[{"name":"target","type":15,"typeName":"emo::ability::Target"},{"name":"attack","type":6,"typeName":"u16"},{"name":"health","type":6,"typeName":"u16"}],"index":3,"name":"IncreaseStatsByGrade"},{"fields":[{"name":"attack","type":6,"typeName":"u16"},{"name":"health","type":6,"typeName":"u16"}],"index":4,"name":"IncreaseStatsOfAdjacentMenagerie"},{"fields":[{"name":"target","type":15,"typeName":"emo::ability::Target"},{"name":"ability","type":11,"typeName":"Box"}],"index":5,"name":"AddAbility"},{"fields":[{"name":"coin","type":2,"typeName":"u8"}],"index":6,"name":"GetCoin"},{"fields":[{"name":"count_condition","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"divisor","type":2,"typeName":"u8"}],"index":7,"name":"GetCoinByEmoCountDiv"}]}},"path":["common","codec_types","emo","ability","shop","NormalAction"]}},{"id":15,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Oneself"},{"fields":[{"name":"destination","type":16,"typeName":"emo::ability::Destination"},{"name":"typ_and_triple","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":1,"name":"Others"}]}},"path":["common","codec_types","emo","ability","Target"]}},{"id":16,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Left"},{"index":1,"name":"Right"},{"index":2,"name":"All"}]}},"path":["common","codec_types","emo","ability","Destination"]}},{"id":17,"type":{"def":{"composite":{"fields":[{"name":"typ_opt","type":18,"typeName":"Option"},{"name":"is_triple_opt","type":19,"typeName":"Option"}]}},"path":["common","codec_types","emo","ability","TypOptAndIsTripleOpt"]}},{"id":18,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":8}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":8}],"path":["Option"]}},{"id":19,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":20}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":20}],"path":["Option"]}},{"id":20,"type":{"def":{"primitive":"bool"}}},{"id":21,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"typ_count","type":2,"typeName":"u8"},{"name":"attack","type":6,"typeName":"u16"},{"name":"health","type":6,"typeName":"u16"}],"index":0,"name":"IncreaseStatsOfMenagerie"}]}},"path":["common","codec_types","emo","ability","shop","RandomAction"]}},{"id":22,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"trigger","type":23,"typeName":"emo::ability::shop::PeriAsOneselfTrigger"},{"name":"action","type":14,"typeName":"emo::ability::shop::NormalAction"}],"index":0,"name":"AsOneself"},{"fields":[{"name":"trigger","type":24,"typeName":"emo::ability::shop::PeriAsAllyTrigger"},{"name":"action","type":25,"typeName":"emo::ability::shop::PeriAsAllyAction"}],"index":1,"name":"AsAlly"}]}},"path":["common","codec_types","emo","ability","shop","Peri"]}},{"id":23,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Set"},{"index":1,"name":"Sell"},{"fields":[{"name":"typ_and_triple","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":2,"name":"AllySet"}]}},"path":["common","codec_types","emo","ability","shop","PeriAsOneselfTrigger"]}},{"id":24,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"typ_and_triple","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":0,"name":"AllySet"}]}},"path":["common","codec_types","emo","ability","shop","PeriAsAllyTrigger"]}},{"id":25,"type":{"def":{"variant":{"variants":[{"fields":[{"type":14,"typeName":"emo::ability::shop::NormalAction"}],"index":0,"name":"OneselfTripleNormal"},{"fields":[{"type":26,"typeName":"emo::ability::shop::AsAllyAction"}],"index":1,"name":"Custom"}]}},"path":["common","codec_types","emo","ability","shop","PeriAsAllyAction"]}},{"id":26,"type":{"def":{"variant":{"variants":[{"index":0,"name":"TriggerSetActions"}]}},"path":["common","codec_types","emo","ability","shop","AsAllyAction"]}},{"id":27,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Placeholder"}]}},"path":["common","codec_types","emo","ability","shop","Special"]}},{"id":28,"type":{"def":{"variant":{"variants":[{"fields":[{"type":29,"typeName":"emo::ability::battle::General"}],"index":0,"name":"General"},{"fields":[{"type":37,"typeName":"emo::ability::battle::Special"}],"index":1,"name":"Special"}]}},"path":["common","codec_types","emo","ability","battle","Battle"]}},{"id":29,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"trigger","type":30,"typeName":"emo::ability::battle::GeneralAsOneselfTrigger"},{"name":"action","type":31,"typeName":"emo::ability::battle::NormalAction"}],"index":0,"name":"AsOneself"},{"fields":[{"name":"trigger","type":34,"typeName":"emo::ability::battle::GeneralAsAllyTrigger"},{"name":"action","type":35,"typeName":"emo::ability::battle::GeneralAsAllyAction"}],"index":1,"name":"AsAlly"}]}},"path":["common","codec_types","emo","ability","battle","General"]}},{"id":30,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Pre"},{"index":1,"name":"Retire"},{"fields":[{"name":"typ_and_triple","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":2,"name":"AllyRetire"},{"fields":[{"name":"typ_and_triple","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":3,"name":"RivalRetire"},{"fields":[{"name":"typ_and_triple","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"excludes_same_base","type":20,"typeName":"bool"},{"name":"ability","type":28,"typeName":"Box"}],"index":4,"name":"AllyBattleAbilityRemoved"}]}},"path":["common","codec_types","emo","ability","battle","GeneralAsOneselfTrigger"]}},{"id":31,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"side","type":32,"typeName":"emo::ability::Side"},{"name":"base_id","type":6,"typeName":"u16"}],"index":0,"name":"SetEmo"},{"fields":[{"name":"side","type":32,"typeName":"emo::ability::Side"},{"name":"base_id","type":6,"typeName":"u16"},{"name":"divisor","type":2,"typeName":"u8"}],"index":1,"name":"SetEmosByAttackDiv"},{"fields":[{"name":"target_or_random","type":33,"typeName":"emo::ability::TargetOrRandom"},{"name":"attack","type":6,"typeName":"u16"},{"name":"health","type":6,"typeName":"u16"}],"index":2,"name":"IncreaseStats"},{"fields":[{"name":"target_or_random","type":33,"typeName":"emo::ability::TargetOrRandom"},{"name":"attack","type":6,"typeName":"u16"},{"name":"health","type":6,"typeName":"u16"}],"index":3,"name":"DecreaseStats"},{"fields":[{"name":"side","type":32,"typeName":"emo::ability::Side"},{"name":"target_or_random","type":33,"typeName":"emo::ability::TargetOrRandom"},{"name":"count_condition","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"attack","type":6,"typeName":"u16"},{"name":"health","type":6,"typeName":"u16"}],"index":4,"name":"IncreaseStatsByEmoCount"},{"fields":[{"name":"target_or_random","type":33,"typeName":"emo::ability::TargetOrRandom"},{"name":"ability","type":28,"typeName":"Box"}],"index":5,"name":"AddBattleAbility"},{"fields":[{"name":"side","type":32,"typeName":"emo::ability::Side"},{"name":"damage","type":6,"typeName":"u16"}],"index":6,"name":"DamageAll"}]}},"path":["common","codec_types","emo","ability","battle","NormalAction"]}},{"id":32,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Ally"},{"index":1,"name":"Rival"}]}},"path":["common","codec_types","emo","ability","Side"]}},{"id":33,"type":{"def":{"variant":{"variants":[{"fields":[{"type":15,"typeName":"emo::ability::Target"}],"index":0,"name":"Target"},{"fields":[{"name":"typ_and_triple","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"count","type":2,"typeName":"u8"}],"index":1,"name":"Random"}]}},"path":["common","codec_types","emo","ability","TargetOrRandom"]}},{"id":34,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"typ_and_triple","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":0,"name":"AllySet"},{"fields":[{"name":"typ_and_triple","type":17,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":1,"name":"AllyRetire"}]}},"path":["common","codec_types","emo","ability","battle","GeneralAsAllyTrigger"]}},{"id":35,"type":{"def":{"variant":{"variants":[{"fields":[{"type":31,"typeName":"emo::ability::battle::NormalAction"}],"index":0,"name":"OneselfTripleNormal"},{"fields":[{"type":36,"typeName":"emo::ability::battle::AsAllyAction"}],"index":1,"name":"Custom"}]}},"path":["common","codec_types","emo","ability","battle","GeneralAsAllyAction"]}},{"id":36,"type":{"def":{"variant":{"variants":[{"index":0,"name":"TriggerRetireActions"}]}},"path":["common","codec_types","emo","ability","battle","AsAllyAction"]}},{"id":37,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Shield"},{"index":1,"name":"Attractive"},{"index":2,"name":"AttackLowestAttack"}]}},"path":["common","codec_types","emo","ability","battle","Special"]}},{"id":38,"type":{"def":{"sequence":{"type":39}}}},{"id":39,"type":{"def":{"tuple":[6,7]}}},{"id":40,"type":{"def":{"sequence":{"type":6}}}},{"id":41,"type":{"def":{"array":{"len":6,"type":6}}}},{"id":42,"type":{"def":{"sequence":{"type":43}}}},{"id":43,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"mtc_emo_id","type":6,"typeName":"u16"},{"name":"index","type":2,"typeName":"u8"}],"index":0,"name":"Buy"},{"fields":[{"name":"index","type":2,"typeName":"u8"}],"index":1,"name":"Sell"},{"fields":[{"name":"indexes","type":44,"typeName":"Vec"}],"index":2,"name":"Move"},{"index":3,"name":"NextCatalogLine"},{"index":4,"name":"Upgrade"}]}},"path":["common","codec_types","mtc","shop","PlayerOperation"]}},{"id":44,"type":{"def":{"sequence":{"type":2}}}}]}} +{ + "source": { + "hash": "0xd8e29a14a59f1c318a708d49bca1f85bf334a8291a95096ecc0932603b55ee68", + "language": "ink! 3.0.0-rc8", + "compiler": "rustc 1.60.0-nightly" + }, + "contract": { + "name": "logic", + "version": "0.1.0", + "authors": [ + "Open Emoji Battler" + ], + "license": "Apache-2.0" + }, + "V3": { + "spec": { + "constructors": [ + { + "args": [ + { + "label": "storage_account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "new", + "payable": false, + "selector": "0x9bae9d5e" + } + ], + "docs": [], + "events": [], + "messages": [ + { + "args": [], + "docs": [], + "label": "get_storage_account_id", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "AccountId" + ], + "type": 0 + }, + "selector": "0xff14d9a8" + }, + { + "args": [], + "docs": [], + "label": "get_root_account_id", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "AccountId" + ], + "type": 0 + }, + "selector": "0x3d2fa9ca" + }, + { + "args": [ + { + "label": "new_root_account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "set_root_account_id", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x1fb27db2" + }, + { + "args": [ + { + "label": "new_bases", + "type": { + "displayName": [ + "emo", + "Bases" + ], + "type": 4 + } + }, + { + "label": "fixed_base_ids", + "type": { + "displayName": [ + "Vec" + ], + "type": 40 + } + }, + { + "label": "built_base_ids", + "type": { + "displayName": [ + "Vec" + ], + "type": 40 + } + }, + { + "label": "force_bases_update", + "type": { + "displayName": [ + "bool" + ], + "type": 20 + } + } + ], + "docs": [], + "label": "update_emo_bases", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xd1bd8ea7" + }, + { + "args": [ + { + "label": "caller", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "deck_emo_base_ids", + "type": { + "displayName": [], + "type": 41 + } + } + ], + "docs": [], + "label": "start_mtc", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x04bfdb29" + }, + { + "args": [ + { + "label": "caller", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "player_operations", + "type": { + "displayName": [ + "Vec" + ], + "type": 42 + } + } + ], + "docs": [], + "label": "finish_mtc_shop", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xfbd3f532" + }, + { + "args": [], + "docs": [], + "label": "get_allowed_accounts", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Vec" + ], + "type": 3 + }, + "selector": "0xc35cfacd" + }, + { + "args": [ + { + "label": "account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "allow_account", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x815c22c2" + }, + { + "args": [ + { + "label": "account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "disallow_account", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xbb8bad9e" + } + ] + }, + "storage": { + "struct": { + "fields": [ + { + "layout": { + "cell": { + "key": "0x0000000000000000000000000000000000000000000000000000000000000000", + "ty": 0 + } + }, + "name": "storage_account_id" + }, + { + "layout": { + "cell": { + "key": "0x0100000000000000000000000000000000000000000000000000000000000000", + "ty": 3 + } + }, + "name": "allowed_accounts" + }, + { + "layout": { + "cell": { + "key": "0x0200000000000000000000000000000000000000000000000000000000000000", + "ty": 0 + } + }, + "name": "root_account_id" + } + ] + } + }, + "types": [ + { + "id": 0, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 1, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_env", + "types", + "AccountId" + ] + } + }, + { + "id": 1, + "type": { + "def": { + "array": { + "len": 32, + "type": 2 + } + } + } + }, + { + "id": 2, + "type": { + "def": { + "primitive": "u8" + } + } + }, + { + "id": 3, + "type": { + "def": { + "sequence": { + "type": 0 + } + } + } + }, + { + "id": 4, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 5, + "typeName": "BTreeMap" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "Bases" + ] + } + }, + { + "id": 5, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 38 + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 6 + }, + { + "name": "V", + "type": 7 + } + ], + "path": [ + "BTreeMap" + ] + } + }, + { + "id": 6, + "type": { + "def": { + "primitive": "u16" + } + } + }, + { + "id": 7, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "id", + "type": 6, + "typeName": "u16" + }, + { + "name": "typ", + "type": 8, + "typeName": "emo::Typ" + }, + { + "name": "codepoint", + "type": 9, + "typeName": "u32" + }, + { + "name": "grade", + "type": 2, + "typeName": "u8" + }, + { + "name": "attack", + "type": 6, + "typeName": "u16" + }, + { + "name": "health", + "type": 6, + "typeName": "u16" + }, + { + "name": "abilities", + "type": 10, + "typeName": "Vec" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "Base" + ] + } + }, + { + "id": 8, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Human" + }, + { + "index": 1, + "name": "Nature" + }, + { + "index": 2, + "name": "Food" + }, + { + "index": 3, + "name": "Object" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "Typ" + ] + } + }, + { + "id": 9, + "type": { + "def": { + "primitive": "u32" + } + } + }, + { + "id": 10, + "type": { + "def": { + "sequence": { + "type": 11 + } + } + } + }, + { + "id": 11, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 12, + "typeName": "emo::ability::shop::Shop" + } + ], + "index": 0, + "name": "Shop" + }, + { + "fields": [ + { + "type": 28, + "typeName": "emo::ability::battle::Battle" + } + ], + "index": 1, + "name": "Battle" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "Ability" + ] + } + }, + { + "id": 12, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 13, + "typeName": "emo::ability::shop::Pre" + } + ], + "index": 0, + "name": "Pre" + }, + { + "fields": [ + { + "type": 22, + "typeName": "emo::ability::shop::Peri" + } + ], + "index": 1, + "name": "Peri" + }, + { + "fields": [ + { + "type": 27, + "typeName": "emo::ability::shop::Special" + } + ], + "index": 2, + "name": "Special" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "Shop" + ] + } + }, + { + "id": 13, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 14, + "typeName": "emo::ability::shop::NormalAction" + } + ], + "index": 0, + "name": "Normal" + }, + { + "fields": [ + { + "type": 21, + "typeName": "emo::ability::shop::RandomAction" + } + ], + "index": 1, + "name": "Random" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "Pre" + ] + } + }, + { + "id": 14, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "base_id", + "type": 6, + "typeName": "u16" + } + ], + "index": 0, + "name": "SetEmo" + }, + { + "fields": [ + { + "name": "target", + "type": 15, + "typeName": "emo::ability::Target" + }, + { + "name": "attack", + "type": 6, + "typeName": "u16" + }, + { + "name": "health", + "type": 6, + "typeName": "u16" + } + ], + "index": 1, + "name": "IncreaseStats" + }, + { + "fields": [ + { + "name": "target", + "type": 15, + "typeName": "emo::ability::Target" + }, + { + "name": "count_condition", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "attack", + "type": 6, + "typeName": "u16" + }, + { + "name": "health", + "type": 6, + "typeName": "u16" + } + ], + "index": 2, + "name": "IncreaseStatsByEmoCount" + }, + { + "fields": [ + { + "name": "target", + "type": 15, + "typeName": "emo::ability::Target" + }, + { + "name": "attack", + "type": 6, + "typeName": "u16" + }, + { + "name": "health", + "type": 6, + "typeName": "u16" + } + ], + "index": 3, + "name": "IncreaseStatsByGrade" + }, + { + "fields": [ + { + "name": "attack", + "type": 6, + "typeName": "u16" + }, + { + "name": "health", + "type": 6, + "typeName": "u16" + } + ], + "index": 4, + "name": "IncreaseStatsOfAdjacentMenagerie" + }, + { + "fields": [ + { + "name": "target", + "type": 15, + "typeName": "emo::ability::Target" + }, + { + "name": "ability", + "type": 11, + "typeName": "Box" + } + ], + "index": 5, + "name": "AddAbility" + }, + { + "fields": [ + { + "name": "coin", + "type": 2, + "typeName": "u8" + } + ], + "index": 6, + "name": "GetCoin" + }, + { + "fields": [ + { + "name": "count_condition", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "divisor", + "type": 2, + "typeName": "u8" + } + ], + "index": 7, + "name": "GetCoinByEmoCountDiv" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "NormalAction" + ] + } + }, + { + "id": 15, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Oneself" + }, + { + "fields": [ + { + "name": "destination", + "type": 16, + "typeName": "emo::ability::Destination" + }, + { + "name": "typ_and_triple", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 1, + "name": "Others" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "Target" + ] + } + }, + { + "id": 16, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Left" + }, + { + "index": 1, + "name": "Right" + }, + { + "index": 2, + "name": "All" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "Destination" + ] + } + }, + { + "id": 17, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "typ_opt", + "type": 18, + "typeName": "Option" + }, + { + "name": "is_triple_opt", + "type": 19, + "typeName": "Option" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "TypOptAndIsTripleOpt" + ] + } + }, + { + "id": 18, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 8 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 8 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 19, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 20 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 20 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 20, + "type": { + "def": { + "primitive": "bool" + } + } + }, + { + "id": 21, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "typ_count", + "type": 2, + "typeName": "u8" + }, + { + "name": "attack", + "type": 6, + "typeName": "u16" + }, + { + "name": "health", + "type": 6, + "typeName": "u16" + } + ], + "index": 0, + "name": "IncreaseStatsOfMenagerie" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "RandomAction" + ] + } + }, + { + "id": 22, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "trigger", + "type": 23, + "typeName": "emo::ability::shop::PeriAsOneselfTrigger" + }, + { + "name": "action", + "type": 14, + "typeName": "emo::ability::shop::NormalAction" + } + ], + "index": 0, + "name": "AsOneself" + }, + { + "fields": [ + { + "name": "trigger", + "type": 24, + "typeName": "emo::ability::shop::PeriAsAllyTrigger" + }, + { + "name": "action", + "type": 25, + "typeName": "emo::ability::shop::PeriAsAllyAction" + } + ], + "index": 1, + "name": "AsAlly" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "Peri" + ] + } + }, + { + "id": 23, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Set" + }, + { + "index": 1, + "name": "Sell" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 2, + "name": "AllySet" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "PeriAsOneselfTrigger" + ] + } + }, + { + "id": 24, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "typ_and_triple", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 0, + "name": "AllySet" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "PeriAsAllyTrigger" + ] + } + }, + { + "id": 25, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 14, + "typeName": "emo::ability::shop::NormalAction" + } + ], + "index": 0, + "name": "OneselfTripleNormal" + }, + { + "fields": [ + { + "type": 26, + "typeName": "emo::ability::shop::AsAllyAction" + } + ], + "index": 1, + "name": "Custom" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "PeriAsAllyAction" + ] + } + }, + { + "id": 26, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "TriggerSetActions" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "AsAllyAction" + ] + } + }, + { + "id": 27, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Placeholder" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "Special" + ] + } + }, + { + "id": 28, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 29, + "typeName": "emo::ability::battle::General" + } + ], + "index": 0, + "name": "General" + }, + { + "fields": [ + { + "type": 37, + "typeName": "emo::ability::battle::Special" + } + ], + "index": 1, + "name": "Special" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "Battle" + ] + } + }, + { + "id": 29, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "trigger", + "type": 30, + "typeName": "emo::ability::battle::GeneralAsOneselfTrigger" + }, + { + "name": "action", + "type": 31, + "typeName": "emo::ability::battle::NormalAction" + } + ], + "index": 0, + "name": "AsOneself" + }, + { + "fields": [ + { + "name": "trigger", + "type": 34, + "typeName": "emo::ability::battle::GeneralAsAllyTrigger" + }, + { + "name": "action", + "type": 35, + "typeName": "emo::ability::battle::GeneralAsAllyAction" + } + ], + "index": 1, + "name": "AsAlly" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "General" + ] + } + }, + { + "id": 30, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Pre" + }, + { + "index": 1, + "name": "Retire" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 2, + "name": "AllyRetire" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 3, + "name": "RivalRetire" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "excludes_same_base", + "type": 20, + "typeName": "bool" + }, + { + "name": "ability", + "type": 28, + "typeName": "Box" + } + ], + "index": 4, + "name": "AllyBattleAbilityRemoved" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "GeneralAsOneselfTrigger" + ] + } + }, + { + "id": 31, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "side", + "type": 32, + "typeName": "emo::ability::Side" + }, + { + "name": "base_id", + "type": 6, + "typeName": "u16" + } + ], + "index": 0, + "name": "SetEmo" + }, + { + "fields": [ + { + "name": "side", + "type": 32, + "typeName": "emo::ability::Side" + }, + { + "name": "base_id", + "type": 6, + "typeName": "u16" + }, + { + "name": "divisor", + "type": 2, + "typeName": "u8" + } + ], + "index": 1, + "name": "SetEmosByAttackDiv" + }, + { + "fields": [ + { + "name": "target_or_random", + "type": 33, + "typeName": "emo::ability::TargetOrRandom" + }, + { + "name": "attack", + "type": 6, + "typeName": "u16" + }, + { + "name": "health", + "type": 6, + "typeName": "u16" + } + ], + "index": 2, + "name": "IncreaseStats" + }, + { + "fields": [ + { + "name": "target_or_random", + "type": 33, + "typeName": "emo::ability::TargetOrRandom" + }, + { + "name": "attack", + "type": 6, + "typeName": "u16" + }, + { + "name": "health", + "type": 6, + "typeName": "u16" + } + ], + "index": 3, + "name": "DecreaseStats" + }, + { + "fields": [ + { + "name": "side", + "type": 32, + "typeName": "emo::ability::Side" + }, + { + "name": "target_or_random", + "type": 33, + "typeName": "emo::ability::TargetOrRandom" + }, + { + "name": "count_condition", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "attack", + "type": 6, + "typeName": "u16" + }, + { + "name": "health", + "type": 6, + "typeName": "u16" + } + ], + "index": 4, + "name": "IncreaseStatsByEmoCount" + }, + { + "fields": [ + { + "name": "target_or_random", + "type": 33, + "typeName": "emo::ability::TargetOrRandom" + }, + { + "name": "ability", + "type": 28, + "typeName": "Box" + } + ], + "index": 5, + "name": "AddBattleAbility" + }, + { + "fields": [ + { + "name": "side", + "type": 32, + "typeName": "emo::ability::Side" + }, + { + "name": "damage", + "type": 6, + "typeName": "u16" + } + ], + "index": 6, + "name": "DamageAll" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "NormalAction" + ] + } + }, + { + "id": 32, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Ally" + }, + { + "index": 1, + "name": "Rival" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "Side" + ] + } + }, + { + "id": 33, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 15, + "typeName": "emo::ability::Target" + } + ], + "index": 0, + "name": "Target" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "count", + "type": 2, + "typeName": "u8" + } + ], + "index": 1, + "name": "Random" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "TargetOrRandom" + ] + } + }, + { + "id": 34, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "typ_and_triple", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 0, + "name": "AllySet" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 17, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 1, + "name": "AllyRetire" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "GeneralAsAllyTrigger" + ] + } + }, + { + "id": 35, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 31, + "typeName": "emo::ability::battle::NormalAction" + } + ], + "index": 0, + "name": "OneselfTripleNormal" + }, + { + "fields": [ + { + "type": 36, + "typeName": "emo::ability::battle::AsAllyAction" + } + ], + "index": 1, + "name": "Custom" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "GeneralAsAllyAction" + ] + } + }, + { + "id": 36, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "TriggerRetireActions" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "AsAllyAction" + ] + } + }, + { + "id": 37, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Shield" + }, + { + "index": 1, + "name": "Attractive" + }, + { + "index": 2, + "name": "AttackLowestAttack" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "Special" + ] + } + }, + { + "id": 38, + "type": { + "def": { + "sequence": { + "type": 39 + } + } + } + }, + { + "id": 39, + "type": { + "def": { + "tuple": [ + 6, + 7 + ] + } + } + }, + { + "id": 40, + "type": { + "def": { + "sequence": { + "type": 6 + } + } + } + }, + { + "id": 41, + "type": { + "def": { + "array": { + "len": 6, + "type": 6 + } + } + } + }, + { + "id": 42, + "type": { + "def": { + "sequence": { + "type": 43 + } + } + } + }, + { + "id": 43, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "mtc_emo_id", + "type": 6, + "typeName": "u16" + }, + { + "name": "index", + "type": 2, + "typeName": "u8" + } + ], + "index": 0, + "name": "Buy" + }, + { + "fields": [ + { + "name": "index", + "type": 2, + "typeName": "u8" + } + ], + "index": 1, + "name": "Sell" + }, + { + "fields": [ + { + "name": "indexes", + "type": 44, + "typeName": "Vec" + } + ], + "index": 2, + "name": "Move" + }, + { + "index": 3, + "name": "NextCatalogLine" + }, + { + "index": 4, + "name": "Upgrade" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "shop", + "PlayerOperation" + ] + } + }, + { + "id": 44, + "type": { + "def": { + "sequence": { + "type": 2 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/contract/deploy/202109210_init/storage.json b/contract/deploy/202109210_init/storage.json index 3ae6d5c4..45a724f3 100644 --- a/contract/deploy/202109210_init/storage.json +++ b/contract/deploy/202109210_init/storage.json @@ -1 +1,3490 @@ -{"source":{"hash":"0xb243347166b796938de0ad5263556161c5f62525dbd9320e0a058b482a6a677e","language":"ink! 3.0.0-rc8","compiler":"rustc 1.60.0-nightly"},"contract":{"name":"storage","version":"0.1.0","authors":["Open Emoji Battler"],"license":"Apache-2.0"},"V3":{"spec":{"constructors":[{"args":[],"docs":[],"label":"new","payable":false,"selector":"0x9bae9d5e"}],"docs":[],"events":[],"messages":[{"args":[],"docs":[],"label":"get_emo_bases","mutates":false,"payable":false,"returnType":{"displayName":["emo","Bases"],"type":68},"selector":"0x7864382a"},{"args":[{"label":"value","type":{"displayName":["emo","Bases"],"type":68}}],"docs":[],"label":"set_emo_bases","mutates":true,"payable":false,"returnType":null,"selector":"0x7a393350"},{"args":[],"docs":[],"label":"get_deck_fixed_emo_base_ids","mutates":false,"payable":false,"returnType":{"displayName":["StdVec"],"type":36},"selector":"0x3e89cbad"},{"args":[{"label":"value","type":{"displayName":["StdVec"],"type":36}}],"docs":[],"label":"set_deck_fixed_emo_base_ids","mutates":true,"payable":false,"returnType":null,"selector":"0x838a1328"},{"args":[],"docs":[],"label":"get_deck_built_emo_base_ids","mutates":false,"payable":false,"returnType":{"displayName":["StdVec"],"type":36},"selector":"0x5604c526"},{"args":[{"label":"value","type":{"displayName":["StdVec"],"type":36}}],"docs":[],"label":"set_deck_built_emo_base_ids","mutates":true,"payable":false,"returnType":null,"selector":"0x25cde072"},{"args":[{"label":"ep_band","type":{"displayName":["u16"],"type":1}}],"docs":[],"label":"get_matchmaking_ghosts","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":69},"selector":"0x5d04aced"},{"args":[{"label":"ep_band","type":{"displayName":["u16"],"type":1}},{"label":"value","type":{"displayName":["StdVec"],"type":38}}],"docs":[],"label":"set_matchmaking_ghosts","mutates":true,"payable":false,"returnType":null,"selector":"0xc9f45dd6"},{"args":[{"label":"ep_band","type":{"displayName":["u16"],"type":1}}],"docs":[],"label":"remove_matchmaking_ghosts","mutates":true,"payable":false,"returnType":null,"selector":"0x3597d231"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"get_player_ep","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":70},"selector":"0xa7a3db39"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}},{"label":"value","type":{"displayName":["u16"],"type":1}}],"docs":[],"label":"set_player_ep","mutates":true,"payable":false,"returnType":null,"selector":"0x5ac44f3e"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"remove_player_ep","mutates":true,"payable":false,"returnType":null,"selector":"0xa7147181"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"get_player_seed","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":71},"selector":"0x09425436"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}},{"label":"value","type":{"displayName":["u64"],"type":52}}],"docs":[],"label":"set_player_seed","mutates":true,"payable":false,"returnType":null,"selector":"0xb49918c7"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"remove_player_seed","mutates":true,"payable":false,"returnType":null,"selector":"0xde5a1632"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"get_player_pool","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":72},"selector":"0x83e00bfa"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}},{"label":"value","type":{"displayName":["StdVec"],"type":54}}],"docs":[],"label":"set_player_pool","mutates":true,"payable":false,"returnType":null,"selector":"0xf200ee58"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"remove_player_pool","mutates":true,"payable":false,"returnType":null,"selector":"0xa8ed1dc9"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"get_player_health","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":73},"selector":"0x7560bd82"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}},{"label":"value","type":{"displayName":["u8"],"type":5}}],"docs":[],"label":"set_player_health","mutates":true,"payable":false,"returnType":null,"selector":"0xd2bf1525"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"remove_player_health","mutates":true,"payable":false,"returnType":null,"selector":"0xa7269337"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"get_player_grade_and_board_history","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":74},"selector":"0x4dd1791b"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}},{"label":"value","type":{"displayName":["StdVec"],"type":58}}],"docs":[],"label":"set_player_grade_and_board_history","mutates":true,"payable":false,"returnType":null,"selector":"0xe842181b"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"remove_player_grade_and_board_history","mutates":true,"payable":false,"returnType":null,"selector":"0x343ac42e"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"get_player_upgrade_coin","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":73},"selector":"0xdf1f8165"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}},{"label":"value","type":{"displayName":["u8"],"type":5}}],"docs":[],"label":"set_player_upgrade_coin","mutates":true,"payable":false,"returnType":null,"selector":"0x9ccfabad"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"remove_player_upgrade_coin","mutates":true,"payable":false,"returnType":null,"selector":"0x1d8e9ab3"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"get_player_ghosts","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":69},"selector":"0xb12c7ae3"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}},{"label":"value","type":{"displayName":["StdVec"],"type":38}}],"docs":[],"label":"set_player_ghosts","mutates":true,"payable":false,"returnType":null,"selector":"0x313fe40f"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"remove_player_ghosts","mutates":true,"payable":false,"returnType":null,"selector":"0x3b727975"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"get_player_ghost_states","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":75},"selector":"0x2235eb1c"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}},{"label":"value","type":{"displayName":["StdVec"],"type":65}}],"docs":[],"label":"set_player_ghost_states","mutates":true,"payable":false,"returnType":null,"selector":"0x3018fabc"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"remove_player_ghost_states","mutates":true,"payable":false,"returnType":null,"selector":"0x5d679eca"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"get_player_battle_ghost_index","mutates":false,"payable":false,"returnType":{"displayName":["Option"],"type":73},"selector":"0x5cbf6203"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}},{"label":"value","type":{"displayName":["u8"],"type":5}}],"docs":[],"label":"set_player_battle_ghost_index","mutates":true,"payable":false,"returnType":null,"selector":"0x5028205d"},{"args":[{"label":"account","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"remove_player_battle_ghost_index","mutates":true,"payable":false,"returnType":null,"selector":"0x3ce4d740"},{"args":[],"docs":[],"label":"get_allowed_accounts","mutates":false,"payable":false,"returnType":{"displayName":["StdVec"],"type":67},"selector":"0xc35cfacd"},{"args":[{"label":"account_id","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"allow_account","mutates":true,"payable":false,"returnType":null,"selector":"0x815c22c2"},{"args":[{"label":"account_id","type":{"displayName":["AccountId"],"type":40}}],"docs":[],"label":"disallow_account","mutates":true,"payable":false,"returnType":null,"selector":"0xbb8bad9e"}]},"storage":{"struct":{"fields":[{"layout":{"struct":{"fields":[{"layout":{"cell":{"key":"0x0000000000000000000000000000000000000000000000000000000000000000","ty":0}},"name":null}]}},"name":"emo_bases"},{"layout":{"cell":{"key":"0x0100000000000000000000000000000000000000000000000000000000000000","ty":36}},"name":"deck_fixed_emo_base_ids"},{"layout":{"cell":{"key":"0x0200000000000000000000000000000000000000000000000000000000000000","ty":36}},"name":"deck_built_emo_base_ids"},{"layout":{"cell":{"key":"0x0300000000000000000000000000000000000000000000000000000000000000","ty":37}},"name":"matchmaking_ghosts"},{"layout":{"cell":{"key":"0x0400000000000000000000000000000000000000000000000000000000000000","ty":50}},"name":"player_ep"},{"layout":{"cell":{"key":"0x0500000000000000000000000000000000000000000000000000000000000000","ty":51}},"name":"player_seed"},{"layout":{"cell":{"key":"0x0600000000000000000000000000000000000000000000000000000000000000","ty":53}},"name":"player_pool"},{"layout":{"cell":{"key":"0x0700000000000000000000000000000000000000000000000000000000000000","ty":56}},"name":"player_health"},{"layout":{"cell":{"key":"0x0800000000000000000000000000000000000000000000000000000000000000","ty":57}},"name":"player_grade_and_board_history"},{"layout":{"cell":{"key":"0x0900000000000000000000000000000000000000000000000000000000000000","ty":56}},"name":"player_upgrade_coin"},{"layout":{"cell":{"key":"0x0a00000000000000000000000000000000000000000000000000000000000000","ty":63}},"name":"player_ghosts"},{"layout":{"cell":{"key":"0x0b00000000000000000000000000000000000000000000000000000000000000","ty":64}},"name":"player_ghost_states"},{"layout":{"cell":{"key":"0x0c00000000000000000000000000000000000000000000000000000000000000","ty":56}},"name":"player_battle_ghost_index"},{"layout":{"cell":{"key":"0x0d00000000000000000000000000000000000000000000000000000000000000","ty":67}},"name":"allowed_accounts"}]}},"types":[{"id":0,"type":{"def":{"composite":{"fields":[{"type":34}]}},"params":[{"name":"K","type":1},{"name":"V","type":2}],"path":["BTreeMap"]}},{"id":1,"type":{"def":{"primitive":"u16"}}},{"id":2,"type":{"def":{"composite":{"fields":[{"name":"id","type":1,"typeName":"u16"},{"name":"typ","type":3,"typeName":"emo::Typ"},{"name":"codepoint","type":4,"typeName":"u32"},{"name":"grade","type":5,"typeName":"u8"},{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"},{"name":"abilities","type":6,"typeName":"Vec"}]}},"path":["common","codec_types","emo","Base"]}},{"id":3,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Human"},{"index":1,"name":"Nature"},{"index":2,"name":"Food"},{"index":3,"name":"Object"}]}},"path":["common","codec_types","emo","Typ"]}},{"id":4,"type":{"def":{"primitive":"u32"}}},{"id":5,"type":{"def":{"primitive":"u8"}}},{"id":6,"type":{"def":{"sequence":{"type":7}}}},{"id":7,"type":{"def":{"variant":{"variants":[{"fields":[{"type":8,"typeName":"emo::ability::shop::Shop"}],"index":0,"name":"Shop"},{"fields":[{"type":24,"typeName":"emo::ability::battle::Battle"}],"index":1,"name":"Battle"}]}},"path":["common","codec_types","emo","ability","Ability"]}},{"id":8,"type":{"def":{"variant":{"variants":[{"fields":[{"type":9,"typeName":"emo::ability::shop::Pre"}],"index":0,"name":"Pre"},{"fields":[{"type":18,"typeName":"emo::ability::shop::Peri"}],"index":1,"name":"Peri"},{"fields":[{"type":23,"typeName":"emo::ability::shop::Special"}],"index":2,"name":"Special"}]}},"path":["common","codec_types","emo","ability","shop","Shop"]}},{"id":9,"type":{"def":{"variant":{"variants":[{"fields":[{"type":10,"typeName":"emo::ability::shop::NormalAction"}],"index":0,"name":"Normal"},{"fields":[{"type":17,"typeName":"emo::ability::shop::RandomAction"}],"index":1,"name":"Random"}]}},"path":["common","codec_types","emo","ability","shop","Pre"]}},{"id":10,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"base_id","type":1,"typeName":"u16"}],"index":0,"name":"SetEmo"},{"fields":[{"name":"target","type":11,"typeName":"emo::ability::Target"},{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"}],"index":1,"name":"IncreaseStats"},{"fields":[{"name":"target","type":11,"typeName":"emo::ability::Target"},{"name":"count_condition","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"}],"index":2,"name":"IncreaseStatsByEmoCount"},{"fields":[{"name":"target","type":11,"typeName":"emo::ability::Target"},{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"}],"index":3,"name":"IncreaseStatsByGrade"},{"fields":[{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"}],"index":4,"name":"IncreaseStatsOfAdjacentMenagerie"},{"fields":[{"name":"target","type":11,"typeName":"emo::ability::Target"},{"name":"ability","type":7,"typeName":"Box"}],"index":5,"name":"AddAbility"},{"fields":[{"name":"coin","type":5,"typeName":"u8"}],"index":6,"name":"GetCoin"},{"fields":[{"name":"count_condition","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"divisor","type":5,"typeName":"u8"}],"index":7,"name":"GetCoinByEmoCountDiv"}]}},"path":["common","codec_types","emo","ability","shop","NormalAction"]}},{"id":11,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Oneself"},{"fields":[{"name":"destination","type":12,"typeName":"emo::ability::Destination"},{"name":"typ_and_triple","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":1,"name":"Others"}]}},"path":["common","codec_types","emo","ability","Target"]}},{"id":12,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Left"},{"index":1,"name":"Right"},{"index":2,"name":"All"}]}},"path":["common","codec_types","emo","ability","Destination"]}},{"id":13,"type":{"def":{"composite":{"fields":[{"name":"typ_opt","type":14,"typeName":"Option"},{"name":"is_triple_opt","type":15,"typeName":"Option"}]}},"path":["common","codec_types","emo","ability","TypOptAndIsTripleOpt"]}},{"id":14,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":3}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":3}],"path":["Option"]}},{"id":15,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":16}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":16}],"path":["Option"]}},{"id":16,"type":{"def":{"primitive":"bool"}}},{"id":17,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"typ_count","type":5,"typeName":"u8"},{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"}],"index":0,"name":"IncreaseStatsOfMenagerie"}]}},"path":["common","codec_types","emo","ability","shop","RandomAction"]}},{"id":18,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"trigger","type":19,"typeName":"emo::ability::shop::PeriAsOneselfTrigger"},{"name":"action","type":10,"typeName":"emo::ability::shop::NormalAction"}],"index":0,"name":"AsOneself"},{"fields":[{"name":"trigger","type":20,"typeName":"emo::ability::shop::PeriAsAllyTrigger"},{"name":"action","type":21,"typeName":"emo::ability::shop::PeriAsAllyAction"}],"index":1,"name":"AsAlly"}]}},"path":["common","codec_types","emo","ability","shop","Peri"]}},{"id":19,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Set"},{"index":1,"name":"Sell"},{"fields":[{"name":"typ_and_triple","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":2,"name":"AllySet"}]}},"path":["common","codec_types","emo","ability","shop","PeriAsOneselfTrigger"]}},{"id":20,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"typ_and_triple","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":0,"name":"AllySet"}]}},"path":["common","codec_types","emo","ability","shop","PeriAsAllyTrigger"]}},{"id":21,"type":{"def":{"variant":{"variants":[{"fields":[{"type":10,"typeName":"emo::ability::shop::NormalAction"}],"index":0,"name":"OneselfTripleNormal"},{"fields":[{"type":22,"typeName":"emo::ability::shop::AsAllyAction"}],"index":1,"name":"Custom"}]}},"path":["common","codec_types","emo","ability","shop","PeriAsAllyAction"]}},{"id":22,"type":{"def":{"variant":{"variants":[{"index":0,"name":"TriggerSetActions"}]}},"path":["common","codec_types","emo","ability","shop","AsAllyAction"]}},{"id":23,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Placeholder"}]}},"path":["common","codec_types","emo","ability","shop","Special"]}},{"id":24,"type":{"def":{"variant":{"variants":[{"fields":[{"type":25,"typeName":"emo::ability::battle::General"}],"index":0,"name":"General"},{"fields":[{"type":33,"typeName":"emo::ability::battle::Special"}],"index":1,"name":"Special"}]}},"path":["common","codec_types","emo","ability","battle","Battle"]}},{"id":25,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"trigger","type":26,"typeName":"emo::ability::battle::GeneralAsOneselfTrigger"},{"name":"action","type":27,"typeName":"emo::ability::battle::NormalAction"}],"index":0,"name":"AsOneself"},{"fields":[{"name":"trigger","type":30,"typeName":"emo::ability::battle::GeneralAsAllyTrigger"},{"name":"action","type":31,"typeName":"emo::ability::battle::GeneralAsAllyAction"}],"index":1,"name":"AsAlly"}]}},"path":["common","codec_types","emo","ability","battle","General"]}},{"id":26,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Pre"},{"index":1,"name":"Retire"},{"fields":[{"name":"typ_and_triple","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":2,"name":"AllyRetire"},{"fields":[{"name":"typ_and_triple","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":3,"name":"RivalRetire"},{"fields":[{"name":"typ_and_triple","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"excludes_same_base","type":16,"typeName":"bool"},{"name":"ability","type":24,"typeName":"Box"}],"index":4,"name":"AllyBattleAbilityRemoved"}]}},"path":["common","codec_types","emo","ability","battle","GeneralAsOneselfTrigger"]}},{"id":27,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"side","type":28,"typeName":"emo::ability::Side"},{"name":"base_id","type":1,"typeName":"u16"}],"index":0,"name":"SetEmo"},{"fields":[{"name":"side","type":28,"typeName":"emo::ability::Side"},{"name":"base_id","type":1,"typeName":"u16"},{"name":"divisor","type":5,"typeName":"u8"}],"index":1,"name":"SetEmosByAttackDiv"},{"fields":[{"name":"target_or_random","type":29,"typeName":"emo::ability::TargetOrRandom"},{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"}],"index":2,"name":"IncreaseStats"},{"fields":[{"name":"target_or_random","type":29,"typeName":"emo::ability::TargetOrRandom"},{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"}],"index":3,"name":"DecreaseStats"},{"fields":[{"name":"side","type":28,"typeName":"emo::ability::Side"},{"name":"target_or_random","type":29,"typeName":"emo::ability::TargetOrRandom"},{"name":"count_condition","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"}],"index":4,"name":"IncreaseStatsByEmoCount"},{"fields":[{"name":"target_or_random","type":29,"typeName":"emo::ability::TargetOrRandom"},{"name":"ability","type":24,"typeName":"Box"}],"index":5,"name":"AddBattleAbility"},{"fields":[{"name":"side","type":28,"typeName":"emo::ability::Side"},{"name":"damage","type":1,"typeName":"u16"}],"index":6,"name":"DamageAll"}]}},"path":["common","codec_types","emo","ability","battle","NormalAction"]}},{"id":28,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Ally"},{"index":1,"name":"Rival"}]}},"path":["common","codec_types","emo","ability","Side"]}},{"id":29,"type":{"def":{"variant":{"variants":[{"fields":[{"type":11,"typeName":"emo::ability::Target"}],"index":0,"name":"Target"},{"fields":[{"name":"typ_and_triple","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"},{"name":"count","type":5,"typeName":"u8"}],"index":1,"name":"Random"}]}},"path":["common","codec_types","emo","ability","TargetOrRandom"]}},{"id":30,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"typ_and_triple","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":0,"name":"AllySet"},{"fields":[{"name":"typ_and_triple","type":13,"typeName":"emo::ability::TypOptAndIsTripleOpt"}],"index":1,"name":"AllyRetire"}]}},"path":["common","codec_types","emo","ability","battle","GeneralAsAllyTrigger"]}},{"id":31,"type":{"def":{"variant":{"variants":[{"fields":[{"type":27,"typeName":"emo::ability::battle::NormalAction"}],"index":0,"name":"OneselfTripleNormal"},{"fields":[{"type":32,"typeName":"emo::ability::battle::AsAllyAction"}],"index":1,"name":"Custom"}]}},"path":["common","codec_types","emo","ability","battle","GeneralAsAllyAction"]}},{"id":32,"type":{"def":{"variant":{"variants":[{"index":0,"name":"TriggerRetireActions"}]}},"path":["common","codec_types","emo","ability","battle","AsAllyAction"]}},{"id":33,"type":{"def":{"variant":{"variants":[{"index":0,"name":"Shield"},{"index":1,"name":"Attractive"},{"index":2,"name":"AttackLowestAttack"}]}},"path":["common","codec_types","emo","ability","battle","Special"]}},{"id":34,"type":{"def":{"sequence":{"type":35}}}},{"id":35,"type":{"def":{"tuple":[1,2]}}},{"id":36,"type":{"def":{"sequence":{"type":1}}}},{"id":37,"type":{"def":{"composite":{"fields":[{"name":"offset_key","type":49,"typeName":"Key"}]}},"params":[{"name":"K","type":1},{"name":"V","type":38}],"path":["ink_storage","lazy","mapping","Mapping"]}},{"id":38,"type":{"def":{"sequence":{"type":39}}}},{"id":39,"type":{"def":{"tuple":[40,1,42]}}},{"id":40,"type":{"def":{"composite":{"fields":[{"type":41,"typeName":"[u8; 32]"}]}},"path":["ink_env","types","AccountId"]}},{"id":41,"type":{"def":{"array":{"len":32,"type":5}}}},{"id":42,"type":{"def":{"composite":{"fields":[{"name":"history","type":43,"typeName":"Vec"}]}},"path":["common","codec_types","mtc","Ghost"]}},{"id":43,"type":{"def":{"sequence":{"type":44}}}},{"id":44,"type":{"def":{"composite":{"fields":[{"name":"grade","type":5,"typeName":"u8"},{"name":"board","type":45,"typeName":"mtc::GhostBoard"}]}},"path":["common","codec_types","mtc","GradeAndGhostBoard"]}},{"id":45,"type":{"def":{"composite":{"fields":[{"type":46,"typeName":"Vec"}]}},"path":["common","codec_types","mtc","GhostBoard"]}},{"id":46,"type":{"def":{"sequence":{"type":47}}}},{"id":47,"type":{"def":{"composite":{"fields":[{"name":"base_id","type":1,"typeName":"u16"},{"name":"attributes","type":48,"typeName":"emo::Attributes"}]}},"path":["common","codec_types","mtc","GhostBoardEmo"]}},{"id":48,"type":{"def":{"composite":{"fields":[{"name":"attack","type":1,"typeName":"u16"},{"name":"health","type":1,"typeName":"u16"},{"name":"abilities","type":6,"typeName":"Vec"},{"name":"is_triple","type":16,"typeName":"bool"}]}},"path":["common","codec_types","emo","Attributes"]}},{"id":49,"type":{"def":{"composite":{"fields":[{"type":41,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","Key"]}},{"id":50,"type":{"def":{"composite":{"fields":[{"name":"offset_key","type":49,"typeName":"Key"}]}},"params":[{"name":"K","type":40},{"name":"V","type":1}],"path":["ink_storage","lazy","mapping","Mapping"]}},{"id":51,"type":{"def":{"composite":{"fields":[{"name":"offset_key","type":49,"typeName":"Key"}]}},"params":[{"name":"K","type":40},{"name":"V","type":52}],"path":["ink_storage","lazy","mapping","Mapping"]}},{"id":52,"type":{"def":{"primitive":"u64"}}},{"id":53,"type":{"def":{"composite":{"fields":[{"name":"offset_key","type":49,"typeName":"Key"}]}},"params":[{"name":"K","type":40},{"name":"V","type":54}],"path":["ink_storage","lazy","mapping","Mapping"]}},{"id":54,"type":{"def":{"sequence":{"type":55}}}},{"id":55,"type":{"def":{"composite":{"fields":[{"name":"id","type":1,"typeName":"u16"},{"name":"base_id","type":1,"typeName":"u16"}]}},"path":["common","codec_types","mtc","Emo"]}},{"id":56,"type":{"def":{"composite":{"fields":[{"name":"offset_key","type":49,"typeName":"Key"}]}},"params":[{"name":"K","type":40},{"name":"V","type":5}],"path":["ink_storage","lazy","mapping","Mapping"]}},{"id":57,"type":{"def":{"composite":{"fields":[{"name":"offset_key","type":49,"typeName":"Key"}]}},"params":[{"name":"K","type":40},{"name":"V","type":58}],"path":["ink_storage","lazy","mapping","Mapping"]}},{"id":58,"type":{"def":{"sequence":{"type":59}}}},{"id":59,"type":{"def":{"composite":{"fields":[{"name":"grade","type":5,"typeName":"u8"},{"name":"board","type":60,"typeName":"mtc::Board"}]}},"path":["common","codec_types","mtc","GradeAndBoard"]}},{"id":60,"type":{"def":{"composite":{"fields":[{"type":61,"typeName":"Vec"}]}},"path":["common","codec_types","mtc","Board"]}},{"id":61,"type":{"def":{"sequence":{"type":62}}}},{"id":62,"type":{"def":{"composite":{"fields":[{"name":"mtc_emo_ids","type":36,"typeName":"Vec"},{"name":"base_id","type":1,"typeName":"u16"},{"name":"attributes","type":48,"typeName":"emo::Attributes"}]}},"path":["common","codec_types","mtc","BoardEmo"]}},{"id":63,"type":{"def":{"composite":{"fields":[{"name":"offset_key","type":49,"typeName":"Key"}]}},"params":[{"name":"K","type":40},{"name":"V","type":38}],"path":["ink_storage","lazy","mapping","Mapping"]}},{"id":64,"type":{"def":{"composite":{"fields":[{"name":"offset_key","type":49,"typeName":"Key"}]}},"params":[{"name":"K","type":40},{"name":"V","type":65}],"path":["ink_storage","lazy","mapping","Mapping"]}},{"id":65,"type":{"def":{"sequence":{"type":66}}}},{"id":66,"type":{"def":{"variant":{"variants":[{"fields":[{"name":"health","type":5,"typeName":"u8"}],"index":0,"name":"Active"},{"fields":[{"name":"final_turn","type":5,"typeName":"u8"}],"index":1,"name":"Retired"}]}},"path":["common","codec_types","mtc","GhostState"]}},{"id":67,"type":{"def":{"sequence":{"type":40}}}},{"id":68,"type":{"def":{"composite":{"fields":[{"type":0,"typeName":"BTreeMap"}]}},"path":["common","codec_types","emo","Bases"]}},{"id":69,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":38}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":38}],"path":["Option"]}},{"id":70,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":1}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":1}],"path":["Option"]}},{"id":71,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":52}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":52}],"path":["Option"]}},{"id":72,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":54}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":54}],"path":["Option"]}},{"id":73,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":5}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":5}],"path":["Option"]}},{"id":74,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":58}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":58}],"path":["Option"]}},{"id":75,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":65}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":65}],"path":["Option"]}}]}} +{ + "source": { + "hash": "0x2903ff48fb44dc84a72a0f55d969bde904113e3fa1b96b259b3f0f5705908c93", + "language": "ink! 3.0.0-rc8", + "compiler": "rustc 1.60.0-nightly" + }, + "contract": { + "name": "storage", + "version": "0.1.0", + "authors": [ + "Open Emoji Battler" + ], + "license": "Apache-2.0" + }, + "V3": { + "spec": { + "constructors": [ + { + "args": [], + "docs": [], + "label": "new", + "payable": false, + "selector": "0x9bae9d5e" + } + ], + "docs": [], + "events": [], + "messages": [ + { + "args": [], + "docs": [], + "label": "get_emo_bases", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 68 + }, + "selector": "0x7864382a" + }, + { + "args": [ + { + "label": "value", + "type": { + "displayName": [ + "Option" + ], + "type": 68 + } + } + ], + "docs": [], + "label": "set_emo_bases", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x7a393350" + }, + { + "args": [], + "docs": [], + "label": "get_deck_fixed_emo_base_ids", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 70 + }, + "selector": "0x3e89cbad" + }, + { + "args": [ + { + "label": "value", + "type": { + "displayName": [ + "Option" + ], + "type": 70 + } + } + ], + "docs": [], + "label": "set_deck_fixed_emo_base_ids", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x838a1328" + }, + { + "args": [], + "docs": [], + "label": "get_deck_built_emo_base_ids", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 70 + }, + "selector": "0x5604c526" + }, + { + "args": [ + { + "label": "value", + "type": { + "displayName": [ + "Option" + ], + "type": 70 + } + } + ], + "docs": [], + "label": "set_deck_built_emo_base_ids", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x25cde072" + }, + { + "args": [ + { + "label": "ep_band", + "type": { + "displayName": [ + "u16" + ], + "type": 1 + } + } + ], + "docs": [], + "label": "get_matchmaking_ghosts", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 71 + }, + "selector": "0x5d04aced" + }, + { + "args": [ + { + "label": "ep_band", + "type": { + "displayName": [ + "u16" + ], + "type": 1 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "Vec" + ], + "type": 38 + } + } + ], + "docs": [], + "label": "set_matchmaking_ghosts", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xc9f45dd6" + }, + { + "args": [ + { + "label": "ep_band", + "type": { + "displayName": [ + "u16" + ], + "type": 1 + } + } + ], + "docs": [], + "label": "remove_matchmaking_ghosts", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x3597d231" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "get_player_ep", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 72 + }, + "selector": "0xa7a3db39" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "u16" + ], + "type": 1 + } + } + ], + "docs": [], + "label": "set_player_ep", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x5ac44f3e" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "remove_player_ep", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xa7147181" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "get_player_seed", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 73 + }, + "selector": "0x09425436" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "u64" + ], + "type": 52 + } + } + ], + "docs": [], + "label": "set_player_seed", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xb49918c7" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "remove_player_seed", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xde5a1632" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "get_player_pool", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 74 + }, + "selector": "0x83e00bfa" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "Vec" + ], + "type": 54 + } + } + ], + "docs": [], + "label": "set_player_pool", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xf200ee58" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "remove_player_pool", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xa8ed1dc9" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "get_player_health", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 75 + }, + "selector": "0x7560bd82" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "u8" + ], + "type": 5 + } + } + ], + "docs": [], + "label": "set_player_health", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xd2bf1525" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "remove_player_health", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xa7269337" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "get_player_grade_and_board_history", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 76 + }, + "selector": "0x4dd1791b" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "Vec" + ], + "type": 58 + } + } + ], + "docs": [], + "label": "set_player_grade_and_board_history", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xe842181b" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "remove_player_grade_and_board_history", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x343ac42e" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "get_player_upgrade_coin", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 75 + }, + "selector": "0xdf1f8165" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "u8" + ], + "type": 5 + } + } + ], + "docs": [], + "label": "set_player_upgrade_coin", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x9ccfabad" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "remove_player_upgrade_coin", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x1d8e9ab3" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "get_player_ghosts", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 71 + }, + "selector": "0xb12c7ae3" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "Vec" + ], + "type": 38 + } + } + ], + "docs": [], + "label": "set_player_ghosts", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x313fe40f" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "remove_player_ghosts", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x3b727975" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "get_player_ghost_states", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 77 + }, + "selector": "0x2235eb1c" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "Vec" + ], + "type": 65 + } + } + ], + "docs": [], + "label": "set_player_ghost_states", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x3018fabc" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "remove_player_ghost_states", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x5d679eca" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "get_player_battle_ghost_index", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Option" + ], + "type": 75 + }, + "selector": "0x5cbf6203" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "u8" + ], + "type": 5 + } + } + ], + "docs": [], + "label": "set_player_battle_ghost_index", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x5028205d" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "remove_player_battle_ghost_index", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x3ce4d740" + }, + { + "args": [], + "docs": [], + "label": "get_allowed_accounts", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "Vec" + ], + "type": 67 + }, + "selector": "0xc35cfacd" + }, + { + "args": [ + { + "label": "account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "allow_account", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0x815c22c2" + }, + { + "args": [ + { + "label": "account_id", + "type": { + "displayName": [ + "AccountId" + ], + "type": 40 + } + } + ], + "docs": [], + "label": "disallow_account", + "mutates": true, + "payable": false, + "returnType": null, + "selector": "0xbb8bad9e" + } + ] + }, + "storage": { + "struct": { + "fields": [ + { + "layout": { + "enum": { + "dispatchKey": "0x0000000000000000000000000000000000000000000000000000000000000000", + "variants": { + "0": { + "fields": [ + { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "cell": { + "key": "0x0100000000000000000000000000000000000000000000000000000000000000", + "ty": 0 + } + }, + "name": null + } + ] + } + }, + "name": null + } + ] + }, + "1": { + "fields": [] + } + } + } + }, + "name": "emo_bases" + }, + { + "layout": { + "enum": { + "dispatchKey": "0x0100000000000000000000000000000000000000000000000000000000000000", + "variants": { + "0": { + "fields": [ + { + "layout": { + "cell": { + "key": "0x0200000000000000000000000000000000000000000000000000000000000000", + "ty": 36 + } + }, + "name": null + } + ] + }, + "1": { + "fields": [] + } + } + } + }, + "name": "deck_fixed_emo_base_ids" + }, + { + "layout": { + "enum": { + "dispatchKey": "0x0200000000000000000000000000000000000000000000000000000000000000", + "variants": { + "0": { + "fields": [ + { + "layout": { + "cell": { + "key": "0x0300000000000000000000000000000000000000000000000000000000000000", + "ty": 36 + } + }, + "name": null + } + ] + }, + "1": { + "fields": [] + } + } + } + }, + "name": "deck_built_emo_base_ids" + }, + { + "layout": { + "cell": { + "key": "0x0300000000000000000000000000000000000000000000000000000000000000", + "ty": 37 + } + }, + "name": "matchmaking_ghosts" + }, + { + "layout": { + "cell": { + "key": "0x0400000000000000000000000000000000000000000000000000000000000000", + "ty": 50 + } + }, + "name": "player_ep" + }, + { + "layout": { + "cell": { + "key": "0x0500000000000000000000000000000000000000000000000000000000000000", + "ty": 51 + } + }, + "name": "player_seed" + }, + { + "layout": { + "cell": { + "key": "0x0600000000000000000000000000000000000000000000000000000000000000", + "ty": 53 + } + }, + "name": "player_pool" + }, + { + "layout": { + "cell": { + "key": "0x0700000000000000000000000000000000000000000000000000000000000000", + "ty": 56 + } + }, + "name": "player_health" + }, + { + "layout": { + "cell": { + "key": "0x0800000000000000000000000000000000000000000000000000000000000000", + "ty": 57 + } + }, + "name": "player_grade_and_board_history" + }, + { + "layout": { + "cell": { + "key": "0x0900000000000000000000000000000000000000000000000000000000000000", + "ty": 56 + } + }, + "name": "player_upgrade_coin" + }, + { + "layout": { + "cell": { + "key": "0x0a00000000000000000000000000000000000000000000000000000000000000", + "ty": 63 + } + }, + "name": "player_ghosts" + }, + { + "layout": { + "cell": { + "key": "0x0b00000000000000000000000000000000000000000000000000000000000000", + "ty": 64 + } + }, + "name": "player_ghost_states" + }, + { + "layout": { + "cell": { + "key": "0x0c00000000000000000000000000000000000000000000000000000000000000", + "ty": 56 + } + }, + "name": "player_battle_ghost_index" + }, + { + "layout": { + "cell": { + "key": "0x0d00000000000000000000000000000000000000000000000000000000000000", + "ty": 67 + } + }, + "name": "allowed_accounts" + } + ] + } + }, + "types": [ + { + "id": 0, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 34 + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 1 + }, + { + "name": "V", + "type": 2 + } + ], + "path": [ + "BTreeMap" + ] + } + }, + { + "id": 1, + "type": { + "def": { + "primitive": "u16" + } + } + }, + { + "id": 2, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "id", + "type": 1, + "typeName": "u16" + }, + { + "name": "typ", + "type": 3, + "typeName": "emo::Typ" + }, + { + "name": "codepoint", + "type": 4, + "typeName": "u32" + }, + { + "name": "grade", + "type": 5, + "typeName": "u8" + }, + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + }, + { + "name": "abilities", + "type": 6, + "typeName": "Vec" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "Base" + ] + } + }, + { + "id": 3, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Human" + }, + { + "index": 1, + "name": "Nature" + }, + { + "index": 2, + "name": "Food" + }, + { + "index": 3, + "name": "Object" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "Typ" + ] + } + }, + { + "id": 4, + "type": { + "def": { + "primitive": "u32" + } + } + }, + { + "id": 5, + "type": { + "def": { + "primitive": "u8" + } + } + }, + { + "id": 6, + "type": { + "def": { + "sequence": { + "type": 7 + } + } + } + }, + { + "id": 7, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 8, + "typeName": "emo::ability::shop::Shop" + } + ], + "index": 0, + "name": "Shop" + }, + { + "fields": [ + { + "type": 24, + "typeName": "emo::ability::battle::Battle" + } + ], + "index": 1, + "name": "Battle" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "Ability" + ] + } + }, + { + "id": 8, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 9, + "typeName": "emo::ability::shop::Pre" + } + ], + "index": 0, + "name": "Pre" + }, + { + "fields": [ + { + "type": 18, + "typeName": "emo::ability::shop::Peri" + } + ], + "index": 1, + "name": "Peri" + }, + { + "fields": [ + { + "type": 23, + "typeName": "emo::ability::shop::Special" + } + ], + "index": 2, + "name": "Special" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "Shop" + ] + } + }, + { + "id": 9, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 10, + "typeName": "emo::ability::shop::NormalAction" + } + ], + "index": 0, + "name": "Normal" + }, + { + "fields": [ + { + "type": 17, + "typeName": "emo::ability::shop::RandomAction" + } + ], + "index": 1, + "name": "Random" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "Pre" + ] + } + }, + { + "id": 10, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "base_id", + "type": 1, + "typeName": "u16" + } + ], + "index": 0, + "name": "SetEmo" + }, + { + "fields": [ + { + "name": "target", + "type": 11, + "typeName": "emo::ability::Target" + }, + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + } + ], + "index": 1, + "name": "IncreaseStats" + }, + { + "fields": [ + { + "name": "target", + "type": 11, + "typeName": "emo::ability::Target" + }, + { + "name": "count_condition", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + } + ], + "index": 2, + "name": "IncreaseStatsByEmoCount" + }, + { + "fields": [ + { + "name": "target", + "type": 11, + "typeName": "emo::ability::Target" + }, + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + } + ], + "index": 3, + "name": "IncreaseStatsByGrade" + }, + { + "fields": [ + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + } + ], + "index": 4, + "name": "IncreaseStatsOfAdjacentMenagerie" + }, + { + "fields": [ + { + "name": "target", + "type": 11, + "typeName": "emo::ability::Target" + }, + { + "name": "ability", + "type": 7, + "typeName": "Box" + } + ], + "index": 5, + "name": "AddAbility" + }, + { + "fields": [ + { + "name": "coin", + "type": 5, + "typeName": "u8" + } + ], + "index": 6, + "name": "GetCoin" + }, + { + "fields": [ + { + "name": "count_condition", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "divisor", + "type": 5, + "typeName": "u8" + } + ], + "index": 7, + "name": "GetCoinByEmoCountDiv" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "NormalAction" + ] + } + }, + { + "id": 11, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Oneself" + }, + { + "fields": [ + { + "name": "destination", + "type": 12, + "typeName": "emo::ability::Destination" + }, + { + "name": "typ_and_triple", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 1, + "name": "Others" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "Target" + ] + } + }, + { + "id": 12, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Left" + }, + { + "index": 1, + "name": "Right" + }, + { + "index": 2, + "name": "All" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "Destination" + ] + } + }, + { + "id": 13, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "typ_opt", + "type": 14, + "typeName": "Option" + }, + { + "name": "is_triple_opt", + "type": 15, + "typeName": "Option" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "TypOptAndIsTripleOpt" + ] + } + }, + { + "id": 14, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 3 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 15, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 16 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 16 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 16, + "type": { + "def": { + "primitive": "bool" + } + } + }, + { + "id": 17, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "typ_count", + "type": 5, + "typeName": "u8" + }, + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + } + ], + "index": 0, + "name": "IncreaseStatsOfMenagerie" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "RandomAction" + ] + } + }, + { + "id": 18, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "trigger", + "type": 19, + "typeName": "emo::ability::shop::PeriAsOneselfTrigger" + }, + { + "name": "action", + "type": 10, + "typeName": "emo::ability::shop::NormalAction" + } + ], + "index": 0, + "name": "AsOneself" + }, + { + "fields": [ + { + "name": "trigger", + "type": 20, + "typeName": "emo::ability::shop::PeriAsAllyTrigger" + }, + { + "name": "action", + "type": 21, + "typeName": "emo::ability::shop::PeriAsAllyAction" + } + ], + "index": 1, + "name": "AsAlly" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "Peri" + ] + } + }, + { + "id": 19, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Set" + }, + { + "index": 1, + "name": "Sell" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 2, + "name": "AllySet" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "PeriAsOneselfTrigger" + ] + } + }, + { + "id": 20, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "typ_and_triple", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 0, + "name": "AllySet" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "PeriAsAllyTrigger" + ] + } + }, + { + "id": 21, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 10, + "typeName": "emo::ability::shop::NormalAction" + } + ], + "index": 0, + "name": "OneselfTripleNormal" + }, + { + "fields": [ + { + "type": 22, + "typeName": "emo::ability::shop::AsAllyAction" + } + ], + "index": 1, + "name": "Custom" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "PeriAsAllyAction" + ] + } + }, + { + "id": 22, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "TriggerSetActions" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "AsAllyAction" + ] + } + }, + { + "id": 23, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Placeholder" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "shop", + "Special" + ] + } + }, + { + "id": 24, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 25, + "typeName": "emo::ability::battle::General" + } + ], + "index": 0, + "name": "General" + }, + { + "fields": [ + { + "type": 33, + "typeName": "emo::ability::battle::Special" + } + ], + "index": 1, + "name": "Special" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "Battle" + ] + } + }, + { + "id": 25, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "trigger", + "type": 26, + "typeName": "emo::ability::battle::GeneralAsOneselfTrigger" + }, + { + "name": "action", + "type": 27, + "typeName": "emo::ability::battle::NormalAction" + } + ], + "index": 0, + "name": "AsOneself" + }, + { + "fields": [ + { + "name": "trigger", + "type": 30, + "typeName": "emo::ability::battle::GeneralAsAllyTrigger" + }, + { + "name": "action", + "type": 31, + "typeName": "emo::ability::battle::GeneralAsAllyAction" + } + ], + "index": 1, + "name": "AsAlly" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "General" + ] + } + }, + { + "id": 26, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Pre" + }, + { + "index": 1, + "name": "Retire" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 2, + "name": "AllyRetire" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 3, + "name": "RivalRetire" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "excludes_same_base", + "type": 16, + "typeName": "bool" + }, + { + "name": "ability", + "type": 24, + "typeName": "Box" + } + ], + "index": 4, + "name": "AllyBattleAbilityRemoved" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "GeneralAsOneselfTrigger" + ] + } + }, + { + "id": 27, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "side", + "type": 28, + "typeName": "emo::ability::Side" + }, + { + "name": "base_id", + "type": 1, + "typeName": "u16" + } + ], + "index": 0, + "name": "SetEmo" + }, + { + "fields": [ + { + "name": "side", + "type": 28, + "typeName": "emo::ability::Side" + }, + { + "name": "base_id", + "type": 1, + "typeName": "u16" + }, + { + "name": "divisor", + "type": 5, + "typeName": "u8" + } + ], + "index": 1, + "name": "SetEmosByAttackDiv" + }, + { + "fields": [ + { + "name": "target_or_random", + "type": 29, + "typeName": "emo::ability::TargetOrRandom" + }, + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + } + ], + "index": 2, + "name": "IncreaseStats" + }, + { + "fields": [ + { + "name": "target_or_random", + "type": 29, + "typeName": "emo::ability::TargetOrRandom" + }, + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + } + ], + "index": 3, + "name": "DecreaseStats" + }, + { + "fields": [ + { + "name": "side", + "type": 28, + "typeName": "emo::ability::Side" + }, + { + "name": "target_or_random", + "type": 29, + "typeName": "emo::ability::TargetOrRandom" + }, + { + "name": "count_condition", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + } + ], + "index": 4, + "name": "IncreaseStatsByEmoCount" + }, + { + "fields": [ + { + "name": "target_or_random", + "type": 29, + "typeName": "emo::ability::TargetOrRandom" + }, + { + "name": "ability", + "type": 24, + "typeName": "Box" + } + ], + "index": 5, + "name": "AddBattleAbility" + }, + { + "fields": [ + { + "name": "side", + "type": 28, + "typeName": "emo::ability::Side" + }, + { + "name": "damage", + "type": 1, + "typeName": "u16" + } + ], + "index": 6, + "name": "DamageAll" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "NormalAction" + ] + } + }, + { + "id": 28, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Ally" + }, + { + "index": 1, + "name": "Rival" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "Side" + ] + } + }, + { + "id": 29, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 11, + "typeName": "emo::ability::Target" + } + ], + "index": 0, + "name": "Target" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + }, + { + "name": "count", + "type": 5, + "typeName": "u8" + } + ], + "index": 1, + "name": "Random" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "TargetOrRandom" + ] + } + }, + { + "id": 30, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "typ_and_triple", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 0, + "name": "AllySet" + }, + { + "fields": [ + { + "name": "typ_and_triple", + "type": 13, + "typeName": "emo::ability::TypOptAndIsTripleOpt" + } + ], + "index": 1, + "name": "AllyRetire" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "GeneralAsAllyTrigger" + ] + } + }, + { + "id": 31, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 27, + "typeName": "emo::ability::battle::NormalAction" + } + ], + "index": 0, + "name": "OneselfTripleNormal" + }, + { + "fields": [ + { + "type": 32, + "typeName": "emo::ability::battle::AsAllyAction" + } + ], + "index": 1, + "name": "Custom" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "GeneralAsAllyAction" + ] + } + }, + { + "id": 32, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "TriggerRetireActions" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "AsAllyAction" + ] + } + }, + { + "id": 33, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "Shield" + }, + { + "index": 1, + "name": "Attractive" + }, + { + "index": 2, + "name": "AttackLowestAttack" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "ability", + "battle", + "Special" + ] + } + }, + { + "id": 34, + "type": { + "def": { + "sequence": { + "type": 35 + } + } + } + }, + { + "id": 35, + "type": { + "def": { + "tuple": [ + 1, + 2 + ] + } + } + }, + { + "id": 36, + "type": { + "def": { + "sequence": { + "type": 1 + } + } + } + }, + { + "id": 37, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "offset_key", + "type": 49, + "typeName": "Key" + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 1 + }, + { + "name": "V", + "type": 38 + } + ], + "path": [ + "ink_storage", + "lazy", + "mapping", + "Mapping" + ] + } + }, + { + "id": 38, + "type": { + "def": { + "sequence": { + "type": 39 + } + } + } + }, + { + "id": 39, + "type": { + "def": { + "tuple": [ + 40, + 1, + 42 + ] + } + } + }, + { + "id": 40, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 41, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_env", + "types", + "AccountId" + ] + } + }, + { + "id": 41, + "type": { + "def": { + "array": { + "len": 32, + "type": 5 + } + } + } + }, + { + "id": 42, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "history", + "type": 43, + "typeName": "Vec" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "Ghost" + ] + } + }, + { + "id": 43, + "type": { + "def": { + "sequence": { + "type": 44 + } + } + } + }, + { + "id": 44, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "grade", + "type": 5, + "typeName": "u8" + }, + { + "name": "board", + "type": 45, + "typeName": "mtc::GhostBoard" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "GradeAndGhostBoard" + ] + } + }, + { + "id": 45, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 46, + "typeName": "Vec" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "GhostBoard" + ] + } + }, + { + "id": 46, + "type": { + "def": { + "sequence": { + "type": 47 + } + } + } + }, + { + "id": 47, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "base_id", + "type": 1, + "typeName": "u16" + }, + { + "name": "attributes", + "type": 48, + "typeName": "emo::Attributes" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "GhostBoardEmo" + ] + } + }, + { + "id": 48, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "attack", + "type": 1, + "typeName": "u16" + }, + { + "name": "health", + "type": 1, + "typeName": "u16" + }, + { + "name": "abilities", + "type": 6, + "typeName": "Vec" + }, + { + "name": "is_triple", + "type": 16, + "typeName": "bool" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "Attributes" + ] + } + }, + { + "id": 49, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 41, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_primitives", + "Key" + ] + } + }, + { + "id": 50, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "offset_key", + "type": 49, + "typeName": "Key" + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 40 + }, + { + "name": "V", + "type": 1 + } + ], + "path": [ + "ink_storage", + "lazy", + "mapping", + "Mapping" + ] + } + }, + { + "id": 51, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "offset_key", + "type": 49, + "typeName": "Key" + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 40 + }, + { + "name": "V", + "type": 52 + } + ], + "path": [ + "ink_storage", + "lazy", + "mapping", + "Mapping" + ] + } + }, + { + "id": 52, + "type": { + "def": { + "primitive": "u64" + } + } + }, + { + "id": 53, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "offset_key", + "type": 49, + "typeName": "Key" + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 40 + }, + { + "name": "V", + "type": 54 + } + ], + "path": [ + "ink_storage", + "lazy", + "mapping", + "Mapping" + ] + } + }, + { + "id": 54, + "type": { + "def": { + "sequence": { + "type": 55 + } + } + } + }, + { + "id": 55, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "id", + "type": 1, + "typeName": "u16" + }, + { + "name": "base_id", + "type": 1, + "typeName": "u16" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "Emo" + ] + } + }, + { + "id": 56, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "offset_key", + "type": 49, + "typeName": "Key" + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 40 + }, + { + "name": "V", + "type": 5 + } + ], + "path": [ + "ink_storage", + "lazy", + "mapping", + "Mapping" + ] + } + }, + { + "id": 57, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "offset_key", + "type": 49, + "typeName": "Key" + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 40 + }, + { + "name": "V", + "type": 58 + } + ], + "path": [ + "ink_storage", + "lazy", + "mapping", + "Mapping" + ] + } + }, + { + "id": 58, + "type": { + "def": { + "sequence": { + "type": 59 + } + } + } + }, + { + "id": 59, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "grade", + "type": 5, + "typeName": "u8" + }, + { + "name": "board", + "type": 60, + "typeName": "mtc::Board" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "GradeAndBoard" + ] + } + }, + { + "id": 60, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 61, + "typeName": "Vec" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "Board" + ] + } + }, + { + "id": 61, + "type": { + "def": { + "sequence": { + "type": 62 + } + } + } + }, + { + "id": 62, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "mtc_emo_ids", + "type": 36, + "typeName": "Vec" + }, + { + "name": "base_id", + "type": 1, + "typeName": "u16" + }, + { + "name": "attributes", + "type": 48, + "typeName": "emo::Attributes" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "BoardEmo" + ] + } + }, + { + "id": 63, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "offset_key", + "type": 49, + "typeName": "Key" + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 40 + }, + { + "name": "V", + "type": 38 + } + ], + "path": [ + "ink_storage", + "lazy", + "mapping", + "Mapping" + ] + } + }, + { + "id": 64, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "offset_key", + "type": 49, + "typeName": "Key" + } + ] + } + }, + "params": [ + { + "name": "K", + "type": 40 + }, + { + "name": "V", + "type": 65 + } + ], + "path": [ + "ink_storage", + "lazy", + "mapping", + "Mapping" + ] + } + }, + { + "id": 65, + "type": { + "def": { + "sequence": { + "type": 66 + } + } + } + }, + { + "id": 66, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "name": "health", + "type": 5, + "typeName": "u8" + } + ], + "index": 0, + "name": "Active" + }, + { + "fields": [ + { + "name": "final_turn", + "type": 5, + "typeName": "u8" + } + ], + "index": 1, + "name": "Retired" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "mtc", + "GhostState" + ] + } + }, + { + "id": 67, + "type": { + "def": { + "sequence": { + "type": 40 + } + } + } + }, + { + "id": 68, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 69 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 69 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 69, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 0, + "typeName": "BTreeMap" + } + ] + } + }, + "path": [ + "common", + "codec_types", + "emo", + "Bases" + ] + } + }, + { + "id": 70, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 36 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 36 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 71, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 38 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 38 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 72, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 1 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 1 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 73, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 52 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 52 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 74, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 54 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 54 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 75, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 5 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 5 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 76, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 58 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 58 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 77, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 65 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 65 + } + ], + "path": [ + "Option" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/contract/deploy/dev.sh b/contract/deploy/dev.sh new file mode 100755 index 00000000..e6216660 --- /dev/null +++ b/contract/deploy/dev.sh @@ -0,0 +1,9 @@ +#!/bin/sh -ex + +cd ../storage && cargo contract build && cd - +cd ../logic && cargo contract build && cd - +cd ../forwarder && cargo contract build && cd - + +yarn ts-node ./dev/setup.ts local + +echo "{\"chainEndpoint\":\"ws://127.0.0.1:9944\",\"contract\":{\"endpoint\":\"ws://127.0.0.1:9988\",\"storageAddress\":`cat ./dev/instantiatedAddress.storage.local.json`,\"forwarderAddress\":`cat ./dev/instantiatedAddress.forwarder.local.json`}}" > ../../common/js/src/envs/local.json diff --git a/contract/deploy/dev/setup.ts b/contract/deploy/dev/setup.ts new file mode 100644 index 00000000..f3ab08ec --- /dev/null +++ b/contract/deploy/dev/setup.ts @@ -0,0 +1,73 @@ +import { readFileSync } from "fs" +import path from "path" + +import { txContract, connected } from "common" +import { loadEmoBases } from "common/src/scriptUtils" +import { instantiateContract, getEndpointAndPair } from "../utils" + +import availableEmoBaseIds from "../../../data/availableEmoBaseIds.json" + +const main = async () => { + const { envName, endpoint, keyringPair } = await getEndpointAndPair() + + await connected( + endpoint, + async (api) => { + const storageContract = await instantiateContract( + api, + keyringPair, + "storage", + [], + __dirname, + envName, + "../../storage/target/ink/storage.contract" + ) + + const logicContract = await instantiateContract( + api, + keyringPair, + "logic", + [storageContract.address.toString()], + __dirname, + envName, + "../../logic/target/ink/logic.contract" + ) + + const forwarderContract = await instantiateContract( + api, + keyringPair, + "forwarder", + [logicContract.address.toString()], + __dirname, + envName, + "../../forwarder/target/ink/forwarder.contract" + ) + + await txContract( + storageContract, + "allowAccount", + [logicContract.address.toString()], + keyringPair + ) + await txContract( + logicContract, + "allowAccount", + [forwarderContract.address.toString()], + keyringPair + ) + + const bases = loadEmoBases( + readFileSync(path.resolve(__dirname, "../../../data/emoBases.json"), "utf8") + ) + await txContract( + logicContract, + "updateEmoBases", + [bases.toU8a(), availableEmoBaseIds.fixed, availableEmoBaseIds.built, true], + keyringPair + ) + }, + false + ) +} + +main().catch(console.error).finally(process.exit) diff --git a/contract/deploy/utils.ts b/contract/deploy/utils.ts index d5c001f6..1ec8e3f1 100644 --- a/contract/deploy/utils.ts +++ b/contract/deploy/utils.ts @@ -3,27 +3,28 @@ import path from "path" import { tx } from "common" -import { WsProvider, ApiPromise } from "@polkadot/api" +import { ApiPromise } from "@polkadot/api" import { CodePromise, ContractPromise } from "@polkadot/api-contract" import type { IKeyringPair } from "@polkadot/types/types" import { getContractEnvAndKeyringPair } from "common/src/scriptUtils" -// const SDN = 1_000_000_000_000_000_000n -// const MILLISDN = SDN / 1_000n - export const instantiateContract = async ( api: ApiPromise, pair: IKeyringPair, contractName: string, constructorArgs: any[], dirname: string, - envName: string + envName: string, + contractFilePath?: string ) => { - const abi = readFileSync(path.resolve(dirname, `./${contractName}.json`), "utf8") - const wasm = readFileSync(path.resolve(dirname, `./${contractName}.wasm`)) - - const code = new CodePromise(api, abi, wasm) + const code = contractFilePath + ? new CodePromise(api, readFileSync(path.resolve(dirname, contractFilePath), "utf8"), null) + : new CodePromise( + api, + readFileSync(path.resolve(dirname, `./${contractName}.json`), "utf8"), + readFileSync(path.resolve(dirname, `./${contractName}.wasm`)) + ) const contract = ( (await tx( diff --git a/contract/forwarder/lib.rs b/contract/forwarder/lib.rs index 4e4b3411..e70103a2 100644 --- a/contract/forwarder/lib.rs +++ b/contract/forwarder/lib.rs @@ -6,13 +6,13 @@ use ink_lang as ink; mod contract { use common::codec_types::*; use ink_env::call::FromAccountId; - use ink_prelude::{vec as std_vec, vec::Vec as StdVec}; + use ink_prelude::{vec, vec::Vec}; use logic::contract::LogicRef; #[ink(storage)] pub struct Forwarder { logic_account_id: AccountId, - allowed_accounts: StdVec, + allowed_accounts: Vec, } impl Forwarder { @@ -20,7 +20,7 @@ mod contract { pub fn new(logic_account_id: AccountId) -> Self { Self { logic_account_id, - allowed_accounts: std_vec![Self::env().caller()], + allowed_accounts: vec![Self::env().caller()], } } @@ -32,7 +32,7 @@ mod contract { } #[ink(message)] - pub fn finish_mtc_shop(&mut self, player_operations: StdVec) { + pub fn finish_mtc_shop(&mut self, player_operations: Vec) { let caller = self.env().caller(); let mut logic = self.get_logic(); logic.finish_mtc_shop(caller, player_operations); @@ -57,7 +57,7 @@ mod contract { // allowed accounts #[ink(message)] - pub fn get_allowed_accounts(&self) -> StdVec { + pub fn get_allowed_accounts(&self) -> Vec { self.allowed_accounts.clone() } @@ -74,10 +74,10 @@ mod contract { } fn only_allowed_caller(&self) { + let caller = &self.env().caller(); assert!( - self.allowed_accounts.contains(&self.env().caller()), - "allowed accounts: this caller is not allowed: {:?}", - &self.env().caller() + self.allowed_accounts.contains(caller), + "allowed accounts: this caller is not allowed: {caller:?}", ); } } diff --git a/contract/logic/lib.rs b/contract/logic/lib.rs index 1b7a29ba..c9da7383 100644 --- a/contract/logic/lib.rs +++ b/contract/logic/lib.rs @@ -22,14 +22,14 @@ pub mod contract { }, }; use ink_env::{call::FromAccountId, hash::Blake2x128}; - use ink_prelude::{vec as std_vec, vec::Vec as StdVec}; + use ink_prelude::{vec, vec::Vec}; use scale::Decode; use storage::contract::StorageRef; #[ink(storage)] pub struct Logic { storage_account_id: AccountId, - allowed_accounts: StdVec, + allowed_accounts: Vec, root_account_id: AccountId, } @@ -39,7 +39,7 @@ pub mod contract { let caller = Self::env().caller(); Self { storage_account_id, - allowed_accounts: std_vec![caller], + allowed_accounts: vec![caller], root_account_id: caller, } } @@ -68,7 +68,7 @@ pub mod contract { assert_eq!( self.root_account_id, self.env().caller(), - "set_root_account_id: not allowed" + "only_root_caller: not allowed" ); } @@ -76,8 +76,8 @@ pub mod contract { pub fn update_emo_bases( &mut self, new_bases: emo::Bases, - fixed_base_ids: StdVec, - built_base_ids: StdVec, + fixed_base_ids: Vec, + built_base_ids: Vec, force_bases_update: bool, ) { self.only_root_caller(); @@ -93,9 +93,9 @@ pub mod contract { ) .expect("update_emo_bases: invalig arg"); - storage.set_emo_bases(bases); - storage.set_deck_fixed_emo_base_ids(fixed_base_ids); - storage.set_deck_built_emo_base_ids(built_base_ids); + storage.set_emo_bases(Some(bases)); + storage.set_deck_fixed_emo_base_ids(Some(fixed_base_ids)); + storage.set_deck_built_emo_base_ids(Some(built_base_ids)); } #[ink(message)] @@ -118,13 +118,13 @@ pub mod contract { caller, build_pool( &deck_emo_base_ids, - &storage.get_emo_bases(), - &storage.get_deck_fixed_emo_base_ids(), - &storage.get_deck_built_emo_base_ids(), + &storage.get_emo_bases().expect("emo_bases none"), + &storage.get_deck_fixed_emo_base_ids().expect("deck_fixed_emo_base_ids none"), + &storage.get_deck_built_emo_base_ids().expect("deck_built_emo_base_ids none"), ) .expect("failed to build player pool"), ); - storage.set_player_grade_and_board_history(caller, StdVec::new()); + storage.set_player_grade_and_board_history(caller, Vec::new()); storage.set_player_battle_ghost_index(caller, 0); self.update_upgrade_coin(&mut storage, caller, get_upgrade_coin(2)); @@ -135,13 +135,13 @@ pub mod contract { pub fn finish_mtc_shop( &mut self, caller: AccountId, - player_operations: StdVec, + player_operations: Vec, ) { self.only_allowed_caller(); let mut storage = self.get_storage(); - let emo_bases = storage.get_emo_bases(); + let emo_bases = storage.get_emo_bases().expect("emo_bases none"); let grade_and_board_history = storage .get_player_grade_and_board_history(caller) .expect("player_grade_and_board_history none"); @@ -265,8 +265,8 @@ pub mod contract { upgrade_coin: Option, battle_ghost_index: u8, health: u8, - ghost_states: StdVec, - mut grade_and_board_history: StdVec, + ghost_states: Vec, + mut grade_and_board_history: Vec, final_place: Option, ) { grade_and_board_history.push(mtc::GradeAndBoard { grade, board }); @@ -347,11 +347,11 @@ pub mod contract { storage: &mut StorageRef, account_id: AccountId, upgrade_coin: Option, - ghost_states: StdVec, + ghost_states: Vec, battle_ghost_index: u8, new_seed: u64, health: u8, - grade_and_board_history: StdVec, + grade_and_board_history: Vec, ) { if exceeds_grade_and_board_history_limit(&grade_and_board_history) { panic!("max turn exceeded"); @@ -373,7 +373,7 @@ pub mod contract { // allowed accounts #[ink(message)] - pub fn get_allowed_accounts(&self) -> StdVec { + pub fn get_allowed_accounts(&self) -> Vec { self.allowed_accounts.clone() } @@ -390,10 +390,10 @@ pub mod contract { } fn only_allowed_caller(&self) { + let caller = &self.env().caller(); assert!( - self.allowed_accounts.contains(&self.env().caller()), - "allowed accounts: this caller is not allowed: {:?}", - &self.env().caller() + self.allowed_accounts.contains(caller), + "allowed accounts: this caller is not allowed: {caller:?}", ); } } diff --git a/contract/storage/lib.rs b/contract/storage/lib.rs index 84ef7fba..1b37d687 100644 --- a/contract/storage/lib.rs +++ b/contract/storage/lib.rs @@ -5,87 +5,81 @@ use ink_lang as ink; #[ink::contract] pub mod contract { use common::codec_types::*; - use ink_prelude::vec as std_vec; - use ink_prelude::vec::Vec as StdVec; - use ink_storage::{lazy::Mapping, traits::SpreadAllocate, Lazy}; + use ink_prelude::vec::Vec; + use ink_storage::lazy::Mapping; // remove `lazy` on next release #[ink(storage)] - #[derive(SpreadAllocate)] + #[derive(Default)] pub struct Storage { - emo_bases: Lazy, - deck_fixed_emo_base_ids: Lazy>, - deck_built_emo_base_ids: Lazy>, + emo_bases: Option, + deck_fixed_emo_base_ids: Option>, + deck_built_emo_base_ids: Option>, - matchmaking_ghosts: Mapping>, + matchmaking_ghosts: Mapping>, player_ep: Mapping, player_seed: Mapping, // remove for each mtc - player_pool: Mapping>, + player_pool: Mapping>, player_health: Mapping, - player_grade_and_board_history: Mapping>, + player_grade_and_board_history: Mapping>, player_upgrade_coin: Mapping, - player_ghosts: Mapping>, - player_ghost_states: Mapping>, + player_ghosts: Mapping>, + player_ghost_states: Mapping>, player_battle_ghost_index: Mapping, // allowed accounts - allowed_accounts: Lazy>, + allowed_accounts: Vec, } impl Storage { #[ink(constructor)] pub fn new() -> Self { - ink_lang::codegen::initialize_contract(|contract: &mut Self| { - // avoid 'encountered empty storage cell' panic on read - contract.emo_bases = Lazy::new(Default::default()); - contract.deck_fixed_emo_base_ids = Lazy::new(Default::default()); - contract.deck_built_emo_base_ids = Lazy::new(Default::default()); - - contract.allowed_accounts = Lazy::new(std_vec![Self::env().caller()]); - }) + let mut contract: Self = Default::default(); + contract.allowed_accounts.push(Self::env().caller()); + contract } #[ink(message)] - pub fn get_emo_bases(&self) -> emo::Bases { + pub fn get_emo_bases(&self) -> Option { self.emo_bases.clone() } #[ink(message)] - pub fn set_emo_bases(&mut self, value: emo::Bases) { + pub fn set_emo_bases(&mut self, value: Option) { self.only_allowed_caller(); - *self.emo_bases = value; + self.emo_bases = value; } #[ink(message)] - pub fn get_deck_fixed_emo_base_ids(&self) -> StdVec { + pub fn get_deck_fixed_emo_base_ids(&self) -> Option> { self.deck_fixed_emo_base_ids.clone() } #[ink(message)] - pub fn set_deck_fixed_emo_base_ids(&mut self, value: StdVec) { + pub fn set_deck_fixed_emo_base_ids(&mut self, value: Option>) { self.only_allowed_caller(); - *self.deck_fixed_emo_base_ids = value; + self.deck_fixed_emo_base_ids = value; } #[ink(message)] - pub fn get_deck_built_emo_base_ids(&self) -> StdVec { + pub fn get_deck_built_emo_base_ids(&self) -> Option> { self.deck_built_emo_base_ids.clone() } #[ink(message)] - pub fn set_deck_built_emo_base_ids(&mut self, value: StdVec) { + pub fn set_deck_built_emo_base_ids(&mut self, value: Option>) { self.only_allowed_caller(); - *self.deck_built_emo_base_ids = value; + self.deck_built_emo_base_ids = value; } #[ink(message)] pub fn get_matchmaking_ghosts( &self, ep_band: u16, - ) -> Option> { + ) -> Option> { self.matchmaking_ghosts.get(ep_band) } @@ -93,7 +87,7 @@ pub mod contract { pub fn set_matchmaking_ghosts( &mut self, ep_band: u16, - value: StdVec<(AccountId, u16, mtc::Ghost)>, + value: Vec<(AccountId, u16, mtc::Ghost)>, ) { self.only_allowed_caller(); self.matchmaking_ghosts.insert(ep_band, &value); @@ -140,12 +134,12 @@ pub mod contract { } #[ink(message)] - pub fn get_player_pool(&self, account: AccountId) -> Option> { + pub fn get_player_pool(&self, account: AccountId) -> Option> { self.player_pool.get(&account) } #[ink(message)] - pub fn set_player_pool(&mut self, account: AccountId, value: StdVec) { + pub fn set_player_pool(&mut self, account: AccountId, value: Vec) { self.only_allowed_caller(); self.player_pool.insert(account, &value); } @@ -177,7 +171,7 @@ pub mod contract { pub fn get_player_grade_and_board_history( &self, account: AccountId, - ) -> Option> { + ) -> Option> { self.player_grade_and_board_history.get(&account) } @@ -185,7 +179,7 @@ pub mod contract { pub fn set_player_grade_and_board_history( &mut self, account: AccountId, - value: StdVec, + value: Vec, ) { self.only_allowed_caller(); self.player_grade_and_board_history.insert(account, &value); @@ -218,7 +212,7 @@ pub mod contract { pub fn get_player_ghosts( &self, account: AccountId, - ) -> Option> { + ) -> Option> { self.player_ghosts.get(&account) } @@ -226,7 +220,7 @@ pub mod contract { pub fn set_player_ghosts( &mut self, account: AccountId, - value: StdVec<(AccountId, u16, mtc::Ghost)>, + value: Vec<(AccountId, u16, mtc::Ghost)>, ) { self.only_allowed_caller(); self.player_ghosts.insert(account, &value); @@ -239,19 +233,12 @@ pub mod contract { } #[ink(message)] - pub fn get_player_ghost_states( - &self, - account: AccountId, - ) -> Option> { + pub fn get_player_ghost_states(&self, account: AccountId) -> Option> { self.player_ghost_states.get(&account) } #[ink(message)] - pub fn set_player_ghost_states( - &mut self, - account: AccountId, - value: StdVec, - ) { + pub fn set_player_ghost_states(&mut self, account: AccountId, value: Vec) { self.only_allowed_caller(); self.player_ghost_states.insert(account, &value); } @@ -282,7 +269,7 @@ pub mod contract { // allowed accounts #[ink(message)] - pub fn get_allowed_accounts(&self) -> StdVec { + pub fn get_allowed_accounts(&self) -> Vec { self.allowed_accounts.clone() } @@ -299,10 +286,10 @@ pub mod contract { } fn only_allowed_caller(&self) { + let caller = &self.env().caller(); assert!( - self.allowed_accounts.contains(&self.env().caller()), - "allowed accounts: this caller is not allowed: {:?}", - &self.env().caller() + self.allowed_accounts.contains(caller), + "allowed accounts: this caller is not allowed: {caller:?}", ); } } diff --git a/front/package.json b/front/package.json index 618baf38..c34279c5 100644 --- a/front/package.json +++ b/front/package.json @@ -6,7 +6,7 @@ "sideEffects": ["**/*.sass"], "scripts": { "dev": "OEB_ENV=local webpack serve --mode development --stats minimal --hot", - "build": "rm -rf ./dist && ./scripts/put-redirects.sh && OEB_ENV=production webpack --mode production", + "build": "echo '\"\"' > ../common/js/src/envs/local.json && rm -rf ./dist && ./scripts/put-redirects.sh && OEB_ENV=production webpack --mode production", "lint": "prettier --write '{src,scripts}/**/*'", "update-wasm": "wasm-pack build --target bundler --release --out-dir pkgbundler wasm && wasm-pack build --target nodejs --release --out-dir pkgnodejs wasm && ts-node scripts/generateSrcWasm.ts", "check-ts": "tsc -p . --noEmit" diff --git a/front/src/components/App/ConnectionProvider/Contract/tasks.ts b/front/src/components/App/ConnectionProvider/Contract/tasks.ts index 0059bfe7..b5a40647 100644 --- a/front/src/components/App/ConnectionProvider/Contract/tasks.ts +++ b/front/src/components/App/ConnectionProvider/Contract/tasks.ts @@ -20,9 +20,9 @@ export const buildConnection = async (api: ApiPromise, env: EnvContract): Promis const forwarderContract = getForwarderContract(api, env.forwarderAddress) const codec = createType( - "emo_Bases", + "Option", (await queryContract(storageContract, "getEmoBases")).toU8a() - ) + ).unwrap() const emoBases = buildEmoBases(codec) @@ -40,14 +40,14 @@ export const buildConnection = async (api: ApiPromise, env: EnvContract): Promis const buildConnectionQuery = (storageContract: ContractPromise): Connection["query"] => ({ deckFixedEmoBaseIds: async () => createType( - "Vec", + "Option>", (await queryContract(storageContract, "getDeckFixedEmoBaseIds")).toU8a() - ), + ).unwrap(), deckBuiltEmoBaseIds: async () => createType( - "Vec", + "Option>", (await queryContract(storageContract, "getDeckBuiltEmoBaseIds")).toU8a() - ), + ).unwrap(), matchmakingGhosts: async (band) => createType( "Option>",