diff --git a/.editorconfig b/.editorconfig index 0d412aa775..97bd27e878 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,4 +12,9 @@ insert_final_newline=true [*.toml] indent_style=tab indent_size=tab +tab_width=4 + +[*.ts] +indent_style=tab +indent_size=tab tab_width=4 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 9530792689..3fc40ef188 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1068,9 +1068,9 @@ dependencies = [ [[package]] name = "environmental" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516aa8d7a71cb00a1c4146f0798549b93d083d4f189b3ced8f3de6b8f11ee6c4" +checksum = "6576a1755ddffd988788025e75bce9e74b018f7cc226198fe931d077911c6d7e" [[package]] name = "erased-serde" @@ -1097,9 +1097,9 @@ dependencies = [ [[package]] name = "ethereum" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f873613a1191fe9d63794b5d0b636712446153ef0df192e9381bf1f951d3b94" +checksum = "da7fef4d2da1de3a4f4f85408379644276db9b46c4af7b0fe38a3debec5cb7cd" dependencies = [ "ethereum-types", "parity-scale-codec", @@ -1281,16 +1281,16 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", ] [[package]] name = "frame-benchmarking" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "frame-system", @@ -1307,8 +1307,8 @@ dependencies = [ [[package]] name = "frame-executive" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "frame-system", @@ -1323,8 +1323,8 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "11.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "12.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "serde", @@ -1334,8 +1334,8 @@ dependencies = [ [[package]] name = "frame-support" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "bitmask", "frame-metadata", @@ -1359,8 +1359,8 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support-procedural-tools", "proc-macro2", @@ -1370,8 +1370,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -1382,8 +1382,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "proc-macro2", "quote", @@ -1392,8 +1392,8 @@ dependencies = [ [[package]] name = "frame-system" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -1408,8 +1408,8 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "sp-api", @@ -3609,8 +3609,8 @@ dependencies = [ [[package]] name = "pallet-aura" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "frame-system", @@ -3628,8 +3628,8 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "frame-system", @@ -3643,8 +3643,8 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-benchmarking", "frame-support", @@ -3689,8 +3689,8 @@ checksum = "bd4556fb64842e71bb6e2f98b7541c0d310069eb607d432c6ac9bdaecbfd3118" [[package]] name = "pallet-evm" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "evm", "frame-support", @@ -3712,8 +3712,8 @@ dependencies = [ [[package]] name = "pallet-finality-tracker" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "frame-system", @@ -3728,8 +3728,8 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-benchmarking", "frame-support", @@ -3750,8 +3750,8 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "frame-system", @@ -3763,8 +3763,8 @@ dependencies = [ [[package]] name = "pallet-session" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "frame-system", @@ -3783,8 +3783,8 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "frame-system", @@ -3797,8 +3797,8 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-benchmarking", "frame-support", @@ -3814,8 +3814,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "frame-system", @@ -3831,8 +3831,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "jsonrpc-core 15.0.0", "jsonrpc-core-client 15.0.0", @@ -3849,8 +3849,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-support", "parity-scale-codec", @@ -4899,8 +4899,8 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -4923,8 +4923,8 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -4940,8 +4940,8 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -4957,8 +4957,8 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4968,8 +4968,8 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "ansi_term 0.12.1", "atty", @@ -5017,8 +5017,8 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "fnv", @@ -5053,8 +5053,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "blake2-rfc", "hash-db", @@ -5083,8 +5083,8 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "sc-client-api", "sp-blockchain", @@ -5094,8 +5094,8 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "futures 0.3.5", @@ -5125,8 +5125,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "fork-tree", @@ -5169,8 +5169,8 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "fork-tree", "parity-scale-codec", @@ -5182,8 +5182,8 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "assert_matches", "derive_more", @@ -5213,8 +5213,8 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -5236,8 +5236,8 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "log", "sc-client-api", @@ -5250,8 +5250,8 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "lazy_static", @@ -5277,8 +5277,8 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "log", @@ -5294,8 +5294,8 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "log", "parity-scale-codec", @@ -5309,8 +5309,8 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "finality-grandpa", @@ -5346,8 +5346,8 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "ansi_term 0.12.1", "futures 0.3.5", @@ -5364,8 +5364,8 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "hex", @@ -5380,8 +5380,8 @@ dependencies = [ [[package]] name = "sc-light" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "hash-db", "lazy_static", @@ -5399,8 +5399,8 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "async-std", "async-trait", @@ -5453,8 +5453,8 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -5468,8 +5468,8 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "bytes 0.5.6", "fnv", @@ -5495,8 +5495,8 @@ dependencies = [ [[package]] name = "sc-peerset" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.3.5", "libp2p", @@ -5508,8 +5508,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -5517,8 +5517,8 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.3.5", "hash-db", @@ -5549,8 +5549,8 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "futures 0.3.5", @@ -5573,8 +5573,8 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.1.29", "jsonrpc-core 15.0.0", @@ -5591,8 +5591,8 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "directories", @@ -5653,8 +5653,8 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "log", "parity-scale-codec", @@ -5667,8 +5667,8 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -5688,8 +5688,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "erased-serde", "log", @@ -5707,8 +5707,8 @@ dependencies = [ [[package]] name = "sc-transaction-graph" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "futures 0.3.5", @@ -5728,8 +5728,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "futures 0.3.5", @@ -6099,8 +6099,8 @@ dependencies = [ [[package]] name = "sp-allocator" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "log", @@ -6111,8 +6111,8 @@ dependencies = [ [[package]] name = "sp-api" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "hash-db", "parity-scale-codec", @@ -6126,8 +6126,8 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -6138,8 +6138,8 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "serde", @@ -6150,8 +6150,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "integer-sqrt", "num-traits", @@ -6163,8 +6163,8 @@ dependencies = [ [[package]] name = "sp-authorship" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -6174,8 +6174,8 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "sp-api", @@ -6186,8 +6186,8 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "log", @@ -6203,8 +6203,8 @@ dependencies = [ [[package]] name = "sp-chain-spec" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "serde", "serde_json", @@ -6212,8 +6212,8 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "futures 0.3.5", @@ -6238,8 +6238,8 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "sp-api", @@ -6252,8 +6252,8 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "merlin", "parity-scale-codec", @@ -6271,8 +6271,8 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -6280,8 +6280,8 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -6292,8 +6292,8 @@ dependencies = [ [[package]] name = "sp-core" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "base58", "blake2-rfc", @@ -6336,8 +6336,8 @@ dependencies = [ [[package]] name = "sp-database" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "kvdb", "parking_lot 0.10.2", @@ -6345,8 +6345,8 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "proc-macro2", "quote", @@ -6355,8 +6355,8 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "environmental", "parity-scale-codec", @@ -6366,8 +6366,8 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "finality-grandpa", "log", @@ -6382,8 +6382,8 @@ dependencies = [ [[package]] name = "sp-finality-tracker" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -6392,8 +6392,8 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "parity-scale-codec", @@ -6404,8 +6404,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.3.5", "hash-db", @@ -6427,8 +6427,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "lazy_static", "sp-core", @@ -6438,8 +6438,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "sp-api", "sp-core", @@ -6448,8 +6448,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "backtrace", "log", @@ -6457,8 +6457,8 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "serde", "sp-core", @@ -6466,8 +6466,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "either", "hash256-std-hasher", @@ -6488,8 +6488,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "primitive-types", @@ -6504,8 +6504,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "Inflector", "proc-macro-crate", @@ -6516,8 +6516,8 @@ dependencies = [ [[package]] name = "sp-serializer" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "serde", "serde_json", @@ -6525,8 +6525,8 @@ dependencies = [ [[package]] name = "sp-session" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "sp-api", @@ -6538,8 +6538,8 @@ dependencies = [ [[package]] name = "sp-staking" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -6548,8 +6548,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "hash-db", "log", @@ -6569,13 +6569,13 @@ dependencies = [ [[package]] name = "sp-std" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" [[package]] name = "sp-storage" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "impl-serde", "parity-scale-codec", @@ -6587,8 +6587,8 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -6601,8 +6601,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "log", "parity-scale-codec", @@ -6614,8 +6614,8 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "derive_more", "futures 0.3.5", @@ -6629,8 +6629,8 @@ dependencies = [ [[package]] name = "sp-trie" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "hash-db", "memory-db", @@ -6643,8 +6643,8 @@ dependencies = [ [[package]] name = "sp-utils" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.3.5", "futures-core", @@ -6655,8 +6655,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "impl-serde", "parity-scale-codec", @@ -6667,8 +6667,8 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -6796,16 +6796,16 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "platforms", ] [[package]] name = "substrate-frame-rpc-system" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.5", @@ -6827,8 +6827,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "0.8.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "async-std", "derive_more", @@ -6841,8 +6841,8 @@ dependencies = [ [[package]] name = "substrate-test-client" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" dependencies = [ "futures 0.1.29", "futures 0.3.5", @@ -6868,7 +6868,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder-runner" version = "1.0.6" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#7314ddce65d6023ccb7ae18006a4ada792604bfd" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#d81e3abb6c62fad079a8a8127d595d2772ec7a98" [[package]] name = "subtle" @@ -7431,7 +7431,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" dependencies = [ - "rand 0.7.3", + "rand 0.3.23", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f9b714d3d0..617395b329 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,5 +9,4 @@ members = [ "template/node", "template/runtime", "template/test-utils/client", -] -exclude = ["vendor"] \ No newline at end of file +] \ No newline at end of file diff --git a/README.md b/README.md index e0c569963b..4411b7db55 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Frontier +![GitHub Workflow Status](https://img.shields.io/github/workflow/status/paritytech/frontier/Rust) +![Matrix](https://img.shields.io/matrix/frontier:matrix.org) + Frontier is Substrate's Ethereum compatibility layer. It allows you to run unmodified Ethereum dapps. @@ -57,4 +60,4 @@ git submodule update 1. Override your local cargo config to point to your local substrate (pointing to your WIP branch): place `paths = ["path/to/substrate"]` in `~/.cargo/config`. 2. You are good to go. -Remember to comment out the override after it is done to avoid mysterious build issues on other repo. \ No newline at end of file +Remember to comment out the override after it is done to avoid mysterious build issues on other repo. diff --git a/frame/ethereum/src/lib.rs b/frame/ethereum/src/lib.rs index bf849ee612..e937b074d1 100644 --- a/frame/ethereum/src/lib.rs +++ b/frame/ethereum/src/lib.rs @@ -243,16 +243,11 @@ impl<T: Trait> Module<T> { } let ommers = Vec::<ethereum::Header>::new(); - let header = ethereum::Header { + let partial_header = ethereum::PartialHeader { parent_hash: Self::current_block_hash().unwrap_or_default(), - ommers_hash: H256::from_slice( - Keccak256::digest(&rlp::encode_list(&ommers)[..]).as_slice(), - ), // TODO: check ommers hash. beneficiary: <Module<T>>::find_author(), - state_root: H256::default(), // TODO: figure out if there's better way to get a sort-of-valid state root. - transactions_root: H256::from_slice( - Keccak256::digest(&rlp::encode_list(&transactions)[..]).as_slice(), - ), // TODO: check transactions hash. + // TODO: figure out if there's better way to get a sort-of-valid state root. + state_root: H256::default(), receipts_root: H256::from_slice( Keccak256::digest(&rlp::encode_list(&receipts)[..]).as_slice(), ), // TODO: check receipts hash. @@ -272,13 +267,7 @@ impl<T: Trait> Module<T> { mix_hash: H256::default(), nonce: H64::default(), }; - let hash = Self::ethereum_block_hash(&header); - - let block = ethereum::Block { - header: header.clone(), - transactions: transactions.clone(), - ommers, - }; + let block = ethereum::Block::new(partial_header, transactions.clone(), ommers); let mut transaction_hashes = Vec::new(); @@ -296,7 +285,7 @@ impl<T: Trait> Module<T> { let digest = DigestItem::<T::Hash>::Consensus( FRONTIER_ENGINE_ID, ConsensusLog::EndBlock { - block_hash: hash, + block_hash: block.header.hash(), transaction_hashes, }.encode(), ); @@ -323,7 +312,7 @@ impl<T: Trait> Module<T> { /// Get current block hash pub fn current_block_hash() -> Option<H256> { - Self::current_block().map(|block| Self::ethereum_block_hash(&block.header)) + Self::current_block().map(|block| block.header.hash()) } /// Get receipts by number. @@ -457,8 +446,4 @@ impl<T: Trait> Module<T> { ExitError::Other(_s) => return Error::<T>::ExitErrorOther, } } - - fn ethereum_block_hash(header: ðereum::Header) -> H256 { - H256::from_slice(Keccak256::digest(&rlp::encode(header)).as_slice()) - } } diff --git a/frame/ethereum/src/mock.rs b/frame/ethereum/src/mock.rs index bbd63ad52f..d9445056fe 100644 --- a/frame/ethereum/src/mock.rs +++ b/frame/ethereum/src/mock.rs @@ -69,7 +69,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = pallet_balances::AccountData<u64>; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/rpc/primitives/src/lib.rs b/rpc/primitives/src/lib.rs index fadbcbceaa..59167598d3 100644 --- a/rpc/primitives/src/lib.rs +++ b/rpc/primitives/src/lib.rs @@ -80,6 +80,12 @@ sp_api::decl_runtime_apis! { fn current_receipts() -> Option<Vec<ethereum::Receipt>>; /// Return the current transaction status. fn current_transaction_statuses() -> Option<Vec<TransactionStatus>>; + /// Return all the current data for a block in a single runtime call. + fn current_all() -> ( + Option<EthereumBlock>, + Option<Vec<ethereum::Receipt>>, + Option<Vec<TransactionStatus>> + ); } } diff --git a/rpc/src/eth.rs b/rpc/src/eth.rs index 22a4724661..32b4fc3dd0 100644 --- a/rpc/src/eth.rs +++ b/rpc/src/eth.rs @@ -778,7 +778,7 @@ impl<B, C, P, CT, BE, A> EthApiT for EthApi<B, C, P, CT, BE, A> where } fn logs(&self, filter: Filter) -> Result<Vec<Log>> { - let mut blocks_and_receipts = Vec::new(); + let mut blocks_and_statuses = Vec::new(); let mut ret = Vec::new(); // Check for number of past blocks allowed for querying ethereum events. @@ -804,14 +804,12 @@ impl<B, C, P, CT, BE, A> EthApiT for EthApi<B, C, P, CT, BE, A> where return Ok(Vec::new()); } - let block = self.client.runtime_api() - .current_block(&id) + let (block, _, statuses) = self.client.runtime_api() + .current_all(&id) .map_err(|err| internal_err(format!("fetch runtime account basic failed: {:?}", err)))?; - let receipts = self.client.runtime_api().current_receipts(&id) - .map_err(|err| internal_err(format!("call runtime failed: {:?}", err)))?; - if let (Some(block), Some(receipts)) = (block, receipts) { - blocks_and_receipts.push((block, receipts)); + if let (Some(block), Some(statuses)) = (block, statuses) { + blocks_and_statuses.push((block, statuses)); } } else { let mut current_number = filter.to_block @@ -827,18 +825,15 @@ impl<B, C, P, CT, BE, A> EthApiT for EthApi<B, C, P, CT, BE, A> where .unwrap_or( self.client.info().best_number ); - while current_number >= from_number { let id = BlockId::Number(current_number); - let block = self.client.runtime_api() - .current_block(&id) + let (block, _, statuses) = self.client.runtime_api() + .current_all(&id) .map_err(|err| internal_err(format!("fetch runtime account basic failed: {:?}", err)))?; - let receipts = self.client.runtime_api().current_receipts(&id) - .map_err(|err| internal_err(format!("call runtime failed: {:?}", err)))?; - if let (Some(block), Some(receipts)) = (block, receipts) { - blocks_and_receipts.push((block, receipts)); + if let (Some(block), Some(statuses)) = (block, statuses) { + blocks_and_statuses.push((block, statuses)); } if current_number == Zero::zero() { @@ -848,22 +843,22 @@ impl<B, C, P, CT, BE, A> EthApiT for EthApi<B, C, P, CT, BE, A> where } } } - + let mut blocks_processed: u32 = 0; let mut logs_processed: u32 = 0; - - 'outer: for (block, receipts) in blocks_and_receipts { + + 'outer: for (block, statuses) in blocks_and_statuses { if blocks_processed == eth_block_limit { break; } let mut block_log_index: u32 = 0; - for (index, receipt) in receipts.iter().enumerate() { - let logs = receipt.logs.clone(); + let block_hash = H256::from_slice( + Keccak256::digest(&rlp::encode(&block.header)).as_slice() + ); + for status in statuses.iter() { + let logs = status.logs.clone(); let mut transaction_log_index: u32 = 0; - let transaction = &block.transactions[index as usize]; - let transaction_hash = H256::from_slice( - Keccak256::digest(&rlp::encode(transaction)).as_slice() - ); + let transaction_hash = status.transaction_hash; for log in logs { if logs_processed == eth_log_limit { break 'outer; @@ -895,12 +890,10 @@ impl<B, C, P, CT, BE, A> EthApiT for EthApi<B, C, P, CT, BE, A> where address: log.address.clone(), topics: log.topics.clone(), data: Bytes(log.data.clone()), - block_hash: Some(H256::from_slice( - Keccak256::digest(&rlp::encode(&block.header)).as_slice() - )), + block_hash: Some(block_hash), block_number: Some(block.header.number.clone()), transaction_hash: Some(transaction_hash), - transaction_index: Some(U256::from(index)), + transaction_index: Some(U256::from(status.transaction_index)), log_index: Some(U256::from(block_log_index)), transaction_log_index: Some(U256::from(transaction_log_index)), removed: false, diff --git a/rpc/src/eth_pubsub.rs b/rpc/src/eth_pubsub.rs index 2eb69fa3c9..337b008672 100644 --- a/rpc/src/eth_pubsub.rs +++ b/rpc/src/eth_pubsub.rs @@ -305,8 +305,15 @@ impl SubscriptionResult { )); let mut logs: Vec<Log> = vec![]; let mut log_index: u32 = 0; - for receipt in receipts { + for (receipt_index, receipt) in receipts.into_iter().enumerate() { let mut transaction_log_index: u32 = 0; + let transaction_hash: Option<H256> = if receipt.logs.len() > 0 { + Some(H256::from_slice( + Keccak256::digest(&rlp::encode( + &block.transactions[receipt_index as usize] + )).as_slice() + )) + } else { None }; for log in receipt.logs { if self.add_log( block_hash.unwrap(), @@ -320,11 +327,7 @@ impl SubscriptionResult { data: Bytes(log.data), block_hash: block_hash, block_number: Some(block.header.number), - transaction_hash: Some(H256::from_slice( - Keccak256::digest(&rlp::encode( - &block.transactions[log_index as usize] - )).as_slice() - )), + transaction_hash: transaction_hash, transaction_index: Some(U256::from(log_index)), log_index: Some(U256::from(log_index)), transaction_log_index: Some(U256::from( diff --git a/template/examples/contract-erc20/README.md b/template/examples/contract-erc20/README.md index 4a26485d50..d3a3ca5494 100644 --- a/template/examples/contract-erc20/README.md +++ b/template/examples/contract-erc20/README.md @@ -1,14 +1,20 @@ -# Frontier Template tutorial +# ERC20 contract creation -This directory contains typescript script describing the different topics presented by the frontier node template. +This directory contains typescript script describing the different +topics presented by the frontier node template. -## Installation and Usage +## Basic -Use `npm i` to install dependencies. To create an ERC20 contract, execute `node_modules/.bin/ts-node create-erc20.ts` while your template node is running in `--dev` mode. +### Installation and Usage -## Expected output +Use `npm i` to install dependencies. To create an ERC20 contract, +execute `node_modules/.bin/ts-node create-erc20.ts` while your +template node is running in `--dev` mode. + +### Expected output + +The ouput of the command should look similar to this: -The ouput of the command should look similar to this ``` └────╼ ts-node create-erc20.ts Initiating the API (ignore message "Unable to resolve type B..." and "Unknown types found...") @@ -53,3 +59,18 @@ Bob EVM Account (nonce: 0) balance: 0x000000000000000000000000000000000000000000 Bob Contract storage key: 0x0e4b5229940f8e2bf475520e854b789139893f70ee7b5ec9006de746028449fe Bob Contract account storage: 0x00000000000000000000000000000000000000000000000000000000000000dd ``` + +## RPC + +This section describes how to use the web3.js SDK to interact with +Frontier. + +## Installation and Usage + +Use `npm i` to install dependencies. To create an ERC20 contract, +execute `node_modules/.bin/ts-node create-erc20.ts` while your +template node is running in `--dev` mode. + +## Expected output + +WIP diff --git a/template/examples/contract-erc20/create-erc20-rpc.ts b/template/examples/contract-erc20/create-erc20-rpc.ts new file mode 100755 index 0000000000..92d18747f2 --- /dev/null +++ b/template/examples/contract-erc20/create-erc20-rpc.ts @@ -0,0 +1,83 @@ +import Web3 from "web3"; +import * as web3Utils from 'web3-utils'; + +const web3 = new Web3("http://localhost:9933"); +const ERC20_BYTECODE = require("./truffle/contracts/MyToken.json").bytecode; +const STORAGE_SLOT = "0"; + +const createAccount = () => { + const account = web3.eth.accounts.create(); + const mapStorageSlot = STORAGE_SLOT.padStart(64, '0'); + const mapKey = account.address.toString().substring(2).padStart(64, '0'); + const storageKey = web3Utils.sha3('0x'.concat(mapKey.concat(mapStorageSlot))); + return {...account, storageKey}; +} + +const main = async () => { + + console.log("Generating accounts..."); + const alice = createAccount(); + const bob = createAccount(); + + // Step 1: Creating the contract. + console.log(`Alice account: ${alice.address}\n storageKey [slot ${STORAGE_SLOT}]: ${alice.storageKey}`); + console.log(`Bob account: ${bob.address}\n storageKey [slot ${STORAGE_SLOT}]: ${bob.storageKey}`); + + console.log(`\nCreating contract using Eth RPC "sendTransaction" from alice`); + const createTransaction = await alice.signTransaction( + { + data: ERC20_BYTECODE, + value: "0x00", + gasPrice: "0x00", + gas: "0x100000", + }); + console.log("Transaction", { + ...createTransaction, + rawTransaction: `${createTransaction.rawTransaction.substring( + 0, + 32 + )}... (${createTransaction.rawTransaction.length} length)`, + }); + + const createReceipt = await web3.eth.sendSignedTransaction( + createTransaction.rawTransaction + ); + console.log( + `Contract deployed at address ${createReceipt.contractAddress}` + ); + + // Step 2: Sending contract tokens to bob + console.log(`\nSending 221 Contract tokens from alice to bob`); + const transferFnCode = `a9059cbb000000000000000000000000`; + const tokensToTransfer = `00000000000000000000000000000000000000000000000000000000000000dd`; + const inputCode = `0x${transferFnCode}${bob.address.substring( + 2 + )}${tokensToTransfer}`; + + const transferTransaction = await alice.signTransaction( + { + to: createReceipt.contractAddress, + data: inputCode, + value: "0x00", + gasPrice: "0x00", + gas: "0x100000", + }); + console.log("Transaction", { + ...transferTransaction, + rawTransaction: `${transferTransaction.rawTransaction.substring( + 0, + 32 + )}... (${transferTransaction.rawTransaction.length} length)`, + }); + + const transferReceipt = await web3.eth.sendSignedTransaction( + transferTransaction.rawTransaction + ); + console.log( + `Transfer executed to ${transferReceipt.to} (H: ${transferReceipt.transactionHash})` + ); +}; + +main().catch((err) => { + console.log("Error", err); +}); diff --git a/template/examples/contract-erc20/create-erc20.ts b/template/examples/contract-erc20/create-erc20.ts index e012a50e58..577a9b0cc4 100644 --- a/template/examples/contract-erc20/create-erc20.ts +++ b/template/examples/contract-erc20/create-erc20.ts @@ -4,201 +4,200 @@ import { U8aFixed } from '@polkadot/types/codec'; import * as web3Utils from 'web3-utils'; import * as crypto from '@polkadot/util-crypto'; - // Provider is set to localhost for development const wsProvider = new WsProvider("ws://localhost:9944"); // Keyring needed to sign using Alice account const keyring = new Keyring({ type: 'sr25519' }); -// ByteCode of our ERC20 exemple: copied from ../truffle/contracts/MyToken.json -const ERC20_BYTECODES = "0x608060405234801561001057600080fd5b50610041337fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61004660201b60201c565b610291565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156100e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6101028160025461020960201b610c7c1790919060201c565b60028190555061015d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461020960201b610c7c1790919060201c565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080828401905083811015610287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b610e3a806102a06000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a08231146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e1461032157610088565b8063095ea7b31461008d57806318160ddd146100f357806323b872dd146101115780633950935114610197575b600080fd5b6100d9600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610399565b604051808215151515815260200191505060405180910390f35b6100fb6103b7565b6040518082815260200191505060405180910390f35b61017d6004803603606081101561012757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103c1565b604051808215151515815260200191505060405180910390f35b6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061049a565b604051808215151515815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061054d565b6040518082815260200191505060405180910390f35b6102a16004803603604081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610595565b604051808215151515815260200191505060405180910390f35b610307600480360360408110156102d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610662565b604051808215151515815260200191505060405180910390f35b6103836004803603604081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610680565b6040518082815260200191505060405180910390f35b60006103ad6103a6610707565b848461070f565b6001905092915050565b6000600254905090565b60006103ce848484610906565b61048f846103da610707565b61048a85604051806060016040528060288152602001610d7060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610440610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b600190509392505050565b60006105436104a7610707565b8461053e85600160006104b8610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b61070f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106586105a2610707565b8461065385604051806060016040528060258152602001610de160259139600160006105cc610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b6001905092915050565b600061067661066f610707565b8484610906565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610795576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610dbd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561081b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610d286022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610d986025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610d056023913960400191505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c2e578082015181840152602081019050610c13565b50505050905090810190601f168015610c5b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820c7a5ffabf642bda14700b2de42f8c57b36621af020441df825de45fd2b3e1c5c64736f6c63430005100032"; +// ByteCode of our ERC20 exemple: copied from ./truffle/contracts/MyToken.json +const ERC20_BYTECODES = require("./truffle/contracts/MyToken.json").bytecode; // Setup the API and Alice Account async function init() { - console.log(`Initiating the API (ignore message "Unable to resolve type B..." and "Unknown types found...")`); - - // Initiate the polkadot API. - const api = await ApiPromise.create({ - provider: wsProvider, - types: { - // mapping the actual specified address format - Address: "AccountId", - // mapping the lookup - LookupSource: "AccountId", - Account: { - nonce: "U256", - balance: "U256" - }, - Transaction: { - nonce: "U256", - action: "String", - gas_price: "u64", - gas_limit: "u64", - value: "U256", - input: "Vec<u8>", - signature: "Signature" - }, - Signature: { - v: "u64", - r: "H256", - s: "H256" - } - } - }); - console.log(`Initialiation done`); - console.log(`Genesis at block: ${api.genesisHash.toHex()}`); - - const alice = keyring.addFromUri('//Alice', { name: 'Alice default' }); - const bob = keyring.addFromUri('//Bob', { name: 'Bob default' }); - - const { nonce, data: balance } = await api.query.system.account(alice.address); - console.log(`Alice Substrate Account: ${alice.address}`); - console.log(`Alice Substrate Account (nonce: ${nonce}) balance, free: ${balance.free.toHex()}`); - - const aliceEvmAccount = `0x${crypto.blake2AsHex(crypto.decodeAddress(alice.address), 256).substring(26)}`; - - console.log(`Alice EVM Account: ${aliceEvmAccount}`); - const evmData = (await api.query.evm.accounts(aliceEvmAccount)) as any; - console.log(`Alice EVM Account (nonce: ${evmData.nonce}) balance: ${evmData.balance.toHex()}`); - - return { api, alice, bob }; + console.log(`Initiating the API (ignore message "Unable to resolve type B..." and "Unknown types found...")`); + + // Initiate the polkadot API. + const api = await ApiPromise.create({ + provider: wsProvider, + types: { + // mapping the actual specified address format + Address: "AccountId", + // mapping the lookup + LookupSource: "AccountId", + Account: { + nonce: "U256", + balance: "U256" + }, + Transaction: { + nonce: "U256", + action: "String", + gas_price: "u64", + gas_limit: "u64", + value: "U256", + input: "Vec<u8>", + signature: "Signature" + }, + Signature: { + v: "u64", + r: "H256", + s: "H256" + } + } + }); + console.log(`Initialiation done`); + console.log(`Genesis at block: ${api.genesisHash.toHex()}`); + + const alice = keyring.addFromUri('//Alice', { name: 'Alice default' }); + const bob = keyring.addFromUri('//Bob', { name: 'Bob default' }); + + const { nonce, data: balance } = await api.query.system.account(alice.address); + console.log(`Alice Substrate Account: ${alice.address}`); + console.log(`Alice Substrate Account (nonce: ${nonce}) balance, free: ${balance.free.toHex()}`); + + const aliceEvmAccount = `0x${crypto.blake2AsHex(crypto.decodeAddress(alice.address), 256).substring(26)}`; + + console.log(`Alice EVM Account: ${aliceEvmAccount}`); + const evmData = (await api.query.evm.accounts(aliceEvmAccount)) as any; + console.log(`Alice EVM Account (nonce: ${evmData.nonce}) balance: ${evmData.balance.toHex()}`); + + return { api, alice, bob }; } // Create the ERC20 contract from ALICE async function step1(api: ApiPromise, alice: KeyringPair) { - console.log(`\nStep 1: Creating Smart Contract`); - - // params: [bytecode, initialBalance, gasLimit, gasPrice], - // tx: api.tx.evm.create - - const transaction = await api.tx.evm.create(ERC20_BYTECODES, 0, 4294967295, 1, null); - - const contract = new Promise<{ block: string, address: string }>(async (resolve, reject) => { - const unsub = await transaction.signAndSend(alice, (result) => { - console.log(`Contract creation is ${result.status}`); - if (result.status.isInBlock) { - console.log(`Contract included at blockHash ${result.status.asInBlock}`); - console.log(`Waiting for finalization... (can take a minute)`); - } else if (result.status.isFinalized) { - const contractAddress = ( - result.events?.find( - event => event?.event?.index.toHex() == "0x0500" - )?.event.data[0] as any - ).address as string; - console.log(`Contract finalized at blockHash ${result.status.asFinalized}`); - console.log(`Contract address: ${contractAddress}`); - unsub(); - resolve({ - block: result.status.asFinalized.toString(), - address: contractAddress - }); - } - }); - }); - return contract; + console.log(`\nStep 1: Creating Smart Contract`); + + // params: [bytecode, initialBalance, gasLimit, gasPrice], + // tx: api.tx.evm.create + + const transaction = await api.tx.evm.create(ERC20_BYTECODES, 0, 4294967295, 1, null); + + const contract = new Promise<{ block: string, address: string }>(async (resolve, reject) => { + const unsub = await transaction.signAndSend(alice, (result) => { + console.log(`Contract creation is ${result.status}`); + if (result.status.isInBlock) { + console.log(`Contract included at blockHash ${result.status.asInBlock}`); + console.log(`Waiting for finalization... (can take a minute)`); + } else if (result.status.isFinalized) { + const contractAddress = ( + result.events?.find( + event => event?.event?.index.toHex() == "0x0500" + )?.event.data[0] as any + ).address as string; + console.log(`Contract finalized at blockHash ${result.status.asFinalized}`); + console.log(`Contract address: ${contractAddress}`); + unsub(); + resolve({ + block: result.status.asFinalized.toString(), + address: contractAddress + }); + } + }); + }); + return contract; } // Retrieve Alice & Contract Storage async function step2(api: ApiPromise, alice: KeyringPair, contractAddress: string) { - console.log(`\nStep 2: Retrieving Contract from evm address: ${contractAddress}`); + console.log(`\nStep 2: Retrieving Contract from evm address: ${contractAddress}`); - // Retrieve Alice account with new nonce value - const { nonce, data: balance } = await api.query.system.account(alice.address); - console.log(`Alice Substrate Account (nonce: ${nonce}) balance, free: ${balance.free}`); + // Retrieve Alice account with new nonce value + const { nonce, data: balance } = await api.query.system.account(alice.address); + console.log(`Alice Substrate Account (nonce: ${nonce}) balance, free: ${balance.free}`); - const accountCode = (await api.query.evm.accountCodes(contractAddress)).toString(); - console.log(`Contract account code: ${accountCode.substring(0, 16)}...${accountCode.substring(accountCode.length - 16)}`); + const accountCode = (await api.query.evm.accountCodes(contractAddress)).toString(); + console.log(`Contract account code: ${accountCode.substring(0, 16)}...${accountCode.substring(accountCode.length - 16)}`); - // Computing Contract Storage Slot, using slot 0 and alice EVM account - const aliceEvmAccount = `0x${crypto.blake2AsHex(crypto.decodeAddress(alice.address), 256).substring(26)}`; - const slot = "0"; - const mapStorageSlot = slot.padStart(64, '0'); - const mapKey = aliceEvmAccount.toString().substring(2).padStart(64, '0'); + // Computing Contract Storage Slot, using slot 0 and alice EVM account + const aliceEvmAccount = `0x${crypto.blake2AsHex(crypto.decodeAddress(alice.address), 256).substring(26)}`; + const slot = "0"; + const mapStorageSlot = slot.padStart(64, '0'); + const mapKey = aliceEvmAccount.toString().substring(2).padStart(64, '0'); - const storageKey = web3Utils.sha3('0x'.concat(mapKey.concat(mapStorageSlot))); - console.log(`Alice Contract storage key: ${storageKey}`); + const storageKey = web3Utils.sha3('0x'.concat(mapKey.concat(mapStorageSlot))); + console.log(`Alice Contract storage key: ${storageKey}`); - const accountStorage = (await api.query.evm.accountStorages(contractAddress, storageKey)).toString(); - console.log(`Alice Contract account storage: ${accountStorage}`); - return; + const accountStorage = (await api.query.evm.accountStorages(contractAddress, storageKey)).toString(); + console.log(`Alice Contract account storage: ${accountStorage}`); + return; } // Transfer tokens to Bob async function step3(api: ApiPromise, alice: KeyringPair, bob: KeyringPair, contractAddress: string) { - const bobEvmAccount = `0x${crypto.blake2AsHex(crypto.decodeAddress(bob.address), 256).substring(26)}`; - console.log(`\nStep 3: Transfering Tokens to Bob EVM Account: ${bobEvmAccount}`); - - console.log(`Preparing transfer of 0xdd`); - // params: [contractAddress, inputCode, value,m gasLimit, gasPrice], - // tx: api.tx.evm.create - const transferFnCode = `a9059cbb000000000000000000000000`; - const tokensToTransfer = `00000000000000000000000000000000000000000000000000000000000000dd`; - const inputCode = `0x${transferFnCode}${bobEvmAccount.substring(2)}${tokensToTransfer}`; - console.log(`Sending call input: ${inputCode}`); - const transaction = await api.tx.evm.call(contractAddress, inputCode, 0, 4294967295, 1, null); - - const data = new Promise<{ block: string, address: string }>(async (resolve, reject) => { - const unsub = await transaction.signAndSend(alice, (result) => { - console.log(`Transfer is ${result.status}`); - if (result.status.isInBlock) { - console.log(`Transfer included at blockHash ${result.status.asInBlock}`); - console.log(`Waiting for finalization... (can take a minute)`); - } else if (result.status.isFinalized) { - console.log(`Transfer finalized at blockHash ${result.status.asFinalized}`); - unsub(); - resolve(); - } - }); - }); - return data; + const bobEvmAccount = `0x${crypto.blake2AsHex(crypto.decodeAddress(bob.address), 256).substring(26)}`; + console.log(`\nStep 3: Transfering Tokens to Bob EVM Account: ${bobEvmAccount}`); + + console.log(`Preparing transfer of 0xdd`); + // params: [contractAddress, inputCode, value,m gasLimit, gasPrice], + // tx: api.tx.evm.create + const transferFnCode = `a9059cbb000000000000000000000000`; + const tokensToTransfer = `00000000000000000000000000000000000000000000000000000000000000dd`; + const inputCode = `0x${transferFnCode}${bobEvmAccount.substring(2)}${tokensToTransfer}`; + console.log(`Sending call input: ${inputCode}`); + const transaction = await api.tx.evm.call(contractAddress, inputCode, 0, 4294967295, 1, null); + + const data = new Promise<{ block: string, address: string }>(async (resolve, reject) => { + const unsub = await transaction.signAndSend(alice, (result) => { + console.log(`Transfer is ${result.status}`); + if (result.status.isInBlock) { + console.log(`Transfer included at blockHash ${result.status.asInBlock}`); + console.log(`Waiting for finalization... (can take a minute)`); + } else if (result.status.isFinalized) { + console.log(`Transfer finalized at blockHash ${result.status.asFinalized}`); + unsub(); + resolve(); + } + }); + }); + return data; } // Retrieve Bob async function step4(api: ApiPromise, bob: KeyringPair, contractAddress: string) { - console.log(`\nStep 4: Retrieving Bob tokens`); + console.log(`\nStep 4: Retrieving Bob tokens`); - // Retrieve Bob account with new nonce value - const { nonce, data: balance } = await api.query.system.account(bob.address); - console.log(`Bob Substrate Account (nonce: ${nonce}) balance, free: ${balance.free}`); - const bobEvmAccount = `0x${crypto.blake2AsHex(crypto.decodeAddress(bob.address), 256).substring(26)}`; + // Retrieve Bob account with new nonce value + const { nonce, data: balance } = await api.query.system.account(bob.address); + console.log(`Bob Substrate Account (nonce: ${nonce}) balance, free: ${balance.free}`); + const bobEvmAccount = `0x${crypto.blake2AsHex(crypto.decodeAddress(bob.address), 256).substring(26)}`; - console.log(`Bob EVM Account: ${bobEvmAccount}`); - const evmData = (await api.query.evm.accounts(bobEvmAccount)) as any; - console.log(`Bob EVM Account (nonce: ${evmData.nonce}) balance: ${evmData.balance.toHex()}`); + console.log(`Bob EVM Account: ${bobEvmAccount}`); + const evmData = (await api.query.evm.accounts(bobEvmAccount)) as any; + console.log(`Bob EVM Account (nonce: ${evmData.nonce}) balance: ${evmData.balance.toHex()}`); - const slot = "0"; - const mapStorageSlot = slot.padStart(64, '0'); - const mapKey = bobEvmAccount.toString().substring(2).padStart(64, '0'); + const slot = "0"; + const mapStorageSlot = slot.padStart(64, '0'); + const mapKey = bobEvmAccount.toString().substring(2).padStart(64, '0'); - const storageKey = web3Utils.sha3('0x'.concat(mapKey.concat(mapStorageSlot))); - console.log(`Bob Contract storage key: ${storageKey}`); + const storageKey = web3Utils.sha3('0x'.concat(mapKey.concat(mapStorageSlot))); + console.log(`Bob Contract storage key: ${storageKey}`); - const accountStorage = (await api.query.evm.accountStorages(contractAddress, storageKey)).toString(); - console.log(`Bob Contract account storage: ${accountStorage}`); + const accountStorage = (await api.query.evm.accountStorages(contractAddress, storageKey)).toString(); + console.log(`Bob Contract account storage: ${accountStorage}`); - return; + return; } async function main() { - const { api, alice, bob } = await init(); + const { api, alice, bob } = await init(); - // step 1: Creating the contract from ALICE - const contractAccount = await step1(api, alice) + // step 1: Creating the contract from ALICE + const contractAccount = await step1(api, alice) - // step 2: Retrieving Alice and Contract information - await step2(api, alice, contractAccount.address); + // step 2: Retrieving Alice and Contract information + await step2(api, alice, contractAccount.address); - // step 3: Transfering Smart Contract tokens from Alice to Bob - await step3(api, alice, bob, contractAccount.address); + // step 3: Transfering Smart Contract tokens from Alice to Bob + await step3(api, alice, bob, contractAccount.address); - // step 3: Retrieving Bob information - await step4(api, bob, contractAccount.address); + // step 3: Retrieving Bob information + await step4(api, bob, contractAccount.address); } main().catch(console.error).then(() => process.exit(0)); diff --git a/template/examples/contract-erc20/package.json b/template/examples/contract-erc20/package.json index e37d61a5d1..1a142aff95 100644 --- a/template/examples/contract-erc20/package.json +++ b/template/examples/contract-erc20/package.json @@ -1,5 +1,5 @@ { - "name": "frontier-tutorials", + "name": "frontier-template-contract-erc20", "version": "0.0.0", "dependencies": { "@polkadot/api": "^1.16.0-beta.2", diff --git a/template/examples/contract-web3-rpc/tsconfig.json b/template/examples/contract-erc20/tsconfig.json old mode 100755 new mode 100644 similarity index 100% rename from template/examples/contract-web3-rpc/tsconfig.json rename to template/examples/contract-erc20/tsconfig.json diff --git a/template/examples/contract-web3-rpc/.gitignore b/template/examples/contract-web3-rpc/.gitignore deleted file mode 100755 index 34b23da894..0000000000 --- a/template/examples/contract-web3-rpc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build/ -/node_modules/ diff --git a/template/examples/contract-web3-rpc/README.md b/template/examples/contract-web3-rpc/README.md deleted file mode 100755 index 5028e16e19..0000000000 --- a/template/examples/contract-web3-rpc/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# ERC20 contract creation (RPC) - -This directory contains typescript script describing how to use the web3.js SDK to interact with Frontier. - -## Installation and Usage - -Use `npm i` to install dependencies. To create an ERC20 contract, execute `node_modules/.bin/ts-node create-erc20.ts` while your template node is running in `--dev` mode. - -## Expected output - -WIP diff --git a/template/examples/contract-web3-rpc/create-erc20.ts b/template/examples/contract-web3-rpc/create-erc20.ts deleted file mode 100755 index 952d792679..0000000000 --- a/template/examples/contract-web3-rpc/create-erc20.ts +++ /dev/null @@ -1,84 +0,0 @@ -import Web3 from "web3"; -import * as web3Utils from 'web3-utils'; - -const web3 = new Web3("http://localhost:9933"); -const ERC20_BYTECODE = - "0x608060405234801561001057600080fd5b50610041337fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61004660201b60201c565b610291565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156100e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6101028160025461020960201b610c7c1790919060201c565b60028190555061015d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461020960201b610c7c1790919060201c565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080828401905083811015610287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b610e3a806102a06000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a08231146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e1461032157610088565b8063095ea7b31461008d57806318160ddd146100f357806323b872dd146101115780633950935114610197575b600080fd5b6100d9600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610399565b604051808215151515815260200191505060405180910390f35b6100fb6103b7565b6040518082815260200191505060405180910390f35b61017d6004803603606081101561012757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103c1565b604051808215151515815260200191505060405180910390f35b6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061049a565b604051808215151515815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061054d565b6040518082815260200191505060405180910390f35b6102a16004803603604081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610595565b604051808215151515815260200191505060405180910390f35b610307600480360360408110156102d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610662565b604051808215151515815260200191505060405180910390f35b6103836004803603604081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610680565b6040518082815260200191505060405180910390f35b60006103ad6103a6610707565b848461070f565b6001905092915050565b6000600254905090565b60006103ce848484610906565b61048f846103da610707565b61048a85604051806060016040528060288152602001610d7060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610440610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b600190509392505050565b60006105436104a7610707565b8461053e85600160006104b8610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b61070f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106586105a2610707565b8461065385604051806060016040528060258152602001610de160259139600160006105cc610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b6001905092915050565b600061067661066f610707565b8484610906565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610795576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610dbd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561081b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610d286022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610d986025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610d056023913960400191505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c2e578082015181840152602081019050610c13565b50505050905090810190601f168015610c5b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820c7a5ffabf642bda14700b2de42f8c57b36621af020441df825de45fd2b3e1c5c64736f6c63430005100032"; -const STORAGE_SLOT = "0"; - -const createAccount = () => { - const account = web3.eth.accounts.create(); - const mapStorageSlot = STORAGE_SLOT.padStart(64, '0'); - const mapKey = account.address.toString().substring(2).padStart(64, '0'); - const storageKey = web3Utils.sha3('0x'.concat(mapKey.concat(mapStorageSlot))); - return {...account, storageKey}; -} - -const main = async () => { - - console.log("Generating accounts..."); - const alice = createAccount(); - const bob = createAccount(); - - // Step 1: Creating the contract. - console.log(`Alice account: ${alice.address}\n storageKey [slot ${STORAGE_SLOT}]: ${alice.storageKey}`); - console.log(`Bob account: ${bob.address}\n storageKey [slot ${STORAGE_SLOT}]: ${bob.storageKey}`); - - console.log(`\nCreating contract using Eth RPC "sendTransaction" from alice`); - const createTransaction = await alice.signTransaction( - { - data: ERC20_BYTECODE, - value: "0x00", - gasPrice: "0x00", - gas: "0x100000", - }); - console.log("Transaction", { - ...createTransaction, - rawTransaction: `${createTransaction.rawTransaction.substring( - 0, - 32 - )}... (${createTransaction.rawTransaction.length} length)`, - }); - - const createReceipt = await web3.eth.sendSignedTransaction( - createTransaction.rawTransaction - ); - console.log( - `Contract deployed at address ${createReceipt.contractAddress}` - ); - - // Step 2: Sending contract tokens to bob - console.log(`\nSending 221 Contract tokens from alice to bob`); - const transferFnCode = `a9059cbb000000000000000000000000`; - const tokensToTransfer = `00000000000000000000000000000000000000000000000000000000000000dd`; - const inputCode = `0x${transferFnCode}${bob.address.substring( - 2 - )}${tokensToTransfer}`; - - const transferTransaction = await alice.signTransaction( - { - to: createReceipt.contractAddress, - data: inputCode, - value: "0x00", - gasPrice: "0x00", - gas: "0x100000", - }); - console.log("Transaction", { - ...transferTransaction, - rawTransaction: `${transferTransaction.rawTransaction.substring( - 0, - 32 - )}... (${transferTransaction.rawTransaction.length} length)`, - }); - - const transferReceipt = await web3.eth.sendSignedTransaction( - transferTransaction.rawTransaction - ); - console.log( - `Transfer executed to ${transferReceipt.to} (H: ${transferReceipt.transactionHash})` - ); -}; - -main().catch((err) => { - console.log("Error", err); -}); diff --git a/template/examples/contract-web3-rpc/package.json b/template/examples/contract-web3-rpc/package.json deleted file mode 100644 index 15d5395ecd..0000000000 --- a/template/examples/contract-web3-rpc/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "frontier-contract-web3", - "version": "0.0.0", - "dependencies": { - "ts-node": "^8.10.1", - "typescript": "^3.9.3", - "web3": "^1.2.8" - } -} diff --git a/template/runtime/src/lib.rs b/template/runtime/src/lib.rs index 4f96465e01..d34afa9d31 100644 --- a/template/runtime/src/lib.rs +++ b/template/runtime/src/lib.rs @@ -200,7 +200,7 @@ impl frame_system::Trait for Runtime { /// Converts a module to the index of the module in `construct_runtime!`. /// /// This type is being generated by `construct_runtime!`. - type ModuleToIndex = ModuleToIndex; + type PalletInfo = PalletInfo; /// What to do if a new account is created. type OnNewAccount = (); /// What to do if an account is fully reaped from the system. @@ -553,6 +553,18 @@ impl_runtime_apis! { fn current_receipts() -> Option<Vec<frame_ethereum::Receipt>> { Ethereum::current_receipts() } + + fn current_all() -> ( + Option<frame_ethereum::Block>, + Option<Vec<frame_ethereum::Receipt>>, + Option<Vec<TransactionStatus>> + ) { + ( + Ethereum::current_block(), + Ethereum::current_receipts(), + Ethereum::current_transaction_statuses() + ) + } } impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< diff --git a/ts-tests/tests/test-block.ts b/ts-tests/tests/test-block.ts index e92b722f57..aba85a1d2f 100644 --- a/ts-tests/tests/test-block.ts +++ b/ts-tests/tests/test-block.ts @@ -30,7 +30,6 @@ describeWithFrontier("Frontier RPC (Block)", `simple-specs.json`, (context) => { number: 0, //parentHash: "0x2cc74f91423ba20e9bb0b2c7d8924eacd14bc98aa1daad078f8844e529221cde", receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - sha3Uncles: "0x0000000000000000000000000000000000000000000000000000000000000000", size: 533, stateRoot: "0x0000000000000000000000000000000000000000000000000000000000000000", //timestamp: 1595012243836, @@ -61,8 +60,8 @@ describeWithFrontier("Frontier RPC (Block)", `simple-specs.json`, (context) => { step("should have valid timestamp after block production", async function () { const block = await context.web3.eth.getBlock("latest"); - const last5Minutes= (Date.now() / 1000) - 300; - const next5Minutes= (Date.now() / 1000) + 300; + const last5Minutes = (Date.now() / 1000) - 300; + const next5Minutes = (Date.now() / 1000) + 300; expect(block.timestamp).to.be.least(last5Minutes); expect(block.timestamp).to.be.below(next5Minutes); }); @@ -84,7 +83,6 @@ describeWithFrontier("Frontier RPC (Block)", `simple-specs.json`, (context) => { number: 1, //parentHash: "0x04540257811b46d103d9896e7807040e7de5080e285841c5430d1a81588a0ce4", receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - sha3Uncles: "0x0000000000000000000000000000000000000000000000000000000000000000", size: 539, stateRoot: "0x0000000000000000000000000000000000000000000000000000000000000000", //timestamp: 1595012243836,