diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 045fb8c..33ec0fd 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -22,9 +22,6 @@ jobs: - name: Checkout source code uses: actions/checkout@v3 - - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v1 - - name: Run cargo fmt uses: actions-rs/cargo@v1 with: @@ -38,9 +35,7 @@ jobs: args: --all-targets -- --no-deps -D warnings - name: Run unit tests - uses: actions-rs/cargo@v1 - with: - command: test + run: make test build: name: Build the contract @@ -50,23 +45,5 @@ jobs: - name: Checkout source code uses: actions/checkout@v3 - - name: Cache Crates - uses: actions/cache@v3 - with: - path: ~/.cargo - key: ${{ runner.os }}-contract-build-env-${{ hashFiles('rust-toolchain.toml') }} - - - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v1 - - - name: Install cargo contract - uses: actions-rs/cargo@v1 - with: - command: install - args: --locked cargo-contract - - name: Build contract - uses: actions-rs/cargo@v1 - with: - command: contract - args: build --release + run: make build diff --git a/Cargo.lock b/Cargo.lock index 8d70240..fd75b89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -31,15 +31,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "bitvec" @@ -79,12 +73,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" [[package]] name = "cfg-if" @@ -94,9 +85,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -170,15 +161,15 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -193,16 +184,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" -dependencies = [ - "libc", - "windows-sys", -] - [[package]] name = "fnv" version = "1.0.7" @@ -227,9 +208,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -239,9 +220,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "humantime" @@ -277,9 +258,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -331,7 +312,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.39", + "syn 2.0.55", ] [[package]] @@ -388,7 +369,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.55", ] [[package]] @@ -403,7 +384,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.55", "synstructure", ] @@ -478,12 +459,12 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys", ] @@ -498,63 +479,57 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] [[package]] name = "libc" -version = "0.2.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" - -[[package]] -name = "linux-raw-sys" -version = "0.4.11" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec", "bitvec", @@ -566,11 +541,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.2", "proc-macro2", "quote", "syn 1.0.109", @@ -589,23 +564,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] [[package]] name = "psp22" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "701aea3ff70bbecb49f4a664d25292076f13bbe5592406e2ca4bddf448c37fe0" +checksum = "5a9bdae21c2e17b9501b2c3f8597a679cfbe2f81ec5432091bd8d4b156f66194" dependencies = [ "ink", "parity-scale-codec", @@ -614,9 +599,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -629,9 +614,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "regex" -version = "1.10.2" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -641,9 +626,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -652,9 +637,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rlibc" @@ -662,24 +647,11 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" -[[package]] -name = "rustix" -version = "0.38.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "scale-bits" @@ -712,7 +684,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27873eb6005868f8cc72dcfe109fae664cf51223d35387bc2f28be4c28d94c47" dependencies = [ "darling", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -738,7 +710,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" dependencies = [ "darling", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -746,9 +718,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "788745a868b0e751750388f4e6546eb921ef714a4317fa6954f7cde114eb2eb7" dependencies = [ "bitvec", "cfg-if", @@ -760,11 +732,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "7dc2f4e8bc344b9fc3d5f74f72c2e55bfc38d28dc2ebc69c194a3df424e4d9ac" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -790,29 +762,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.192" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.55", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -842,9 +814,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "static_assertions" @@ -877,9 +849,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" dependencies = [ "proc-macro2", "quote", @@ -888,14 +860,13 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "285ba80e733fac80aa4270fbcdf83772a79b80aa35c97075320abfee4a915b06" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", - "unicode-xid", + "syn 2.0.55", ] [[package]] @@ -906,18 +877,18 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" @@ -930,6 +901,17 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + [[package]] name = "typenum" version = "1.17.0" @@ -942,12 +924,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "version_check" version = "0.9.4" @@ -987,18 +963,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1011,58 +987,58 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] [[package]] -name = "wrapped_azero" -version = "0.1.0" +name = "wrapped-azero" +version = "1.0.0" dependencies = [ "ink", "parity-scale-codec", @@ -1081,6 +1057,6 @@ dependencies = [ [[package]] name = "xxhash-rust" -version = "0.8.7" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9828b178da53440fa9c766a3d2f73f7cf5d0ac1fe3980c1e5018d899fd19e07b" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" diff --git a/Cargo.toml b/Cargo.toml index aba4cb1..02c71e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wrapped-azero" -version = "0.1.0" +version = "1.0.0" edition = "2021" authors = ["Cardinal"] homepage = "https://github.com/Cardinal-Cryptography/wAZERO" @@ -11,12 +11,12 @@ description = "Smart contract for AZERO coin wrapped as a PSP22 token" exclude = [ ".github/*" ] [dependencies] -ink = { version = "4.3", default-features = false } +ink = { version = "=4.3.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.9", default-features = false, features = ["derive"], optional = true } -psp22 = { version = "0.2", default-features = false } +psp22 = { version = "=0.2.2", default-features = false } [lib] path = "lib.rs" @@ -29,4 +29,5 @@ std = [ "scale-info/std", "psp22/std", ] +contract = [] ink-as-dependency = [] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..23bd583 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.PHONY: build +build: + @docker run --rm \ + --name ink-dev \ + --volume "$(shell pwd)":/code \ + public.ecr.aws/p6e8q1z1/ink-dev:2.1.0 \ + cargo contract build --release --features "contract" + +.PHONY: test +test: + @docker run --rm \ + --name ink-dev \ + --volume "$(shell pwd)":/code \ + public.ecr.aws/p6e8q1z1/ink-dev:2.1.0 \ + cargo test --features "contract" diff --git a/README.md b/README.md index 3620c5b..8b73406 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,69 @@ -# wAZERO -ink! smart contract for AZERO wrapped as a PSP22 token +# Wrapped AZERO + +This repository contains an [ink!][ink] smart contract for [Aleph Zero][aleph] blockchain which enables wrapping the native chain coin (AZERO) into a fungible token following [PSP22][psp22] standard. + +The contract is deployed to both test and main networks under the following addresses: + - Aleph Zero Mainnet: `[TODO]` + - Aleph Zero Testnet: `[TODO]` + +The [`artifacts`][artifacts] folder contains the exact compiled binary that has been deployed, as well as all other compilation artifacts for verification purposes. + +The contents of this repository has been published to [crates.io][wazero-crates] to allow for easy integration from other projects. + +## How to interact with Wrapped AZERO from other contracts + +1. Add the [wrapped-azero][wazero-crates] dependency in your project's `Cargo.toml`: +```TOML +wrapped-azero = { version = "1.0", default-features = false } +# ... +[features] +# ... +std = [ + # ... + "wrapped-azero/std", +] + +``` + +2. To call `deposit` and `withdraw` methods from your contract, use [`contract_ref`][contract_ref] macro with `WrappedAZERO` trait: +```rust +use ink::{codegen::TraitCallBuilder, contract_ref}; +use wrapped_azero::{WrappedAZERO, MAINNET}; + +let mut wazero: contract_ref!(WrappedAZERO) = MAINNET.into(); +wazero.withdraw(amount); // returns Result<(), PSP22Error> + +// Deposit call must be composed manually to be able to attach AZERO transfer +wazero.call_mut().deposit().transferred_value(amount).invoke(); // returns Result<(), PSP22Error> + +``` + +3. To call regular PSP22 methods (transfers, balances, approvals) from your contract, use [`contract_ref`][contract_ref] macro with `PSP22` trait: +```rust +use ink::contract_ref; +use ink::prelude::vec; +use wrapped_azero::{PSP22, MAINNET}; + +let mut wazero: contract_ref!(PSP22) = MAINNET.into(); +let balance = wazero.balance_of(some_account); +wazero.transfer(recipient, value, vec![]); // returns Result<(), PSP22Error> +``` + +## How to interact with Wrapped AZERO manually via web interface + +1. Go to [Contracts UI][contracts-ui]. +2. Select "Aleph Zero" (or "Aleph Zero Testnet") from the networks menu in top left corner. +3. Choose "Add New Contract" and then "Use On-Chain Contract Address". +4. Paste the Mainnet (Testnet) address listed above. +5. Choose any name you like and use the [metadata file][metadata] from `artifacts` folder. +6. Choose the caller and the method to call. For read-only methods (like `psp22::balanceOf`) you will see the response immediately. For other methods fill in the parameters (leave all the limits with their default values) and sign the transaction (you need to have Aleph Zero Signer or similar browser extension connected with Contracts UI). + +[traits]: ./traits.rs +[artifacts]: ./artifacts +[metadata]: ./artifacts/wrapped_azero.json +[wazero-crates]: https://crates.io/crates/wrapped-azero +[aleph]: https://alephzero.org/ +[ink]: https://use.ink +[psp22]: https://github.com/inkdevhub/standards/blob/master/PSPs/psp-22.md +[contract_ref]: https://paritytech.github.io/ink/ink/macro.contract_ref.html +[contracts-ui]: https://contracts-ui.substrate.io \ No newline at end of file diff --git a/RELEASE_TODO.md b/RELEASE_TODO.md new file mode 100644 index 0000000..a65abbb --- /dev/null +++ b/RELEASE_TODO.md @@ -0,0 +1,10 @@ +The release procedure: + +1. Compile the current version of the crate with `make build`. +2. Deploy contracts to Testnet and Mainnet. +3. Prepare a release PR which: + a. Inserts deployed addresses in `traits.rs` and `README.md`, + b. Updates `.contract`, `.json` and `.wasm` files in `artifacts`, + c. Deletes this file. +4. Merge the release PR and tag the resulting commit with `1.0.0`. +5. Publish to crates.io \ No newline at end of file diff --git a/artifacts/wrapped_azero.contract b/artifacts/wrapped_azero.contract new file mode 100644 index 0000000..e515e14 --- /dev/null +++ b/artifacts/wrapped_azero.contract @@ -0,0 +1 @@ +{"source":{"hash":"0xfc5b9a47f139db14f0101d114d6287c9a18e8856dd4fc35d41ae9c89950af900","language":"ink! 4.3.0","compiler":"rustc 1.76.0","wasm":"0x0061736d0100000001510e60027f7f0060037f7f7f0060017f0060047f7f7f7f017f60027f7f017f60000060037f7f7f017f60027e7e0060037f7e7e0060047f7f7f7f006000017f60037e7e7f0060017f017f60057f7f7f7e7e0002d8010b057365616c310b6765745f73746f726167650003057365616c301176616c75655f7472616e736665727265640000057365616c3005696e7075740000057365616c300663616c6c65720000057365616c300f686173685f626c616b65325f3235360001057365616c30087472616e736665720003057365616c300d6465706f7369745f6576656e740009057365616c320b7365745f73746f726167650003057365616c310d636c6561725f73746f726167650004057365616c300b7365616c5f72657475726e000103656e76066d656d6f727902010210032d2c0606000100010000020000020a02010100010001010b070205000700000005080c020d0408020205040000000608017f01418080040b0711020463616c6c0028066465706c6f7900310a866c2c2b01017f037f2002200346047f200005200020036a200120036a2d00003a0000200341016a21030c010b0b0b8e0101017f20002d00042103200041003a0004027f0240200304402001200041056a2d00003a00004101200028020022002802042203200241016b2202490d021a200141016a200028020022012002100a1a0c010b41012000280200220028020422032002490d011a2001200028020022012002100a1a0b2000200320026b3602042000200120026a36020041000b0bbf0101057f230041306b2202240002402000280204220420002802082203490d00200028020021052002410036020c2002200420036b22043602082002200320056a220536020420012802002001280204200241046a2206100d20012802082006100e200228020c220120022802084b0d00200241046a220620022802042001100f2002410036022c20022004360228200220053602242006200241246a10102003200228022c6a22012003490d0020002001360208200241306a24000f0b000b1000200120021013200220002001101b0b210020002d00004504402001410010270f0b200141011027200041016a200110100bed0101077f230041406a22032400200341186a22044200370300200341106a22054200370300200341086a22064200370300200342003703000240200241214f0440200341386a22074200370300200341306a22084200370300200341286a220942003703002003420037032020012002200341206a1004200420072903003703002005200829030037030020062009290300370300200320032903203703000c010b200320012002100a1a0b20002003290300370000200041186a200341186a290300370000200041106a200341106a290300370000200041086a200341086a290300370000200341406b24000b0a00200120004120101b0bbf0101057f230041306b2202240002402000280204220420002802082203490d00200028020021052002410036020c2002200420036b22043602082002200320056a220536020420012802002001280204200241046a2206100d200128020820061010200228020c220120022802084b0d00200241046a220620022802042001100f2002410036022c20022004360228200220053602242006200241246a10102003200228022c6a22012003490d0020002001360208200241306a24000f0b000b6b01047f230041106b2201240002402000280204220320002802082202490d00200028020021042001410036020c2001200320026b3602082001200220046a3602044103200141046a101320022002200128020c6a22024b0d0020002002360208200141106a24000f0b000b7401017f230041106b2202240002402000413f4d04402001200041027410270c010b200041ffff004d0440200220004102744101723b010e20012002410e6a4102101b0c010b200041ffffffff034d04402000410274410272200110250c010b2001410310272000200110250b200241106a24000b8d0202047f047e230041206b22032400420121060240200128020422024120490d002001200241206b36020420012001280200220241206a360200200341086a210420012802042205411049047e4201052001200541106b36020420012001280200220141106a360200200141086a29000021072001290000210842000b21092004200837030820042009370300200441106a20073703002003290308a70d00200341186a2903002106200041286a200329031037030020002002290000370008200041306a2006370300200041206a200241186a290000370000200041186a200241106a290000370000200041106a200241086a290000370000420021060b20002006370300200341206a24000b6d01017f230041106b2201240020014180800136020c419482042001410c6a1003200041958204290000370001200041096a419d8204290000370000200041116a41a58204290000370000200041186a41ac82042900003700002000419482042d00003a0000200141106a24000b3602017f027e230041106b2200240020001017200041086a290300210120002903002102200041106a2400410541042001200284501b0b4c02017f017e230041206b2201240020014200370308200142003703002001411036021c20012001411c6a1001200129030021022000200129030837030820002002370300200141206a24000b4801027f230041106b22032400200341086a20024100101d20032802082104200328020c20012002100a2101200020023602082000200136020420002004360200200341106a24000bcf0202037f027e23004190016b22032400200341186a200141186a290000370300200341106a200141106a290000370300200341086a200141086a290000370300200341286a200241086a290000370300200341306a200241106a290000370300200341386a200241186a2900003703002003200129000037030020032002290000370320200341c48104360240200341c4006a200341c000100a1a2003428080013702880120034194820436028401200341406b20034184016a103302402003280288012204200328028c012201490d0020032802840121022003200420016b22043602840120022001200120026a220120034184016a1000210220042003280284012205490d00027e0240024020020e0400030301030b2005410f4d0d0220012900002106200141086a2900000c010b42000b2107200020063703002000200737030820034190016a24000f0b000bf90102047f027e230041306b220224002002410c6a200141086a290000370200200241146a200141106a2900003702002002411c6a200141186a290000370200200241c88104360200200220012900003702042002428080013702282002419482043602242002200241246a1035024020022802282204200228022c2201490d00200228022421032002200420016b220436022420032001200120036a2201200241246a10002103200420022802242205490d00027e0240024020030e0400030301030b2005410f4d0d0220012900002106200141086a2900000c010b42000b21072000200637030020002007370308200241306a24000f0b000b4801027f024002402000280208220320026a22042003490d00200420002802044b0d00200420036b2002470d01200028020020036a20012002100a1a200020043602080f0b000b000bb30301067f230041206b220324000240024020012802042204450d00200128020022052d000021022001200441016b3602042001200541016a36020002400240024002400240200241037141016b0e03020301000b200241027621020c030b2004410549200241034b720d03200528000121022001200441056b3602042001200541056a36020020024180808080044f0d020c030b200341196a20023a0000200341013a001820032001360214200341003b011c200341146a2003411c6a4102100b0d0220032f011c220241ff014d0d02200241027621020c010b200341196a20023a0000200341013a0018200320013602142003410036021c200341146a2003411c6a4104100b0d01200328021c220241808004490d01200241027621020b024020012802042002490d00200341086a20024101101d200128020422052002490d0020032802082104200328020c200128020022062002100a21072001200520026b3602042001200220066a3602002004418080808078460d002000200236020820002007360204200020043602000c020b20004180808080783602000c010b20004180808080783602000b200341206a24000b4400024002402001450440410121020c010b20014100480d012002450440419082042d00001a0b4101200110322202450d010b20002002360204200020013602000f0b000bdd0101057f230041306b2203240002402001280204220520012802082204490d00200128020021062003410036020c2003200520046b22053602082003200420066a220636020420022802002002280204200341046a2207100d200720022802084110101b200328020c220220032802084b0d00200341046a220720032802042002100f2003410036022c20032005360228200320063602242007200341246a10102004200328022c6a22022004490d00200141086a22042002360200200041086a200428020036020020002001290200370200200341306a24000f0b000b2a01017f230041106b220324002003200137030820032000370300200220034110101b200341106a24000b4c01017f230041106b220224002002419482043602044194820441003a0000200242808081801037020820002001200241046a101f200228020c2202418180014f0440000b410020021026000b9a0101027f230041106b22012400200141808001360208200141948204360204024041958204027f200028020022024181808080784704404194820441003a000041002002418080808078460d011a4195820441013a00002001410236020c20002802042000280208200141046a100d200128020c220041818001490d02000b4194820441013a000041010b3a0000410221000b410020001026000b1300419482044181023b0100410141021026000bfd0101037f230041106b22022400200241808001360208200241948204360204024002400240024002402001280200220441074704404194820441003a0000200441064604404195820441003a0000410221010c060b4195820441013a0000024002400240200441016b0e050600010204050b4196820441023a00000c060b410321014196820441033a00000c060b4196820441043a00000c040b419482044181023b0100410221010c040b410521030b4196820420033a00002002410336020c200141086a2802002001410c6a280200200241046a100d200228020c220141818001490d02000b4196820441013a00000b410321010b200020011026000b8f0101047f230041106b220224002002428080013702082002419482043602044100200241046a1025024020022802082203200228020c2204490d00200228020421052002410036020c2002200320046b3602082002200420056a36020420002001200241046a101f200228020c220320022802084b0d00200520042002280204200310071a200241106a24000f0b000b2601017f230041106b220224002002200036020c20012002410c6a4104101b200241106a24000b0d0020004194820420011009000b2d01017f2000280208220220002802044904402000200241016a360208200028020020026a20013a00000f0b000b803902087f097e230041a0046b220024002000418080013602a80241948204200041a8026a100202400240024020002802a8022205418180014f0d000240024020054104490d002000419882043602c0032000200541046b22063602c403419782042d00002102419682042d00002103419582042d000021040240024002400240024002400240419482042d0000220141164704400240200141344704402001413d470440200141cd00460d05200141d400460d07200141dd00470440200141e500460d05200141f200460d032001419601460d0a200141b201460d09200141db01460d07200141fe01460d0b200141f50147200441ff017141f1014772200341ff017141890147200241d8014772720d0c41808080807821020c0d0b200441ff0171418f0147200341ff017141ca0047722002413847200641104972720d0b200041a882043602c00341a08204290200220842388641988204290200220c42088884210b2008420888210a200ca7210141818080807821020c0c0b200441ff0171412647200341ff0171411b4772200241d40147720d0a41828080807821020c0b0b200441ff0171412047200341ff017141db004772200241e50147720d0941838080807821020c0a0b200441ff017141f10047200341ff017141b7014772200241820147720d0841848080807821020c090b200441ff0171412d47200341ff017141f8014772200241c20147720d0741858080807821020c080b200441ff017141e80047200341ff0171413847722002412f472006411f4d72720d06200041e8036a41b08204290200370300200041a882042902003703e00341a1820435000041a7820431000042308641a582043300004220868484210a41998204290000210b419882042d0000210141868080807821020c070b200441ff017141c70047200341ff017141d90147722002412147200541c4006b41404f72720d05200041e8036a41b08204290200370300200041a882042902003703e00341a1820435000041a7820431000042308641a582043300004220868484210a41c08204290200210841b88204290200210c41998204290000210b41d48204280200210341cc8204290200210d41c882042802002104419882042d0000210141878080807821020c060b200441ff0171412047200341ff017141f9014772200241f50147200641204972720d04200041b0026a41b08204290200370300200041a882042902003703a802200541346b2202416f4b0d0441a58204330000210941a78204310000210e41a18204350000210a41998204290000210b419882042d00002101200041c882043602c003200020023602c40341c08204290200210841b88204290200210c200041b8016a200041c0036a101c20002802b8012204418080808078460d04200a200e42308620094220868484210a200041e8036a200041b0026a290300370300200020002903a8023703e00320002902bc01210d41888080807821020c050b200441ff017141b30147200341ff017141c7014772200241ee0047200641204972720d03200041b0026a41b08204290200370300200041a882042902003703a802200541c4006b2201415f4b2001411049720d0341a58204330000210a41a78204310000210f41a18204350000211041998204290000210b419882042d0000210141c08204290200210841b88204290200210c41d48204280200210341cc8204290200210d41c882042802002104200041e882043602c0032000200541d4006b3602c40341e08204290200210e41d882042902002109200041b8016a200041c0036a101c20002802b8012202418080808078460d032010200f423086200a4220868484210a200041e8036a200041b0026a290300370300200020002903a8023703e00320002902bc01210f0c040b200441ff0171410f47200341ff0171411b4772200241bd0147720d02200041a8026a200041c0036a101420002903a8024200520d02200041e8036a200041c8026a2903003703002000200041c0026a2903003703e003200041b8026a290300220842388620002903b002220942088884210b2008420888210a200041d8026a2903002108200041d0026a290300210c2009a72101418a8080807821020c030b200441ff017141d60147200341ff017141b5014772200241fa0047720d01200041a8026a200041c0036a101420002903a8024200520d01200041e8036a200041c8026a2903003703002000200041c0026a2903003703e003200041b8026a290300220842388620002903b002220942088884210b2008420888210a200041d8026a2903002108200041d0026a290300210c2009a72101418b8080807821020c020b200441ff017141cb0147200341ff017141d7004772200241d50147720d00200041a8026a200041c0036a101420002903a8024200520d00200041e8036a200041c8026a2903003703002000200041c0026a2903003703e003200041b8026a290300220842388620002903b002220942088884210b2008420888210a200041d8026a2903002108200041d0026a290300210c2009a72101418c8080807821020c010b1022000b200041d0016a200041e8036a29030037030020004180026a200e370300200041e0016a2008370300200020002903e0033703c801200020093703f8012000200c3703d8012000200f37028c022000200236028802200020033602f4012000200d3702ec01200020043602e8012000200a420886200b42388884220c3703c00120002001ad42ff0183200b42088684220b3703b8012000428080013702ac022000419482043602a8024100200041a8026a102520002802ac02220520002802b0022201490d0020002802a80221032000200520016b22053602a80220032001200120036a2201200041a8026a1000200520002802a802220349722003410f4d720d0041082103200129000021082000200141086a29000022093703a00220002008370398020240027f02402000027f02400240024002400240024002400240024002400240024002400240410920024180808080787322012001410d4f1b41016b0e0c0c0102030405060708090a0b000b200041a8026a1015200041206a1017410021010240024020002000290320220b200041286a290300220c8450047f41000541002102200041186a41394100101d20002802182104200028021c220341cc81044139100a1a2008200b7c220a20085422052005ad2009200c7c7c220820095420082009511b0d01200041a0026a220420083703002000200a37039802200041086a200041a8026a2202101a2002427f20002903082209200b7c2208200820095422022002ad200041106a2903002209200c7c7c220820095420082009511b22021b427f200820021b102941d800102a220341003b01002003200b370348200341013a0022200341d0006a200c370300200320002900a8023700232003412b6a200041b0026a290000370000200341336a200041b8026a2900003700002003413b6a200041c0026a29000037000020042903002109200029039802210841010b22023602e803200020033602e403200020023602e003200041e0036a102b200820091024410621020c010b410121010b200041393602b402200020033602b002200020043602ac020c120b101641ff01714105470d10200041a8026a220041b08104410d101820001021000b101641ff01714105470d0f200041a8026a220041bd81044106101820001021000b101641ff01714105470d0e230041106b220024002000419482043602004194820441003a000020004280808180103702042000410c3a000f20002000410f6a4101101b20002802082200418180014f0440000b410020001026000b101641ff01714105470d0d200820091020000b101641ff01714105470d0c230041406a22012400200141286a200041b8016a220241086a290000370200200141306a200241106a290000370200200141386a200241186a290000370200200120004198026a36021c20012002290000370220200141086a200141206a101a20012903082109200041c8006a2202200141106a29030037030820022009370300200141406b24002000290348200041d0006a2903001020000b101641ff01714105470d0b230041e0006b22012400200120004198026a36021c200141086a200141206a200041b8016a41c000100a200141406b101920012903082109200041d8006a2202200141106a29030037030820022009370300200141e0006a24002000290358200041e0006a2903001020000b101641ff01714105470d0a200041b0026a200041b8016a4130100a2101200041e0026a2004360200200041e4026a200041ec016a2202290200370200200041ec026a200241086a280200360200200020004198026a3602a802200041d8026a2903002109200041d0026a2903002108200041e0036a22021015200041c0036a2002200120082009102c024020002802c00322014106470440200041e8036a200041cc036a280200360200200020002902c4033703e0030c010b200041a8036a200041cc036a280200360200200020002902c4033703a003200041a0036a102b200029039802200041a0026a29030010240b200041b4026a200041e8036a280200360200200020002903e0033702ac02200020013602a8022001410647200041a8026a1023000b101641ff01714105470d09200041b0026a200041b8016a41d000100a210320004180036a200236020020004184036a2000418c026a22012902003702002000418c036a200141086a280200360200200041f8026a2903002109200041f0026a2903002108200020004198026a3602a802200041c0036a1015410021042003200041d0026a2201102d21050240024002402008200984500440410821020c010b4108210220050d00200041c0036a2003102d0d0120004188016a2003200041c0036a101941022102200029038801220c200854220420004190016a290300220b2009542009200b511b0d02200041f8006a2003101a410121022000290378220d200854220520004180016a290300220a2009542009200a511b0d0202402008200c852009200b858450450440200041f8036a200041d0016a290300370300200041f0036a200041c8016a290300370300200041e8036a200041c0016a29030037030020004188046a200041c8036a29000037030020004190046a200041d0036a29000037030020004198046a200041d8036a290000370300200020002903b8013703e003200020002900c00337038004200041e0036a4200200c20087d220e200c200e54200b20097d2004ad7d220e200b56200b200e511b22021b4200200e20021b102e0c010b200041f8036a200041d0016a290300370300200041f0036a200041c8016a290300370300200041e8036a200041c0016a29030037030020004188046a200041c8036a29000037030020004190046a200041d0036a29000037030020004198046a200041d8036a290000370300200020002903b8013703e003200020002900c00337038004200041e0036a102f0b02402008200d852009200a85845045044020034200200d20087d220e200d200e54200a20097d2005ad7d220d200a56200a200d511b22021b4200200d20021b10290c010b200310300b200041e8006a2001101a2001427f2000290368220a20087c220d200a200d5622022002ad200041f0006a290300220a20097c7c220d200a54200a200d511b22021b427f200d20021b102941b001102a22024200200c20087d220a200a200c56200b20097d2004ad7d220c200b56200b200c511b22031b370308200241013a000020024180023b0158200241106a4200200c20031b370300200220002903b801370318200241206a200041c0016a2203290300370300200241286a200041c8016a2204290300370300200241306a200041d0016a2205290300370300200220002900c003370038200241406b200041c8036a290000370000200241c8006a200041d0036a290000370000200241d0006a200041d8036a290000370000200241fa006a41013a0000200241a0016a2008370300200241a8016a2009370300200241f2006a2005290300370000200241ea006a2004290300370000200241e2006a2003290300370000200241da006a20002903b801370000200241fb006a200129000037000020024183016a200141086a2900003700002002418b016a200141106a29000037000020024193016a200141186a290000370000410221040b200041ac036a2004360200200041a8036a2002360200200020043602a4030c080b200041a0036a200041c0036a200120082009102c20002802a00322024106460d070b200041e8036a200041ac036a280200360200200020002902a4033703e00341010c070b101641ff01714105470d08200020004198026a3602e003200041e8036a200041b8016a4130100a210320004190046a290300210920004188046a2903002108200041c0036a22041015410021024108210120042003102d45044002402008200984500440200041c0026a200041d8036a290000370300200041b8026a200041d0036a290000370300200041b0026a200041c8036a290000370300200041d0026a200041c0016a290300370300200041d8026a200041c8016a290300370300200041e0026a200041d0016a290300370300200020002900c0033703a802200020002903b8013703c802200041a8026a102f0c010b200041c0026a200041d8036a290000370300200041b8026a200041d0036a290000370300200041b0026a200041c8036a290000370300200041d0026a200041c0016a290300370300200041d8026a200041c8016a290300370300200041e0026a200041d0016a290300370300200020002900c0033703a802200020002903b8013703c802200041a8026a20082009102e0b41d800102a22012008370308200141013a0000200141106a2009370300200120002900c003370018200141206a200041c8036a290000370000200141286a200041d0036a290000370000200141306a200041d8036a290000370000200120002903b801370338200141406b200041c0016a290300370300200141c8006a200041c8016a290300370300200141d0006a200041d0016a290300370300410121020b200020023602b0020c0a0b101641ff01714105470d07200020004198026a3602e003200041e8036a200041b8016a4130100a210220004190046a290300210820004188046a290300210b200041c0036a2201101520012002102d2103410821012000027f41002008200b84500d001a410020030d001a20004198016a200041c0036a20021019200041a0016a2903002109200029039801210c200041c0026a200041d8036a2202290000370300200041b8026a200041d0036a2203290000370300200041b0026a200041c8036a2204290000370300200041d0026a200041c0016a2205290300370300200041d8026a200041c8016a2206290300370300200041e0026a200041d0016a2207290300370300200020002900c0033703a802200020002903b8013703c802200041a8026a427f200b200c7c220b200b200c5422012001ad200820097c7c220820095420082009511b22011b2209427f200820011b2208102e41d800102a22012009370308200141013a0000200141106a2008370300200120002900c003370018200141206a2004290000370000200141286a2003290000370000200141306a2002290000370000200120002903b801370338200141406b2005290300370300200141c8006a2006290300370300200141d0006a200729030037030041010b22023602b0020c090b101641ff01714105470d06200020004198026a3602e003200041e8036a200041b8016a4130100a210220004190046a290300210920004188046a290300210b200041c0036a220110154100210320012002102d2104410821012000027f41002009200b84500d001a410020040d001a200041a8016a200041c0036a2002101920002903a801220c200b542201200041b0016a2903002208200954200820095122021b0d024200200820097d2001ad7d220a200c200b7d220d200c562008200a542008200a511b22011b210a4200200d20011b210d0240200b200c54200820095620021b450440200041c0026a200041d8036a290000370300200041b8026a200041d0036a290000370300200041b0026a200041c8036a290000370300200041d0026a200041c0016a290300370300200041d8026a200041c8016a290300370300200041e0026a200041d0016a290300370300200020002900c0033703a802200020002903b8013703c802200041a8026a102f0c010b200041c0026a200041d8036a290000370300200041b8026a200041d0036a290000370300200041b0026a200041c8036a290000370300200041d0026a200041c0016a290300370300200041d8026a200041c8016a290300370300200041e0026a200041d0016a290300370300200020002900c0033703a802200020002903b8013703c802200041a8026a200d200a102e0b41d800102a2201200d370308200141013a0000200141106a200a370300200120002900c003370018200141206a200041c8036a290000370000200141286a200041d0036a290000370000200141306a200041d8036a290000370000200120002903b801370338200141406b200041c0016a290300370300200141c8006a200041c8016a290300370300200141d0006a200041d0016a29030037030041010b22023602a803200020013602a403200020023602a003200041a0036a102b200029039802200041a0026a290300102441060c020b101641ff01714105460d040c050b4101210341020b3602a8022003200041a8026a1023000b200041b8036a200041ac036a280200360200200020002902a4033703b003200041b0036a102b200029039802200041a0026a29030010244106210241000b2101200041b4026a200041e8036a280200360200200020002903e0033702ac020c020b200041a8026a1015027f0240027f2000027f200b200c845004404108210141000c010b200041386a200041a8026a101a41012000290338220d200b542201200041406b290300220a200c54200a200c511b0d011a0240200b200d85200a200c858450450440200041a8026a4200200d200b7d220e200d200e54200a200c7d2001ad7d220d200a56200a200d511b22011b4200200d20011b10290c010b200041a8026a10300b200042002009200c7d2008200b54ad7d220a20082008200b7d220d542009200a542009200a511b22011b3703a00220004200200d20011b3703980241d800102a2201200b37034820014180023b0100200141003a0022200141d0006a200c370300200120002902a8023700022001410a6a200041b0026a290200370000200141126a200041b8026a2902003700002001411a6a200041c0026a29020037000041010b22023602c803200020013602c403200020023602c0032000428080013702e4032000419482043602e003200041a8026a200041e0036a101020002802e403220420002802e8032201490d0320002802e0032102200041003602e8032000200420016b3602e4032000200120026a3602e003200b200c200041e0036a101f20002802e803220420002802e4034b0d032002200120002802e00320041005450d01200041306a411e4100101d200028023021032000280234220141928104290000370000200141166a41a88104290000370000200141106a41a28104290000370000200141086a419a810429000037000041000b210441010c010b200041c0036a102b200029039802200041a0026a29030010244106210441000b21022000411e3602b402200020013602b002200020033602ac02200020043602a8022002200041a8026a1023000b000b200020023602a8022001200041a8026a1023000b200020013602ac02200020023602a802200041a8026a2201102b200029039802200041a0026a2903001024200041063602a802410020011023000bd20101037f230041306b220324002003410c6a200041086a290000370200200341146a200041106a2900003702002003411c6a200041186a290000370200200341c88104360200200320002900003702042003428080013702282003419482043602242003200341246a1035024020032802282204200328022c2200490d00200328022421052003410036022c2003200420006b3602282003200020056a36022420012002200341246a101f200328022c220420032802284b0d00200520002003280224200410071a200341306a24000f0b000b1900419082042d00001a4108200010322200044020000f0b000be00802107f047e230041c0016b22042400024020002802082201450d0020044199016a210c2004418f016a2106200441f8006a21072004410a6a210d200441e8006a210e200441d0006a2108200441206a210920002802042100200141d8006c210a20044187016a210f200441a0016a2110034020002d000022054102460d01200041d0006a2903002111200041106a290300211220002903482113200029030821142004200041186a22014130100a210202402005410171450440200f2012370000200241f0006a20113703002007200041016a220528000036000020062001290000370000200741036a200541036a280000360000200641086a200141086a2f00003b00002002201437007f20022013370368200c200d4121100a1a200242013703600c010b20082009290300370300200241c8006a200141186a290300370300200241406b200141106a290300370300200241386a200141086a290300370300200841086a200941086a29030037030020022001290300370330200e200241306a4130100a1a200241b0016a201237030020102011370300200220143703a8012002201337039801200242003703600b230041b0016b22012400200141086a200241e0006a41e000100a1a20014280800137027020014194820436026c024002402001027f2001290308500440200141ec006a1012200141a8016a200141f4006a2802003602002001200129026c3703a00120014188016a2202200141a0016a220541908004101e2001200141106a36029c0120014117360298012001419c800436029401200220014194016a101120014180016a220220014190016a28020036020020012001290288013703782001200141306a3602a801200141193602a401200141b380043602a001200141f8006a20051011200128027c220320022802002202490d0220012802782105200320026b0c010b200141ec006a1012200141a8016a200141f4006a2802003602002001200129026c3703a00120014188016a2202200141a0016a220541dc8004101e2001200141206a36029c012001411636029801200141e8800436029401200220014194016a100c20014180016a220220014190016a28020036020020012001290288013703782001200141c1006a3602a801200141143602a401200141fe80043602a001200141f8006a2005100c200128027c220320022802002202490d0120012802782105200320026b0b22033602a4012001200220056a220b3602a001027f20012903085004402003450d02200b41003a0000200141013602a801200141106a200141a0016a22031010200141306a20031010200141d0006a0c010b2003450d01200b41013a0000200141013602a801200141206a200141a0016a2203100e200141c1006a2003100e200141106a0b2203290300200341086a290300200141a0016a101f20012802a801220320012802a4014b0d002005200220012802a00120031006200141b0016a24000c010b000b200041d8006a2100200a41d8006b220a0d000b0b200441c0016a24000bb60302047f037e230041206b2206240020012002102d21082000027f02402003200484500440410821050c010b4108210520080d00200641106a2001101a4101200629031022092003542207200641186a290300220a2004542004200a511b0d011a024020032009852004200a85845045044020014200200920037d220b2009200b54200a20047d2007ad7d2209200a562009200a511b22051b4200200920051b10290c010b200110300b20062002101a2002427f2006290300220a20037c22092009200a5422052005ad200641086a290300220a20047c7c2209200a542009200a511b22051b427f200920051b102941d800102a22054180023b010041012107200541013a0022200520012900003700022005410a6a200141086a290000370000200541126a200141106a2900003700002005411a6a200141186a290000370000200520022900003700232005412b6a200241086a290000370000200541336a200241106a2900003700002005413b6a200241186a290000370000200541d0006a2004370300200520033703480b200020073602042000410c6a2007360200200041086a200536020041060b360200200641206a24000b4601037f027f41202102034041002002450d011a200241016b210220012d0000210320002d00002104200041016a2100200141016a210120032004460d000b200420036b0b450ba90101037f230041d0006b22032400200341c48104360200200341046a200041c000100a1a2003428080013702482003419482043602442003200341c4006a1033024020032802482204200328024c2200490d00200328024421052003410036024c2003200420006b3602482003200020056a36024420012002200341c4006a101f200328024c220420032802484b0d00200520002003280244200410071a200341d0006a24000f0b000b6301017f230041d0006b22012400200141c48104360200200141046a200041c000100a1a2001428080013702482001419482043602442001200141c4006a1033200128024c220020012802484b0440000b2001280244200010081a200141d0006a24000b8d0101017f230041306b220124002001410c6a200041086a290000370200200141146a200041106a2900003702002001411c6a200041186a290000370200200141c88104360200200120002900003702042001428080013702282001419482043602242001200141246a1035200128022c220020012802284b0440000b2001280224200010081a200141306a24000b940101017f230041106b2200240002400240101641ff01714105470d0020004180800136020c419482042000410c6a1002200028020c2200418180014f0d00200041044f0440419482042d0000419b0147419582042d000041ae014772419682042d0000419d014772419782042d000041de004772450d020b1022000b000b4200420010244194820441003b0100410041021026000ba00101027f02402001200020016a41016b410020006b7122004d0440024041888204280200220120006a22032001490d00418c82042802002003490440200041ffff036a22022000490d0320024110764000220141ffff034b0d032001411074220120024180807c716a22032001490d0341002102418c82042003360200200020016a22032001490d010b418882042003360200200121020b20020f0b000b41000b1d00200028020020011034200041046a20011010200041246a200110100b0b002000280200200110250b1400200028020020011034200041046a200110100b0b8e020100418080040b850257617a65726f3a3a417070726f76616c00000100000000000000010057617a65726f3a3a417070726f76616c3a3a6f776e657257617a65726f3a3a417070726f76616c3a3a7370656e64657257617a65726f3a3a5472616e7366657200000100000000004c00010057617a65726f3a3a5472616e736665723a3a66726f6d57617a65726f3a3a5472616e736665723a3a746f5772617070656420415a45524f3a207769746864726177206661696c65645772617070656420415a45524f77415a45524f00a1b3ef00d446c7454d617820505350323220737570706c792065786365656465642e204d617820737570706c79206c696d6974656420746f20325e3132382d312e","build_info":{"build_mode":"Release","cargo_contract_version":"3.2.0","rust_toolchain":"stable-x86_64-unknown-linux-gnu","wasm_opt_settings":{"keep_debug_symbols":false,"optimization_passes":"Z"}}},"contract":{"name":"wrapped-azero","version":"1.0.0","authors":["Cardinal"],"description":"Smart contract for AZERO coin wrapped as a PSP22 token","repository":"https://github.com/Cardinal-Cryptography/wAZERO","homepage":"https://github.com/Cardinal-Cryptography/wAZERO"},"spec":{"constructors":[{"args":[],"default":false,"docs":[],"label":"new","payable":false,"returnType":{"displayName":["ink_primitives","ConstructorResult"],"type":1},"selector":"0x9bae9d5e"}],"docs":[],"environment":{"accountId":{"displayName":["AccountId"],"type":13},"balance":{"displayName":["Balance"],"type":0},"blockNumber":{"displayName":["BlockNumber"],"type":19},"chainExtension":{"displayName":["ChainExtension"],"type":20},"hash":{"displayName":["Hash"],"type":17},"maxEventTopics":4,"timestamp":{"displayName":["Timestamp"],"type":18}},"events":[{"args":[{"docs":[],"indexed":true,"label":"owner","type":{"displayName":["AccountId"],"type":13}},{"docs":[],"indexed":true,"label":"spender","type":{"displayName":["AccountId"],"type":13}},{"docs":[],"indexed":false,"label":"amount","type":{"displayName":["u128"],"type":0}}],"docs":[],"label":"Approval"},{"args":[{"docs":[],"indexed":true,"label":"from","type":{"displayName":["Option"],"type":16}},{"docs":[],"indexed":true,"label":"to","type":{"displayName":["Option"],"type":16}},{"docs":[],"indexed":false,"label":"value","type":{"displayName":["u128"],"type":0}}],"docs":[],"label":"Transfer"}],"lang_error":{"displayName":["ink","LangError"],"type":3},"messages":[{"args":[],"default":false,"docs":[],"label":"WrappedAZERO::deposit","mutates":true,"payable":true,"returnType":{"displayName":["ink","MessageResult"],"type":4},"selector":"0xf5f189d8"},{"args":[{"label":"value","type":{"displayName":["u128"],"type":0}}],"default":false,"docs":[],"label":"WrappedAZERO::withdraw","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":4},"selector":"0x5d8f4a38"},{"args":[],"default":false,"docs":[],"label":"PSP22Metadata::token_name","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":8},"selector":"0x3d261bd4"},{"args":[],"default":false,"docs":[],"label":"PSP22Metadata::token_symbol","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":8},"selector":"0x34205be5"},{"args":[],"default":false,"docs":[],"label":"PSP22Metadata::token_decimals","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":10},"selector":"0x7271b782"},{"args":[],"default":false,"docs":[],"label":"PSP22::total_supply","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":12},"selector":"0x162df8c2"},{"args":[{"label":"owner","type":{"displayName":["AccountId"],"type":13}}],"default":false,"docs":[],"label":"PSP22::balance_of","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":12},"selector":"0x6568382f"},{"args":[{"label":"owner","type":{"displayName":["AccountId"],"type":13}},{"label":"spender","type":{"displayName":["AccountId"],"type":13}}],"default":false,"docs":[],"label":"PSP22::allowance","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":12},"selector":"0x4d47d921"},{"args":[{"label":"to","type":{"displayName":["AccountId"],"type":13}},{"label":"value","type":{"displayName":["u128"],"type":0}},{"label":"_data","type":{"displayName":["Vec"],"type":15}}],"default":false,"docs":[],"label":"PSP22::transfer","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":4},"selector":"0xdb20f9f5"},{"args":[{"label":"from","type":{"displayName":["AccountId"],"type":13}},{"label":"to","type":{"displayName":["AccountId"],"type":13}},{"label":"value","type":{"displayName":["u128"],"type":0}},{"label":"_data","type":{"displayName":["Vec"],"type":15}}],"default":false,"docs":[],"label":"PSP22::transfer_from","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":4},"selector":"0x54b3c76e"},{"args":[{"label":"spender","type":{"displayName":["AccountId"],"type":13}},{"label":"value","type":{"displayName":["u128"],"type":0}}],"default":false,"docs":[],"label":"PSP22::approve","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":4},"selector":"0xb20f1bbd"},{"args":[{"label":"spender","type":{"displayName":["AccountId"],"type":13}},{"label":"delta_value","type":{"displayName":["u128"],"type":0}}],"default":false,"docs":[],"label":"PSP22::increase_allowance","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":4},"selector":"0x96d6b57a"},{"args":[{"label":"spender","type":{"displayName":["AccountId"],"type":13}},{"label":"delta_value","type":{"displayName":["u128"],"type":0}}],"default":false,"docs":[],"label":"PSP22::decrease_allowance","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":4},"selector":"0xfecb57d5"}]},"storage":{"root":{"layout":{"struct":{"fields":[{"layout":{"struct":{"fields":[{"layout":{"leaf":{"key":"0x00000000","ty":0}},"name":"total_supply"},{"layout":{"root":{"layout":{"leaf":{"key":"0x45c746d4","ty":0}},"root_key":"0x45c746d4"}},"name":"balances"},{"layout":{"root":{"layout":{"leaf":{"key":"0x00efb3a1","ty":0}},"root_key":"0x00efb3a1"}},"name":"allowances"}],"name":"PSP22Data"}},"name":"data"}],"name":"Wazero"}},"root_key":"0x00000000"}},"types":[{"id":0,"type":{"def":{"primitive":"u128"}}},{"id":1,"type":{"def":{"variant":{"variants":[{"fields":[{"type":2}],"index":0,"name":"Ok"},{"fields":[{"type":3}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":2},{"name":"E","type":3}],"path":["Result"]}},{"id":2,"type":{"def":{"tuple":[]}}},{"id":3,"type":{"def":{"variant":{"variants":[{"index":1,"name":"CouldNotReadInput"}]}},"path":["ink_primitives","LangError"]}},{"id":4,"type":{"def":{"variant":{"variants":[{"fields":[{"type":5}],"index":0,"name":"Ok"},{"fields":[{"type":3}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":5},{"name":"E","type":3}],"path":["Result"]}},{"id":5,"type":{"def":{"variant":{"variants":[{"fields":[{"type":2}],"index":0,"name":"Ok"},{"fields":[{"type":6}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":2},{"name":"E","type":6}],"path":["Result"]}},{"id":6,"type":{"def":{"variant":{"variants":[{"fields":[{"type":7,"typeName":"String"}],"index":0,"name":"Custom"},{"index":1,"name":"InsufficientBalance"},{"index":2,"name":"InsufficientAllowance"},{"index":3,"name":"ZeroRecipientAddress"},{"index":4,"name":"ZeroSenderAddress"},{"fields":[{"type":7,"typeName":"String"}],"index":5,"name":"SafeTransferCheckFailed"}]}},"path":["psp22","errors","PSP22Error"]}},{"id":7,"type":{"def":{"primitive":"str"}}},{"id":8,"type":{"def":{"variant":{"variants":[{"fields":[{"type":9}],"index":0,"name":"Ok"},{"fields":[{"type":3}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":9},{"name":"E","type":3}],"path":["Result"]}},{"id":9,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":7}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":7}],"path":["Option"]}},{"id":10,"type":{"def":{"variant":{"variants":[{"fields":[{"type":11}],"index":0,"name":"Ok"},{"fields":[{"type":3}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":11},{"name":"E","type":3}],"path":["Result"]}},{"id":11,"type":{"def":{"primitive":"u8"}}},{"id":12,"type":{"def":{"variant":{"variants":[{"fields":[{"type":0}],"index":0,"name":"Ok"},{"fields":[{"type":3}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":0},{"name":"E","type":3}],"path":["Result"]}},{"id":13,"type":{"def":{"composite":{"fields":[{"type":14,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","AccountId"]}},{"id":14,"type":{"def":{"array":{"len":32,"type":11}}}},{"id":15,"type":{"def":{"sequence":{"type":11}}}},{"id":16,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":13}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":13}],"path":["Option"]}},{"id":17,"type":{"def":{"composite":{"fields":[{"type":14,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","Hash"]}},{"id":18,"type":{"def":{"primitive":"u64"}}},{"id":19,"type":{"def":{"primitive":"u32"}}},{"id":20,"type":{"def":{"variant":{}},"path":["ink_env","types","NoChainExtension"]}}],"version":"4"} \ No newline at end of file diff --git a/artifacts/wrapped_azero.json b/artifacts/wrapped_azero.json new file mode 100644 index 0000000..740441c --- /dev/null +++ b/artifacts/wrapped_azero.json @@ -0,0 +1,1116 @@ +{ + "source": { + "hash": "0xfc5b9a47f139db14f0101d114d6287c9a18e8856dd4fc35d41ae9c89950af900", + "language": "ink! 4.3.0", + "compiler": "rustc 1.76.0", + "build_info": { + "build_mode": "Release", + "cargo_contract_version": "3.2.0", + "rust_toolchain": "stable-x86_64-unknown-linux-gnu", + "wasm_opt_settings": { + "keep_debug_symbols": false, + "optimization_passes": "Z" + } + } + }, + "contract": { + "name": "wrapped-azero", + "version": "1.0.0", + "authors": [ + "Cardinal" + ], + "description": "Smart contract for AZERO coin wrapped as a PSP22 token", + "repository": "https://github.com/Cardinal-Cryptography/wAZERO", + "homepage": "https://github.com/Cardinal-Cryptography/wAZERO" + }, + "spec": { + "constructors": [ + { + "args": [], + "default": false, + "docs": [], + "label": "new", + "payable": false, + "returnType": { + "displayName": [ + "ink_primitives", + "ConstructorResult" + ], + "type": 1 + }, + "selector": "0x9bae9d5e" + } + ], + "docs": [], + "environment": { + "accountId": { + "displayName": [ + "AccountId" + ], + "type": 13 + }, + "balance": { + "displayName": [ + "Balance" + ], + "type": 0 + }, + "blockNumber": { + "displayName": [ + "BlockNumber" + ], + "type": 19 + }, + "chainExtension": { + "displayName": [ + "ChainExtension" + ], + "type": 20 + }, + "hash": { + "displayName": [ + "Hash" + ], + "type": 17 + }, + "maxEventTopics": 4, + "timestamp": { + "displayName": [ + "Timestamp" + ], + "type": 18 + } + }, + "events": [ + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "owner", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + }, + { + "docs": [], + "indexed": true, + "label": "spender", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + }, + { + "docs": [], + "indexed": false, + "label": "amount", + "type": { + "displayName": [ + "u128" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "Approval" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "from", + "type": { + "displayName": [ + "Option" + ], + "type": 16 + } + }, + { + "docs": [], + "indexed": true, + "label": "to", + "type": { + "displayName": [ + "Option" + ], + "type": 16 + } + }, + { + "docs": [], + "indexed": false, + "label": "value", + "type": { + "displayName": [ + "u128" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "Transfer" + } + ], + "lang_error": { + "displayName": [ + "ink", + "LangError" + ], + "type": 3 + }, + "messages": [ + { + "args": [], + "default": false, + "docs": [], + "label": "WrappedAZERO::deposit", + "mutates": true, + "payable": true, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 4 + }, + "selector": "0xf5f189d8" + }, + { + "args": [ + { + "label": "value", + "type": { + "displayName": [ + "u128" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "WrappedAZERO::withdraw", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 4 + }, + "selector": "0x5d8f4a38" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "PSP22Metadata::token_name", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 8 + }, + "selector": "0x3d261bd4" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "PSP22Metadata::token_symbol", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 8 + }, + "selector": "0x34205be5" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "PSP22Metadata::token_decimals", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 10 + }, + "selector": "0x7271b782" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "PSP22::total_supply", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 12 + }, + "selector": "0x162df8c2" + }, + { + "args": [ + { + "label": "owner", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + } + ], + "default": false, + "docs": [], + "label": "PSP22::balance_of", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 12 + }, + "selector": "0x6568382f" + }, + { + "args": [ + { + "label": "owner", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + }, + { + "label": "spender", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + } + ], + "default": false, + "docs": [], + "label": "PSP22::allowance", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 12 + }, + "selector": "0x4d47d921" + }, + { + "args": [ + { + "label": "to", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "u128" + ], + "type": 0 + } + }, + { + "label": "_data", + "type": { + "displayName": [ + "Vec" + ], + "type": 15 + } + } + ], + "default": false, + "docs": [], + "label": "PSP22::transfer", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 4 + }, + "selector": "0xdb20f9f5" + }, + { + "args": [ + { + "label": "from", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + }, + { + "label": "to", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "u128" + ], + "type": 0 + } + }, + { + "label": "_data", + "type": { + "displayName": [ + "Vec" + ], + "type": 15 + } + } + ], + "default": false, + "docs": [], + "label": "PSP22::transfer_from", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 4 + }, + "selector": "0x54b3c76e" + }, + { + "args": [ + { + "label": "spender", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "u128" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "PSP22::approve", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 4 + }, + "selector": "0xb20f1bbd" + }, + { + "args": [ + { + "label": "spender", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + }, + { + "label": "delta_value", + "type": { + "displayName": [ + "u128" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "PSP22::increase_allowance", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 4 + }, + "selector": "0x96d6b57a" + }, + { + "args": [ + { + "label": "spender", + "type": { + "displayName": [ + "AccountId" + ], + "type": 13 + } + }, + { + "label": "delta_value", + "type": { + "displayName": [ + "u128" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "PSP22::decrease_allowance", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 4 + }, + "selector": "0xfecb57d5" + } + ] + }, + "storage": { + "root": { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 0 + } + }, + "name": "total_supply" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x45c746d4", + "ty": 0 + } + }, + "root_key": "0x45c746d4" + } + }, + "name": "balances" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x00efb3a1", + "ty": 0 + } + }, + "root_key": "0x00efb3a1" + } + }, + "name": "allowances" + } + ], + "name": "PSP22Data" + } + }, + "name": "data" + } + ], + "name": "Wazero" + } + }, + "root_key": "0x00000000" + } + }, + "types": [ + { + "id": 0, + "type": { + "def": { + "primitive": "u128" + } + } + }, + { + "id": 1, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 2 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 2 + }, + { + "name": "E", + "type": 3 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 2, + "type": { + "def": { + "tuple": [] + } + } + }, + { + "id": 3, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 1, + "name": "CouldNotReadInput" + } + ] + } + }, + "path": [ + "ink_primitives", + "LangError" + ] + } + }, + { + "id": 4, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 5 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 5 + }, + { + "name": "E", + "type": 3 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 5, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 2 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 6 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 2 + }, + { + "name": "E", + "type": 6 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 6, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 7, + "typeName": "String" + } + ], + "index": 0, + "name": "Custom" + }, + { + "index": 1, + "name": "InsufficientBalance" + }, + { + "index": 2, + "name": "InsufficientAllowance" + }, + { + "index": 3, + "name": "ZeroRecipientAddress" + }, + { + "index": 4, + "name": "ZeroSenderAddress" + }, + { + "fields": [ + { + "type": 7, + "typeName": "String" + } + ], + "index": 5, + "name": "SafeTransferCheckFailed" + } + ] + } + }, + "path": [ + "psp22", + "errors", + "PSP22Error" + ] + } + }, + { + "id": 7, + "type": { + "def": { + "primitive": "str" + } + } + }, + { + "id": 8, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 9 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 9 + }, + { + "name": "E", + "type": 3 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 9, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 7 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 7 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 10, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 11 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 11 + }, + { + "name": "E", + "type": 3 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 11, + "type": { + "def": { + "primitive": "u8" + } + } + }, + { + "id": 12, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 0 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 0 + }, + { + "name": "E", + "type": 3 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 13, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 14, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_primitives", + "types", + "AccountId" + ] + } + }, + { + "id": 14, + "type": { + "def": { + "array": { + "len": 32, + "type": 11 + } + } + } + }, + { + "id": 15, + "type": { + "def": { + "sequence": { + "type": 11 + } + } + } + }, + { + "id": 16, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 13 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 13 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 17, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 14, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_primitives", + "types", + "Hash" + ] + } + }, + { + "id": 18, + "type": { + "def": { + "primitive": "u64" + } + } + }, + { + "id": 19, + "type": { + "def": { + "primitive": "u32" + } + } + }, + { + "id": 20, + "type": { + "def": { + "variant": {} + }, + "path": [ + "ink_env", + "types", + "NoChainExtension" + ] + } + } + ], + "version": "4" +} \ No newline at end of file diff --git a/artifacts/wrapped_azero.wasm b/artifacts/wrapped_azero.wasm new file mode 100644 index 0000000..413de89 Binary files /dev/null and b/artifacts/wrapped_azero.wasm differ diff --git a/lib.rs b/lib.rs index f73951b..c47e511 100644 --- a/lib.rs +++ b/lib.rs @@ -2,8 +2,12 @@ mod traits; -pub use traits::WrappedAZERO; +// Re-export of PSP22 stuff for convenience of cross-contract calls +pub use psp22::{PSP22Error, PSP22}; +pub use traits::{WrappedAZERO, MAINNET, TESTNET}; + +#[cfg(feature = "contract")] #[ink::contract] mod wazero { use crate::WrappedAZERO; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 91e2cd5..8926550 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.72.1" +channel = "1.76.0" components = ["rustfmt", "rust-src", "clippy"] targets = ["wasm32-unknown-unknown"] profile = "minimal" diff --git a/traits.rs b/traits.rs index f191ae6..25167a9 100644 --- a/traits.rs +++ b/traits.rs @@ -31,3 +31,8 @@ pub trait WrappedAZERO { #[ink(message)] fn withdraw(&mut self, value: u128) -> Result<(), PSP22Error>; } + +/// Mainnet deployment address +pub const MAINNET: &str = "TODO"; +/// Testnet deployment address +pub const TESTNET: &str = "TODO";