From c7c0e96522668e0986d7b30fe2adb829cec9f32e Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 13:05:37 +0200 Subject: [PATCH 01/31] implementation sur course --- contracts/button/Cargo.lock | 179 +-- contracts/game_token/lib.rs | 4 +- contracts/simple_dex/Cargo.lock | 1094 +++++++++++++++ contracts/simple_dex/Cargo.toml | 52 + contracts/simple_dex/lib.rs | 304 ++++ contracts/simple_dex/out | 2319 +++++++++++++++++++++++++++++++ 6 files changed, 3865 insertions(+), 87 deletions(-) create mode 100644 contracts/simple_dex/Cargo.lock create mode 100644 contracts/simple_dex/Cargo.toml create mode 100644 contracts/simple_dex/lib.rs create mode 100644 contracts/simple_dex/out diff --git a/contracts/button/Cargo.lock b/contracts/button/Cargo.lock index 2c36ea0f76..4da0c93010 100644 --- a/contracts/button/Cargo.lock +++ b/contracts/button/Cargo.lock @@ -42,9 +42,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bitvec" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", @@ -74,9 +74,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array", ] @@ -107,9 +107,9 @@ checksum = "87c5fdd0166095e1d463fc6cc01aa8ce547ad77a4e84d42eb6762b084e28067e" [[package]] name = "camino" -version = "1.0.9" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869119e97797867fd90f5e22af7d0bd274bd4635ebb9eb68c04f3f513ae6c412" +checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" dependencies = [ "serde", ] @@ -171,18 +171,18 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] [[package]] name = "crypto-common" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5999502d32b9c48d492abe66392408144895020ec4709e549e840799f3bb74c0" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", "typenum", @@ -231,9 +231,9 @@ dependencies = [ [[package]] name = "either" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "fs2" @@ -269,9 +269,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -325,18 +325,18 @@ dependencies = [ [[package]] name = "ink_allocator" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed249de74298ed051ebcf6d3082b8d3dbd19cbc448d9ed3235d8a7b92713049" +checksum = "a291f411e310b7a3bb01ce21102b8c0aea5b7b523e4bad0b40a8e55a76c58906" dependencies = [ "cfg-if", ] [[package]] name = "ink_engine" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acb9d32ec27d71fefb3f2b6a26bae82a2c6509d7ad61e8a5107b6291a1b03ecb" +checksum = "075eab468da2937288ec484be920cb18614147003d7f1afbdfcfb190ed771c46" dependencies = [ "blake2 0.10.4", "derive_more", @@ -349,9 +349,9 @@ dependencies = [ [[package]] name = "ink_env" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1549f5966167387c89fb3dfcdc59973bfb396cc3a7110d7a31ad5fdea56db0cf" +checksum = "271689b643d7ccf2bcd09d7ef07eda79cd3366ee042d5bbfcebf534b08da79d7" dependencies = [ "arrayref", "blake2 0.10.4", @@ -376,9 +376,9 @@ dependencies = [ [[package]] name = "ink_lang" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5282f2722ac6dca469e7f223a7b38b2a6d20fbca6b974497e630d5dc8934e9" +checksum = "62cf662fe6a130ea1ada3520142405e3ed521b79c35b7274cc95dd37bc833571" dependencies = [ "derive_more", "ink_env", @@ -392,9 +392,9 @@ dependencies = [ [[package]] name = "ink_lang_codegen" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb3a5de33b59450adc3f61c5eb05b768067c7ab8af9d00f33e284310598168dc" +checksum = "94dc22732ced2557f0411de5fa31d6fddc3878968041b699ae16ed1c390d2660" dependencies = [ "blake2 0.10.4", "derive_more", @@ -411,9 +411,9 @@ dependencies = [ [[package]] name = "ink_lang_ir" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d4d614462280fa06e15b9ca5725d7c8440dde93c8dae1c6f15422f7756cacb" +checksum = "a089bcac8d7e6a487b7a18ea8a1d20eb540ed26657706ac221cc0e8239047e45" dependencies = [ "blake2 0.10.4", "either", @@ -425,9 +425,9 @@ dependencies = [ [[package]] name = "ink_lang_macro" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f85f64141957c5db7cbabbb97a9c16c489e5e9d363e9f147d132a43c71cd29" +checksum = "1330da0b8007b86de94f95fbc74769c0461d3b078b291af5497771598db1c5b4" dependencies = [ "ink_lang_codegen", "ink_lang_ir", @@ -439,9 +439,9 @@ dependencies = [ [[package]] name = "ink_metadata" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca6c159a2774f07437c6fd9ea710eb73a6b5e9a031a932bddf08742bf2c081a" +checksum = "d442f4f5dcbf120aa84cae9e399065ad99d143d5a920b06d3da286e91c03ec70" dependencies = [ "derive_more", "impl-serde", @@ -453,18 +453,18 @@ dependencies = [ [[package]] name = "ink_prelude" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f7f4dec15e573496c9d2af353e78bde84add391251608f25b5adcf175dc777" +checksum = "e38d71af62cfec3425727d28665a947d636c3be6ae71ac3a79868ef8a08633f3" dependencies = [ "cfg-if", ] [[package]] name = "ink_primitives" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3296dd1c4f4fe12ede7c92d60e6fcb94d46a959ec19c701e4ac588b09e0b4a6" +checksum = "ea7afd5330a9d3be1533222a48b8ab44b3a3356a5e6bb090bff0790aa562b418" dependencies = [ "cfg-if", "ink_prelude", @@ -474,9 +474,9 @@ dependencies = [ [[package]] name = "ink_storage" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff9b503995a7b41fe201a7a2643ce22f5a11e0b67db7b685424b6d5fe0ecf0b" +checksum = "be827b98c102c413b2309075f0835a9bb8c6325fc6aa09e66963424db7a8bcb5" dependencies = [ "array-init", "cfg-if", @@ -492,9 +492,9 @@ dependencies = [ [[package]] name = "ink_storage_derive" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb68e24e93e8327dda1924868d7ee4dbe01e1ed2b392f28583caa96809b585c" +checksum = "8ced452d5d0b2268b1257ffd2ec73cf9c3b4fba5f3632f185a03aafec8888439" dependencies = [ "proc-macro2", "quote", @@ -504,18 +504,18 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "d8bf247779e67a9082a4790b45e71ac7cfd1321331a5c856a74a9faebdab78d0" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" [[package]] name = "keccak" @@ -525,9 +525,9 @@ checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "num-traits" @@ -538,6 +538,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "once_cell" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" + [[package]] name = "opaque-debug" version = "0.3.0" @@ -626,9 +632,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.1.5" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" dependencies = [ "arrayvec", "bitvec", @@ -652,15 +658,15 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" [[package]] name = "pest" -version = "2.2.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69486e2b8c2d2aeb9762db7b4e00b0331156393555cff467f4163ff06821eef8" +checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" dependencies = [ "thiserror", "ucd-trie", @@ -674,28 +680,29 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ + "once_cell", "thiserror", "toml", ] [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -750,9 +757,9 @@ checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "scale-info" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46be926081c9f4dd5dd9b6f1d3e3229f2360bc6502dd8836f84a93b7c75e99a" +checksum = "333af15b02563b8182cd863f925bd31ef8fa86a0e095d30c091956057d436153" dependencies = [ "bitvec", "cfg-if", @@ -764,9 +771,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e334bb10a245e28e5fd755cabcafd96cfcd167c99ae63a46924ca8d8703a3c" +checksum = "53f56acbd0743d29ffa08f911ab5397def774ad01bab3786804cf6ee057fb5e1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -776,18 +783,18 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.22.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26947345339603ae8395f68e2f3d85a6b0a8ddfe6315818e80b8504415099db0" +checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "152e20a0fd0519390fc43ab404663af8a0b794273d2a91d60ad4a39f13ffe110" +checksum = "7058dc8eaf3f2810d7828680320acda0b25a288f6d288e19278e249bbf74226b" dependencies = [ "cc", ] @@ -813,18 +820,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.138" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.138" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", @@ -833,9 +840,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ "itoa", "ryu", @@ -844,9 +851,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5" dependencies = [ "cfg-if", "cpufeatures", @@ -861,9 +868,9 @@ checksum = "5edcd790916d95ff81bdc1505b09c74d30d47a755929cc8c71c59cbbfa99f91b" [[package]] name = "sha3" -version = "0.10.1" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" +checksum = "eaedf34ed289ea47c2b741bb72e5357a209512d67bcd4bda44359e5bf0470f56" dependencies = [ "digest 0.10.3", "keccak", @@ -883,9 +890,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", @@ -912,18 +919,18 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" dependencies = [ "proc-macro2", "quote", @@ -963,21 +970,21 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "unicode-ident" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" +checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" [[package]] name = "unicode-xid" diff --git a/contracts/game_token/lib.rs b/contracts/game_token/lib.rs index aeff1aeab0..6893038c45 100644 --- a/contracts/game_token/lib.rs +++ b/contracts/game_token/lib.rs @@ -2,7 +2,8 @@ #![feature(min_specialization)] pub use crate::game_token::{ - BALANCE_OF_SELECTOR, MINT_TO_SELECTOR, TRANSFER_FROM_SELECTOR, TRANSFER_SELECTOR, + ALLOWANCE_SELECTOR, BALANCE_OF_SELECTOR, MINT_TO_SELECTOR, TRANSFER_FROM_SELECTOR, + TRANSFER_SELECTOR, }; #[openbrush::contract] @@ -23,6 +24,7 @@ pub mod game_token { pub const BALANCE_OF_SELECTOR: [u8; 4] = [0x65, 0x68, 0x38, 0x2f]; pub const TRANSFER_SELECTOR: [u8; 4] = [0xdb, 0x20, 0xf9, 0xf5]; pub const TRANSFER_FROM_SELECTOR: [u8; 4] = [0x54, 0xb3, 0xc7, 0x6e]; + pub const ALLOWANCE_SELECTOR: [u8; 4] = [0x4d, 0x47, 0xd9, 0x21]; // TODO : use correct selector when mint/burn is implemented pub const MINT_TO_SELECTOR: [u8; 4] = [0x0, 0x0, 0x0, 0x0]; diff --git a/contracts/simple_dex/Cargo.lock b/contracts/simple_dex/Cargo.lock new file mode 100644 index 0000000000..9adb79e2f3 --- /dev/null +++ b/contracts/simple_dex/Cargo.lock @@ -0,0 +1,1094 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "access_control" +version = "0.1.0" +dependencies = [ + "ink_env", + "ink_lang", + "ink_lang_codegen", + "ink_metadata", + "ink_primitives", + "ink_storage", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "array-init" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb6d71005dc22a708c7496eee5c8dc0300ee47355de6256c3b35b12b5fef596" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +dependencies = [ + "crypto-mac", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "blake2" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" +dependencies = [ + "digest 0.10.3", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byte-slice-cast" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87c5fdd0166095e1d463fc6cc01aa8ce547ad77a4e84d42eb6762b084e28067e" + +[[package]] +name = "camino" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "081e3f0755c1f380c2d010481b6fa2e02973586d5f2b24eebb7a2a1d98b143d8" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "semver-parser", + "serde", + "serde_json", +] + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const_format" +version = "0.2.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "939dc9e2eb9077e0679d2ce32de1ded8531779360b003b4a972a7a39ec263495" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef196d5d972878a48da7decb7686eded338b4858fbabeed513d63a7c98b2b82d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[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.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "game_token" +version = "2.1.0" +dependencies = [ + "access_control", + "ink_env", + "ink_lang", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "openbrush", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ink_allocator" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a291f411e310b7a3bb01ce21102b8c0aea5b7b523e4bad0b40a8e55a76c58906" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_engine" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "075eab468da2937288ec484be920cb18614147003d7f1afbdfcfb190ed771c46" +dependencies = [ + "blake2 0.10.4", + "derive_more", + "parity-scale-codec", + "rand", + "secp256k1", + "sha2", + "sha3", +] + +[[package]] +name = "ink_env" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271689b643d7ccf2bcd09d7ef07eda79cd3366ee042d5bbfcebf534b08da79d7" +dependencies = [ + "arrayref", + "blake2 0.10.4", + "cfg-if", + "derive_more", + "ink_allocator", + "ink_engine", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "num-traits", + "parity-scale-codec", + "paste", + "rand", + "rlibc", + "scale-info", + "secp256k1", + "sha2", + "sha3", + "static_assertions", +] + +[[package]] +name = "ink_lang" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cf662fe6a130ea1ada3520142405e3ed521b79c35b7274cc95dd37bc833571" +dependencies = [ + "derive_more", + "ink_env", + "ink_lang_macro", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "parity-scale-codec", +] + +[[package]] +name = "ink_lang_codegen" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94dc22732ced2557f0411de5fa31d6fddc3878968041b699ae16ed1c390d2660" +dependencies = [ + "blake2 0.10.4", + "derive_more", + "either", + "heck 0.4.0", + "impl-serde", + "ink_lang_ir", + "itertools", + "parity-scale-codec", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ink_lang_ir" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a089bcac8d7e6a487b7a18ea8a1d20eb540ed26657706ac221cc0e8239047e45" +dependencies = [ + "blake2 0.10.4", + "either", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ink_lang_macro" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1330da0b8007b86de94f95fbc74769c0461d3b078b291af5497771598db1c5b4" +dependencies = [ + "ink_lang_codegen", + "ink_lang_ir", + "ink_primitives", + "parity-scale-codec", + "proc-macro2", + "syn", +] + +[[package]] +name = "ink_metadata" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d442f4f5dcbf120aa84cae9e399065ad99d143d5a920b06d3da286e91c03ec70" +dependencies = [ + "derive_more", + "impl-serde", + "ink_prelude", + "ink_primitives", + "scale-info", + "serde", +] + +[[package]] +name = "ink_prelude" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e38d71af62cfec3425727d28665a947d636c3be6ae71ac3a79868ef8a08633f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_primitives" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea7afd5330a9d3be1533222a48b8ab44b3a3356a5e6bb090bff0790aa562b418" +dependencies = [ + "cfg-if", + "ink_prelude", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ink_storage" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be827b98c102c413b2309075f0835a9bb8c6325fc6aa09e66963424db7a8bcb5" +dependencies = [ + "array-init", + "cfg-if", + "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.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ced452d5d0b2268b1257ffd2ec73cf9c3b4fba5f3632f185a03aafec8888439" +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 = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" + +[[package]] +name = "keccak" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" + +[[package]] +name = "libc" +version = "0.2.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" + +[[package]] +name = "num" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openbrush" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "ink_env", + "ink_lang", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "openbrush_contracts", + "openbrush_lang", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "openbrush_contracts" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "ink_env", + "ink_lang", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "openbrush_lang", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "openbrush_lang" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "const_format", + "ink_env", + "ink_lang", + "ink_metadata", + "ink_primitives", + "ink_storage", + "openbrush_lang_macro", + "parity-scale-codec", + "scale-info", + "sha2-const", +] + +[[package]] +name = "openbrush_lang_codegen" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "blake2 0.9.2", + "cargo_metadata", + "fs2", + "heck 0.3.3", + "ink_lang_ir", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", + "synstructure", + "unwrap", +] + +[[package]] +name = "openbrush_lang_macro" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "openbrush_lang_codegen", + "proc-macro2", + "syn", + "synstructure", +] + +[[package]] +name = "parity-scale-codec" +version = "3.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "pest" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0560d531d1febc25a3c9398a62a71256c0178f2e3443baedd9ad4bb8c9deb4" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[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.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +dependencies = [ + "once_cell", + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro2" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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 = "rlibc" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "scale-info" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c46be926081c9f4dd5dd9b6f1d3e3229f2360bc6502dd8836f84a93b7c75e99a" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e334bb10a245e28e5fd755cabcafd96cfcd167c99ae63a46924ca8d8703a3c" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "secp256k1" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7058dc8eaf3f2810d7828680320acda0b25a288f6d288e19278e249bbf74226b" +dependencies = [ + "cc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha2-const" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5edcd790916d95ff81bdc1505b09c74d30d47a755929cc8c71c59cbbfa99f91b" + +[[package]] +name = "sha3" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaedf34ed289ea47c2b741bb72e5357a209512d67bcd4bda44359e5bf0470f56" +dependencies = [ + "digest 0.10.3", + "keccak", +] + +[[package]] +name = "simple_dex" +version = "0.1.0" +dependencies = [ + "access_control", + "game_token", + "ink_env", + "ink_lang", + "ink_lang_codegen", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "num", + "openbrush", + "parity-scale-codec", + "scale-info", +] + +[[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.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[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 = "thiserror" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" + +[[package]] +name = "unicode-segmentation" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" + +[[package]] +name = "unicode-xid" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" + +[[package]] +name = "unwrap" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e33648dd74328e622c7be51f3b40a303c63f93e6fa5f08778b6203a4c25c20f" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[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-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.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +dependencies = [ + "tap", +] diff --git a/contracts/simple_dex/Cargo.toml b/contracts/simple_dex/Cargo.toml new file mode 100644 index 0000000000..a38620b372 --- /dev/null +++ b/contracts/simple_dex/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "simple_dex" +version = "0.1.0" +authors = ["Cardinal Cryptography"] +edition = "2021" +license = "Apache 2.0" + +[dependencies] +ink_env = { version = "~3.3.0", default-features = false } +ink_lang = { version = "~3.3.0", default-features = false } +ink_lang_codegen = { version = "~3.3.0", default-features = false } +ink_metadata = { version = "~3.3.0", default-features = false, features = ["derive"], optional = true } +ink_prelude = { version = "~3.3.0", default-features = false } +ink_primitives = { version = "~3.3.0", default-features = false } +ink_storage = { version = "~3.3.0", default-features = false } + +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } +scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } + +openbrush = { git = "https://github.com/Supercolony-net/openbrush-contracts.git", rev = "8a20f95", default-features = false, features = ["psp22"] } +num = { version = "0.4.0", default-features = false } +access_control = { path = "../access_control", default-features = false, features = ["ink-as-dependency"] } +game_token = { path = "../game_token", default-features = false, features = ["ink-as-dependency"] } + +[lib] +name = "simple_dex" +path = "lib.rs" +crate-type = [ + # Used for normal contract Wasm blobs. + "cdylib", +] + +[features] +default = ["std"] +std = [ + "access_control/std", + "game_token/std", + "ink_env/std", + "ink_lang_codegen/std", + "ink_metadata/std", + "ink_prelude/std", + "ink_primitives/std", + "ink_storage/std", + "num/std", + "openbrush/std", + "scale-info/std", + "scale/std", +] +ink-as-dependency = [] + +[profile.dev] +codegen-units = 16 \ No newline at end of file diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs new file mode 100644 index 0000000000..921dddff58 --- /dev/null +++ b/contracts/simple_dex/lib.rs @@ -0,0 +1,304 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +use ink_lang as ink; + +#[ink::contract] +mod simple_dex { + + use access_control::{traits::AccessControlled, Role, ACCESS_CONTROL_PUBKEY}; + use game_token::{ + ALLOWANCE_SELECTOR, BALANCE_OF_SELECTOR, TRANSFER_FROM_SELECTOR, TRANSFER_SELECTOR, + }; + use ink_env::{ + call::{build_call, Call, ExecutionInput, Selector}, + CallFlags, DefaultEnvironment, Environment as EnvironmentTrait, Error as InkEnvError, + }; + use ink_lang::{ + codegen::{initialize_contract, EmitEvent}, + reflect::ContractEventBase, + }; + use ink_prelude::{format, string::String, vec}; + use ink_storage::{traits::SpreadAllocate, Mapping}; + use openbrush::contracts::traits::errors::PSP22Error; + + // Event type + // type Event = ::Type; + + #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] + #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] + pub enum DexError { + PSP22(PSP22Error), + // NotEnoughBalanceOf(AccountId), + // ArithmethicError, + // InsufficientAllowance, + // InsufficientTransferredValue, + Arithmethic, + MissingRole(Role), + InkEnv(String), + CrossContractCall(String), + NativeTransfer, + } + + impl From for DexError { + fn from(e: PSP22Error) -> Self { + DexError::PSP22(e) + } + } + + impl From for DexError { + fn from(why: InkEnvError) -> Self { + DexError::InkEnv(format!("{:?}", why)) + } + } + + // #[ink(event)] + // #[derive(Debug)] + // pub struct DexEvt { + // #[ink(topic)] + // a: AccountId, + // } + + #[ink(storage)] + #[derive(SpreadAllocate)] + pub struct SimpleDex { + /// total supply of pool shares + pub total_liquidity: u128, + /// tracks pool shares per account + pub liquidity: Mapping, + pub swap_fee: u128, + /// access control contract + pub access_control: AccountId, + pub ubik: AccountId, + pub cyberiad: AccountId, + pub lono: AccountId, + } + + impl AccessControlled for SimpleDex { + type ContractError = DexError; + } + + impl SimpleDex { + #[ink(constructor)] + pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { + let caller = Self::env().caller(); + let code_hash = Self::env() + .own_code_hash() + .expect("Called new on a contract with no code hash"); + let required_role = Role::Initializer(code_hash); + let access_control = AccountId::from(ACCESS_CONTROL_PUBKEY); + + let role_check = ::check_role( + access_control, + caller, + required_role, + |why: InkEnvError| { + DexError::CrossContractCall(format!( + "Calling access control has failed: {:?}", + why + )) + }, + DexError::MissingRole, + ); + + match role_check { + Ok(_) => { + initialize_contract(|contract| Self::new_init(contract, ubik, cyberiad, lono)) + } + Err(why) => panic!("Could not initialize the contract {:?}", why), + } + } + + // mesages + + /// swap the transferred amount of native token to one of the pools PSP22 tokens + #[ink(message, payable)] + pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + let amount_token_in = self.env().transferred_value(); + // we use the balance of the native token just before the exchange tx + let balance_token_in = self + .env() + .balance() + .checked_sub(amount_token_in) + .ok_or(DexError::Arithmethic)?; + + let swap_fee = self.swap_fee; + let caller = self.env().caller(); + let this = self.env().account_id(); + + let balance_token_out = self.balance_of(token_out, this)?; + + let amount_token_out = Self::out_given_in( + amount_token_in, + balance_token_in, + balance_token_out, + swap_fee, + )?; + + // transfer token_out from contract to user + self.transfer_tx(token_out, caller, amount_token_out)??; + + // TOOD : emit event + + Ok(()) + } + + /// swap the a specified amount of pools token to the native token + /// calling account needs to give allowance to the DEX contract to spend amount_token_in on it's behalf + #[ink(message)] + pub fn token_to_native( + &mut self, + token_in: AccountId, + amount_token_in: u128, + ) -> Result<(), DexError> { + let caller = self.env().caller(); + let balance_token_out = self.env().balance(); + let swap_fee = self.swap_fee; + let this = self.env().account_id(); + let balance_token_in = self.balance_of(token_in, this)?; + let amount_token_out = Self::out_given_in( + amount_token_in, + balance_token_in, + balance_token_out, + swap_fee, + )?; + + // TODO check allowance + // if PSP22Ref::allowance(&token_in, caller, this) < amount_token_in { + // return Err(DexError::InsufficientAllowance); + // } + + // transfer token_in from the user to the contract + self.transfer_from_tx(token_in, caller, this, amount_token_in)?; + + self.env() + .transfer(caller, amount_token_out) + .map_err(|_| DexError::NativeTransfer)?; + + // TOOD : emit event + + Ok(()) + } + + // END: mesages + + fn new_init(&mut self, ubik: AccountId, cyberiad: AccountId, lono: AccountId) { + self.access_control = AccountId::from(ACCESS_CONTROL_PUBKEY); + self.ubik = ubik; + self.cyberiad = cyberiad; + self.lono = lono; + } + + /// transfers a given amount of a PSP22 token to a specified using the contracts own balance + fn transfer_tx( + &self, + token: AccountId, + to: AccountId, + amount: Balance, + ) -> Result, InkEnvError> { + build_call::() + .call_type(Call::new().callee(token)) + .exec_input( + ExecutionInput::new(Selector::new(TRANSFER_SELECTOR)) + .push_arg(to) + .push_arg(amount) + .push_arg(vec![0x0]), + ) + .returns::>() + .fire() + } + + /// transfers a given amount of a PSP22 token on behalf of a specified account to another account + /// Will revert if not enough allowance was given to the caller prior to executing this tx + fn transfer_from_tx( + &self, + token: AccountId, + from: AccountId, + to: AccountId, + amount: Balance, + ) -> Result, InkEnvError> { + build_call::() + .call_type(Call::new().callee(token)) + .exec_input( + ExecutionInput::new(Selector::new(TRANSFER_FROM_SELECTOR)) + .push_arg(from) + .push_arg(to) + .push_arg(amount) + .push_arg(vec![0x0]), + ) + .call_flags(CallFlags::default().set_allow_reentry(true)) + .returns::>() + .fire() + } + + /// returns unused allowance that the owner has given to spender + fn allowance( + &self, + token: AccountId, + owner: AccountId, + spender: AccountId, + ) -> Result { + build_call::() + .call_type(Call::new().callee(token)) + .exec_input( + ExecutionInput::new(Selector::new(ALLOWANCE_SELECTOR)) + .push_arg(owner) + .push_arg(spender), + ) + .returns::() + .fire() + } + + /// returns DEX balance of a PSP22 token for an account + fn balance_of(&self, token: AccountId, account: AccountId) -> Result { + build_call::() + .call_type(Call::new().callee(token)) + .exec_input( + ExecutionInput::new(Selector::new(BALANCE_OF_SELECTOR)).push_arg(account), + ) + .returns::() + .fire() + } + + fn out_given_in( + amount_token_in: u128, + balance_token_in: u128, + balance_token_out: u128, + swap_fee: u128, + ) -> Result { + let op1 = 1u128.checked_sub(swap_fee).ok_or(DexError::Arithmethic)?; + + let op2 = amount_token_in + .checked_mul(op1) + .ok_or(DexError::Arithmethic)?; + + let op3 = balance_token_in + .checked_add(op2) + .ok_or(DexError::Arithmethic)?; + + let op4 = balance_token_in + .checked_div(op3) + .ok_or(DexError::Arithmethic)?; + + let op5 = 1u128.checked_sub(op4).ok_or(DexError::Arithmethic)?; + + balance_token_out + .checked_mul(op5) + .ok_or(DexError::Arithmethic) + } + + // fn emit_event(emitter: EE, event: Event) + // where + // EE: EmitEvent, + // { + // emitter.emit_event(event); + // } + + /// Returns own code hash + #[ink(message)] + pub fn code_hash(&self) -> Result { + self.env() + .own_code_hash() + .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) + } + } +} diff --git a/contracts/simple_dex/out b/contracts/simple_dex/out new file mode 100644 index 0000000000..0eabbb390c --- /dev/null +++ b/contracts/simple_dex/out @@ -0,0 +1,2319 @@ + [1/2] Checking ink! linting rules +Checking with toolchain `nightly-2022-03-14-x86_64-unknown-linux-gnu` +warning: unused import: `Environment as EnvironmentTrait` + --> lib.rs:12:29 + | +12 | DefaultEnvironment, Environment as EnvironmentTrait, Error as InkEnvError, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +warning: unused imports: `EmitEvent`, `reflect::ContractEventBase` + --> lib.rs:15:40 + | +15 | codegen::{initialize_contract, EmitEvent}, + | ^^^^^^^^^ +16 | reflect::ContractEventBase, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused variable: `caller` + --> lib.rs:122:17 + | +122 | let caller = self.env().caller(); + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_caller` + | + = note: `#[warn(unused_variables)]` on by default + +warning: unused variable: `amount_token_out` + --> lib.rs:127:17 + | +127 | let amount_token_out = Self::out_given_in( + | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_amount_token_out` + +warning: `simple_dex` (lib) generated 4 warnings + Finished dev [unoptimized + debuginfo] target(s) in 0.04s + [2/2] Executing `cargo check` + Updating crates.io index + Updating git repository `https://github.com/Supercolony-net/openbrush-contracts.git` + Checking simple_dex v0.1.0 (/tmp/cargo-contract_OIkPhg) +error: cannot find macro `vec` in this scope + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:161:35 + | +161 | .push_arg(vec![0x0]), + | ^^^ + | + = note: consider importing this macro: + ink_prelude::vec + +warning: unused import: `Environment as EnvironmentTrait` + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:12:29 + | +12 | DefaultEnvironment, Environment as EnvironmentTrait, Error as InkEnvError, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +warning: unused imports: `EmitEvent`, `reflect::ContractEventBase` + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:15:40 + | +15 | codegen::{initialize_contract, EmitEvent}, + | ^^^^^^^^^ +16 | reflect::ContractEventBase, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: duplicate lang item in crate `std`: `panic_impl`. + | + = note: the lang item is first defined in crate `ink_env` (which `simple_dex` depends on) + = note: first definition in `ink_env` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libink_env-4dd2a3ff5e73501d.rmeta + = note: second definition in `std` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libstd-029a8450b0f90c5b.rmeta + +error: duplicate lang item in crate `std`: `oom`. + | + = note: the lang item is first defined in crate `ink_allocator` (which `ink_env` depends on) + = note: first definition in `ink_allocator` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libink_allocator-0e2573d576e36ef2.rmeta + = note: second definition in `std` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libstd-029a8450b0f90c5b.rmeta + +error: duplicate lang item in crate `core`: `sized`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `unsize`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `structural_peq`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `structural_teq`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `copy`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `clone`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `sync`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `discriminant_kind`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `discriminant_type`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `pointee_trait`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `metadata_type`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `dyn_metadata`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `freeze`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `drop`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `destruct`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `coerce_unsized`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `dispatch_from_dyn`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `transmute_trait`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `add`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `sub`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `mul`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `div`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `rem`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `neg`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `not`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `bitxor`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `bitand`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `bitor`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `shl`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `shr`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `add_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `sub_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `mul_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `div_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `rem_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `bitxor_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `bitand_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `bitor_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `shl_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `shr_assign`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `index`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `index_mut`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `unsafe_cell`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `va_list`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `deref`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `deref_mut`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `deref_target`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `receiver`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `fn`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `fn_mut`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `fn_once`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `fn_once_output`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `future_trait`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `generator_state`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `generator`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `generator_return`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `unpin`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `pin`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `eq`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `partial_ord`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `panic`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `panic_fmt`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `panic_display`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `const_panic_fmt`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `panic_bounds_check`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `panic_info`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `panic_location`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `panic_no_unwind`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `drop_in_place`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `alloc_layout`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `const_eval_select`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `const_eval_select_ct`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `phantom_data`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `manually_drop`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `maybe_uninit`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `align_offset`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `Try`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `slice_len_fn`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `from_residual`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `from_output`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `branch`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `from_yeet`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `Ready`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `Pending`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `from_generator`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `get_context`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `poll`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `from`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `Some`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `None`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `Ok`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `Err`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `Continue`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `Break`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `into_future`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `into_iter`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `next`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `new_unchecked`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `RangeFrom`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `RangeFull`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `RangeInclusive`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `range_inclusive_new`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `Range`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `RangeToInclusive`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +error: duplicate lang item in crate `core`: `RangeTo`. + | + = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) + = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib + = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib + +warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ + +warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:36 + | +25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] + | ^^^^^^^^^^^^^ + | + = note: this warning originates in the derive macro `scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `ink_env::AccountId` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:65:24 + | +65 | pub liquidity: Mapping, + | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::AccountId` +note: required by a bound in `ink_storage::Mapping` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_storage-3.3.1/src/lazy/mapping.rs:90:20 + | +90 | pub struct Mapping { + | ^ required by this bound in `ink_storage::Mapping` + +error[E0277]: the size for values of type `u128` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:65:24 + | +65 | pub liquidity: Mapping, + | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `u128` +note: required by a bound in `ink_storage::Mapping` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_storage-3.3.1/src/lazy/mapping.rs:90:23 + | +90 | pub struct Mapping { + | ^ required by this bound in `ink_storage::Mapping` + +error[E0277]: the size for values of type `__ink_ConstructorDecoder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `__ink_ConstructorDecoder` +note: required by a bound in `DecodeDispatch` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/reflect/dispatch.rs:653:27 + | +653 | pub trait DecodeDispatch: scale::Decode { + | ^^^^^^^^^^^^^ required by this bound in `DecodeDispatch` + +error[E0277]: the size for values of type `__ink_ConstructorDecoder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `__ink_ConstructorDecoder` +note: required by a bound in `parity_scale_codec::Decode` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 + | +295 | pub trait Decode: Sized { + | ^^^^^ required by this bound in `parity_scale_codec::Decode` + +error[E0277]: the size for values of type `__ink_MessageDecoder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `__ink_MessageDecoder` +note: required by a bound in `DecodeDispatch` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/reflect/dispatch.rs:653:27 + | +653 | pub trait DecodeDispatch: scale::Decode { + | ^^^^^^^^^^^^^ required by this bound in `DecodeDispatch` + +error[E0277]: the size for values of type `__ink_MessageDecoder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `__ink_MessageDecoder` +note: required by a bound in `parity_scale_codec::Decode` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 + | +295 | pub trait Decode: Sized { + | ^^^^^ required by this bound in `parity_scale_codec::Decode` + +error[E0277]: the size for values of type `SimpleDex` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:78:10 + | +78 | impl SimpleDex { + | ^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `SimpleDex` +note: required by a bound in `IsSameType` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/codegen/utils/same_type.rs:34:23 + | +34 | pub struct IsSameType { + | ^ required by this bound in `IsSameType` + +error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` +note: required by a bound in `PackedLayout` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_storage-3.3.1/src/traits/packed.rs:32:56 + | +32 | pub trait PackedLayout: SpreadLayout + scale::Encode + scale::Decode { + | ^^^^^^^^^^^^^ required by this bound in `PackedLayout` + = note: this error originates in the derive macro `::ink_storage::traits::PackedLayout` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` +note: required by a bound in `EncodeLike` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/encode_like.rs:73:41 + | +73 | pub trait EncodeLike: Sized + Encode {} + | ^^^^^ required by this bound in `EncodeLike` + = note: this error originates in the derive macro `::scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` +note: required by a bound in `parity_scale_codec::Decode` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 + | +295 | pub trait Decode: Sized { + | ^^^^^ required by this bound in `parity_scale_codec::Decode` + = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` +note: required by a bound in `Clone` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:110:18 + | +110 | pub trait Clone: Sized { + | ^^^^^ required by this bound in `Clone` + = note: this error originates in the derive macro `::core::clone::Clone` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DefaultEnvironment` +note: required by a bound in `FromAccountId` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:45:25 + | +45 | pub trait FromAccountId + | ^ required by this bound in `FromAccountId` + +error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DefaultEnvironment` +note: required by a bound in `ToAccountId` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/contract_ref.rs:20:23 + | +20 | pub trait ToAccountId + | ^ required by this bound in `ToAccountId` + +error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `SimpleDexRef` +note: required by a bound in `PackedLayout` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_storage-3.3.1/src/traits/packed.rs:32:56 + | +32 | pub trait PackedLayout: SpreadLayout + scale::Encode + scale::Decode { + | ^^^^^^^^^^^^^ required by this bound in `PackedLayout` + = note: this error originates in the derive macro `::ink_storage::traits::PackedLayout` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `SimpleDexRef` +note: required by a bound in `EncodeLike` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/encode_like.rs:73:41 + | +73 | pub trait EncodeLike: Sized + Encode {} + | ^^^^^ required by this bound in `EncodeLike` + = note: this error originates in the derive macro `::scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `SimpleDexRef` +note: required by a bound in `parity_scale_codec::Decode` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 + | +295 | pub trait Decode: Sized { + | ^^^^^ required by this bound in `parity_scale_codec::Decode` + = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `SimpleDexRef` +note: required by a bound in `Clone` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:110:18 + | +110 | pub trait Clone: Sized { + | ^^^^^ required by this bound in `Clone` + = note: this error originates in the derive macro `::core::clone::Clone` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:36 + | +25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `EncodeLike` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/encode_like.rs:73:41 + | +73 | pub trait EncodeLike: Sized + Encode {} + | ^^^^^ required by this bound in `EncodeLike` + = note: this error originates in the derive macro `scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:51 + | +25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `parity_scale_codec::Decode` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 + | +295 | pub trait Decode: Sized { + | ^^^^^ required by this bound in `parity_scale_codec::Decode` + = note: this error originates in the derive macro `scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `openbrush::openbrush_contracts::psp22::PSP22Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:40:10 + | +40 | impl From for DexError { + | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `openbrush::openbrush_contracts::psp22::PSP22Error` +note: required by a bound in `From` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:369:16 + | +369 | pub trait From: Sized { + | ^ required by this bound in `From` + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:40:10 + | +40 | impl From for DexError { + | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `From` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:369:20 + | +369 | pub trait From: Sized { + | ^^^^^ required by this bound in `From` + +error[E0277]: the size for values of type `ink_env::Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:46:10 + | +46 | impl From for DexError { + | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::Error` +note: required by a bound in `From` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:369:16 + | +369 | pub trait From: Sized { + | ^ required by this bound in `From` + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:46:10 + | +46 | impl From for DexError { + | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `From` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:369:20 + | +369 | pub trait From: Sized { + | ^^^^^ required by this bound in `From` + +error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:5:1 + | +5 | #[ink::contract] + | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DefaultEnvironment` +note: required by a bound in `EnvAccess` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/env_access.rs:38:26 + | +38 | pub struct EnvAccess<'a, E> { + | ^ required by this bound in `EnvAccess` + = note: this error originates in the attribute macro `ink::contract` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `()` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `()` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `()` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:9 + | +112 | / pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { +113 | | let amount_token_in = self.env().transferred_value(); +114 | | // we use the balance of the native token just before the exchange tx +115 | | let balance_token_in = self +... | +136 | | Ok(()) +137 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `()` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:9 + | +112 | / pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { +113 | | let amount_token_in = self.env().transferred_value(); +114 | | // we use the balance of the native token just before the exchange tx +115 | | let balance_token_in = self +... | +136 | | Ok(()) +137 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `ink_env::Hash` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::Hash` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `ink_env::Hash` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:212:9 + | +212 | / /// Returns own code hash +213 | | #[ink(message)] +214 | | pub fn code_hash(&self) -> Result { +215 | | self.env() +216 | | .own_code_hash() +217 | | .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) +218 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::Hash` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:212:9 + | +212 | / /// Returns own code hash +213 | | #[ink(message)] +214 | | pub fn code_hash(&self) -> Result { +215 | | self.env() +216 | | .own_code_hash() +217 | | .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) +218 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `__ink_ConstructorDecoder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `__ink_ConstructorDecoder` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `DispatchError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DispatchError` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `parity_scale_codec::Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `parity_scale_codec::Error` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `()` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `()` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `__ink_MessageDecoder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `__ink_MessageDecoder` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `Result<(), openbrush::openbrush_contracts::psp22::PSP22Error>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:154:14 + | +154 | ) -> Result, InkEnvError> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Result<(), openbrush::openbrush_contracts::psp22::PSP22Error>` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `ink_env::Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:154:14 + | +154 | ) -> Result, InkEnvError> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::Error` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `()` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:154:14 + | +154 | ) -> Result, InkEnvError> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `()` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `openbrush::openbrush_contracts::psp22::PSP22Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:154:14 + | +154 | ) -> Result, InkEnvError> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `openbrush::openbrush_contracts::psp22::PSP22Error` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `u128` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:168:71 + | +168 | fn balance_of(&self, token: AccountId, account: AccountId) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `u128` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `ink_env::Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:168:71 + | +168 | fn balance_of(&self, token: AccountId, account: AccountId) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::Error` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `u128` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:183:14 + | +183 | ) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `u128` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:183:14 + | +183 | ) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + +error[E0277]: the size for values of type `()` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `()` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `::core::fmt::Debug` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `core::fmt::Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `core::fmt::Error` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `::core::fmt::Debug` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `u8` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `u8` +note: required by a bound in `Vec` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:400:16 + | +400 | pub struct Vec { + | ^ required by this bound in `Vec` + = note: this error originates in the derive macro `::scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `Global` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Global` +note: required by a bound in `Vec` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:400:75 + | +400 | pub struct Vec { + | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Vec` + = note: this error originates in the derive macro `::scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `parity_scale_codec::Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `parity_scale_codec::Error` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DefaultEnvironment` +note: required by a bound in `ink_env::call::CallBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:24 + | +346 | pub struct CallBuilder + | ^ required by this bound in `ink_env::call::CallBuilder` + +error[E0277]: the size for values of type `Set>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Set>` +note: required by a bound in `ink_env::call::CallBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:27 + | +346 | pub struct CallBuilder + | ^^^^^^^^ required by this bound in `ink_env::call::CallBuilder` + +error[E0277]: the size for values of type `Set, ArgumentList>>>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Set, ArgumentList>>>` +note: required by a bound in `ink_env::call::CallBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:37 + | +346 | pub struct CallBuilder + | ^^^^ required by this bound in `ink_env::call::CallBuilder` + +error[E0277]: the size for values of type `Set>>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Set>>` +note: required by a bound in `ink_env::call::CallBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:43 + | +346 | pub struct CallBuilder + | ^^^^^^^ required by this bound in `ink_env::call::CallBuilder` + +error[E0277]: the size for values of type `Call` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Call` +note: required by a bound in `Set` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 + | +43 | pub struct Set(pub T); + | ^ required by this bound in `Set` + +error[E0277]: the size for values of type `ExecutionInput, ArgumentList>>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ExecutionInput, ArgumentList>>` +note: required by a bound in `Set` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 + | +43 | pub struct Set(pub T); + | ^ required by this bound in `Set` + +error[E0277]: the size for values of type `ArgumentList, ArgumentList>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentList, ArgumentList>` +note: required by a bound in `ExecutionInput` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:19:27 + | +19 | pub struct ExecutionInput { + | ^^^^ required by this bound in `ExecutionInput` + +error[E0277]: the size for values of type `ink_env::call::utils::Argument` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::call::utils::Argument` +note: required by a bound in `ArgumentList` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 + | +74 | pub struct ArgumentList { + | ^^^^ required by this bound in `ArgumentList` + +error[E0277]: the size for values of type `ArgumentList` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentList` +note: required by a bound in `ArgumentList` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:31 + | +74 | pub struct ArgumentList { + | ^^^^ required by this bound in `ArgumentList` + +error[E0277]: the size for values of type `ink_env::AccountId` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::AccountId` +note: required by a bound in `ink_env::call::utils::Argument` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:86:21 + | +86 | pub struct Argument { + | ^ required by this bound in `ink_env::call::utils::Argument` + +error[E0277]: the size for values of type `ArgumentListEnd` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentListEnd` +note: required by a bound in `ArgumentList` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 + | +74 | pub struct ArgumentList { + | ^^^^ required by this bound in `ArgumentList` + +error[E0277]: the size for values of type `ReturnType>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ReturnType>` +note: required by a bound in `Set` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 + | +43 | pub struct Set(pub T); + | ^ required by this bound in `Set` + +error[E0277]: the size for values of type `Result<(), DexError>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 + | +112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Result<(), DexError>` +note: required by a bound in `ReturnType` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:23:23 + | +23 | pub struct ReturnType(PhantomData T>); + | ^ required by this bound in `ReturnType` + +error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DefaultEnvironment` +note: required by a bound in `ink_env::call::CallBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:24 + | +346 | pub struct CallBuilder + | ^ required by this bound in `ink_env::call::CallBuilder` + +error[E0277]: the size for values of type `Set>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Set>` +note: required by a bound in `ink_env::call::CallBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:27 + | +346 | pub struct CallBuilder + | ^^^^^^^^ required by this bound in `ink_env::call::CallBuilder` + +error[E0277]: the size for values of type `Set>>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Set>>` +note: required by a bound in `ink_env::call::CallBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:37 + | +346 | pub struct CallBuilder + | ^^^^ required by this bound in `ink_env::call::CallBuilder` + +error[E0277]: the size for values of type `Set>>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Set>>` +note: required by a bound in `ink_env::call::CallBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:43 + | +346 | pub struct CallBuilder + | ^^^^^^^ required by this bound in `ink_env::call::CallBuilder` + +error[E0277]: the size for values of type `Call` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Call` +note: required by a bound in `Set` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 + | +43 | pub struct Set(pub T); + | ^ required by this bound in `Set` + +error[E0277]: the size for values of type `ExecutionInput>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ExecutionInput>` +note: required by a bound in `Set` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 + | +43 | pub struct Set(pub T); + | ^ required by this bound in `Set` + +error[E0277]: the size for values of type `ArgumentList` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentList` +note: required by a bound in `ExecutionInput` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:19:27 + | +19 | pub struct ExecutionInput { + | ^^^^ required by this bound in `ExecutionInput` + +error[E0277]: the size for values of type `ArgumentListEnd` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentListEnd` +note: required by a bound in `ArgumentList` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 + | +74 | pub struct ArgumentList { + | ^^^^ required by this bound in `ArgumentList` + +error[E0277]: the size for values of type `ReturnType>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ReturnType>` +note: required by a bound in `Set` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 + | +43 | pub struct Set(pub T); + | ^ required by this bound in `Set` + +error[E0277]: the size for values of type `Result` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 + | +214 | pub fn code_hash(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Result` +note: required by a bound in `ReturnType` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:23:23 + | +23 | pub struct ReturnType(PhantomData T>); + | ^ required by this bound in `ReturnType` + +error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 + | +60 | / #[derive(SpreadAllocate)] +61 | | pub struct SimpleDex { +62 | | /// total supply of pool shares +63 | | pub total_liquidity: u128, +... | +71 | | pub lono: AccountId, +72 | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `SimpleDexRef` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DefaultEnvironment` +note: required by a bound in `CreateBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:26 + | +129 | pub struct CreateBuilder + | ^ required by this bound in `CreateBuilder` + +error[E0277]: the size for values of type `Unset` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Unset` +note: required by a bound in `CreateBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:29 + | +129 | pub struct CreateBuilder + | ^^^^^^^^ required by this bound in `CreateBuilder` + +error[E0277]: the size for values of type `Unset` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Unset` +note: required by a bound in `CreateBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:39 + | +129 | pub struct CreateBuilder + | ^^^^^^^^ required by this bound in `CreateBuilder` + +error[E0277]: the size for values of type `Unset` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Unset` +note: required by a bound in `CreateBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:49 + | +129 | pub struct CreateBuilder + | ^^^^^^^^^ required by this bound in `CreateBuilder` + +error[E0277]: the size for values of type `Set, ArgumentList, ArgumentList, ArgumentList>>>>>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Set, ArgumentList, ArgumentList, ArgumentList>>>>>` +note: required by a bound in `CreateBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:60 + | +129 | pub struct CreateBuilder + | ^^^^ required by this bound in `CreateBuilder` + +error[E0277]: the size for values of type `Unset` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Unset` +note: required by a bound in `CreateBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:66 + | +129 | pub struct CreateBuilder + | ^^^^ required by this bound in `CreateBuilder` + +error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `SimpleDexRef` +note: required by a bound in `CreateBuilder` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:72 + | +129 | pub struct CreateBuilder + | ^ required by this bound in `CreateBuilder` + +error[E0277]: the size for values of type `ink_env::Hash` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::Hash` +note: required by a bound in `Unset` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:55:18 + | +55 | pub struct Unset(PhantomData T>); + | ^ required by this bound in `Unset` + +error[E0277]: the size for values of type `u64` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `u64` +note: required by a bound in `Unset` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:55:18 + | +55 | pub struct Unset(PhantomData T>); + | ^ required by this bound in `Unset` + +error[E0277]: the size for values of type `u128` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `u128` +note: required by a bound in `Unset` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:55:18 + | +55 | pub struct Unset(PhantomData T>); + | ^ required by this bound in `Unset` + +error[E0277]: the size for values of type `ExecutionInput, ArgumentList, ArgumentList, ArgumentList>>>>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ExecutionInput, ArgumentList, ArgumentList, ArgumentList>>>>` +note: required by a bound in `Set` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 + | +43 | pub struct Set(pub T); + | ^ required by this bound in `Set` + +error[E0277]: the size for values of type `ArgumentList, ArgumentList, ArgumentList, ArgumentList>>>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentList, ArgumentList, ArgumentList, ArgumentList>>>` +note: required by a bound in `ExecutionInput` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:19:27 + | +19 | pub struct ExecutionInput { + | ^^^^ required by this bound in `ExecutionInput` + +error[E0277]: the size for values of type `ink_env::call::utils::Argument` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::call::utils::Argument` +note: required by a bound in `ArgumentList` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 + | +74 | pub struct ArgumentList { + | ^^^^ required by this bound in `ArgumentList` + +error[E0277]: the size for values of type `ArgumentList, ArgumentList, ArgumentList>>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentList, ArgumentList, ArgumentList>>` +note: required by a bound in `ArgumentList` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:31 + | +74 | pub struct ArgumentList { + | ^^^^ required by this bound in `ArgumentList` + +error[E0277]: the size for values of type `ink_env::AccountId` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ink_env::AccountId` +note: required by a bound in `ink_env::call::utils::Argument` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:86:21 + | +86 | pub struct Argument { + | ^ required by this bound in `ink_env::call::utils::Argument` + +error[E0277]: the size for values of type `ArgumentList, ArgumentList>` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentList, ArgumentList>` +note: required by a bound in `ArgumentList` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:31 + | +74 | pub struct ArgumentList { + | ^^^^ required by this bound in `ArgumentList` + +error[E0277]: the size for values of type `ArgumentList` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentList` +note: required by a bound in `ArgumentList` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:31 + | +74 | pub struct ArgumentList { + | ^^^^ required by this bound in `ArgumentList` + +error[E0277]: the size for values of type `ArgumentListEnd` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `ArgumentListEnd` +note: required by a bound in `ArgumentList` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 + | +74 | pub struct ArgumentList { + | ^^^^ required by this bound in `ArgumentList` + +error[E0277]: the size for values of type `Salt` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 + | +80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { +81 | | let caller = Self::env().caller(); +82 | | let code_hash = Self::env() +83 | | .own_code_hash() +... | +106 | | } +107 | | } + | |_________^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `Salt` +note: required by a bound in `Unset` + --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:55:18 + | +55 | pub struct Unset(PhantomData T>); + | ^ required by this bound in `Unset` + +error[E0277]: the size for values of type `()` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:14 + | +25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] + | ^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `()` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `core::fmt::Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:14 + | +25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] + | ^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `core::fmt::Error` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `DexError` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:51 + | +25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `DexError` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the size for values of type `parity_scale_codec::Error` cannot be known at compilation time + --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:51 + | +25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `parity_scale_codec::Error` +note: required by a bound in `Result` + --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 + | +504 | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) + +For more information about this error, try `rustc --explain E0277`. +warning: `simple_dex` (lib) generated 4 warnings +error: could not compile `simple_dex` due to 211 previous errors; 4 warnings emitted +ERROR: `"/home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/bin/cargo" "check" "--target=wasm32-unknown-unknown" "-Zbuild-std" "--no-default-features" "--release" "--target-dir=/home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink" "-Zbuild-std-features=panic_immediate_abort"` failed with exit code: Some(101) From 71d9c4898bc4592dd5fbd331589fe961b30fb805 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 13:12:06 +0200 Subject: [PATCH 02/31] swaps done --- contracts/simple_dex/lib.rs | 48 ++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 921dddff58..8504a077e8 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -30,7 +30,7 @@ mod simple_dex { PSP22(PSP22Error), // NotEnoughBalanceOf(AccountId), // ArithmethicError, - // InsufficientAllowance, + InsufficientAllowanceOf(AccountId), // InsufficientTransferredValue, Arithmethic, MissingRole(Role), @@ -162,13 +162,13 @@ mod simple_dex { swap_fee, )?; - // TODO check allowance - // if PSP22Ref::allowance(&token_in, caller, this) < amount_token_in { - // return Err(DexError::InsufficientAllowance); - // } + // check allowance + if self.allowance(token_in, caller, this)? < amount_token_in { + return Err(DexError::InsufficientAllowanceOf(token_in)); + } // transfer token_in from the user to the contract - self.transfer_from_tx(token_in, caller, this, amount_token_in)?; + self.transfer_from_tx(token_in, caller, this, amount_token_in)??; self.env() .transfer(caller, amount_token_out) @@ -179,6 +179,42 @@ mod simple_dex { Ok(()) } + /// swap the a specified amount of one pool token to another token + /// calling account needs to give allowance to the DEX contract to spend amount_token_in on it's behalf + #[ink(message)] + pub fn token_to_token( + &mut self, + token_in: AccountId, + token_out: AccountId, + amount_token_in: u128, + ) -> Result<(), DexError> { + let swap_fee = self.swap_fee; + let this = Self::env().account_id(); + let caller = Self::env().caller(); + + let balance_token_in = self.balance_of(token_in, this)?; + let balance_token_out = self.balance_of(token_out, this)?; + + let amount_token_out = Self::out_given_in( + amount_token_in, + balance_token_in, + balance_token_out, + swap_fee, + )?; + + // check allowance + if self.allowance(token_in, caller, this)? < amount_token_in { + return Err(DexError::InsufficientAllowanceOf(token_in)); + } + + // transfer token_in from user to the contract + self.transfer_from_tx(token_in, caller, this, amount_token_in)??; + // transfer token_out from contract to user + self.transfer_tx(token_out, caller, amount_token_out)??; + + Ok(()) + } + // END: mesages fn new_init(&mut self, ubik: AccountId, cyberiad: AccountId, lono: AccountId) { From 9f71ad047a574b53f9b2bc686d1dc7d2c1c5537d Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 13:41:40 +0200 Subject: [PATCH 03/31] add new role --- contracts/access_control/lib.rs | 2 + contracts/simple_dex/lib.rs | 118 +++++++++++++++++++++++++++----- 2 files changed, 104 insertions(+), 16 deletions(-) diff --git a/contracts/access_control/lib.rs b/contracts/access_control/lib.rs index 7dc9e848fd..86af850b60 100644 --- a/contracts/access_control/lib.rs +++ b/contracts/access_control/lib.rs @@ -34,6 +34,8 @@ mod access_control { Owner(AccountId), /// Indicates account can initialize a contract from a given code hash. Initializer(Hash), + /// Indicates account can add liquidity to a DEX contract (call certain functions) + LiquidityProvider(AccountId), } #[ink(storage)] diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 8504a077e8..e82df456c9 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -11,7 +11,7 @@ mod simple_dex { }; use ink_env::{ call::{build_call, Call, ExecutionInput, Selector}, - CallFlags, DefaultEnvironment, Environment as EnvironmentTrait, Error as InkEnvError, + CallFlags, DefaultEnvironment, Error as InkEnvError, }; use ink_lang::{ codegen::{initialize_contract, EmitEvent}, @@ -19,11 +19,19 @@ mod simple_dex { }; use ink_prelude::{format, string::String, vec}; use ink_storage::{traits::SpreadAllocate, Mapping}; + use num::integer::Roots; use openbrush::contracts::traits::errors::PSP22Error; // Event type // type Event = ::Type; + // |why: InkEnvError| { + // DexError::CrossContractCall(format!( + // "Calling access control has failed: {:?}", + // why + // )) + // }, + #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] pub enum DexError { @@ -91,13 +99,8 @@ mod simple_dex { access_control, caller, required_role, - |why: InkEnvError| { - DexError::CrossContractCall(format!( - "Calling access control has failed: {:?}", - why - )) - }, - DexError::MissingRole, + Self::cross_contract_call_error_handler, + Self::access_control_error_handler, ); match role_check { @@ -215,6 +218,89 @@ mod simple_dex { Ok(()) } + /// LP: single-asset native deposit + /// Can be called only by an account carrying a LiquidityProvider role for this contract + #[ink(message, payable)] + pub fn native_asset_deposit(&mut self) -> Result<(), DexError> { + // calculates number of pool shares corresponding to a token deposit amount and current balance in the pool (assuming all other stay constant) + let pool_shares_issued = |deposit_amount: u128, + token_balance: u128, + total_liquidity: u128| + -> Result { + let op1 = deposit_amount + .checked_div(token_balance) + .ok_or(DexError::Arithmethic)?; + + let op2 = op1.checked_add(1).ok_or(DexError::Arithmethic)?; + + let op3 = op2.nth_root(4); + + let op4 = op3.checked_sub(1).ok_or(DexError::Arithmethic)?; + + let op5 = op4 + .checked_mul(total_liquidity) + .ok_or(DexError::Arithmethic)?; + + Ok(op5) + }; + + let total_liquidity = self.total_liquidity; + let caller = Self::env().caller(); + + let native_deposit = Self::env().transferred_value(); + let native_balance = Self::env() + .balance() + .checked_sub(native_deposit) + .ok_or(DexError::Arithmethic)?; + + let minted_liquidity = + pool_shares_issued(native_deposit, native_balance, total_liquidity)?; + + // issue liquidity shares to the caller + let caller_liquidity = self + .liquidity + .get(&caller) + .unwrap_or(0) + .checked_add(minted_liquidity) + .ok_or(DexError::Arithmethic)?; + self.liquidity.insert(&caller, &caller_liquidity); + + // increase total liquidity + self.total_liquidity = self + .total_liquidity + .checked_add(minted_liquidity) + .ok_or(DexError::Arithmethic)?; + + Ok(()) + } + + /// Terminates the contract. + /// + /// can only be called by the contract's Owner + #[ink(message, selector = 7)] + pub fn terminate(&mut self) -> Result<(), DexError> { + let caller = self.env().caller(); + let this = self.env().account_id(); + + ::check_role( + self.access_control, + caller, + Role::Owner(this), + Self::cross_contract_call_error_handler, + Self::access_control_error_handler, + )?; + + self.env().terminate_contract(caller) + } + + /// Returns own code hash + #[ink(message)] + pub fn code_hash(&self) -> Result { + self.env() + .own_code_hash() + .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) + } + // END: mesages fn new_init(&mut self, ubik: AccountId, cyberiad: AccountId, lono: AccountId) { @@ -322,19 +408,19 @@ mod simple_dex { .ok_or(DexError::Arithmethic) } + fn access_control_error_handler(role: Role) -> DexError { + DexError::MissingRole(role) + } + + fn cross_contract_call_error_handler(why: InkEnvError) -> DexError { + DexError::CrossContractCall(format!("Calling access control has failed: {:?}", why)) + } + // fn emit_event(emitter: EE, event: Event) // where // EE: EmitEvent, // { // emitter.emit_event(event); // } - - /// Returns own code hash - #[ink(message)] - pub fn code_hash(&self) -> Result { - self.env() - .own_code_hash() - .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) - } } } From 79b9e0a51ef0609d771792cb36395ca7f6024b2a Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 15:07:07 +0200 Subject: [PATCH 04/31] added events --- contracts/simple_dex/lib.rs | 234 +++++++++++++++++++++++++++++------- 1 file changed, 192 insertions(+), 42 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index e82df456c9..76ddb627d3 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -22,24 +22,13 @@ mod simple_dex { use num::integer::Roots; use openbrush::contracts::traits::errors::PSP22Error; - // Event type - // type Event = ::Type; - - // |why: InkEnvError| { - // DexError::CrossContractCall(format!( - // "Calling access control has failed: {:?}", - // why - // )) - // }, + type Event = ::Type; #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] pub enum DexError { PSP22(PSP22Error), - // NotEnoughBalanceOf(AccountId), - // ArithmethicError, InsufficientAllowanceOf(AccountId), - // InsufficientTransferredValue, Arithmethic, MissingRole(Role), InkEnv(String), @@ -59,12 +48,50 @@ mod simple_dex { } } - // #[ink(event)] - // #[derive(Debug)] - // pub struct DexEvt { - // #[ink(topic)] - // a: AccountId, - // } + #[ink(event)] + #[derive(Debug)] + pub struct NativeToToken { + #[ink(topic)] + token_out: AccountId, + amount_in: Balance, + amount_out: Balance, + } + + #[ink(event)] + #[derive(Debug)] + pub struct TokenToNative { + #[ink(topic)] + token_in: AccountId, + amount_in: Balance, + amount_out: Balance, + } + + #[ink(event)] + #[derive(Debug)] + pub struct TokenToToken { + #[ink(topic)] + token_in: AccountId, + #[ink(topic)] + token_out: AccountId, + amount_in: Balance, + amount_out: Balance, + } + + #[ink(event)] + #[derive(Debug)] + pub struct NativeDeposit { + caller: AccountId, + amount: Balance, + minted_liquidity: Balance, + } + + #[ink(event)] + #[derive(Debug)] + pub struct NativeWithdrawal { + caller: AccountId, + amount: Balance, + redeemed_liquidity: Balance, + } #[ink(storage)] #[derive(SpreadAllocate)] @@ -111,9 +138,7 @@ mod simple_dex { } } - // mesages - - /// swap the transferred amount of native token to one of the pools PSP22 tokens + /// Swaps the transferred amount of native token to one of the pools PSP22 tokens #[ink(message, payable)] pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { let amount_token_in = self.env().transferred_value(); @@ -140,13 +165,22 @@ mod simple_dex { // transfer token_out from contract to user self.transfer_tx(token_out, caller, amount_token_out)??; - // TOOD : emit event + // emit event + Self::emit_event( + self.env(), + Event::NativeToToken(NativeToToken { + token_out, + amount_in: amount_token_in, + amount_out: amount_token_out, + }), + ); Ok(()) } - /// swap the a specified amount of pools token to the native token - /// calling account needs to give allowance to the DEX contract to spend amount_token_in on it's behalf + /// Swap the a specified amount of one of the pool PSP22 tokens to the native token + /// Calling account needs to give allowance to the DEX contract to spend amount_token_in of token_in on it's behalf + /// before executing this tx. #[ink(message)] pub fn token_to_native( &mut self, @@ -177,13 +211,22 @@ mod simple_dex { .transfer(caller, amount_token_out) .map_err(|_| DexError::NativeTransfer)?; - // TOOD : emit event + // emit event + Self::emit_event( + self.env(), + Event::TokenToNative(TokenToNative { + token_in, + amount_in: amount_token_in, + amount_out: amount_token_out, + }), + ); Ok(()) } - /// swap the a specified amount of one pool token to another token - /// calling account needs to give allowance to the DEX contract to spend amount_token_in on it's behalf + /// Swaps the a specified amount of one pool's PSP22 tokens to another PSP22 token + /// Calling account needs to give allowance to the DEX contract to spend amount_token_in of token_in on it's behalf + /// before executing this tx. #[ink(message)] pub fn token_to_token( &mut self, @@ -215,13 +258,26 @@ mod simple_dex { // transfer token_out from contract to user self.transfer_tx(token_out, caller, amount_token_out)??; + // emit event + Self::emit_event( + self.env(), + Event::TokenToToken(TokenToToken { + token_in, + token_out, + amount_in: amount_token_in, + amount_out: amount_token_out, + }), + ); + Ok(()) } /// LP: single-asset native deposit - /// Can be called only by an account carrying a LiquidityProvider role for this contract + /// + /// Can be called only by an account carrying a LiquidityProvider role for this contract. + /// This account gets a number of (virtual) pools shares which can than be redeemed for the #[ink(message, payable)] - pub fn native_asset_deposit(&mut self) -> Result<(), DexError> { + pub fn native_deposit(&mut self) -> Result<(), DexError> { // calculates number of pool shares corresponding to a token deposit amount and current balance in the pool (assuming all other stay constant) let pool_shares_issued = |deposit_amount: u128, token_balance: u128, @@ -244,11 +300,23 @@ mod simple_dex { Ok(op5) }; + let this = self.env().account_id(); + let caller = self.env().caller(); + + // check role, only designated account can add liquidity + ::check_role( + self.access_control, + caller, + Role::LiquidityProvider(this), + Self::cross_contract_call_error_handler, + Self::access_control_error_handler, + )?; + let total_liquidity = self.total_liquidity; - let caller = Self::env().caller(); - let native_deposit = Self::env().transferred_value(); - let native_balance = Self::env() + let native_deposit = self.env().transferred_value(); + let native_balance = self + .env() .balance() .checked_sub(native_deposit) .ok_or(DexError::Arithmethic)?; @@ -271,13 +339,97 @@ mod simple_dex { .checked_add(minted_liquidity) .ok_or(DexError::Arithmethic)?; + // emit event + Self::emit_event( + self.env(), + Event::NativeDeposit(NativeDeposit { + caller, + amount: native_deposit, + minted_liquidity, + }), + ); + + Ok(()) + } + + /// LP: single-asset native withdrawal + /// + /// Can be called only by an account carrying a LiquidityProvider role for this contract + #[ink(message, payable)] + pub fn native_withdrawal(&mut self, amount: u128) -> Result<(), DexError> { + let pool_shares_redeemed = |withdraw_amount: u128, + token_balance: u128, + total_liquidity: u128| + -> Result { + let op1 = withdraw_amount + .checked_div(token_balance) + .ok_or(DexError::Arithmethic)?; + + let op2 = 1u128.checked_sub(op1).ok_or(DexError::Arithmethic)?; + + let op3 = op2.nth_root(4); + + let op4 = 1u128.checked_sub(op3).ok_or(DexError::Arithmethic)?; + + let op5 = total_liquidity + .checked_mul(op4) + .ok_or(DexError::Arithmethic)?; + + Ok(op5) + }; + + let caller = self.env().caller(); + let native_balance = self.env().balance(); + let this = self.env().account_id(); + + // check role, only designated account can add liquidity + ::check_role( + self.access_control, + caller, + Role::LiquidityProvider(this), + Self::cross_contract_call_error_handler, + Self::access_control_error_handler, + )?; + + let total_liquidity = self.total_liquidity; + let redeemed_liquidity = pool_shares_redeemed(amount, native_balance, total_liquidity)?; + + // this should return Err variant if user has not enough liquidity so we can omit an explicit check + let caller_liquidity = self + .liquidity + .get(&caller) + .unwrap_or(0) + .checked_sub(redeemed_liquidity) + .ok_or(DexError::Arithmethic)?; + + self.liquidity.insert(&caller, &caller_liquidity); + + self.total_liquidity = self + .total_liquidity + .checked_sub(redeemed_liquidity) + .ok_or(DexError::Arithmethic)?; + + Self::env() + .transfer(caller, amount) + .map_err(|_| DexError::NativeTransfer)?; + + // emit event + Self::emit_event( + self.env(), + Event::NativeWithdrawal(NativeWithdrawal { + caller, + amount, + redeemed_liquidity, + }), + ); + Ok(()) } /// Terminates the contract. /// - /// can only be called by the contract's Owner - #[ink(message, selector = 7)] + /// Can only be called by the contract's Owner. + #[ink(message)] pub fn terminate(&mut self) -> Result<(), DexError> { let caller = self.env().caller(); let this = self.env().account_id(); @@ -301,8 +453,6 @@ mod simple_dex { .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) } - // END: mesages - fn new_init(&mut self, ubik: AccountId, cyberiad: AccountId, lono: AccountId) { self.access_control = AccountId::from(ACCESS_CONTROL_PUBKEY); self.ubik = ubik; @@ -416,11 +566,11 @@ mod simple_dex { DexError::CrossContractCall(format!("Calling access control has failed: {:?}", why)) } - // fn emit_event(emitter: EE, event: Event) - // where - // EE: EmitEvent, - // { - // emitter.emit_event(event); - // } + fn emit_event(emitter: EE, event: Event) + where + EE: EmitEvent, + { + emitter.emit_event(event); + } } } From 974f05694cab12d96ea066ffe1ada438b666dd1d Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 15:09:59 +0200 Subject: [PATCH 05/31] wut --- contracts/simple_dex/out | 2319 -------------------------------------- 1 file changed, 2319 deletions(-) delete mode 100644 contracts/simple_dex/out diff --git a/contracts/simple_dex/out b/contracts/simple_dex/out deleted file mode 100644 index 0eabbb390c..0000000000 --- a/contracts/simple_dex/out +++ /dev/null @@ -1,2319 +0,0 @@ - [1/2] Checking ink! linting rules -Checking with toolchain `nightly-2022-03-14-x86_64-unknown-linux-gnu` -warning: unused import: `Environment as EnvironmentTrait` - --> lib.rs:12:29 - | -12 | DefaultEnvironment, Environment as EnvironmentTrait, Error as InkEnvError, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(unused_imports)]` on by default - -warning: unused imports: `EmitEvent`, `reflect::ContractEventBase` - --> lib.rs:15:40 - | -15 | codegen::{initialize_contract, EmitEvent}, - | ^^^^^^^^^ -16 | reflect::ContractEventBase, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused variable: `caller` - --> lib.rs:122:17 - | -122 | let caller = self.env().caller(); - | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_caller` - | - = note: `#[warn(unused_variables)]` on by default - -warning: unused variable: `amount_token_out` - --> lib.rs:127:17 - | -127 | let amount_token_out = Self::out_given_in( - | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_amount_token_out` - -warning: `simple_dex` (lib) generated 4 warnings - Finished dev [unoptimized + debuginfo] target(s) in 0.04s - [2/2] Executing `cargo check` - Updating crates.io index - Updating git repository `https://github.com/Supercolony-net/openbrush-contracts.git` - Checking simple_dex v0.1.0 (/tmp/cargo-contract_OIkPhg) -error: cannot find macro `vec` in this scope - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:161:35 - | -161 | .push_arg(vec![0x0]), - | ^^^ - | - = note: consider importing this macro: - ink_prelude::vec - -warning: unused import: `Environment as EnvironmentTrait` - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:12:29 - | -12 | DefaultEnvironment, Environment as EnvironmentTrait, Error as InkEnvError, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(unused_imports)]` on by default - -warning: unused imports: `EmitEvent`, `reflect::ContractEventBase` - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:15:40 - | -15 | codegen::{initialize_contract, EmitEvent}, - | ^^^^^^^^^ -16 | reflect::ContractEventBase, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: duplicate lang item in crate `std`: `panic_impl`. - | - = note: the lang item is first defined in crate `ink_env` (which `simple_dex` depends on) - = note: first definition in `ink_env` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libink_env-4dd2a3ff5e73501d.rmeta - = note: second definition in `std` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libstd-029a8450b0f90c5b.rmeta - -error: duplicate lang item in crate `std`: `oom`. - | - = note: the lang item is first defined in crate `ink_allocator` (which `ink_env` depends on) - = note: first definition in `ink_allocator` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libink_allocator-0e2573d576e36ef2.rmeta - = note: second definition in `std` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libstd-029a8450b0f90c5b.rmeta - -error: duplicate lang item in crate `core`: `sized`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `unsize`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `structural_peq`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `structural_teq`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `copy`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `clone`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `sync`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `discriminant_kind`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `discriminant_type`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `pointee_trait`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `metadata_type`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `dyn_metadata`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `freeze`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `drop`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `destruct`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `coerce_unsized`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `dispatch_from_dyn`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `transmute_trait`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `add`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `sub`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `mul`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `div`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `rem`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `neg`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `not`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `bitxor`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `bitand`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `bitor`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `shl`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `shr`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `add_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `sub_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `mul_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `div_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `rem_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `bitxor_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `bitand_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `bitor_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `shl_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `shr_assign`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `index`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `index_mut`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `unsafe_cell`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `va_list`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `deref`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `deref_mut`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `deref_target`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `receiver`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `fn`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `fn_mut`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `fn_once`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `fn_once_output`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `future_trait`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `generator_state`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `generator`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `generator_return`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `unpin`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `pin`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `eq`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `partial_ord`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `panic`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `panic_fmt`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `panic_display`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `const_panic_fmt`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `panic_bounds_check`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `panic_info`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `panic_location`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `panic_no_unwind`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `drop_in_place`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `alloc_layout`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `const_eval_select`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `const_eval_select_ct`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `phantom_data`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `manually_drop`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `maybe_uninit`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `align_offset`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `Try`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `slice_len_fn`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `from_residual`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `from_output`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `branch`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `from_yeet`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `Ready`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `Pending`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `from_generator`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `get_context`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `poll`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `from`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `Some`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `None`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `Ok`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `Err`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `Continue`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `Break`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `into_future`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `into_iter`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `next`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `new_unchecked`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `RangeFrom`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `RangeFull`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `RangeInclusive`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `range_inclusive_new`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `Range`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `RangeToInclusive`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -error: duplicate lang item in crate `core`: `RangeTo`. - | - = note: the lang item is first defined in crate `core` (which `simple_dex` depends on) - = note: first definition in `core` loaded from /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink/wasm32-unknown-unknown/release/deps/libcore-4ebef8fca2dad587.rlib - = note: second definition in `core` loaded from /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-658cdd8d8c2a0952.rlib - -warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ - -warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:36 - | -25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] - | ^^^^^^^^^^^^^ - | - = note: this warning originates in the derive macro `scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `ink_env::AccountId` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:65:24 - | -65 | pub liquidity: Mapping, - | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::AccountId` -note: required by a bound in `ink_storage::Mapping` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_storage-3.3.1/src/lazy/mapping.rs:90:20 - | -90 | pub struct Mapping { - | ^ required by this bound in `ink_storage::Mapping` - -error[E0277]: the size for values of type `u128` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:65:24 - | -65 | pub liquidity: Mapping, - | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `u128` -note: required by a bound in `ink_storage::Mapping` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_storage-3.3.1/src/lazy/mapping.rs:90:23 - | -90 | pub struct Mapping { - | ^ required by this bound in `ink_storage::Mapping` - -error[E0277]: the size for values of type `__ink_ConstructorDecoder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `__ink_ConstructorDecoder` -note: required by a bound in `DecodeDispatch` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/reflect/dispatch.rs:653:27 - | -653 | pub trait DecodeDispatch: scale::Decode { - | ^^^^^^^^^^^^^ required by this bound in `DecodeDispatch` - -error[E0277]: the size for values of type `__ink_ConstructorDecoder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `__ink_ConstructorDecoder` -note: required by a bound in `parity_scale_codec::Decode` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 - | -295 | pub trait Decode: Sized { - | ^^^^^ required by this bound in `parity_scale_codec::Decode` - -error[E0277]: the size for values of type `__ink_MessageDecoder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `__ink_MessageDecoder` -note: required by a bound in `DecodeDispatch` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/reflect/dispatch.rs:653:27 - | -653 | pub trait DecodeDispatch: scale::Decode { - | ^^^^^^^^^^^^^ required by this bound in `DecodeDispatch` - -error[E0277]: the size for values of type `__ink_MessageDecoder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `__ink_MessageDecoder` -note: required by a bound in `parity_scale_codec::Decode` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 - | -295 | pub trait Decode: Sized { - | ^^^^^ required by this bound in `parity_scale_codec::Decode` - -error[E0277]: the size for values of type `SimpleDex` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:78:10 - | -78 | impl SimpleDex { - | ^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `SimpleDex` -note: required by a bound in `IsSameType` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/codegen/utils/same_type.rs:34:23 - | -34 | pub struct IsSameType { - | ^ required by this bound in `IsSameType` - -error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` -note: required by a bound in `PackedLayout` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_storage-3.3.1/src/traits/packed.rs:32:56 - | -32 | pub trait PackedLayout: SpreadLayout + scale::Encode + scale::Decode { - | ^^^^^^^^^^^^^ required by this bound in `PackedLayout` - = note: this error originates in the derive macro `::ink_storage::traits::PackedLayout` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` -note: required by a bound in `EncodeLike` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/encode_like.rs:73:41 - | -73 | pub trait EncodeLike: Sized + Encode {} - | ^^^^^ required by this bound in `EncodeLike` - = note: this error originates in the derive macro `::scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` -note: required by a bound in `parity_scale_codec::Decode` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 - | -295 | pub trait Decode: Sized { - | ^^^^^ required by this bound in `parity_scale_codec::Decode` - = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` -note: required by a bound in `Clone` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:110:18 - | -110 | pub trait Clone: Sized { - | ^^^^^ required by this bound in `Clone` - = note: this error originates in the derive macro `::core::clone::Clone` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DefaultEnvironment` -note: required by a bound in `FromAccountId` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:45:25 - | -45 | pub trait FromAccountId - | ^ required by this bound in `FromAccountId` - -error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DefaultEnvironment` -note: required by a bound in `ToAccountId` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/contract_ref.rs:20:23 - | -20 | pub trait ToAccountId - | ^ required by this bound in `ToAccountId` - -error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `SimpleDexRef` -note: required by a bound in `PackedLayout` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_storage-3.3.1/src/traits/packed.rs:32:56 - | -32 | pub trait PackedLayout: SpreadLayout + scale::Encode + scale::Decode { - | ^^^^^^^^^^^^^ required by this bound in `PackedLayout` - = note: this error originates in the derive macro `::ink_storage::traits::PackedLayout` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `SimpleDexRef` -note: required by a bound in `EncodeLike` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/encode_like.rs:73:41 - | -73 | pub trait EncodeLike: Sized + Encode {} - | ^^^^^ required by this bound in `EncodeLike` - = note: this error originates in the derive macro `::scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `SimpleDexRef` -note: required by a bound in `parity_scale_codec::Decode` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 - | -295 | pub trait Decode: Sized { - | ^^^^^ required by this bound in `parity_scale_codec::Decode` - = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `SimpleDexRef` -note: required by a bound in `Clone` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:110:18 - | -110 | pub trait Clone: Sized { - | ^^^^^ required by this bound in `Clone` - = note: this error originates in the derive macro `::core::clone::Clone` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:36 - | -25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] - | ^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `EncodeLike` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/encode_like.rs:73:41 - | -73 | pub trait EncodeLike: Sized + Encode {} - | ^^^^^ required by this bound in `EncodeLike` - = note: this error originates in the derive macro `scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:51 - | -25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] - | ^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `parity_scale_codec::Decode` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/parity-scale-codec-3.1.5/src/codec.rs:295:19 - | -295 | pub trait Decode: Sized { - | ^^^^^ required by this bound in `parity_scale_codec::Decode` - = note: this error originates in the derive macro `scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `openbrush::openbrush_contracts::psp22::PSP22Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:40:10 - | -40 | impl From for DexError { - | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `openbrush::openbrush_contracts::psp22::PSP22Error` -note: required by a bound in `From` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:369:16 - | -369 | pub trait From: Sized { - | ^ required by this bound in `From` - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:40:10 - | -40 | impl From for DexError { - | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `From` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:369:20 - | -369 | pub trait From: Sized { - | ^^^^^ required by this bound in `From` - -error[E0277]: the size for values of type `ink_env::Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:46:10 - | -46 | impl From for DexError { - | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::Error` -note: required by a bound in `From` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:369:16 - | -369 | pub trait From: Sized { - | ^ required by this bound in `From` - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:46:10 - | -46 | impl From for DexError { - | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `From` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:369:20 - | -369 | pub trait From: Sized { - | ^^^^^ required by this bound in `From` - -error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:5:1 - | -5 | #[ink::contract] - | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DefaultEnvironment` -note: required by a bound in `EnvAccess` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_lang-3.3.1/src/env_access.rs:38:26 - | -38 | pub struct EnvAccess<'a, E> { - | ^ required by this bound in `EnvAccess` - = note: this error originates in the attribute macro `ink::contract` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `()` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `()` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `()` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:9 - | -112 | / pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { -113 | | let amount_token_in = self.env().transferred_value(); -114 | | // we use the balance of the native token just before the exchange tx -115 | | let balance_token_in = self -... | -136 | | Ok(()) -137 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `()` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:9 - | -112 | / pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { -113 | | let amount_token_in = self.env().transferred_value(); -114 | | // we use the balance of the native token just before the exchange tx -115 | | let balance_token_in = self -... | -136 | | Ok(()) -137 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `ink_env::Hash` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::Hash` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `ink_env::Hash` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:212:9 - | -212 | / /// Returns own code hash -213 | | #[ink(message)] -214 | | pub fn code_hash(&self) -> Result { -215 | | self.env() -216 | | .own_code_hash() -217 | | .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) -218 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::Hash` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:212:9 - | -212 | / /// Returns own code hash -213 | | #[ink(message)] -214 | | pub fn code_hash(&self) -> Result { -215 | | self.env() -216 | | .own_code_hash() -217 | | .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) -218 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `__ink_ConstructorDecoder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `__ink_ConstructorDecoder` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `DispatchError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DispatchError` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `parity_scale_codec::Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `parity_scale_codec::Error` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `()` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `()` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `__ink_MessageDecoder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `__ink_MessageDecoder` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `Result<(), openbrush::openbrush_contracts::psp22::PSP22Error>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:154:14 - | -154 | ) -> Result, InkEnvError> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Result<(), openbrush::openbrush_contracts::psp22::PSP22Error>` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `ink_env::Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:154:14 - | -154 | ) -> Result, InkEnvError> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::Error` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `()` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:154:14 - | -154 | ) -> Result, InkEnvError> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `()` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `openbrush::openbrush_contracts::psp22::PSP22Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:154:14 - | -154 | ) -> Result, InkEnvError> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `openbrush::openbrush_contracts::psp22::PSP22Error` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `u128` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:168:71 - | -168 | fn balance_of(&self, token: AccountId, account: AccountId) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `u128` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `ink_env::Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:168:71 - | -168 | fn balance_of(&self, token: AccountId, account: AccountId) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::Error` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `u128` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:183:14 - | -183 | ) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `u128` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:183:14 - | -183 | ) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - -error[E0277]: the size for values of type `()` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `()` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `::core::fmt::Debug` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `core::fmt::Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `core::fmt::Error` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `::core::fmt::Debug` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `u8` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `u8` -note: required by a bound in `Vec` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:400:16 - | -400 | pub struct Vec { - | ^ required by this bound in `Vec` - = note: this error originates in the derive macro `::scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `Global` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Global` -note: required by a bound in `Vec` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:400:75 - | -400 | pub struct Vec { - | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Vec` - = note: this error originates in the derive macro `::scale::Encode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `simple_dex::_::CallBuilder` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `simple_dex::_::CallBuilder` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `parity_scale_codec::Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `parity_scale_codec::Error` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DefaultEnvironment` -note: required by a bound in `ink_env::call::CallBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:24 - | -346 | pub struct CallBuilder - | ^ required by this bound in `ink_env::call::CallBuilder` - -error[E0277]: the size for values of type `Set>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Set>` -note: required by a bound in `ink_env::call::CallBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:27 - | -346 | pub struct CallBuilder - | ^^^^^^^^ required by this bound in `ink_env::call::CallBuilder` - -error[E0277]: the size for values of type `Set, ArgumentList>>>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Set, ArgumentList>>>` -note: required by a bound in `ink_env::call::CallBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:37 - | -346 | pub struct CallBuilder - | ^^^^ required by this bound in `ink_env::call::CallBuilder` - -error[E0277]: the size for values of type `Set>>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Set>>` -note: required by a bound in `ink_env::call::CallBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:43 - | -346 | pub struct CallBuilder - | ^^^^^^^ required by this bound in `ink_env::call::CallBuilder` - -error[E0277]: the size for values of type `Call` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Call` -note: required by a bound in `Set` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 - | -43 | pub struct Set(pub T); - | ^ required by this bound in `Set` - -error[E0277]: the size for values of type `ExecutionInput, ArgumentList>>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ExecutionInput, ArgumentList>>` -note: required by a bound in `Set` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 - | -43 | pub struct Set(pub T); - | ^ required by this bound in `Set` - -error[E0277]: the size for values of type `ArgumentList, ArgumentList>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentList, ArgumentList>` -note: required by a bound in `ExecutionInput` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:19:27 - | -19 | pub struct ExecutionInput { - | ^^^^ required by this bound in `ExecutionInput` - -error[E0277]: the size for values of type `ink_env::call::utils::Argument` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::call::utils::Argument` -note: required by a bound in `ArgumentList` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 - | -74 | pub struct ArgumentList { - | ^^^^ required by this bound in `ArgumentList` - -error[E0277]: the size for values of type `ArgumentList` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentList` -note: required by a bound in `ArgumentList` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:31 - | -74 | pub struct ArgumentList { - | ^^^^ required by this bound in `ArgumentList` - -error[E0277]: the size for values of type `ink_env::AccountId` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::AccountId` -note: required by a bound in `ink_env::call::utils::Argument` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:86:21 - | -86 | pub struct Argument { - | ^ required by this bound in `ink_env::call::utils::Argument` - -error[E0277]: the size for values of type `ArgumentListEnd` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentListEnd` -note: required by a bound in `ArgumentList` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 - | -74 | pub struct ArgumentList { - | ^^^^ required by this bound in `ArgumentList` - -error[E0277]: the size for values of type `ReturnType>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ReturnType>` -note: required by a bound in `Set` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 - | -43 | pub struct Set(pub T); - | ^ required by this bound in `Set` - -error[E0277]: the size for values of type `Result<(), DexError>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:112:68 - | -112 | pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Result<(), DexError>` -note: required by a bound in `ReturnType` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:23:23 - | -23 | pub struct ReturnType(PhantomData T>); - | ^ required by this bound in `ReturnType` - -error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DefaultEnvironment` -note: required by a bound in `ink_env::call::CallBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:24 - | -346 | pub struct CallBuilder - | ^ required by this bound in `ink_env::call::CallBuilder` - -error[E0277]: the size for values of type `Set>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Set>` -note: required by a bound in `ink_env::call::CallBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:27 - | -346 | pub struct CallBuilder - | ^^^^^^^^ required by this bound in `ink_env::call::CallBuilder` - -error[E0277]: the size for values of type `Set>>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Set>>` -note: required by a bound in `ink_env::call::CallBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:37 - | -346 | pub struct CallBuilder - | ^^^^ required by this bound in `ink_env::call::CallBuilder` - -error[E0277]: the size for values of type `Set>>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Set>>` -note: required by a bound in `ink_env::call::CallBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/call_builder.rs:346:43 - | -346 | pub struct CallBuilder - | ^^^^^^^ required by this bound in `ink_env::call::CallBuilder` - -error[E0277]: the size for values of type `Call` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Call` -note: required by a bound in `Set` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 - | -43 | pub struct Set(pub T); - | ^ required by this bound in `Set` - -error[E0277]: the size for values of type `ExecutionInput>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ExecutionInput>` -note: required by a bound in `Set` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 - | -43 | pub struct Set(pub T); - | ^ required by this bound in `Set` - -error[E0277]: the size for values of type `ArgumentList` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentList` -note: required by a bound in `ExecutionInput` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:19:27 - | -19 | pub struct ExecutionInput { - | ^^^^ required by this bound in `ExecutionInput` - -error[E0277]: the size for values of type `ArgumentListEnd` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentListEnd` -note: required by a bound in `ArgumentList` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 - | -74 | pub struct ArgumentList { - | ^^^^ required by this bound in `ArgumentList` - -error[E0277]: the size for values of type `ReturnType>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ReturnType>` -note: required by a bound in `Set` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 - | -43 | pub struct Set(pub T); - | ^ required by this bound in `Set` - -error[E0277]: the size for values of type `Result` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:214:36 - | -214 | pub fn code_hash(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Result` -note: required by a bound in `ReturnType` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:23:23 - | -23 | pub struct ReturnType(PhantomData T>); - | ^ required by this bound in `ReturnType` - -error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:60:5 - | -60 | / #[derive(SpreadAllocate)] -61 | | pub struct SimpleDex { -62 | | /// total supply of pool shares -63 | | pub total_liquidity: u128, -... | -71 | | pub lono: AccountId, -72 | | } - | |_____^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `SimpleDexRef` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `DefaultEnvironment` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DefaultEnvironment` -note: required by a bound in `CreateBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:26 - | -129 | pub struct CreateBuilder - | ^ required by this bound in `CreateBuilder` - -error[E0277]: the size for values of type `Unset` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Unset` -note: required by a bound in `CreateBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:29 - | -129 | pub struct CreateBuilder - | ^^^^^^^^ required by this bound in `CreateBuilder` - -error[E0277]: the size for values of type `Unset` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Unset` -note: required by a bound in `CreateBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:39 - | -129 | pub struct CreateBuilder - | ^^^^^^^^ required by this bound in `CreateBuilder` - -error[E0277]: the size for values of type `Unset` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Unset` -note: required by a bound in `CreateBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:49 - | -129 | pub struct CreateBuilder - | ^^^^^^^^^ required by this bound in `CreateBuilder` - -error[E0277]: the size for values of type `Set, ArgumentList, ArgumentList, ArgumentList>>>>>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Set, ArgumentList, ArgumentList, ArgumentList>>>>>` -note: required by a bound in `CreateBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:60 - | -129 | pub struct CreateBuilder - | ^^^^ required by this bound in `CreateBuilder` - -error[E0277]: the size for values of type `Unset` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Unset` -note: required by a bound in `CreateBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:66 - | -129 | pub struct CreateBuilder - | ^^^^ required by this bound in `CreateBuilder` - -error[E0277]: the size for values of type `SimpleDexRef` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `SimpleDexRef` -note: required by a bound in `CreateBuilder` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/create_builder.rs:129:72 - | -129 | pub struct CreateBuilder - | ^ required by this bound in `CreateBuilder` - -error[E0277]: the size for values of type `ink_env::Hash` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::Hash` -note: required by a bound in `Unset` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:55:18 - | -55 | pub struct Unset(PhantomData T>); - | ^ required by this bound in `Unset` - -error[E0277]: the size for values of type `u64` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `u64` -note: required by a bound in `Unset` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:55:18 - | -55 | pub struct Unset(PhantomData T>); - | ^ required by this bound in `Unset` - -error[E0277]: the size for values of type `u128` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `u128` -note: required by a bound in `Unset` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:55:18 - | -55 | pub struct Unset(PhantomData T>); - | ^ required by this bound in `Unset` - -error[E0277]: the size for values of type `ExecutionInput, ArgumentList, ArgumentList, ArgumentList>>>>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ExecutionInput, ArgumentList, ArgumentList, ArgumentList>>>>` -note: required by a bound in `Set` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:43:16 - | -43 | pub struct Set(pub T); - | ^ required by this bound in `Set` - -error[E0277]: the size for values of type `ArgumentList, ArgumentList, ArgumentList, ArgumentList>>>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentList, ArgumentList, ArgumentList, ArgumentList>>>` -note: required by a bound in `ExecutionInput` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:19:27 - | -19 | pub struct ExecutionInput { - | ^^^^ required by this bound in `ExecutionInput` - -error[E0277]: the size for values of type `ink_env::call::utils::Argument` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::call::utils::Argument` -note: required by a bound in `ArgumentList` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 - | -74 | pub struct ArgumentList { - | ^^^^ required by this bound in `ArgumentList` - -error[E0277]: the size for values of type `ArgumentList, ArgumentList, ArgumentList>>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentList, ArgumentList, ArgumentList>>` -note: required by a bound in `ArgumentList` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:31 - | -74 | pub struct ArgumentList { - | ^^^^ required by this bound in `ArgumentList` - -error[E0277]: the size for values of type `ink_env::AccountId` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ink_env::AccountId` -note: required by a bound in `ink_env::call::utils::Argument` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:86:21 - | -86 | pub struct Argument { - | ^ required by this bound in `ink_env::call::utils::Argument` - -error[E0277]: the size for values of type `ArgumentList, ArgumentList>` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentList, ArgumentList>` -note: required by a bound in `ArgumentList` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:31 - | -74 | pub struct ArgumentList { - | ^^^^ required by this bound in `ArgumentList` - -error[E0277]: the size for values of type `ArgumentList` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentList` -note: required by a bound in `ArgumentList` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:31 - | -74 | pub struct ArgumentList { - | ^^^^ required by this bound in `ArgumentList` - -error[E0277]: the size for values of type `ArgumentListEnd` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `ArgumentListEnd` -note: required by a bound in `ArgumentList` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/execution_input.rs:74:25 - | -74 | pub struct ArgumentList { - | ^^^^ required by this bound in `ArgumentList` - -error[E0277]: the size for values of type `Salt` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:80:9 - | -80 | / pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { -81 | | let caller = Self::env().caller(); -82 | | let code_hash = Self::env() -83 | | .own_code_hash() -... | -106 | | } -107 | | } - | |_________^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `Salt` -note: required by a bound in `Unset` - --> /home/filip/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/ink_env-3.3.1/src/call/common.rs:55:18 - | -55 | pub struct Unset(PhantomData T>); - | ^ required by this bound in `Unset` - -error[E0277]: the size for values of type `()` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:14 - | -25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] - | ^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `()` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `core::fmt::Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:14 - | -25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] - | ^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `core::fmt::Error` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `DexError` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:51 - | -25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] - | ^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `DexError` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:17 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `parity_scale_codec::Error` cannot be known at compilation time - --> /home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/lib.rs:25:51 - | -25 | #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] - | ^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `parity_scale_codec::Error` -note: required by a bound in `Result` - --> /home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:504:20 - | -504 | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info) - -For more information about this error, try `rustc --explain E0277`. -warning: `simple_dex` (lib) generated 4 warnings -error: could not compile `simple_dex` due to 211 previous errors; 4 warnings emitted -ERROR: `"/home/filip/.rustup/toolchains/nightly-2022-08-12-x86_64-unknown-linux-gnu/bin/cargo" "check" "--target=wasm32-unknown-unknown" "-Zbuild-std" "--no-default-features" "--release" "--target-dir=/home/filip/CloudStation/aleph/aleph-node/contracts/simple_dex/target/ink" "-Zbuild-std-features=panic_immediate_abort"` failed with exit code: Some(101) From ed2ad452de3846a12addd06dca58845a3a336258 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 15:15:04 +0200 Subject: [PATCH 06/31] edited events --- contracts/simple_dex/lib.rs | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 76ddb627d3..4fc747182d 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -51,6 +51,7 @@ mod simple_dex { #[ink(event)] #[derive(Debug)] pub struct NativeToToken { + caller: AccountId, #[ink(topic)] token_out: AccountId, amount_in: Balance, @@ -60,6 +61,7 @@ mod simple_dex { #[ink(event)] #[derive(Debug)] pub struct TokenToNative { + caller: AccountId, #[ink(topic)] token_in: AccountId, amount_in: Balance, @@ -69,6 +71,7 @@ mod simple_dex { #[ink(event)] #[derive(Debug)] pub struct TokenToToken { + caller: AccountId, #[ink(topic)] token_in: AccountId, #[ink(topic)] @@ -93,6 +96,14 @@ mod simple_dex { redeemed_liquidity: Balance, } + #[ink(event)] + #[derive(Debug)] + pub struct SwapFeeSet { + #[ink(topic)] + caller: AccountId, + swap_fee: Balance, + } + #[ink(storage)] #[derive(SpreadAllocate)] pub struct SimpleDex { @@ -169,6 +180,7 @@ mod simple_dex { Self::emit_event( self.env(), Event::NativeToToken(NativeToToken { + caller, token_out, amount_in: amount_token_in, amount_out: amount_token_out, @@ -215,6 +227,7 @@ mod simple_dex { Self::emit_event( self.env(), Event::TokenToNative(TokenToNative { + caller, token_in, amount_in: amount_token_in, amount_out: amount_token_out, @@ -262,6 +275,7 @@ mod simple_dex { Self::emit_event( self.env(), Event::TokenToToken(TokenToToken { + caller, token_in, token_out, amount_in: amount_token_in, @@ -426,6 +440,38 @@ mod simple_dex { Ok(()) } + /// Alters the swap_fee parameter + /// + /// Can only be called by the contract's Admin. + #[ink(message)] + pub fn set_swap_fee(&mut self, swap_fee: Balance) -> Result<(), DexError> { + let caller = self.env().caller(); + let this = self.env().account_id(); + + ::check_role( + self.access_control, + caller, + Role::Admin(this), + Self::cross_contract_call_error_handler, + Self::access_control_error_handler, + )?; + + // emit event + Self::emit_event( + self.env(), + Event::SwapFeeSet(SwapFeeSet { caller, swap_fee }), + ); + + self.swap_fee = swap_fee; + Ok(()) + } + + /// Returns current value of the swap_fee parameter + #[ink(message)] + pub fn swap_fee(&mut self) -> Balance { + self.swap_fee + } + /// Terminates the contract. /// /// Can only be called by the contract's Owner. From 56a4b04d8bfb10e39a97764e0afdbfc6f56228e3 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 15:24:36 +0200 Subject: [PATCH 07/31] set AC --- contracts/simple_dex/lib.rs | 38 +++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 4fc747182d..56017c2cd7 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -472,6 +472,35 @@ mod simple_dex { self.swap_fee } + /// Sets access_control to a new contract address + /// + /// Potentially very destructive, can only be called by the contract's Owner. + #[ink(message)] + pub fn set_access_control(&mut self, access_control: AccountId) -> Result<(), DexError> + where + Self: AccessControlled, + { + let caller = self.env().caller(); + let this = self.env().account_id(); + + ::check_role( + self.access_control, + caller, + Role::Owner(this), + Self::cross_contract_call_error_handler, + Self::access_control_error_handler, + )?; + + self.access_control = access_control; + Ok(()) + } + + /// Returns current address of the AccessControl contract that holds the account priviledges for this DEX + #[ink(message)] + pub fn access_control(&self) -> AccountId { + self.access_control + } + /// Terminates the contract. /// /// Can only be called by the contract's Owner. @@ -506,7 +535,7 @@ mod simple_dex { self.lono = lono; } - /// transfers a given amount of a PSP22 token to a specified using the contracts own balance + /// Transfers a given amount of a PSP22 token to a specified using the callers own balance fn transfer_tx( &self, token: AccountId, @@ -525,7 +554,8 @@ mod simple_dex { .fire() } - /// transfers a given amount of a PSP22 token on behalf of a specified account to another account + /// Transfers a given amount of a PSP22 token on behalf of a specified account to another account + /// /// Will revert if not enough allowance was given to the caller prior to executing this tx fn transfer_from_tx( &self, @@ -543,12 +573,12 @@ mod simple_dex { .push_arg(amount) .push_arg(vec![0x0]), ) - .call_flags(CallFlags::default().set_allow_reentry(true)) + .call_flags(CallFlags::default().set_allow_reentry(true)) // needed for checking allowance before the actual tx .returns::>() .fire() } - /// returns unused allowance that the owner has given to spender + /// Returns the amount of unused allowance that the token owner has given to the spender fn allowance( &self, token: AccountId, From 4476eaa2aa7a0a21d88e7a42869f6d322a3919c9 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 15:31:01 +0200 Subject: [PATCH 08/31] give why --- contracts/simple_dex/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 56017c2cd7..f99360a6cb 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -33,7 +33,7 @@ mod simple_dex { MissingRole(Role), InkEnv(String), CrossContractCall(String), - NativeTransfer, + NativeTransferFailed(String), } impl From for DexError { @@ -221,7 +221,7 @@ mod simple_dex { self.env() .transfer(caller, amount_token_out) - .map_err(|_| DexError::NativeTransfer)?; + .map_err(|why| DexError::NativeTransferFailed(format!("{:?}", why)))?; // emit event Self::emit_event( @@ -425,7 +425,7 @@ mod simple_dex { Self::env() .transfer(caller, amount) - .map_err(|_| DexError::NativeTransfer)?; + .map_err(|why| DexError::NativeTransferFailed(format!("{:?}", why)))?; // emit event Self::emit_event( From b12d883b7139525525a415f647f4ad90f521e508 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 15:51:38 +0200 Subject: [PATCH 09/31] docstring --- contracts/simple_dex/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index f99360a6cb..0bd476b52d 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -2,6 +2,13 @@ use ink_lang as ink; +/// Simple DEX contract +/// +/// This contract is based on Balancer multi asset LP design and all formulas are taken from the Balancer's whitepaper (https://balancer.fi/whitepaper.pdf) +/// It has one pool with three PSP22 game reward tokens and our native token +/// Swaps can be done between all pairs in the pool +/// Liquidity provision is provided as single (native) asset deposits/withdrawals only, and calling the assosiated functions is limited to designated accounts only. + #[ink::contract] mod simple_dex { From 23f0cf347086a4776aedea9d7ec6d4dc989f93f3 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 16:02:19 +0200 Subject: [PATCH 10/31] modified docstring --- contracts/simple_dex/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 0bd476b52d..03748d5e9c 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -119,7 +119,6 @@ mod simple_dex { /// tracks pool shares per account pub liquidity: Mapping, pub swap_fee: u128, - /// access control contract pub access_control: AccountId, pub ubik: AccountId, pub cyberiad: AccountId, @@ -296,7 +295,7 @@ mod simple_dex { /// LP: single-asset native deposit /// /// Can be called only by an account carrying a LiquidityProvider role for this contract. - /// This account gets a number of (virtual) pools shares which can than be redeemed for the + /// This account gets a number of (virtual) pools shares which can than be redeemed back for the native asset using the withdrawal transaction #[ink(message, payable)] pub fn native_deposit(&mut self) -> Result<(), DexError> { // calculates number of pool shares corresponding to a token deposit amount and current balance in the pool (assuming all other stay constant) From 2012cfe80189a15dee8352fe581feafe31f26587 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 8 Sep 2022 16:46:31 +0200 Subject: [PATCH 11/31] cleanup --- contracts/simple_dex/lib.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 03748d5e9c..7b9541d0ff 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -196,7 +196,7 @@ mod simple_dex { Ok(()) } - /// Swap the a specified amount of one of the pool PSP22 tokens to the native token + /// Swap the specified amount of one of the pools PSP22 tokens to the native token /// Calling account needs to give allowance to the DEX contract to spend amount_token_in of token_in on it's behalf /// before executing this tx. #[ink(message)] @@ -206,10 +206,12 @@ mod simple_dex { amount_token_in: u128, ) -> Result<(), DexError> { let caller = self.env().caller(); - let balance_token_out = self.env().balance(); - let swap_fee = self.swap_fee; let this = self.env().account_id(); + let swap_fee = self.swap_fee; + + let balance_token_out = self.env().balance(); let balance_token_in = self.balance_of(token_in, this)?; + let amount_token_out = Self::out_given_in( amount_token_in, balance_token_in, @@ -253,9 +255,9 @@ mod simple_dex { token_out: AccountId, amount_token_in: u128, ) -> Result<(), DexError> { + let this = self.env().account_id(); + let caller = self.env().caller(); let swap_fee = self.swap_fee; - let this = Self::env().account_id(); - let caller = Self::env().caller(); let balance_token_in = self.balance_of(token_in, this)?; let balance_token_out = self.balance_of(token_out, this)?; @@ -399,7 +401,6 @@ mod simple_dex { }; let caller = self.env().caller(); - let native_balance = self.env().balance(); let this = self.env().account_id(); // check role, only designated account can add liquidity @@ -411,6 +412,7 @@ mod simple_dex { Self::access_control_error_handler, )?; + let native_balance = self.env().balance(); let total_liquidity = self.total_liquidity; let redeemed_liquidity = pool_shares_redeemed(amount, native_balance, total_liquidity)?; @@ -429,7 +431,7 @@ mod simple_dex { .checked_sub(redeemed_liquidity) .ok_or(DexError::Arithmethic)?; - Self::env() + self.env() .transfer(caller, amount) .map_err(|why| DexError::NativeTransferFailed(format!("{:?}", why)))?; From 3be698732462917b213431cc7c8d4f0821fe3a8e Mon Sep 17 00:00:00 2001 From: Filip Bielejec Date: Wed, 14 Sep 2022 13:06:27 +0200 Subject: [PATCH 12/31] Update contracts/simple_dex/lib.rs Co-authored-by: deuszx <95355183+deuszx@users.noreply.github.com> --- contracts/simple_dex/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 7b9541d0ff..15cf31cce1 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -197,7 +197,7 @@ mod simple_dex { } /// Swap the specified amount of one of the pools PSP22 tokens to the native token - /// Calling account needs to give allowance to the DEX contract to spend amount_token_in of token_in on it's behalf + /// Calling account needs to give allowance to the DEX contract to spend `amount_token_in` of `token_in` on its behalf /// before executing this tx. #[ink(message)] pub fn token_to_native( From 99952a4437e4cab96b5676917fe70088f2cafc7d Mon Sep 17 00:00:00 2001 From: filip Date: Wed, 14 Sep 2022 13:42:12 +0200 Subject: [PATCH 13/31] simplified artihmetic --- contracts/simple_dex/lib.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 15cf31cce1..0b8bc18f40 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -621,24 +621,23 @@ mod simple_dex { balance_token_out: u128, swap_fee: u128, ) -> Result { - let op1 = 1u128.checked_sub(swap_fee).ok_or(DexError::Arithmethic)?; - - let op2 = amount_token_in - .checked_mul(op1) + let op0 = amount_token_in + .checked_mul(swap_fee) .ok_or(DexError::Arithmethic)?; - let op3 = balance_token_in - .checked_add(op2) + let op1 = balance_token_in + .checked_add(amount_token_in) + .and_then(|result| result.checked_sub(op0)) .ok_or(DexError::Arithmethic)?; - let op4 = balance_token_in - .checked_div(op3) + let op2 = balance_token_out + .checked_mul(balance_token_in) .ok_or(DexError::Arithmethic)?; - let op5 = 1u128.checked_sub(op4).ok_or(DexError::Arithmethic)?; + let op3 = op2.checked_div(op1).ok_or(DexError::Arithmethic)?; balance_token_out - .checked_mul(op5) + .checked_sub(op3) .ok_or(DexError::Arithmethic) } From e4d8211411099b15175f67aeaa360807fb11df96 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 15 Sep 2022 13:22:40 +0200 Subject: [PATCH 14/31] moved roles to own mod --- contracts/access_control/Cargo.lock | 2 +- contracts/access_control/Cargo.toml | 2 +- contracts/access_control/lib.rs | 26 +++++--------------------- contracts/access_control/roles.rs | 19 +++++++++++++++++++ contracts/access_control/traits.rs | 2 +- contracts/button/Cargo.lock | 2 +- contracts/button/errors.rs | 2 +- contracts/button/lib.rs | 2 +- contracts/game_token/Cargo.lock | 2 +- contracts/game_token/lib.rs | 2 +- contracts/marketplace/Cargo.lock | 2 +- contracts/marketplace/lib.rs | 2 +- contracts/ticket_token/Cargo.lock | 2 +- contracts/ticket_token/lib.rs | 2 +- 14 files changed, 36 insertions(+), 33 deletions(-) create mode 100644 contracts/access_control/roles.rs diff --git a/contracts/access_control/Cargo.lock b/contracts/access_control/Cargo.lock index a2156c82b3..8ec3003bf5 100644 --- a/contracts/access_control/Cargo.lock +++ b/contracts/access_control/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "access_control" -version = "0.1.0" +version = "1.0.0" dependencies = [ "ink_env", "ink_lang", diff --git a/contracts/access_control/Cargo.toml b/contracts/access_control/Cargo.toml index fe84521b5c..6ed28e95a2 100644 --- a/contracts/access_control/Cargo.toml +++ b/contracts/access_control/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "access_control" -version = "0.1.0" +version = "1.0.0" authors = ["Cardinal Cryptography"] edition = "2021" publish = false diff --git a/contracts/access_control/lib.rs b/contracts/access_control/lib.rs index 86af850b60..de127a993d 100644 --- a/contracts/access_control/lib.rs +++ b/contracts/access_control/lib.rs @@ -1,8 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] pub use crate::access_control::{ - AccessControlError, Role, ACCESS_CONTROL_PUBKEY, CHECK_ROLE_SELECTOR, HAS_ROLE_SELECTOR, + AccessControlError, ACCESS_CONTROL_PUBKEY, CHECK_ROLE_SELECTOR, HAS_ROLE_SELECTOR, }; +pub mod roles; pub mod traits; use ink_lang as ink; @@ -10,34 +11,17 @@ use ink_lang as ink; mod access_control { use ink_lang::{codegen::EmitEvent, reflect::ContractEventBase}; - use ink_storage::{ - traits::{PackedLayout, SpreadAllocate, SpreadLayout}, - Mapping, - }; + use ink_storage::{traits::SpreadAllocate, Mapping}; use scale::{Decode, Encode}; + use crate::roles::Role; + // address placeholder, to be set in the bytecode // 4465614444656144446561444465614444656144446561444465614444656144 => 5DcPEG9AQ4Y9Lo9C5WXuKJDDawens77jWxZ6zGChnm8y8FUX pub const ACCESS_CONTROL_PUBKEY: [u8; 32] = *b"DeaDDeaDDeaDDeaDDeaDDeaDDeaDDeaD"; pub const HAS_ROLE_SELECTOR: [u8; 4] = [0, 0, 0, 3]; pub const CHECK_ROLE_SELECTOR: [u8; 4] = [0, 0, 0, 5]; - #[derive(Debug, Encode, Decode, Clone, Copy, SpreadLayout, PackedLayout, PartialEq, Eq)] - #[cfg_attr( - feature = "std", - derive(scale_info::TypeInfo, ink_storage::traits::StorageLayout) - )] - pub enum Role { - /// Indicates a superuser. - Admin(AccountId), - /// Indicates account can terminate a contract. - Owner(AccountId), - /// Indicates account can initialize a contract from a given code hash. - Initializer(Hash), - /// Indicates account can add liquidity to a DEX contract (call certain functions) - LiquidityProvider(AccountId), - } - #[ink(storage)] #[derive(SpreadAllocate)] pub struct AccessControl { diff --git a/contracts/access_control/roles.rs b/contracts/access_control/roles.rs new file mode 100644 index 0000000000..ce607a9160 --- /dev/null +++ b/contracts/access_control/roles.rs @@ -0,0 +1,19 @@ +use ink_env::{AccountId, Hash}; +use ink_storage::traits::{PackedLayout, SpreadLayout}; +use scale::{Decode, Encode}; + +#[derive(Debug, Encode, Decode, Clone, Copy, SpreadLayout, PackedLayout, PartialEq, Eq)] +#[cfg_attr( + feature = "std", + derive(scale_info::TypeInfo, ink_storage::traits::StorageLayout) +)] +pub enum Role { + /// Indicates a superuser. + Admin(AccountId), + /// Indicates account can terminate a contract. + Owner(AccountId), + /// Indicates account can initialize a contract from a given code hash. + Initializer(Hash), + /// Indicates account can add liquidity to a DEX contract (call certain functions) + LiquidityProvider(AccountId), +} diff --git a/contracts/access_control/traits.rs b/contracts/access_control/traits.rs index c5a1a6208b..167bf2657c 100644 --- a/contracts/access_control/traits.rs +++ b/contracts/access_control/traits.rs @@ -3,7 +3,7 @@ use ink_env::{ AccountId, DefaultEnvironment, Error as InkEnvError, }; -use crate::access_control::{Role, HAS_ROLE_SELECTOR}; +use crate::{access_control::HAS_ROLE_SELECTOR, roles::Role}; pub trait AccessControlled { type ContractError; diff --git a/contracts/button/Cargo.lock b/contracts/button/Cargo.lock index 4da0c93010..63021fcccd 100644 --- a/contracts/button/Cargo.lock +++ b/contracts/button/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "access_control" -version = "0.1.0" +version = "1.0.0" dependencies = [ "ink_env", "ink_lang", diff --git a/contracts/button/errors.rs b/contracts/button/errors.rs index 4da4c55914..c6d8382833 100644 --- a/contracts/button/errors.rs +++ b/contracts/button/errors.rs @@ -1,4 +1,4 @@ -use access_control::Role; +use access_control::roles::Role; use ink_env::Error as InkEnvError; use ink_prelude::{format, string::String}; use openbrush::contracts::psp22::PSP22Error; diff --git a/contracts/button/lib.rs b/contracts/button/lib.rs index 343acef407..e0ef00f703 100644 --- a/contracts/button/lib.rs +++ b/contracts/button/lib.rs @@ -6,7 +6,7 @@ use ink_lang as ink; #[ink::contract] mod button_game { - use access_control::{traits::AccessControlled, Role, ACCESS_CONTROL_PUBKEY}; + use access_control::{roles::Role, traits::AccessControlled, ACCESS_CONTROL_PUBKEY}; use game_token::MINT_TO_SELECTOR; use ink_env::{ call::{build_call, Call, ExecutionInput, Selector}, diff --git a/contracts/game_token/Cargo.lock b/contracts/game_token/Cargo.lock index 01b884861c..e61e165d6c 100644 --- a/contracts/game_token/Cargo.lock +++ b/contracts/game_token/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "access_control" -version = "0.1.0" +version = "1.0.0" dependencies = [ "ink_env", "ink_lang", diff --git a/contracts/game_token/lib.rs b/contracts/game_token/lib.rs index 6893038c45..b5037fda67 100644 --- a/contracts/game_token/lib.rs +++ b/contracts/game_token/lib.rs @@ -8,7 +8,7 @@ pub use crate::game_token::{ #[openbrush::contract] pub mod game_token { - use access_control::{traits::AccessControlled, Role, ACCESS_CONTROL_PUBKEY}; + use access_control::{roles::Role, traits::AccessControlled, ACCESS_CONTROL_PUBKEY}; use ink_env::Error as InkEnvError; use ink_lang::{ codegen::{EmitEvent, Env}, diff --git a/contracts/marketplace/Cargo.lock b/contracts/marketplace/Cargo.lock index 890f67d366..f7039b7356 100644 --- a/contracts/marketplace/Cargo.lock +++ b/contracts/marketplace/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "access_control" -version = "0.1.0" +version = "1.0.0" dependencies = [ "ink_env", "ink_lang", diff --git a/contracts/marketplace/lib.rs b/contracts/marketplace/lib.rs index 827c88bf96..4613b5d800 100644 --- a/contracts/marketplace/lib.rs +++ b/contracts/marketplace/lib.rs @@ -23,7 +23,7 @@ use ink_lang as ink; #[ink::contract] pub mod marketplace { - use access_control::{traits::AccessControlled, Role, ACCESS_CONTROL_PUBKEY}; + use access_control::{roles::Role, traits::AccessControlled, ACCESS_CONTROL_PUBKEY}; use game_token::TRANSFER_FROM_SELECTOR as TRANSFER_FROM_GAME_TOKEN_SELECTOR; use ink_env::{ call::{build_call, Call, ExecutionInput, Selector}, diff --git a/contracts/ticket_token/Cargo.lock b/contracts/ticket_token/Cargo.lock index a41adcd8fe..cfd660507d 100644 --- a/contracts/ticket_token/Cargo.lock +++ b/contracts/ticket_token/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "access_control" -version = "0.1.0" +version = "1.0.0" dependencies = [ "ink_env", "ink_lang", diff --git a/contracts/ticket_token/lib.rs b/contracts/ticket_token/lib.rs index 07ffd2b7d6..d4706d41fa 100644 --- a/contracts/ticket_token/lib.rs +++ b/contracts/ticket_token/lib.rs @@ -5,7 +5,7 @@ pub use crate::ticket_token::{BALANCE_OF_SELECTOR, TRANSFER_FROM_SELECTOR, TRANS #[openbrush::contract] pub mod ticket_token { - use access_control::{traits::AccessControlled, Role, ACCESS_CONTROL_PUBKEY}; + use access_control::{roles::Role, traits::AccessControlled, ACCESS_CONTROL_PUBKEY}; use ink_env::Error as InkEnvError; use ink_lang::{ codegen::{EmitEvent, Env}, From 1e31342f89e900f98ffc047925339d5c224eb8fd Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 15 Sep 2022 15:14:23 +0200 Subject: [PATCH 15/31] wZERO --- contracts/simple_dex/Cargo.lock | 2 +- contracts/simple_dex/lib.rs | 14 +- contracts/wrapped_azero/Cargo.lock | 1008 ++++++++++++++++++++++++++++ contracts/wrapped_azero/Cargo.toml | 52 ++ contracts/wrapped_azero/lib.rs | 252 +++++++ 5 files changed, 1320 insertions(+), 8 deletions(-) create mode 100644 contracts/wrapped_azero/Cargo.lock create mode 100644 contracts/wrapped_azero/Cargo.toml create mode 100644 contracts/wrapped_azero/lib.rs diff --git a/contracts/simple_dex/Cargo.lock b/contracts/simple_dex/Cargo.lock index 9adb79e2f3..31b6320cfd 100644 --- a/contracts/simple_dex/Cargo.lock +++ b/contracts/simple_dex/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "access_control" -version = "0.1.0" +version = "1.0.0" dependencies = [ "ink_env", "ink_lang", diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 0b8bc18f40..5e2c829a73 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -12,7 +12,7 @@ use ink_lang as ink; #[ink::contract] mod simple_dex { - use access_control::{traits::AccessControlled, Role, ACCESS_CONTROL_PUBKEY}; + use access_control::{roles::Role, traits::AccessControlled, ACCESS_CONTROL_PUBKEY}; use game_token::{ ALLOWANCE_SELECTOR, BALANCE_OF_SELECTOR, TRANSFER_FROM_SELECTOR, TRANSFER_SELECTOR, }; @@ -118,7 +118,7 @@ mod simple_dex { pub total_liquidity: u128, /// tracks pool shares per account pub liquidity: Mapping, - pub swap_fee: u128, + pub swap_fee: Balance, pub access_control: AccountId, pub ubik: AccountId, pub cyberiad: AccountId, @@ -616,11 +616,11 @@ mod simple_dex { } fn out_given_in( - amount_token_in: u128, - balance_token_in: u128, - balance_token_out: u128, - swap_fee: u128, - ) -> Result { + amount_token_in: Balance, + balance_token_in: Balance, + balance_token_out: Balance, + swap_fee: Balance, + ) -> Result { let op0 = amount_token_in .checked_mul(swap_fee) .ok_or(DexError::Arithmethic)?; diff --git a/contracts/wrapped_azero/Cargo.lock b/contracts/wrapped_azero/Cargo.lock new file mode 100644 index 0000000000..005cc5779a --- /dev/null +++ b/contracts/wrapped_azero/Cargo.lock @@ -0,0 +1,1008 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "access_control" +version = "1.0.0" +dependencies = [ + "ink_env", + "ink_lang", + "ink_lang_codegen", + "ink_primitives", + "ink_storage", + "parity-scale-codec", +] + +[[package]] +name = "array-init" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb6d71005dc22a708c7496eee5c8dc0300ee47355de6256c3b35b12b5fef596" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +dependencies = [ + "crypto-mac", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "blake2" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" +dependencies = [ + "digest 0.10.3", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byte-slice-cast" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87c5fdd0166095e1d463fc6cc01aa8ce547ad77a4e84d42eb6762b084e28067e" + +[[package]] +name = "camino" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "081e3f0755c1f380c2d010481b6fa2e02973586d5f2b24eebb7a2a1d98b143d8" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "semver-parser", + "serde", + "serde_json", +] + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const_format" +version = "0.2.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "939dc9e2eb9077e0679d2ce32de1ded8531779360b003b4a972a7a39ec263495" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef196d5d972878a48da7decb7686eded338b4858fbabeed513d63a7c98b2b82d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[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.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ink_allocator" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a291f411e310b7a3bb01ce21102b8c0aea5b7b523e4bad0b40a8e55a76c58906" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_engine" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "075eab468da2937288ec484be920cb18614147003d7f1afbdfcfb190ed771c46" +dependencies = [ + "blake2 0.10.4", + "derive_more", + "parity-scale-codec", + "rand", + "secp256k1", + "sha2", + "sha3", +] + +[[package]] +name = "ink_env" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271689b643d7ccf2bcd09d7ef07eda79cd3366ee042d5bbfcebf534b08da79d7" +dependencies = [ + "arrayref", + "blake2 0.10.4", + "cfg-if", + "derive_more", + "ink_allocator", + "ink_engine", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "num-traits", + "parity-scale-codec", + "paste", + "rand", + "rlibc", + "scale-info", + "secp256k1", + "sha2", + "sha3", + "static_assertions", +] + +[[package]] +name = "ink_lang" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cf662fe6a130ea1ada3520142405e3ed521b79c35b7274cc95dd37bc833571" +dependencies = [ + "derive_more", + "ink_env", + "ink_lang_macro", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "parity-scale-codec", +] + +[[package]] +name = "ink_lang_codegen" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94dc22732ced2557f0411de5fa31d6fddc3878968041b699ae16ed1c390d2660" +dependencies = [ + "blake2 0.10.4", + "derive_more", + "either", + "heck 0.4.0", + "impl-serde", + "ink_lang_ir", + "itertools", + "parity-scale-codec", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ink_lang_ir" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a089bcac8d7e6a487b7a18ea8a1d20eb540ed26657706ac221cc0e8239047e45" +dependencies = [ + "blake2 0.10.4", + "either", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ink_lang_macro" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1330da0b8007b86de94f95fbc74769c0461d3b078b291af5497771598db1c5b4" +dependencies = [ + "ink_lang_codegen", + "ink_lang_ir", + "ink_primitives", + "parity-scale-codec", + "proc-macro2", + "syn", +] + +[[package]] +name = "ink_metadata" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d442f4f5dcbf120aa84cae9e399065ad99d143d5a920b06d3da286e91c03ec70" +dependencies = [ + "derive_more", + "impl-serde", + "ink_prelude", + "ink_primitives", + "scale-info", + "serde", +] + +[[package]] +name = "ink_prelude" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e38d71af62cfec3425727d28665a947d636c3be6ae71ac3a79868ef8a08633f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_primitives" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea7afd5330a9d3be1533222a48b8ab44b3a3356a5e6bb090bff0790aa562b418" +dependencies = [ + "cfg-if", + "ink_prelude", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ink_storage" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be827b98c102c413b2309075f0835a9bb8c6325fc6aa09e66963424db7a8bcb5" +dependencies = [ + "array-init", + "cfg-if", + "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.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ced452d5d0b2268b1257ffd2ec73cf9c3b4fba5f3632f185a03aafec8888439" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "itertools" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8bf247779e67a9082a4790b45e71ac7cfd1321331a5c856a74a9faebdab78d0" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" + +[[package]] +name = "keccak" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" + +[[package]] +name = "libc" +version = "0.2.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openbrush" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "ink_env", + "ink_lang", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "openbrush_contracts", + "openbrush_lang", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "openbrush_contracts" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "ink_env", + "ink_lang", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "openbrush_lang", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "openbrush_lang" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "const_format", + "ink_env", + "ink_lang", + "ink_metadata", + "ink_primitives", + "ink_storage", + "openbrush_lang_macro", + "parity-scale-codec", + "scale-info", + "sha2-const", +] + +[[package]] +name = "openbrush_lang_codegen" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "blake2 0.9.2", + "cargo_metadata", + "fs2", + "heck 0.3.3", + "ink_lang_ir", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", + "synstructure", + "unwrap", +] + +[[package]] +name = "openbrush_lang_macro" +version = "2.1.0" +source = "git+https://github.com/Supercolony-net/openbrush-contracts.git?rev=8a20f95#8a20f951feaf8c6ea72c4bf113bf115bad9f158f" +dependencies = [ + "openbrush_lang_codegen", + "proc-macro2", + "syn", + "synstructure", +] + +[[package]] +name = "parity-scale-codec" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "pest" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[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.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +dependencies = [ + "once_cell", + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro2" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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 = "rlibc" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "scale-info" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "333af15b02563b8182cd863f925bd31ef8fa86a0e095d30c091956057d436153" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53f56acbd0743d29ffa08f911ab5397def774ad01bab3786804cf6ee057fb5e1" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "secp256k1" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7058dc8eaf3f2810d7828680320acda0b25a288f6d288e19278e249bbf74226b" +dependencies = [ + "cc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha2-const" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5edcd790916d95ff81bdc1505b09c74d30d47a755929cc8c71c59cbbfa99f91b" + +[[package]] +name = "sha3" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaedf34ed289ea47c2b741bb72e5357a209512d67bcd4bda44359e5bf0470f56" +dependencies = [ + "digest 0.10.3", + "keccak", +] + +[[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.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[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 = "thiserror" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unicode-ident" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" + +[[package]] +name = "unicode-segmentation" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" + +[[package]] +name = "unicode-xid" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" + +[[package]] +name = "unwrap" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e33648dd74328e622c7be51f3b40a303c63f93e6fa5f08778b6203a4c25c20f" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[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-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "wrapped_azero" +version = "1.0.0" +dependencies = [ + "access_control", + "ink_engine", + "ink_env", + "ink_lang", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "num-traits", + "openbrush", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "wyz" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +dependencies = [ + "tap", +] diff --git a/contracts/wrapped_azero/Cargo.toml b/contracts/wrapped_azero/Cargo.toml new file mode 100644 index 0000000000..0894b27252 --- /dev/null +++ b/contracts/wrapped_azero/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "wrapped_azero" +version = "1.0.0" +authors = ["Cardinal Cryptography"] +edition = "2021" +license = "Apache 2.0" + +[dependencies] +ink_primitives = { version = "~3.3.0", default-features = false } +ink_metadata = { version = "~3.3.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.3.0", default-features = false } +ink_storage = { version = "~3.3.0", default-features = false } +ink_lang = { version = "~3.3.0", default-features = false } +ink_prelude = { version = "~3.3.0", default-features = false } +ink_engine = { version = "~3.3.0", default-features = false, optional = true } + +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } +scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } + +num-traits = { version = "0.2", default-features = false } +openbrush = { git = "https://github.com/Supercolony-net/openbrush-contracts.git", rev = "8a20f95", default-features = false, features = ["psp22"] } +access_control = { path = "../access_control", default-features = false, features = ["ink-as-dependency"] } + +[lib] +name = "wrapped_azero" +path = "lib.rs" +crate-type = [ + # Used for normal contract Wasm blobs. + "cdylib", + # Used for ABI generation. + # "rlib", +] + +[features] +default = ["std"] +std = [ + "num-traits/std", + "ink_env/std", + "ink_lang/std", + "ink_metadata", + "ink_metadata/std", + "ink_primitives/std", + "ink_storage/std", + "openbrush/std", + "scale-info", + "scale-info/std", + "scale/std", +] +ink-as-dependency = [] + +[profile.dev] +codegen-units = 16 diff --git a/contracts/wrapped_azero/lib.rs b/contracts/wrapped_azero/lib.rs new file mode 100644 index 0000000000..851af8ed1e --- /dev/null +++ b/contracts/wrapped_azero/lib.rs @@ -0,0 +1,252 @@ +#![cfg_attr(not(feature = "std"), no_std)] +#![feature(min_specialization)] + +pub use crate::wrapped_azero::{ + ALLOWANCE_SELECTOR, BALANCE_OF_SELECTOR, TRANSFER_FROM_SELECTOR, TRANSFER_SELECTOR, +}; + +#[openbrush::contract] +pub mod wrapped_azero { + use access_control::{roles::Role, traits::AccessControlled, ACCESS_CONTROL_PUBKEY}; + use ink_env::Error as InkEnvError; + use ink_lang::{ + codegen::{EmitEvent, Env}, + reflect::ContractEventBase, + }; + use ink_prelude::{format, string::String}; + use ink_storage::traits::SpreadAllocate; + use num_traits::identities::Zero; + use openbrush::{ + contracts::psp22::{extensions::metadata::*, Internal}, + traits::Storage, + }; + + pub const BALANCE_OF_SELECTOR: [u8; 4] = [0x65, 0x68, 0x38, 0x2f]; + pub const TRANSFER_SELECTOR: [u8; 4] = [0xdb, 0x20, 0xf9, 0xf5]; + pub const TRANSFER_FROM_SELECTOR: [u8; 4] = [0x54, 0xb3, 0xc7, 0x6e]; + pub const ALLOWANCE_SELECTOR: [u8; 4] = [0x4d, 0x47, 0xd9, 0x21]; + + #[ink(event)] + #[derive(Debug)] + pub struct Wrapped { + caller: AccountId, + amount: Balance, + } + + #[ink(event)] + #[derive(Debug)] + pub struct UnWrapped { + caller: AccountId, + amount: Balance, + } + + #[ink(storage)] + #[derive(Default, SpreadAllocate, Storage)] + pub struct WrappedAzero { + #[storage_field] + psp22: psp22::Data, + #[storage_field] + metadata: metadata::Data, + /// access control contract + access_control: AccountId, + } + + impl PSP22 for WrappedAzero {} + + impl PSP22Metadata for WrappedAzero {} + + // emit events + // https://github.com/w3f/PSPs/blob/master/PSPs/psp-22.md + impl Internal for WrappedAzero { + fn _emit_transfer_event( + &self, + _from: Option, + _to: Option, + _amount: Balance, + ) { + WrappedAzero::emit_event( + self.env(), + Event::Transfer(Transfer { + from: _from, + to: _to, + value: _amount, + }), + ); + } + + fn _emit_approval_event(&self, _owner: AccountId, _spender: AccountId, _amount: Balance) { + WrappedAzero::emit_event( + self.env(), + Event::Approval(Approval { + owner: _owner, + spender: _spender, + value: _amount, + }), + ); + } + } + + impl AccessControlled for WrappedAzero { + type ContractError = PSP22Error; + } + + /// Result type + pub type Result = core::result::Result; + /// Event type + pub type Event = ::Type; + + /// Event emitted when a token transfer occurs. + #[ink(event)] + #[derive(Debug)] + pub struct Transfer { + #[ink(topic)] + pub from: Option, + #[ink(topic)] + pub to: Option, + pub value: Balance, + } + + /// Event emitted when an approval occurs that `spender` is allowed to withdraw + /// up to the amount of `value` tokens from `owner`. + #[ink(event)] + #[derive(Debug)] + pub struct Approval { + #[ink(topic)] + owner: AccountId, + #[ink(topic)] + spender: AccountId, + value: Balance, + } + + impl WrappedAzero { + /// Creates a new token + /// + /// The token will have its name and symbol set in metadata to the specified values. + /// Decimals are fixed at 18. + /// + /// Will revert if called from an account without a proper role + #[ink(constructor)] + pub fn new(name: String, symbol: String) -> Self { + let caller = Self::env().caller(); + let code_hash = Self::env() + .own_code_hash() + .expect("Called new on a contract with no code hash"); + let required_role = Role::Initializer(code_hash); + + let role_check = ::check_role( + AccountId::from(ACCESS_CONTROL_PUBKEY), + caller, + required_role, + Self::cross_contract_call_error_handler, + Self::access_control_error_handler, + ); + + match role_check { + Ok(_) => ink_lang::codegen::initialize_contract(|instance: &mut WrappedAzero| { + instance.metadata.name = Some(name); + instance.metadata.symbol = Some(symbol); + instance.metadata.decimals = 12; // same as AZERO + + instance.access_control = AccountId::from(ACCESS_CONTROL_PUBKEY); + }), + Err(why) => panic!("Could not initialize the contract {:?}", why), + } + } + + /// Wraps the transferred amount of native token and mints it to the callers account + #[ink(message, payable)] + pub fn wrap(&mut self) -> Result<()> { + let caller = self.env().caller(); + let amount = self.env().transferred_value(); + if !amount.eq(&Balance::zero()) { + self._mint(caller, amount)?; + Self::emit_event(self.env(), Event::Wrapped(Wrapped { caller, amount })); + } + + Ok(()) + } + + /// Unwraps a specified amount + #[ink(message, payable)] + pub fn unwrap(&mut self, amount: Balance) -> Result<()> { + let caller = self.env().caller(); + // let this = self.env().account_id(); + + if !amount.eq(&Balance::zero()) { + // burn the token form the caller, will fail if the calling account doesn't have enough balance + self._burn_from(caller, amount)?; + + // return the native token to the caller + self.env().transfer(caller, amount).map_err(|why| { + PSP22Error::Custom(format!("Native transfer failed: {:?}", why)) + })?; + Self::emit_event(self.env(), Event::UnWrapped(UnWrapped { caller, amount })); + } + + Ok(()) + } + + /// Terminates the contract. + /// + /// can only be called by the contract's Owner + #[ink(message)] + pub fn terminate(&mut self) -> Result<()> { + let caller = self.env().caller(); + let this = self.env().account_id(); + let required_role = Role::Owner(this); + + self.check_role(caller, required_role)?; + self.env().terminate_contract(caller) + } + + /// Returns the contract's access control contract address + #[ink(message)] + pub fn access_control(&self) -> AccountId { + self.access_control + } + + /// Sets new access control contract address + /// + /// Can only be called by the contract's Owner + #[ink(message)] + pub fn set_access_control(&mut self, access_control: AccountId) -> Result<()> { + let caller = self.env().caller(); + let this = self.env().account_id(); + + self.check_role(caller, Role::Owner(this))?; + + self.access_control = access_control; + Ok(()) + } + + /// Returns own code hash + #[ink(message)] + pub fn code_hash(&self) -> Result { + Self::env().own_code_hash().map_err(|why| { + PSP22Error::Custom(format!("Can't retrieve own code hash: {:?}", why)) + }) + } + + pub fn emit_event>(emitter: EE, event: Event) { + emitter.emit_event(event); + } + + fn access_control_error_handler(role: Role) -> PSP22Error { + PSP22Error::Custom(format!("MissingRole:{:?}", role)) + } + + fn cross_contract_call_error_handler(why: InkEnvError) -> PSP22Error { + PSP22Error::Custom(format!("Calling access control has failed: {:?}", why)) + } + + fn check_role(&self, account: AccountId, role: Role) -> Result<()> { + ::check_role( + self.access_control, + account, + role, + Self::cross_contract_call_error_handler, + Self::access_control_error_handler, + ) + } + } +} From 67cb4c898f71b9fb8a9ecbccb98c9797c632de87 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 15 Sep 2022 16:21:58 +0200 Subject: [PATCH 16/31] dumbed down LP --- contracts/simple_dex/lib.rs | 319 +++++---------------------------- contracts/wrapped_azero/lib.rs | 32 ++-- 2 files changed, 60 insertions(+), 291 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 5e2c829a73..0b812ce962 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -24,9 +24,8 @@ mod simple_dex { codegen::{initialize_contract, EmitEvent}, reflect::ContractEventBase, }; - use ink_prelude::{format, string::String, vec}; - use ink_storage::{traits::SpreadAllocate, Mapping}; - use num::integer::Roots; + use ink_prelude::{format, string::String, vec, vec::Vec}; + use ink_storage::traits::SpreadAllocate; use openbrush::contracts::traits::errors::PSP22Error; type Event = ::Type; @@ -40,7 +39,6 @@ mod simple_dex { MissingRole(Role), InkEnv(String), CrossContractCall(String), - NativeTransferFailed(String), } impl From for DexError { @@ -57,27 +55,7 @@ mod simple_dex { #[ink(event)] #[derive(Debug)] - pub struct NativeToToken { - caller: AccountId, - #[ink(topic)] - token_out: AccountId, - amount_in: Balance, - amount_out: Balance, - } - - #[ink(event)] - #[derive(Debug)] - pub struct TokenToNative { - caller: AccountId, - #[ink(topic)] - token_in: AccountId, - amount_in: Balance, - amount_out: Balance, - } - - #[ink(event)] - #[derive(Debug)] - pub struct TokenToToken { + pub struct Swapped { caller: AccountId, #[ink(topic)] token_in: AccountId, @@ -87,22 +65,6 @@ mod simple_dex { amount_out: Balance, } - #[ink(event)] - #[derive(Debug)] - pub struct NativeDeposit { - caller: AccountId, - amount: Balance, - minted_liquidity: Balance, - } - - #[ink(event)] - #[derive(Debug)] - pub struct NativeWithdrawal { - caller: AccountId, - amount: Balance, - redeemed_liquidity: Balance, - } - #[ink(event)] #[derive(Debug)] pub struct SwapFeeSet { @@ -114,10 +76,6 @@ mod simple_dex { #[ink(storage)] #[derive(SpreadAllocate)] pub struct SimpleDex { - /// total supply of pool shares - pub total_liquidity: u128, - /// tracks pool shares per account - pub liquidity: Mapping, pub swap_fee: Balance, pub access_control: AccountId, pub ubik: AccountId, @@ -131,7 +89,7 @@ mod simple_dex { impl SimpleDex { #[ink(constructor)] - pub fn new(ubik: AccountId, cyberiad: AccountId, lono: AccountId) -> Self { + pub fn new() -> Self { let caller = Self::env().caller(); let code_hash = Self::env() .own_code_hash() @@ -148,120 +106,35 @@ mod simple_dex { ); match role_check { - Ok(_) => { - initialize_contract(|contract| Self::new_init(contract, ubik, cyberiad, lono)) - } + Ok(_) => initialize_contract(|contract| Self::new_init(contract)), Err(why) => panic!("Could not initialize the contract {:?}", why), } } - /// Swaps the transferred amount of native token to one of the pools PSP22 tokens - #[ink(message, payable)] - pub fn native_to_token(&mut self, token_out: AccountId) -> Result<(), DexError> { - let amount_token_in = self.env().transferred_value(); - // we use the balance of the native token just before the exchange tx - let balance_token_in = self - .env() - .balance() - .checked_sub(amount_token_in) - .ok_or(DexError::Arithmethic)?; - - let swap_fee = self.swap_fee; - let caller = self.env().caller(); - let this = self.env().account_id(); - - let balance_token_out = self.balance_of(token_out, this)?; - - let amount_token_out = Self::out_given_in( - amount_token_in, - balance_token_in, - balance_token_out, - swap_fee, - )?; - - // transfer token_out from contract to user - self.transfer_tx(token_out, caller, amount_token_out)??; - - // emit event - Self::emit_event( - self.env(), - Event::NativeToToken(NativeToToken { - caller, - token_out, - amount_in: amount_token_in, - amount_out: amount_token_out, - }), - ); - - Ok(()) - } - - /// Swap the specified amount of one of the pools PSP22 tokens to the native token - /// Calling account needs to give allowance to the DEX contract to spend `amount_token_in` of `token_in` on its behalf + /// Swaps the a specified amount of one of the pool's PSP22 tokens to another PSP22 token + /// Calling account needs to give allowance to the DEX contract to spend amount_token_in of token_in on it's behalf /// before executing this tx. #[ink(message)] - pub fn token_to_native( + pub fn swap( &mut self, token_in: AccountId, + token_out: AccountId, amount_token_in: u128, ) -> Result<(), DexError> { - let caller = self.env().caller(); let this = self.env().account_id(); + let caller = self.env().caller(); let swap_fee = self.swap_fee; - let balance_token_out = self.env().balance(); - let balance_token_in = self.balance_of(token_in, this)?; - - let amount_token_out = Self::out_given_in( - amount_token_in, - balance_token_in, - balance_token_out, - swap_fee, - )?; - - // check allowance + // check allowance if self.allowance(token_in, caller, this)? < amount_token_in { return Err(DexError::InsufficientAllowanceOf(token_in)); } - // transfer token_in from the user to the contract - self.transfer_from_tx(token_in, caller, this, amount_token_in)??; - - self.env() - .transfer(caller, amount_token_out) - .map_err(|why| DexError::NativeTransferFailed(format!("{:?}", why)))?; - - // emit event - Self::emit_event( - self.env(), - Event::TokenToNative(TokenToNative { - caller, - token_in, - amount_in: amount_token_in, - amount_out: amount_token_out, - }), - ); - - Ok(()) - } - - /// Swaps the a specified amount of one pool's PSP22 tokens to another PSP22 token - /// Calling account needs to give allowance to the DEX contract to spend amount_token_in of token_in on it's behalf - /// before executing this tx. - #[ink(message)] - pub fn token_to_token( - &mut self, - token_in: AccountId, - token_out: AccountId, - amount_token_in: u128, - ) -> Result<(), DexError> { - let this = self.env().account_id(); - let caller = self.env().caller(); - let swap_fee = self.swap_fee; - let balance_token_in = self.balance_of(token_in, this)?; let balance_token_out = self.balance_of(token_out, this)?; + // TODO : check if we have enough liquidity + let amount_token_out = Self::out_given_in( amount_token_in, balance_token_in, @@ -269,11 +142,6 @@ mod simple_dex { swap_fee, )?; - // check allowance - if self.allowance(token_in, caller, this)? < amount_token_in { - return Err(DexError::InsufficientAllowanceOf(token_in)); - } - // transfer token_in from user to the contract self.transfer_from_tx(token_in, caller, this, amount_token_in)??; // transfer token_out from contract to user @@ -282,7 +150,7 @@ mod simple_dex { // emit event Self::emit_event( self.env(), - Event::TokenToToken(TokenToToken { + Event::Swapped(Swapped { caller, token_in, token_out, @@ -294,34 +162,13 @@ mod simple_dex { Ok(()) } - /// LP: single-asset native deposit + /// Liquidity deposit /// - /// Can be called only by an account carrying a LiquidityProvider role for this contract. - /// This account gets a number of (virtual) pools shares which can than be redeemed back for the native asset using the withdrawal transaction - #[ink(message, payable)] - pub fn native_deposit(&mut self) -> Result<(), DexError> { - // calculates number of pool shares corresponding to a token deposit amount and current balance in the pool (assuming all other stay constant) - let pool_shares_issued = |deposit_amount: u128, - token_balance: u128, - total_liquidity: u128| - -> Result { - let op1 = deposit_amount - .checked_div(token_balance) - .ok_or(DexError::Arithmethic)?; - - let op2 = op1.checked_add(1).ok_or(DexError::Arithmethic)?; - - let op3 = op2.nth_root(4); - - let op4 = op3.checked_sub(1).ok_or(DexError::Arithmethic)?; - - let op5 = op4 - .checked_mul(total_liquidity) - .ok_or(DexError::Arithmethic)?; - - Ok(op5) - }; - + /// Can only be performed by an account with a LiquidityProvider role + /// Caller needs to give at least the passed amount of allowance to the contract to spend the deposited tokens on his behalf + // Will revert if not enough allowance was given to the contract by the caller prior to executing this tx + #[ink(message)] + pub fn deposit(&mut self, deposits: Vec<(AccountId, Balance)>) -> Result<(), DexError> { let this = self.env().account_id(); let caller = self.env().caller(); @@ -334,74 +181,26 @@ mod simple_dex { Self::access_control_error_handler, )?; - let total_liquidity = self.total_liquidity; - - let native_deposit = self.env().transferred_value(); - let native_balance = self - .env() - .balance() - .checked_sub(native_deposit) - .ok_or(DexError::Arithmethic)?; - - let minted_liquidity = - pool_shares_issued(native_deposit, native_balance, total_liquidity)?; - - // issue liquidity shares to the caller - let caller_liquidity = self - .liquidity - .get(&caller) - .unwrap_or(0) - .checked_add(minted_liquidity) - .ok_or(DexError::Arithmethic)?; - self.liquidity.insert(&caller, &caller_liquidity); - - // increase total liquidity - self.total_liquidity = self - .total_liquidity - .checked_add(minted_liquidity) - .ok_or(DexError::Arithmethic)?; - - // emit event - Self::emit_event( - self.env(), - Event::NativeDeposit(NativeDeposit { - caller, - amount: native_deposit, - minted_liquidity, - }), - ); + deposits + .into_iter() + .try_for_each(|(token_in, amount)| -> Result<(), DexError> { + // transfer token_in from the caller to the contract + // will revert if the contract does not have enough allowance from the caller + // in which case the whole tx is reverted + self.transfer_from_tx(token_in, caller, this, amount)??; + Ok(()) + })?; Ok(()) } - /// LP: single-asset native withdrawal - /// - /// Can be called only by an account carrying a LiquidityProvider role for this contract - #[ink(message, payable)] - pub fn native_withdrawal(&mut self, amount: u128) -> Result<(), DexError> { - let pool_shares_redeemed = |withdraw_amount: u128, - token_balance: u128, - total_liquidity: u128| - -> Result { - let op1 = withdraw_amount - .checked_div(token_balance) - .ok_or(DexError::Arithmethic)?; - - let op2 = 1u128.checked_sub(op1).ok_or(DexError::Arithmethic)?; - - let op3 = op2.nth_root(4); - - let op4 = 1u128.checked_sub(op3).ok_or(DexError::Arithmethic)?; - - let op5 = total_liquidity - .checked_mul(op4) - .ok_or(DexError::Arithmethic)?; - - Ok(op5) - }; - - let caller = self.env().caller(); + #[ink(message)] + pub fn withdrawal( + &mut self, + withdrawals: Vec<(AccountId, Balance)>, + ) -> Result<(), DexError> { let this = self.env().account_id(); + let caller = self.env().caller(); // check role, only designated account can add liquidity ::check_role( @@ -412,38 +211,13 @@ mod simple_dex { Self::access_control_error_handler, )?; - let native_balance = self.env().balance(); - let total_liquidity = self.total_liquidity; - let redeemed_liquidity = pool_shares_redeemed(amount, native_balance, total_liquidity)?; - - // this should return Err variant if user has not enough liquidity so we can omit an explicit check - let caller_liquidity = self - .liquidity - .get(&caller) - .unwrap_or(0) - .checked_sub(redeemed_liquidity) - .ok_or(DexError::Arithmethic)?; - - self.liquidity.insert(&caller, &caller_liquidity); - - self.total_liquidity = self - .total_liquidity - .checked_sub(redeemed_liquidity) - .ok_or(DexError::Arithmethic)?; - - self.env() - .transfer(caller, amount) - .map_err(|why| DexError::NativeTransferFailed(format!("{:?}", why)))?; - - // emit event - Self::emit_event( - self.env(), - Event::NativeWithdrawal(NativeWithdrawal { - caller, - amount, - redeemed_liquidity, - }), - ); + withdrawals.into_iter().try_for_each( + |(token_out, amount)| -> Result<(), DexError> { + // transfer token_out from the contract to the caller + self.transfer_tx(token_out, caller, amount)??; + Ok(()) + }, + )?; Ok(()) } @@ -482,7 +256,7 @@ mod simple_dex { /// Sets access_control to a new contract address /// - /// Potentially very destructive, can only be called by the contract's Owner. + /// Potentially very destructive, can only be called by the contract's Owner. #[ink(message)] pub fn set_access_control(&mut self, access_control: AccountId) -> Result<(), DexError> where @@ -536,11 +310,8 @@ mod simple_dex { .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) } - fn new_init(&mut self, ubik: AccountId, cyberiad: AccountId, lono: AccountId) { + fn new_init(&mut self) { self.access_control = AccountId::from(ACCESS_CONTROL_PUBKEY); - self.ubik = ubik; - self.cyberiad = cyberiad; - self.lono = lono; } /// Transfers a given amount of a PSP22 token to a specified using the callers own balance @@ -604,7 +375,7 @@ mod simple_dex { .fire() } - /// returns DEX balance of a PSP22 token for an account + /// Returns DEX balance of a PSP22 token for an account fn balance_of(&self, token: AccountId, account: AccountId) -> Result { build_call::() .call_type(Call::new().callee(token)) diff --git a/contracts/wrapped_azero/lib.rs b/contracts/wrapped_azero/lib.rs index 851af8ed1e..59b9ef7cd6 100644 --- a/contracts/wrapped_azero/lib.rs +++ b/contracts/wrapped_azero/lib.rs @@ -26,20 +26,6 @@ pub mod wrapped_azero { pub const TRANSFER_FROM_SELECTOR: [u8; 4] = [0x54, 0xb3, 0xc7, 0x6e]; pub const ALLOWANCE_SELECTOR: [u8; 4] = [0x4d, 0x47, 0xd9, 0x21]; - #[ink(event)] - #[derive(Debug)] - pub struct Wrapped { - caller: AccountId, - amount: Balance, - } - - #[ink(event)] - #[derive(Debug)] - pub struct UnWrapped { - caller: AccountId, - amount: Balance, - } - #[ink(storage)] #[derive(Default, SpreadAllocate, Storage)] pub struct WrappedAzero { @@ -118,6 +104,20 @@ pub mod wrapped_azero { value: Balance, } + #[ink(event)] + #[derive(Debug)] + pub struct Wrapped { + caller: AccountId, + amount: Balance, + } + + #[ink(event)] + #[derive(Debug)] + pub struct UnWrapped { + caller: AccountId, + amount: Balance, + } + impl WrappedAzero { /// Creates a new token /// @@ -131,12 +131,11 @@ pub mod wrapped_azero { let code_hash = Self::env() .own_code_hash() .expect("Called new on a contract with no code hash"); - let required_role = Role::Initializer(code_hash); let role_check = ::check_role( AccountId::from(ACCESS_CONTROL_PUBKEY), caller, - required_role, + Role::Initializer(code_hash), Self::cross_contract_call_error_handler, Self::access_control_error_handler, ); @@ -170,7 +169,6 @@ pub mod wrapped_azero { #[ink(message, payable)] pub fn unwrap(&mut self, amount: Balance) -> Result<()> { let caller = self.env().caller(); - // let this = self.env().account_id(); if !amount.eq(&Balance::zero()) { // burn the token form the caller, will fail if the calling account doesn't have enough balance From ff4e744ff513e5c1e03a05cf297464bf07e24fac Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 15 Sep 2022 16:29:42 +0200 Subject: [PATCH 17/31] slippage check --- contracts/simple_dex/lib.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 0b812ce962..f5f92c96e4 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -39,6 +39,7 @@ mod simple_dex { MissingRole(Role), InkEnv(String), CrossContractCall(String), + TooMuchSlippage, } impl From for DexError { @@ -78,9 +79,6 @@ mod simple_dex { pub struct SimpleDex { pub swap_fee: Balance, pub access_control: AccountId, - pub ubik: AccountId, - pub cyberiad: AccountId, - pub lono: AccountId, } impl AccessControlled for SimpleDex { @@ -90,6 +88,8 @@ mod simple_dex { impl SimpleDex { #[ink(constructor)] pub fn new() -> Self { + // TODO : token addresses in the pool (4) + let caller = Self::env().caller(); let code_hash = Self::env() .own_code_hash() @@ -119,12 +119,15 @@ mod simple_dex { &mut self, token_in: AccountId, token_out: AccountId, - amount_token_in: u128, + amount_token_in: Balance, + min_amount_token_out: Balance, ) -> Result<(), DexError> { let this = self.env().account_id(); let caller = self.env().caller(); let swap_fee = self.swap_fee; + // TODO : check if tokens are supported by the pool + // check allowance if self.allowance(token_in, caller, this)? < amount_token_in { return Err(DexError::InsufficientAllowanceOf(token_in)); @@ -133,7 +136,7 @@ mod simple_dex { let balance_token_in = self.balance_of(token_in, this)?; let balance_token_out = self.balance_of(token_out, this)?; - // TODO : check if we have enough liquidity + // TODO : check if we have enough liquidity in the pool let amount_token_out = Self::out_given_in( amount_token_in, @@ -142,6 +145,10 @@ mod simple_dex { swap_fee, )?; + if amount_token_out < min_amount_token_out { + return Err(DexError::TooMuchSlippage); + } + // transfer token_in from user to the contract self.transfer_from_tx(token_in, caller, this, amount_token_in)??; // transfer token_out from contract to user From c2a36fc7e5efff28f1bfa80a85a86929e9f72d1e Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 15 Sep 2022 16:46:41 +0200 Subject: [PATCH 18/31] check pool composition --- contracts/simple_dex/lib.rs | 43 +++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index f5f92c96e4..04ce05cdf2 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -40,6 +40,8 @@ mod simple_dex { InkEnv(String), CrossContractCall(String), TooMuchSlippage, + NotEnoughLiquidityOf(AccountId), + UnsupportedToken(AccountId), } impl From for DexError { @@ -79,6 +81,8 @@ mod simple_dex { pub struct SimpleDex { pub swap_fee: Balance, pub access_control: AccountId, + // pool tokens + pub tokens: [AccountId; 4], } impl AccessControlled for SimpleDex { @@ -87,9 +91,7 @@ mod simple_dex { impl SimpleDex { #[ink(constructor)] - pub fn new() -> Self { - // TODO : token addresses in the pool (4) - + pub fn new(tokens: [AccountId; 4]) -> Self { let caller = Self::env().caller(); let code_hash = Self::env() .own_code_hash() @@ -106,7 +108,7 @@ mod simple_dex { ); match role_check { - Ok(_) => initialize_contract(|contract| Self::new_init(contract)), + Ok(_) => initialize_contract(|contract| Self::new_init(contract, tokens)), Err(why) => panic!("Could not initialize the contract {:?}", why), } } @@ -126,7 +128,14 @@ mod simple_dex { let caller = self.env().caller(); let swap_fee = self.swap_fee; - // TODO : check if tokens are supported by the pool + // check if tokens are supported by the pool + if !self.tokens.contains(&token_in) { + return Err(DexError::UnsupportedToken(token_in)); + } + + if !self.tokens.contains(&token_out) { + return Err(DexError::UnsupportedToken(token_out)); + } // check allowance if self.allowance(token_in, caller, this)? < amount_token_in { @@ -136,7 +145,10 @@ mod simple_dex { let balance_token_in = self.balance_of(token_in, this)?; let balance_token_out = self.balance_of(token_out, this)?; - // TODO : check if we have enough liquidity in the pool + if balance_token_out < min_amount_token_out { + // throw early if we cannot support this swap anyway due to liquidity being too low + return Err(DexError::NotEnoughLiquidityOf(token_out)); + } let amount_token_out = Self::out_given_in( amount_token_in, @@ -145,7 +157,14 @@ mod simple_dex { swap_fee, )?; + if balance_token_out < amount_token_out { + // liquidity too low + return Err(DexError::NotEnoughLiquidityOf(token_out)); + } + if amount_token_out < min_amount_token_out { + // thrown if too much slippage occured before this tx gets executed + // as a sandwitch atack prevention return Err(DexError::TooMuchSlippage); } @@ -191,6 +210,10 @@ mod simple_dex { deposits .into_iter() .try_for_each(|(token_in, amount)| -> Result<(), DexError> { + if !self.tokens.contains(&token_in) { + return Err(DexError::UnsupportedToken(token_in)); + } + // transfer token_in from the caller to the contract // will revert if the contract does not have enough allowance from the caller // in which case the whole tx is reverted @@ -220,6 +243,10 @@ mod simple_dex { withdrawals.into_iter().try_for_each( |(token_out, amount)| -> Result<(), DexError> { + if !self.tokens.contains(&token_out) { + return Err(DexError::UnsupportedToken(token_out)); + } + // transfer token_out from the contract to the caller self.transfer_tx(token_out, caller, amount)??; Ok(()) @@ -317,8 +344,10 @@ mod simple_dex { .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) } - fn new_init(&mut self) { + fn new_init(&mut self, tokens: [AccountId; 4]) { self.access_control = AccountId::from(ACCESS_CONTROL_PUBKEY); + self.tokens = tokens; + self.swap_fee = 0; } /// Transfers a given amount of a PSP22 token to a specified using the callers own balance From 71523bf68bbdf42d6219282ee8e0e4bed7827276 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 15 Sep 2022 17:10:16 +0200 Subject: [PATCH 19/31] explicitely check swap fee value that is set --- contracts/game_token/lib.rs | 2 +- contracts/simple_dex/lib.rs | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/contracts/game_token/lib.rs b/contracts/game_token/lib.rs index b5037fda67..eeecacacb3 100644 --- a/contracts/game_token/lib.rs +++ b/contracts/game_token/lib.rs @@ -135,7 +135,7 @@ pub mod game_token { Ok(_) => ink_lang::codegen::initialize_contract(|instance: &mut GameToken| { instance.metadata.name = Some(name); instance.metadata.symbol = Some(symbol); - instance.metadata.decimals = 18; + instance.metadata.decimals = 12; instance ._mint(instance.env().caller(), total_supply) .expect("Should mint"); diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 04ce05cdf2..2cf03cd12d 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -36,6 +36,7 @@ mod simple_dex { PSP22(PSP22Error), InsufficientAllowanceOf(AccountId), Arithmethic, + WrongParameterValue, MissingRole(Role), InkEnv(String), CrossContractCall(String), @@ -73,13 +74,13 @@ mod simple_dex { pub struct SwapFeeSet { #[ink(topic)] caller: AccountId, - swap_fee: Balance, + swap_fee: u128, } #[ink(storage)] #[derive(SpreadAllocate)] pub struct SimpleDex { - pub swap_fee: Balance, + pub swap_fee: u128, pub access_control: AccountId, // pool tokens pub tokens: [AccountId; 4], @@ -260,7 +261,11 @@ mod simple_dex { /// /// Can only be called by the contract's Admin. #[ink(message)] - pub fn set_swap_fee(&mut self, swap_fee: Balance) -> Result<(), DexError> { + pub fn set_swap_fee(&mut self, swap_fee: u128) -> Result<(), DexError> { + if swap_fee.gt(&100) || swap_fee.lt(&0) { + return Err(DexError::WrongParameterValue); + } + let caller = self.env().caller(); let this = self.env().account_id(); @@ -426,10 +431,11 @@ mod simple_dex { amount_token_in: Balance, balance_token_in: Balance, balance_token_out: Balance, - swap_fee: Balance, + swap_fee: u128, ) -> Result { let op0 = amount_token_in .checked_mul(swap_fee) + .and_then(|result| result.checked_div(100)) .ok_or(DexError::Arithmethic)?; let op1 = balance_token_in From be7a3162f4b9bf68e246d653e1b5c6b9cb366ef1 Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 16 Sep 2022 12:12:40 +0200 Subject: [PATCH 20/31] change parameter name to avoid confusion, use integer operations could use promils for better precision but meh --- contracts/simple_dex/lib.rs | 51 ++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 2cf03cd12d..3c5c381fe0 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -74,13 +74,13 @@ mod simple_dex { pub struct SwapFeeSet { #[ink(topic)] caller: AccountId, - swap_fee: u128, + swap_fee_percentage: u128, } #[ink(storage)] #[derive(SpreadAllocate)] pub struct SimpleDex { - pub swap_fee: u128, + pub swap_fee_percentage: u128, pub access_control: AccountId, // pool tokens pub tokens: [AccountId; 4], @@ -127,7 +127,6 @@ mod simple_dex { ) -> Result<(), DexError> { let this = self.env().account_id(); let caller = self.env().caller(); - let swap_fee = self.swap_fee; // check if tokens are supported by the pool if !self.tokens.contains(&token_in) { @@ -155,7 +154,7 @@ mod simple_dex { amount_token_in, balance_token_in, balance_token_out, - swap_fee, + self.swap_fee_percentage, )?; if balance_token_out < amount_token_out { @@ -261,8 +260,11 @@ mod simple_dex { /// /// Can only be called by the contract's Admin. #[ink(message)] - pub fn set_swap_fee(&mut self, swap_fee: u128) -> Result<(), DexError> { - if swap_fee.gt(&100) || swap_fee.lt(&0) { + pub fn set_swap_fee_percentage( + &mut self, + swap_fee_percentage: u128, + ) -> Result<(), DexError> { + if swap_fee_percentage.gt(&100) { return Err(DexError::WrongParameterValue); } @@ -280,17 +282,20 @@ mod simple_dex { // emit event Self::emit_event( self.env(), - Event::SwapFeeSet(SwapFeeSet { caller, swap_fee }), + Event::SwapFeeSet(SwapFeeSet { + caller, + swap_fee_percentage, + }), ); - self.swap_fee = swap_fee; + self.swap_fee_percentage = swap_fee_percentage; Ok(()) } - /// Returns current value of the swap_fee parameter + /// Returns current value of the swap_fee_percentage parameter #[ink(message)] - pub fn swap_fee(&mut self) -> Balance { - self.swap_fee + pub fn swap_fee_percentage(&mut self) -> Balance { + self.swap_fee_percentage } /// Sets access_control to a new contract address @@ -352,7 +357,7 @@ mod simple_dex { fn new_init(&mut self, tokens: [AccountId; 4]) { self.access_control = AccountId::from(ACCESS_CONTROL_PUBKEY); self.tokens = tokens; - self.swap_fee = 0; + self.swap_fee_percentage = 0; } /// Transfers a given amount of a PSP22 token to a specified using the callers own balance @@ -427,30 +432,36 @@ mod simple_dex { .fire() } + /// Swap trade output given a curve with equal token weights + /// + /// swap_fee_percentage (integer) is a percentage of the trade that goes towards the pool + /// B_0 - (100 * B_0 * B_i) / (100 * (B_i + A_i) -A_i * fee) fn out_given_in( amount_token_in: Balance, balance_token_in: Balance, balance_token_out: Balance, - swap_fee: u128, + swap_fee_percentage: u128, ) -> Result { let op0 = amount_token_in - .checked_mul(swap_fee) - .and_then(|result| result.checked_div(100)) + .checked_mul(swap_fee_percentage) .ok_or(DexError::Arithmethic)?; let op1 = balance_token_in .checked_add(amount_token_in) - .and_then(|result| result.checked_sub(op0)) + .and_then(|result| result.checked_mul(100)) .ok_or(DexError::Arithmethic)?; - let op2 = balance_token_out - .checked_mul(balance_token_in) + let op2 = op1.checked_sub(op0).ok_or(DexError::Arithmethic)?; + + let op3 = balance_token_in + .checked_mul(balance_token_out) + .and_then(|result| result.checked_mul(100)) .ok_or(DexError::Arithmethic)?; - let op3 = op2.checked_div(op1).ok_or(DexError::Arithmethic)?; + let op4 = op3.checked_div(op2).ok_or(DexError::Arithmethic)?; balance_token_out - .checked_sub(op3) + .checked_sub(op4) .ok_or(DexError::Arithmethic) } From b70278cdc458615cdd72a43e591c295c70c673de Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 16 Sep 2022 12:23:25 +0200 Subject: [PATCH 21/31] not payabale --- contracts/wrapped_azero/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/wrapped_azero/lib.rs b/contracts/wrapped_azero/lib.rs index 59b9ef7cd6..1db49ca4ac 100644 --- a/contracts/wrapped_azero/lib.rs +++ b/contracts/wrapped_azero/lib.rs @@ -166,7 +166,7 @@ pub mod wrapped_azero { } /// Unwraps a specified amount - #[ink(message, payable)] + #[ink(message)] pub fn unwrap(&mut self, amount: Balance) -> Result<()> { let caller = self.env().caller(); From 2c4213ce0f78b0a0bab100f15b3ad841ecf9992f Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 16 Sep 2022 12:25:34 +0200 Subject: [PATCH 22/31] refactor --- contracts/wrapped_azero/lib.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/contracts/wrapped_azero/lib.rs b/contracts/wrapped_azero/lib.rs index 1db49ca4ac..502b09f382 100644 --- a/contracts/wrapped_azero/lib.rs +++ b/contracts/wrapped_azero/lib.rs @@ -168,18 +168,20 @@ pub mod wrapped_azero { /// Unwraps a specified amount #[ink(message)] pub fn unwrap(&mut self, amount: Balance) -> Result<()> { + if amount.eq(&Balance::zero()) { + return Ok(()); + } + let caller = self.env().caller(); - if !amount.eq(&Balance::zero()) { - // burn the token form the caller, will fail if the calling account doesn't have enough balance - self._burn_from(caller, amount)?; - - // return the native token to the caller - self.env().transfer(caller, amount).map_err(|why| { - PSP22Error::Custom(format!("Native transfer failed: {:?}", why)) - })?; - Self::emit_event(self.env(), Event::UnWrapped(UnWrapped { caller, amount })); - } + // burn the token form the caller, will fail if the calling account doesn't have enough balance + self._burn_from(caller, amount)?; + + // return the native token to the caller + self.env() + .transfer(caller, amount) + .map_err(|why| PSP22Error::Custom(format!("Native transfer failed: {:?}", why)))?; + Self::emit_event(self.env(), Event::UnWrapped(UnWrapped { caller, amount })); Ok(()) } From d3fef1cb4c37b44901698d159429bfc679565a01 Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 16 Sep 2022 12:29:03 +0200 Subject: [PATCH 23/31] ok semver --- contracts/access_control/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/access_control/Cargo.toml b/contracts/access_control/Cargo.toml index 6ed28e95a2..28e7cb8614 100644 --- a/contracts/access_control/Cargo.toml +++ b/contracts/access_control/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "access_control" -version = "1.0.0" +version = "0.2.0" authors = ["Cardinal Cryptography"] edition = "2021" publish = false From 7210d54c0bc8b02f5e6ba88f5bf458751bce6ce1 Mon Sep 17 00:00:00 2001 From: filip Date: Mon, 19 Sep 2022 13:55:56 +0200 Subject: [PATCH 24/31] refactor role check --- contracts/simple_dex/Cargo.lock | 2 +- contracts/simple_dex/lib.rs | 59 +++++++++++---------------------- 2 files changed, 21 insertions(+), 40 deletions(-) diff --git a/contracts/simple_dex/Cargo.lock b/contracts/simple_dex/Cargo.lock index 31b6320cfd..ffe616031d 100644 --- a/contracts/simple_dex/Cargo.lock +++ b/contracts/simple_dex/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "access_control" -version = "1.0.0" +version = "0.2.0" dependencies = [ "ink_env", "ink_lang", diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 3c5c381fe0..77f25ac2c6 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -192,20 +192,14 @@ mod simple_dex { /// /// Can only be performed by an account with a LiquidityProvider role /// Caller needs to give at least the passed amount of allowance to the contract to spend the deposited tokens on his behalf - // Will revert if not enough allowance was given to the contract by the caller prior to executing this tx + /// prior to executing this tx #[ink(message)] pub fn deposit(&mut self, deposits: Vec<(AccountId, Balance)>) -> Result<(), DexError> { let this = self.env().account_id(); let caller = self.env().caller(); // check role, only designated account can add liquidity - ::check_role( - self.access_control, - caller, - Role::LiquidityProvider(this), - Self::cross_contract_call_error_handler, - Self::access_control_error_handler, - )?; + self.check_role(caller, Role::LiquidityProvider(this))?; deposits .into_iter() @@ -232,14 +226,8 @@ mod simple_dex { let this = self.env().account_id(); let caller = self.env().caller(); - // check role, only designated account can add liquidity - ::check_role( - self.access_control, - caller, - Role::LiquidityProvider(this), - Self::cross_contract_call_error_handler, - Self::access_control_error_handler, - )?; + // check role, only designated account can remove liquidity + self.check_role(caller, Role::LiquidityProvider(this))?; withdrawals.into_iter().try_for_each( |(token_out, amount)| -> Result<(), DexError> { @@ -271,13 +259,7 @@ mod simple_dex { let caller = self.env().caller(); let this = self.env().account_id(); - ::check_role( - self.access_control, - caller, - Role::Admin(this), - Self::cross_contract_call_error_handler, - Self::access_control_error_handler, - )?; + self.check_role(caller, Role::Admin(this))?; // emit event Self::emit_event( @@ -309,13 +291,7 @@ mod simple_dex { let caller = self.env().caller(); let this = self.env().account_id(); - ::check_role( - self.access_control, - caller, - Role::Owner(this), - Self::cross_contract_call_error_handler, - Self::access_control_error_handler, - )?; + self.check_role(caller, Role::Owner(this))?; self.access_control = access_control; Ok(()) @@ -334,15 +310,7 @@ mod simple_dex { pub fn terminate(&mut self) -> Result<(), DexError> { let caller = self.env().caller(); let this = self.env().account_id(); - - ::check_role( - self.access_control, - caller, - Role::Owner(this), - Self::cross_contract_call_error_handler, - Self::access_control_error_handler, - )?; - + self.check_role(caller, Role::Owner(this))?; self.env().terminate_contract(caller) } @@ -473,6 +441,19 @@ mod simple_dex { DexError::CrossContractCall(format!("Calling access control has failed: {:?}", why)) } + fn check_role(&self, account: AccountId, role: Role) -> Result<(), DexError> + where + Self: AccessControlled, + { + ::check_role( + self.access_control, + account, + role, + Self::cross_contract_call_error_handler, + Self::access_control_error_handler, + ) + } + fn emit_event(emitter: EE, event: Event) where EE: EmitEvent, From e7673797f69e614dbb02d17a7c54c688c511cf66 Mon Sep 17 00:00:00 2001 From: filip Date: Mon, 19 Sep 2022 14:13:11 +0200 Subject: [PATCH 25/31] remove duplicated check --- contracts/simple_dex/lib.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 77f25ac2c6..75b342413d 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -157,11 +157,6 @@ mod simple_dex { self.swap_fee_percentage, )?; - if balance_token_out < amount_token_out { - // liquidity too low - return Err(DexError::NotEnoughLiquidityOf(token_out)); - } - if amount_token_out < min_amount_token_out { // thrown if too much slippage occured before this tx gets executed // as a sandwitch atack prevention From ab507bf54ad2786e1c89f02037e8ce98debbbb42 Mon Sep 17 00:00:00 2001 From: Filip Bielejec Date: Mon, 19 Sep 2022 14:37:49 +0200 Subject: [PATCH 26/31] Update contracts/wrapped_azero/lib.rs Co-authored-by: deuszx <95355183+deuszx@users.noreply.github.com> --- contracts/wrapped_azero/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/wrapped_azero/lib.rs b/contracts/wrapped_azero/lib.rs index 502b09f382..77c490ff8c 100644 --- a/contracts/wrapped_azero/lib.rs +++ b/contracts/wrapped_azero/lib.rs @@ -122,7 +122,7 @@ pub mod wrapped_azero { /// Creates a new token /// /// The token will have its name and symbol set in metadata to the specified values. - /// Decimals are fixed at 18. + /// Decimals are fixed at 12. /// /// Will revert if called from an account without a proper role #[ink(constructor)] From bed038f951137f6e03f36bd676ee7ef0d4b58aa3 Mon Sep 17 00:00:00 2001 From: filip Date: Mon, 19 Sep 2022 14:54:35 +0200 Subject: [PATCH 27/31] remove unused dep --- contracts/simple_dex/Cargo.lock | 68 --------------------------------- contracts/simple_dex/Cargo.toml | 2 - 2 files changed, 70 deletions(-) diff --git a/contracts/simple_dex/Cargo.lock b/contracts/simple_dex/Cargo.lock index ffe616031d..0dd7a6f029 100644 --- a/contracts/simple_dex/Cargo.lock +++ b/contracts/simple_dex/Cargo.lock @@ -511,73 +511,6 @@ version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" -[[package]] -name = "num" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.15" @@ -938,7 +871,6 @@ dependencies = [ "ink_prelude", "ink_primitives", "ink_storage", - "num", "openbrush", "parity-scale-codec", "scale-info", diff --git a/contracts/simple_dex/Cargo.toml b/contracts/simple_dex/Cargo.toml index a38620b372..2f141e8076 100644 --- a/contracts/simple_dex/Cargo.toml +++ b/contracts/simple_dex/Cargo.toml @@ -18,7 +18,6 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } openbrush = { git = "https://github.com/Supercolony-net/openbrush-contracts.git", rev = "8a20f95", default-features = false, features = ["psp22"] } -num = { version = "0.4.0", default-features = false } access_control = { path = "../access_control", default-features = false, features = ["ink-as-dependency"] } game_token = { path = "../game_token", default-features = false, features = ["ink-as-dependency"] } @@ -41,7 +40,6 @@ std = [ "ink_prelude/std", "ink_primitives/std", "ink_storage/std", - "num/std", "openbrush/std", "scale-info/std", "scale/std", From 00224a50f23ed23c6b27ac9ecbd1c28beec31751 Mon Sep 17 00:00:00 2001 From: Filip Bielejec Date: Fri, 23 Sep 2022 13:23:31 +0200 Subject: [PATCH 28/31] Update contracts/simple_dex/lib.rs Co-authored-by: Michal Handzlik --- contracts/simple_dex/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 75b342413d..0b7b29e994 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -159,7 +159,7 @@ mod simple_dex { if amount_token_out < min_amount_token_out { // thrown if too much slippage occured before this tx gets executed - // as a sandwitch atack prevention + // as a sandwich attack prevention return Err(DexError::TooMuchSlippage); } From 40a42dea98721425bfa11c69793218ca6371d513 Mon Sep 17 00:00:00 2001 From: Filip Bielejec Date: Fri, 23 Sep 2022 13:24:44 +0200 Subject: [PATCH 29/31] Update contracts/simple_dex/lib.rs Co-authored-by: Michal Handzlik --- contracts/simple_dex/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 0b7b29e994..75f8ffa65b 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -115,7 +115,7 @@ mod simple_dex { } /// Swaps the a specified amount of one of the pool's PSP22 tokens to another PSP22 token - /// Calling account needs to give allowance to the DEX contract to spend amount_token_in of token_in on it's behalf + /// Calling account needs to give allowance to the DEX contract to spend amount_token_in of token_in on its behalf /// before executing this tx. #[ink(message)] pub fn swap( From 65be1ac32cc3a1aedf6a549526c99511b4c966cd Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 23 Sep 2022 15:16:10 +0200 Subject: [PATCH 30/31] added swap pairs --- contracts/access_control/Cargo.lock | 2 +- contracts/game_token/Cargo.lock | 2 +- contracts/simple_dex/lib.rs | 98 +++++++++++++++++++++-------- 3 files changed, 74 insertions(+), 28 deletions(-) diff --git a/contracts/access_control/Cargo.lock b/contracts/access_control/Cargo.lock index 8ec3003bf5..59450d4d86 100644 --- a/contracts/access_control/Cargo.lock +++ b/contracts/access_control/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "access_control" -version = "1.0.0" +version = "0.2.0" dependencies = [ "ink_env", "ink_lang", diff --git a/contracts/game_token/Cargo.lock b/contracts/game_token/Cargo.lock index e61e165d6c..1febd0fb6c 100644 --- a/contracts/game_token/Cargo.lock +++ b/contracts/game_token/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "access_control" -version = "1.0.0" +version = "0.2.0" dependencies = [ "ink_env", "ink_lang", diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index 75f8ffa65b..baa70f7e4d 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -25,11 +25,24 @@ mod simple_dex { reflect::ContractEventBase, }; use ink_prelude::{format, string::String, vec, vec::Vec}; - use ink_storage::traits::SpreadAllocate; - use openbrush::contracts::traits::errors::PSP22Error; + use ink_storage::traits::{PackedLayout, SpreadAllocate, SpreadLayout}; + use openbrush::{contracts::traits::errors::PSP22Error, storage::Mapping}; type Event = ::Type; + #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode, SpreadLayout, PackedLayout)] + #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] + pub struct SwapPair { + pub from: AccountId, + pub to: AccountId, + } + + impl SwapPair { + pub fn new(from: AccountId, to: AccountId) -> Self { + Self { from, to } + } + } + #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] pub enum DexError { @@ -42,7 +55,7 @@ mod simple_dex { CrossContractCall(String), TooMuchSlippage, NotEnoughLiquidityOf(AccountId), - UnsupportedToken(AccountId), + UnsupportedSwapPair(SwapPair), } impl From for DexError { @@ -58,7 +71,18 @@ mod simple_dex { } #[ink(event)] - #[derive(Debug)] + pub struct SwapPairAdded { + #[ink(topic)] + pair: SwapPair, + } + + #[ink(event)] + pub struct SwapPairRemoved { + #[ink(topic)] + pair: SwapPair, + } + + #[ink(event)] pub struct Swapped { caller: AccountId, #[ink(topic)] @@ -70,7 +94,6 @@ mod simple_dex { } #[ink(event)] - #[derive(Debug)] pub struct SwapFeeSet { #[ink(topic)] caller: AccountId, @@ -82,8 +105,8 @@ mod simple_dex { pub struct SimpleDex { pub swap_fee_percentage: u128, pub access_control: AccountId, - // pool tokens - pub tokens: [AccountId; 4], + // a set of pairs that are availiable for swapping between + pub swap_pairs: Mapping, } impl AccessControlled for SimpleDex { @@ -92,7 +115,7 @@ mod simple_dex { impl SimpleDex { #[ink(constructor)] - pub fn new(tokens: [AccountId; 4]) -> Self { + pub fn new() -> Self { let caller = Self::env().caller(); let code_hash = Self::env() .own_code_hash() @@ -109,7 +132,7 @@ mod simple_dex { ); match role_check { - Ok(_) => initialize_contract(|contract| Self::new_init(contract, tokens)), + Ok(_) => initialize_contract(|contract| Self::new_init(contract)), Err(why) => panic!("Could not initialize the contract {:?}", why), } } @@ -128,13 +151,9 @@ mod simple_dex { let this = self.env().account_id(); let caller = self.env().caller(); - // check if tokens are supported by the pool - if !self.tokens.contains(&token_in) { - return Err(DexError::UnsupportedToken(token_in)); - } - - if !self.tokens.contains(&token_out) { - return Err(DexError::UnsupportedToken(token_out)); + let swap_pair = SwapPair::new(token_in, token_out); + if !self.swap_pairs.contains(&swap_pair) { + return Err(DexError::UnsupportedSwapPair(swap_pair)); } // check allowance @@ -199,10 +218,6 @@ mod simple_dex { deposits .into_iter() .try_for_each(|(token_in, amount)| -> Result<(), DexError> { - if !self.tokens.contains(&token_in) { - return Err(DexError::UnsupportedToken(token_in)); - } - // transfer token_in from the caller to the contract // will revert if the contract does not have enough allowance from the caller // in which case the whole tx is reverted @@ -226,10 +241,6 @@ mod simple_dex { withdrawals.into_iter().try_for_each( |(token_out, amount)| -> Result<(), DexError> { - if !self.tokens.contains(&token_out) { - return Err(DexError::UnsupportedToken(token_out)); - } - // transfer token_out from the contract to the caller self.transfer_tx(token_out, caller, amount)??; Ok(()) @@ -298,6 +309,42 @@ mod simple_dex { self.access_control } + /// Whitelists a token pair for swapping between + /// + /// Token pair is understood as a swap between tokens in one direction + /// Can only be called by an Admin + #[ink(message)] + pub fn add_swap_pair(&mut self, from: AccountId, to: AccountId) -> Result<(), DexError> { + let caller = self.env().caller(); + let this = self.env().account_id(); + self.check_role(caller, Role::Admin(this))?; + + let pair = SwapPair::new(from, to); + self.swap_pairs.insert(&pair, &()); + + Self::emit_event(self.env(), Event::SwapPairAdded(SwapPairAdded { pair })); + + Ok(()) + } + + /// Blacklists a token pair from swapping + /// + /// Token pair is understood as a swap between tokens in one direction + /// Can only be called by an Admin + #[ink(message)] + pub fn remove_swap_pair(&mut self, from: AccountId, to: AccountId) -> Result<(), DexError> { + let caller = self.env().caller(); + let this = self.env().account_id(); + self.check_role(caller, Role::Admin(this))?; + + let pair = SwapPair::new(from, to); + self.swap_pairs.remove(&pair); + + Self::emit_event(self.env(), Event::SwapPairRemoved(SwapPairRemoved { pair })); + + Ok(()) + } + /// Terminates the contract. /// /// Can only be called by the contract's Owner. @@ -317,9 +364,8 @@ mod simple_dex { .map_err(|why| DexError::InkEnv(format!("Can't retrieve own code hash: {:?}", why))) } - fn new_init(&mut self, tokens: [AccountId; 4]) { + fn new_init(&mut self) { self.access_control = AccountId::from(ACCESS_CONTROL_PUBKEY); - self.tokens = tokens; self.swap_fee_percentage = 0; } From 9a67828df7bc7d2fd544d6886a78559cb68d9007 Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 23 Sep 2022 15:22:19 +0200 Subject: [PATCH 31/31] edited docstring --- contracts/simple_dex/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contracts/simple_dex/lib.rs b/contracts/simple_dex/lib.rs index baa70f7e4d..b058994c80 100644 --- a/contracts/simple_dex/lib.rs +++ b/contracts/simple_dex/lib.rs @@ -5,9 +5,10 @@ use ink_lang as ink; /// Simple DEX contract /// /// This contract is based on Balancer multi asset LP design and all formulas are taken from the Balancer's whitepaper (https://balancer.fi/whitepaper.pdf) -/// It has one pool with three PSP22 game reward tokens and our native token -/// Swaps can be done between all pairs in the pool -/// Liquidity provision is provided as single (native) asset deposits/withdrawals only, and calling the assosiated functions is limited to designated accounts only. +/// It has one pool with PSP22 tokens with equal weights +/// +/// Swaps can be performed between all pairs in the pool whitelisted for trading +/// Liquidity provisioning is limited to designated accounts only and works as deposits / withdrawals of arbitrary composition. #[ink::contract] mod simple_dex {