I'm trying to make my Substrate-based blockchain
compatible with Solidity and MetaMask
. I've cloned Substrate from the polkadot-v0.9.39
branch and am trying to integrate Frontier's Ethereum
compatibility pallets, specifically pallet-ethereum
and pallet-evm
.
My Cargo.toml dependencies look like this:
fp-rpc = { default-features = false, branch="polkadot-v0.9.39", git = "https://github.com/paritytech/frontier.git" }
fp-self-contained = { default-features = false, branch="polkadot-v0.9.39", git = "https://github.com/paritytech/frontier.git" }
pallet-dynamic-fee = { default-features = false, branch="polkadot-v0.9.39", git = "https://github.com/paritytech/frontier.git" }
pallet-ethereum = { default-features = false, branch="polkadot-v0.9.39", git = "https://github.com/paritytech/frontier.git" }
pallet-evm = { default-features = false, branch="polkadot-v0.9.39", git = "https://github.com/paritytech/frontier.git" }
pallet-evm-precompile-modexp = { default-features = false, branch="polkadot-v0.9.39", git = "https://github.com/paritytech/frontier.git" }
pallet-evm-precompile-sha3fips = { default-features = false, branch="polkadot-v0.9.39", git = "https://github.com/paritytech/frontier.git" }
pallet-evm-precompile-simple = { default-features = false, branch="polkadot-v0.9.39", git = "https://github.com/paritytech/frontier.git" }
pallet-base-fee = { default-features = false, branch="polkadot-v0.9.39", git = "https://github.com/paritytech/frontier.git" }
However, when I add the following code:
use pallet_ethereum::{Call::transact, Transaction as EthereumTransaction};
use pallet_evm::{Account as EVMAccount, EnsureAddressTruncated, HashedAddressMapping, Runner};
I get this error:
error[E0152]: duplicate lang item in crate `sp_io` (which `frame_support` depends on): `panic_impl`.
|
= note: the lang item is first defined in crate `sp_io` (which `kitchensink_runtime` depends on)
= note: first definition in `sp_io` loaded from /home/kianoush/projects/hearvers/target/debug/wbuild/kitchensink-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-b8b7b73b41341229.rmeta
= note: second definition in `sp_io` loaded from /home/kianoush/projects/hearvers/target/debug/wbuild/kitchensink-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-e1bd7f9d1961d62b.rmeta
For more information about this error, try `rustc --explain E0152`.
warning: `kitchensink-runtime` (lib) generated 3 warnings
error: could not compile `kitchensink-runtime` due to previous error; 3 warnings emitted
warning: build failed, waiting for other jobs to finish...
How can I resolve this sp_io conflict
? I'm finding it difficult to align the sp_io
versions used by kitchensink-runtime
and frame_support
. Any suggestions or insights would be greatly appreciated.