Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 1d5cae9

Browse files
authored
Substrate EVM (#3927)
* srml-evm: init the basic structures * srml-evm: finish executor implementation * srml-evm: implement balance deposit and withdraw * srml-evm: implement the actuall call/create * srml-evm: use crates.io version of evm * srml-evm: fix no-std compile * Remove dependency patch * Update to evm 0.14 * Use double map for account storage * Add precompiles support * Add some basic docs * Use runtime_io::chain_id() * Update srml/evm/src/lib.rs Co-Authored-By: Xiliang Chen <xlchen1291@gmail.com> * Update srml/evm/src/lib.rs Co-Authored-By: Xiliang Chen <xlchen1291@gmail.com> * Fix WithdrawReason * Unique saturate balance to u128 * Unique saturate withdraw to u128 * Remove extern crate alloc * Move account code to a separate storage and use ref for convert_account_id * More match cause for error message * Fix potential interger overflow * Use decode_len for fetching code length
1 parent a218568 commit 1d5cae9

File tree

7 files changed

+601
-30
lines changed

7 files changed

+601
-30
lines changed

Cargo.lock

+89-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ members = [
9393
"srml/transaction-payment",
9494
"srml/transaction-payment/rpc",
9595
"srml/utility",
96+
"srml/evm",
9697
"node/cli",
9798
"node/executor",
9899
"node/primitives",

core/externalities/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
66
edition = "2018"
77

88
[dependencies]
9-
primitive-types = { version = "0.5.1", features = ["codec"] }
9+
primitive-types = { version = "0.6", features = ["codec"] }
1010
primitives-storage = { package = "substrate-primitives-storage", path = "../primitives/storage" }
1111
rstd = { package = "sr-std", path = "../sr-std" }
1212
environmental = { version = "1.0.2" }

core/primitives/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ log = { version = "0.4.8", default-features = false }
1212
serde = { version = "1.0.101", optional = true, features = ["derive"] }
1313
twox-hash = { version = "1.5.0", optional = true }
1414
byteorder = { version = "1.3.2", default-features = false }
15-
primitive-types = { version = "0.5.1", default-features = false, features = ["codec"] }
15+
primitive-types = { version = "0.6", default-features = false, features = ["codec"] }
1616
impl-serde = { version = "0.2.3", optional = true }
1717
wasmi = { version = "0.5.1", optional = true }
1818
hash-db = { version = "0.15.2", default-features = false }

srml/evm/Cargo.toml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[package]
2+
name = "srml-evm"
3+
version = "2.0.0"
4+
authors = ["Parity Technologies <admin@parity.io>"]
5+
edition = "2018"
6+
7+
[dependencies]
8+
serde = { version = "1.0.101", optional = true, features = ["derive"] }
9+
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
10+
support = { package = "srml-support", path = "../support", default-features = false }
11+
system = { package = "srml-system", path = "../system", default-features = false }
12+
timestamp = { package = "srml-timestamp", path = "../timestamp", default-features = false }
13+
balances = { package = "srml-balances", path = "../balances", default-features = false }
14+
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
15+
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
16+
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
17+
runtime-io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
18+
primitive-types = { version = "0.6", default-features = false, features = ["rlp"] }
19+
rlp = { version = "0.4", default-features = false }
20+
evm = { version = "0.14", default-features = false }
21+
sha3 = { version = "0.8", default-features = false }
22+
23+
[features]
24+
default = ["std"]
25+
std = [
26+
"serde",
27+
"codec/std",
28+
"primitives/std",
29+
"sr-primitives/std",
30+
"support/std",
31+
"system/std",
32+
"balances/std",
33+
"runtime-io/std",
34+
"rstd/std",
35+
"sha3/std",
36+
"rlp/std",
37+
"primitive-types/std",
38+
"evm/std",
39+
"timestamp/std",
40+
]

0 commit comments

Comments
 (0)