--- a/Cargo.lock +++ b/Cargo.lock @@ -827,7 +827,7 @@ "ansi_term 0.11.0", "atty", "bitflags", - "strsim", + "strsim 0.8.0", "textwrap", "unicode-width", "vec_map", @@ -1183,6 +1183,41 @@ ] [[package]] +name = "darling" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] name = "data-encoding" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1528,6 +1563,30 @@ ] [[package]] +name = "evm-coder" +version = "0.1.0" +dependencies = [ + "ethereum", + "evm-coder-macros", + "hex", + "hex-literal", + "primitive-types 0.9.0", +] + +[[package]] +name = "evm-coder-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "hex", + "proc-macro2", + "quote", + "sha3 0.9.1", + "syn", +] + +[[package]] name = "evm-core" version = "0.26.0" source = "git+https://github.com/usetech-llc/evm.git?branch=precompile-output#e667bc507590bc67024e5d12c65241d4aef2a1b9" @@ -2678,6 +2737,12 @@ ] [[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] name = "idna" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4527,6 +4592,7 @@ dependencies = [ "ethereum", "ethereum-tx-sign", + "evm-coder", "fp-evm", "frame-benchmarking", "frame-support", @@ -4540,6 +4606,7 @@ "pallet-timestamp", "pallet-transaction-payment", "parity-scale-codec 2.1.1", + "primitive-types 0.9.0", "rlp 0.5.0", "serde", "sp-api", @@ -7782,6 +7849,12 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] name = "structopt" version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,8 @@ 'node', 'pallets/nft', 'runtime', + 'crates/evm-coder', + 'crates/evm-coder-macros', ] [profile.release] panic = 'unwind' --- a/pallets/nft/Cargo.toml +++ b/pallets/nft/Cargo.toml @@ -41,6 +41,9 @@ ethereum = { default-features = false, version = "0.7.1" } rlp = { default-features = false, version = "0.5.0" } +evm-coder = { default-features = false, path = "../../crates/evm-coder" } +primitive-types = { version = "0.9.0", default-features = false } + hex-literal = "0.3.1" [features] @@ -64,5 +67,7 @@ 'rlp/std', 'ethereum-tx-sign', + 'primitive-types/std', + 'evm-coder/std', ] runtime-benchmarks = ["frame-benchmarking"]