difftreelog
feat evm migration pallet
in: master
5 files changed
pallets/evm-migration/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/pallets/evm-migration/Cargo.toml
@@ -0,0 +1,36 @@
+[package]
+name = "pallet-evm-migration"
+version = "0.1.0"
+edition = "2018"
+
+[dependencies]
+frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+frame-benchmarking = { default-features = false, version = '3.0.0', optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+sp-runtime = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+sp-io = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+sp-core = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+pallet-evm = { default-features = false, version = "5.0.0-dev", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }
+fp-evm = { default-features = false, version = "2.0.0", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }
+
+[dependencies.codec]
+default-features = false
+features = ['derive']
+package = 'parity-scale-codec'
+version = '2.0.0'
+
+[features]
+default = ["std", "runtime-benchmarks"]
+std = [
+ "frame-support/std",
+ "frame-system/std",
+ "frame-benchmarking/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "sp-io/std",
+ "sp-core/std",
+ "pallet-evm/std",
+ "fp-evm/std",
+]
+runtime-benchmarks = ["frame-benchmarking"]
pallets/evm-migration/src/benchmarking.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/evm-migration/src/benchmarking.rs
@@ -0,0 +1,30 @@
+use super::{Call, Config, Pallet};
+use frame_benchmarking::benchmarks;
+use frame_system::RawOrigin;
+use sp_core::{H160, H256};
+use sp_std::vec::Vec;
+
+benchmarks! {
+ begin {
+ }: _(RawOrigin::Root, H160::default())
+
+ set_data {
+ let b in 0..80;
+ let address = H160::from_low_u64_be(b as u64);
+ let mut data = Vec::new();
+ for i in 0..b {
+ data.push((
+ H256::from_low_u64_be(i as u64),
+ H256::from_low_u64_be(i as u64),
+ ));
+ }
+ <Pallet<T>>::begin(RawOrigin::Root.into(), address)?;
+ }: _(RawOrigin::Root, address, data)
+
+ finish {
+ let b in 0..80;
+ let address = H160::from_low_u64_be(b as u64);
+ let data: Vec<u8> = (0..b as u8).collect();
+ <Pallet<T>>::begin(RawOrigin::Root.into(), address)?;
+ }: _(RawOrigin::Root, address, data)
+}
pallets/evm-migration/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/evm-migration/src/lib.rs
@@ -0,0 +1,111 @@
+#![cfg_attr(not(feature = "std"), no_std)]
+
+pub use pallet::*;
+#[cfg(feature = "runtime-benchmarks")]
+pub mod benchmarking;
+pub mod weights;
+
+#[frame_support::pallet]
+pub mod pallet {
+ use frame_support::{pallet_prelude::*, transactional};
+ use frame_system::pallet_prelude::*;
+ use sp_core::{H160, H256};
+ use sp_std::vec::Vec;
+ use super::weights::WeightInfo;
+
+ #[pallet::config]
+ pub trait Config: frame_system::Config + pallet_evm::Config {
+ type WeightInfo: WeightInfo;
+ }
+
+ type SelfWeightOf<T> = <T as Config>::WeightInfo;
+
+ #[pallet::pallet]
+ #[pallet::generate_store(pub(super) trait Store)]
+ pub struct Pallet<T>(_);
+
+ #[pallet::error]
+ pub enum Error<T> {
+ AccountNotEmpty,
+ AccountIsNotMigrating,
+ }
+
+ #[pallet::storage]
+ pub(super) type MigrationPending<T: Config> =
+ StorageMap<Hasher = Twox64Concat, Key = H160, Value = bool, QueryKind = ValueQuery>;
+
+ #[pallet::call]
+ impl<T: Config> Pallet<T> {
+ #[pallet::weight(<SelfWeightOf<T>>::begin())]
+ pub fn begin(origin: OriginFor<T>, address: H160) -> DispatchResult {
+ ensure_root(origin)?;
+ ensure!(
+ <pallet_evm::Pallet<T>>::is_account_empty(&address)
+ && !<MigrationPending<T>>::get(&address),
+ <Error<T>>::AccountNotEmpty,
+ );
+
+ <MigrationPending<T>>::insert(address, true);
+ Ok(())
+ }
+
+ #[pallet::weight(<SelfWeightOf<T>>::set_data(data.len() as u32))]
+ pub fn set_data(
+ origin: OriginFor<T>,
+ address: H160,
+ data: Vec<(H256, H256)>,
+ ) -> DispatchResult {
+ use frame_support::StorageDoubleMap;
+ ensure_root(origin)?;
+ ensure!(
+ <MigrationPending<T>>::get(&address),
+ <Error<T>>::AccountIsNotMigrating,
+ );
+
+ for (k, v) in data {
+ pallet_evm::AccountStorages::insert(&address, k, v);
+ }
+ Ok(())
+ }
+
+ #[pallet::weight(<SelfWeightOf<T>>::finish(code.len() as u32))]
+ #[transactional]
+ pub fn finish(origin: OriginFor<T>, address: H160, code: Vec<u8>) -> DispatchResult {
+ use frame_support::StorageMap;
+ ensure_root(origin)?;
+ ensure!(
+ <MigrationPending<T>>::get(&address),
+ <Error<T>>::AccountIsNotMigrating,
+ );
+
+ pallet_evm::AccountCodes::insert(&address, code);
+ <MigrationPending<T>>::remove(address);
+ Ok(())
+ }
+ }
+
+ pub struct OnMethodCall<T>(PhantomData<T>);
+ impl<T: Config> pallet_evm::OnMethodCall<T> for OnMethodCall<T> {
+ fn is_reserved(contract: &H160) -> bool {
+ <MigrationPending<T>>::get(&contract)
+ }
+
+ fn is_used(_contract: &H160) -> bool {
+ false
+ }
+
+ fn call(
+ _source: &H160,
+ _arget: &H160,
+ _gas_left: u64,
+ _input: &[u8],
+ _value: sp_core::U256,
+ ) -> Option<pallet_evm::PrecompileOutput> {
+ None
+ }
+
+ fn get_code(_contract: &H160) -> Option<Vec<u8>> {
+ None
+ }
+ }
+}
runtime/Cargo.tomldiffbeforeafterboth1################################################################################2# Package 34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Substrate node nft'8edition = '2018'9homepage = 'https://unique.network'10license = 'All Rights Reserved'11name = 'nft-runtime'12repository = 'https://github.com/usetech-llc/nft_private/'13version = '3.0.0'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-balances/runtime-benchmarks',27 'pallet-timestamp/runtime-benchmarks',28 'pallet-nft/runtime-benchmarks',29 'pallet-inflation/runtime-benchmarks',30 'sp-runtime/runtime-benchmarks',31]32std = [33 'codec/std',34 'max-encoded-len/std',35 'cumulus-pallet-aura-ext/std',36 'cumulus-pallet-parachain-system/std',37 'cumulus-pallet-xcm/std',38 'cumulus-pallet-xcmp-queue/std',39 'cumulus-primitives-core/std',40 'cumulus-primitives-utility/std',41 'frame-executive/std',42 'frame-support/std',43 'frame-system/std',44 'frame-system-rpc-runtime-api/std',45 'pallet-aura/std',46 'pallet-balances/std',47 # 'pallet-contracts/std',48 # 'pallet-contracts-primitives/std',49 # 'pallet-contracts-rpc-runtime-api/std',50 # 'pallet-contract-helpers/std',51 'pallet-randomness-collective-flip/std',52 'pallet-sudo/std',53 'pallet-timestamp/std',54 'pallet-transaction-payment/std',55 'pallet-transaction-payment-rpc-runtime-api/std',56 'pallet-treasury/std',57 'pallet-vesting/std',58 'pallet-evm/std',59 'pallet-evm-contract-helpers/std',60 'pallet-evm-transaction-payment/std',61 'pallet-evm-coder-substrate/std',62 'pallet-ethereum/std',63 'fp-rpc/std',64 'parachain-info/std',65 'serde',66 'pallet-inflation/std',67 'pallet-nft/std',68 'pallet-scheduler/std',69 'pallet-nft-charge-transaction/std',70 'pallet-nft-transaction-payment/std',71 'nft-data-structs/std',72 'sp-api/std',73 'sp-block-builder/std',74 "sp-consensus-aura/std",75 'sp-core/std',76 'sp-inherents/std',77 'sp-io/std',78 'sp-offchain/std',79 'sp-runtime/std',80 'sp-session/std',81 'sp-std/std',82 'sp-transaction-pool/std',83 'sp-version/std',84 'xcm/std',85 'xcm-builder/std',86 'xcm-executor/std',87]88limit-testing = [89 'pallet-nft/limit-testing',90 'nft-data-structs/limit-testing',91]9293################################################################################94# Substrate Dependencies9596[dependencies.codec]97default-features = false98features = ['derive']99package = 'parity-scale-codec'100version = '2.0.0'101102[dependencies.frame-benchmarking]103default-features = false104git = 'https://github.com/paritytech/substrate.git'105optional = true106branch = 'polkadot-v0.9.8'107version = '3.0.0'108109[dependencies.frame-executive]110default-features = false111git = 'https://github.com/paritytech/substrate.git'112branch = 'polkadot-v0.9.8'113version = '3.0.0'114115[dependencies.frame-support]116default-features = false117git = 'https://github.com/paritytech/substrate.git'118branch = 'polkadot-v0.9.8'119version = '3.0.0'120121[dependencies.frame-system]122default-features = false123git = 'https://github.com/paritytech/substrate.git'124branch = 'polkadot-v0.9.8'125version = '3.0.0'126127[dependencies.frame-system-benchmarking]128default-features = false129git = 'https://github.com/paritytech/substrate.git'130optional = true131branch = 'polkadot-v0.9.8'132version = '3.0.0'133134[dependencies.frame-system-rpc-runtime-api]135default-features = false136git = 'https://github.com/paritytech/substrate.git'137branch = 'polkadot-v0.9.8'138version = '3.0.0'139140[dependencies.hex-literal]141optional = true142version = '0.3.1'143144[dependencies.serde]145default-features = false146features = ['derive']147optional = true148version = '1.0.119'149150[dependencies.pallet-aura]151default-features = false152git = 'https://github.com/paritytech/substrate.git'153branch = 'polkadot-v0.9.8'154version = '3.0.0'155156[dependencies.pallet-balances]157default-features = false158git = 'https://github.com/paritytech/substrate.git'159branch = 'polkadot-v0.9.8'160version = '3.0.0'161162# Contracts specific packages163# [dependencies.pallet-contracts]164# git = 'https://github.com/paritytech/substrate.git'165# default-features = false166# branch = 'polkadot-v0.9.8'167# version = '3.0.0'168169# [dependencies.pallet-contracts-primitives]170# git = 'https://github.com/paritytech/substrate.git'171# default-features = false172# branch = 'polkadot-v0.9.8'173# version = '3.0.0'174175# [dependencies.pallet-contracts-rpc-runtime-api]176# git = 'https://github.com/paritytech/substrate.git'177# default-features = false178# branch = 'polkadot-v0.9.8'179# version = '3.0.0'180181[dependencies.pallet-randomness-collective-flip]182default-features = false183git = 'https://github.com/paritytech/substrate.git'184branch = 'polkadot-v0.9.8'185version = '3.0.0'186187[dependencies.pallet-sudo]188default-features = false189git = 'https://github.com/paritytech/substrate.git'190branch = 'polkadot-v0.9.8'191version = '3.0.0'192193[dependencies.pallet-timestamp]194default-features = false195git = 'https://github.com/paritytech/substrate.git'196branch = 'polkadot-v0.9.8'197version = '3.0.0'198199[dependencies.pallet-transaction-payment]200default-features = false201git = 'https://github.com/paritytech/substrate.git'202branch = 'polkadot-v0.9.8'203version = '3.0.0'204205[dependencies.pallet-transaction-payment-rpc-runtime-api]206default-features = false207git = 'https://github.com/paritytech/substrate.git'208branch = 'polkadot-v0.9.8'209version = '3.0.0'210211[dependencies.pallet-treasury]212default-features = false213git = 'https://github.com/paritytech/substrate.git'214branch = 'polkadot-v0.9.8'215version = '3.0.0'216217[dependencies.pallet-vesting]218default-features = false219git = 'https://github.com/paritytech/substrate.git'220branch = 'polkadot-v0.9.8'221version = '3.0.0'222223[dependencies.sp-arithmetic]224default-features = false225git = 'https://github.com/paritytech/substrate.git'226branch = 'polkadot-v0.9.8'227version = '3.0.0'228229[dependencies.sp-api]230default-features = false231git = 'https://github.com/paritytech/substrate.git'232branch = 'polkadot-v0.9.8'233version = '3.0.0'234235[dependencies.sp-block-builder]236default-features = false237git = 'https://github.com/paritytech/substrate.git'238branch = 'polkadot-v0.9.8'239version = '3.0.0'240241[dependencies.sp-core]242default-features = false243git = 'https://github.com/paritytech/substrate.git'244branch = 'polkadot-v0.9.8'245version = '3.0.0'246247[dependencies.sp-consensus-aura]248default-features = false249git = 'https://github.com/paritytech/substrate.git'250branch = 'polkadot-v0.9.8'251version = '0.9.0'252253[dependencies.sp-inherents]254default-features = false255git = 'https://github.com/paritytech/substrate.git'256branch = 'polkadot-v0.9.8'257version = '3.0.0'258259[dependencies.sp-io]260default-features = false261git = 'https://github.com/paritytech/substrate.git'262branch = 'polkadot-v0.9.8'263version = '3.0.0'264265[dependencies.sp-offchain]266default-features = false267git = 'https://github.com/paritytech/substrate.git'268branch = 'polkadot-v0.9.8'269version = '3.0.0'270271[dependencies.sp-runtime]272default-features = false273git = 'https://github.com/paritytech/substrate.git'274branch = 'polkadot-v0.9.8'275version = '3.0.0'276277[dependencies.sp-session]278default-features = false279git = 'https://github.com/paritytech/substrate.git'280branch = 'polkadot-v0.9.8'281version = '3.0.0'282283[dependencies.sp-std]284default-features = false285git = 'https://github.com/paritytech/substrate.git'286branch = 'polkadot-v0.9.8'287version = '3.0.0'288289[dependencies.sp-transaction-pool]290default-features = false291git = 'https://github.com/paritytech/substrate.git'292branch = 'polkadot-v0.9.8'293version = '3.0.0'294295[dependencies.sp-version]296default-features = false297git = 'https://github.com/paritytech/substrate.git'298branch = 'polkadot-v0.9.8'299version = '3.0.0'300301[dependencies.smallvec]302version = '1.4.1'303304################################################################################305# Cumulus dependencies306307[dependencies.parachain-info]308default-features = false309git = 'https://github.com/paritytech/cumulus.git'310branch = 'polkadot-v0.9.8'311version = '0.1.0'312313[dependencies.cumulus-pallet-aura-ext]314git = 'https://github.com/paritytech/cumulus.git'315branch = 'polkadot-v0.9.8'316default-features = false317318[dependencies.cumulus-pallet-parachain-system]319git = 'https://github.com/paritytech/cumulus.git'320branch = 'polkadot-v0.9.8'321default-features = false322323[dependencies.cumulus-primitives-core]324git = 'https://github.com/paritytech/cumulus.git'325branch = 'polkadot-v0.9.8'326default-features = false327328[dependencies.cumulus-pallet-xcm]329git = 'https://github.com/paritytech/cumulus.git'330branch = 'polkadot-v0.9.8'331default-features = false332333[dependencies.cumulus-pallet-dmp-queue]334git = 'https://github.com/paritytech/cumulus.git'335branch = 'polkadot-v0.9.8'336default-features = false337338[dependencies.cumulus-pallet-xcmp-queue]339git = 'https://github.com/paritytech/cumulus.git'340branch = 'polkadot-v0.9.8'341default-features = false342343[dependencies.cumulus-primitives-utility]344git = 'https://github.com/paritytech/cumulus.git'345branch = 'polkadot-v0.9.8'346default-features = false347348[dependencies.cumulus-primitives-timestamp]349git = 'https://github.com/paritytech/cumulus.git'350branch = 'polkadot-v0.9.8'351default-features = false352353################################################################################354# Polkadot dependencies355356[dependencies.polkadot-parachain]357git = 'https://github.com/paritytech/polkadot'358branch = 'release-v0.9.8'359default-features = false360361[dependencies.xcm]362git = 'https://github.com/paritytech/polkadot'363branch = 'release-v0.9.8'364default-features = false365366[dependencies.xcm-builder]367git = 'https://github.com/paritytech/polkadot'368branch = 'release-v0.9.8'369default-features = false370371[dependencies.xcm-executor]372git = 'https://github.com/paritytech/polkadot'373branch = 'release-v0.9.8'374default-features = false375376[dependencies.pallet-xcm]377git = 'https://github.com/paritytech/polkadot'378branch = 'release-v0.9.8'379default-features = false380381382################################################################################383# local dependencies384385[dependencies]386max-encoded-len = { default-features = false, features = ['derive'], version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }387derivative = "2.2.0"388pallet-nft = { path = '../pallets/nft', default-features = false, version = '3.0.0' }389pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }390nft-data-structs = { path = '../primitives/nft', default-features = false, version = '0.9.0' }391pallet-scheduler = { path = '../pallets/scheduler', default-features = false, version = '3.0.0' }392# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }393pallet-nft-transaction-payment = { path = '../pallets/nft-transaction-payment', default-features = false, version = '3.0.0' }394pallet-nft-charge-transaction = { path = '../pallets/nft-charge-transaction', default-features = false, version = '3.0.0' }395pallet-evm-contract-helpers = { path = '../pallets/evm-contract-helpers', default-features = false }396pallet-evm-transaction-payment = { path = '../pallets/evm-transaction-payment', default-features = false }397pallet-evm-coder-substrate = { default-features = false, path = "../pallets/evm-coder-substrate" }398399pallet-evm = { default-features = false, version = "5.0.0-dev", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }400pallet-ethereum = { default-features = false, version = "3.0.0-dev", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }401fp-rpc = { default-features = false, version = "2.0.0", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }402403################################################################################404# Build Dependencies405406[build-dependencies]407substrate-wasm-builder = '4.0.0'1################################################################################2# Package 34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Substrate node nft'8edition = '2018'9homepage = 'https://unique.network'10license = 'All Rights Reserved'11name = 'nft-runtime'12repository = 'https://github.com/usetech-llc/nft_private/'13version = '3.0.0'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-evm-migration/runtime-benchmarks',27 'pallet-balances/runtime-benchmarks',28 'pallet-timestamp/runtime-benchmarks',29 'pallet-nft/runtime-benchmarks',30 'pallet-inflation/runtime-benchmarks',31 'sp-runtime/runtime-benchmarks',32]33std = [34 'codec/std',35 'max-encoded-len/std',36 'cumulus-pallet-aura-ext/std',37 'cumulus-pallet-parachain-system/std',38 'cumulus-pallet-xcm/std',39 'cumulus-pallet-xcmp-queue/std',40 'cumulus-primitives-core/std',41 'cumulus-primitives-utility/std',42 'frame-executive/std',43 'frame-support/std',44 'frame-system/std',45 'frame-system-rpc-runtime-api/std',46 'pallet-aura/std',47 'pallet-balances/std',48 # 'pallet-contracts/std',49 # 'pallet-contracts-primitives/std',50 # 'pallet-contracts-rpc-runtime-api/std',51 # 'pallet-contract-helpers/std',52 'pallet-randomness-collective-flip/std',53 'pallet-sudo/std',54 'pallet-timestamp/std',55 'pallet-transaction-payment/std',56 'pallet-transaction-payment-rpc-runtime-api/std',57 'pallet-treasury/std',58 'pallet-vesting/std',59 'pallet-evm/std',60 'pallet-evm-migration/std',61 'pallet-evm-contract-helpers/std',62 'pallet-evm-transaction-payment/std',63 'pallet-evm-coder-substrate/std',64 'pallet-ethereum/std',65 'fp-rpc/std',66 'parachain-info/std',67 'serde',68 'pallet-inflation/std',69 'pallet-nft/std',70 'pallet-scheduler/std',71 'pallet-nft-charge-transaction/std',72 'pallet-nft-transaction-payment/std',73 'nft-data-structs/std',74 'sp-api/std',75 'sp-block-builder/std',76 "sp-consensus-aura/std",77 'sp-core/std',78 'sp-inherents/std',79 'sp-io/std',80 'sp-offchain/std',81 'sp-runtime/std',82 'sp-session/std',83 'sp-std/std',84 'sp-transaction-pool/std',85 'sp-version/std',86 'xcm/std',87 'xcm-builder/std',88 'xcm-executor/std',89]90limit-testing = [91 'pallet-nft/limit-testing',92 'nft-data-structs/limit-testing',93]9495################################################################################96# Substrate Dependencies9798[dependencies.codec]99default-features = false100features = ['derive']101package = 'parity-scale-codec'102version = '2.0.0'103104[dependencies.frame-benchmarking]105default-features = false106git = 'https://github.com/paritytech/substrate.git'107optional = true108branch = 'polkadot-v0.9.8'109version = '3.0.0'110111[dependencies.frame-executive]112default-features = false113git = 'https://github.com/paritytech/substrate.git'114branch = 'polkadot-v0.9.8'115version = '3.0.0'116117[dependencies.frame-support]118default-features = false119git = 'https://github.com/paritytech/substrate.git'120branch = 'polkadot-v0.9.8'121version = '3.0.0'122123[dependencies.frame-system]124default-features = false125git = 'https://github.com/paritytech/substrate.git'126branch = 'polkadot-v0.9.8'127version = '3.0.0'128129[dependencies.frame-system-benchmarking]130default-features = false131git = 'https://github.com/paritytech/substrate.git'132optional = true133branch = 'polkadot-v0.9.8'134version = '3.0.0'135136[dependencies.frame-system-rpc-runtime-api]137default-features = false138git = 'https://github.com/paritytech/substrate.git'139branch = 'polkadot-v0.9.8'140version = '3.0.0'141142[dependencies.hex-literal]143optional = true144version = '0.3.1'145146[dependencies.serde]147default-features = false148features = ['derive']149optional = true150version = '1.0.119'151152[dependencies.pallet-aura]153default-features = false154git = 'https://github.com/paritytech/substrate.git'155branch = 'polkadot-v0.9.8'156version = '3.0.0'157158[dependencies.pallet-balances]159default-features = false160git = 'https://github.com/paritytech/substrate.git'161branch = 'polkadot-v0.9.8'162version = '3.0.0'163164# Contracts specific packages165# [dependencies.pallet-contracts]166# git = 'https://github.com/paritytech/substrate.git'167# default-features = false168# branch = 'polkadot-v0.9.8'169# version = '3.0.0'170171# [dependencies.pallet-contracts-primitives]172# git = 'https://github.com/paritytech/substrate.git'173# default-features = false174# branch = 'polkadot-v0.9.8'175# version = '3.0.0'176177# [dependencies.pallet-contracts-rpc-runtime-api]178# git = 'https://github.com/paritytech/substrate.git'179# default-features = false180# branch = 'polkadot-v0.9.8'181# version = '3.0.0'182183[dependencies.pallet-randomness-collective-flip]184default-features = false185git = 'https://github.com/paritytech/substrate.git'186branch = 'polkadot-v0.9.8'187version = '3.0.0'188189[dependencies.pallet-sudo]190default-features = false191git = 'https://github.com/paritytech/substrate.git'192branch = 'polkadot-v0.9.8'193version = '3.0.0'194195[dependencies.pallet-timestamp]196default-features = false197git = 'https://github.com/paritytech/substrate.git'198branch = 'polkadot-v0.9.8'199version = '3.0.0'200201[dependencies.pallet-transaction-payment]202default-features = false203git = 'https://github.com/paritytech/substrate.git'204branch = 'polkadot-v0.9.8'205version = '3.0.0'206207[dependencies.pallet-transaction-payment-rpc-runtime-api]208default-features = false209git = 'https://github.com/paritytech/substrate.git'210branch = 'polkadot-v0.9.8'211version = '3.0.0'212213[dependencies.pallet-treasury]214default-features = false215git = 'https://github.com/paritytech/substrate.git'216branch = 'polkadot-v0.9.8'217version = '3.0.0'218219[dependencies.pallet-vesting]220default-features = false221git = 'https://github.com/paritytech/substrate.git'222branch = 'polkadot-v0.9.8'223version = '3.0.0'224225[dependencies.sp-arithmetic]226default-features = false227git = 'https://github.com/paritytech/substrate.git'228branch = 'polkadot-v0.9.8'229version = '3.0.0'230231[dependencies.sp-api]232default-features = false233git = 'https://github.com/paritytech/substrate.git'234branch = 'polkadot-v0.9.8'235version = '3.0.0'236237[dependencies.sp-block-builder]238default-features = false239git = 'https://github.com/paritytech/substrate.git'240branch = 'polkadot-v0.9.8'241version = '3.0.0'242243[dependencies.sp-core]244default-features = false245git = 'https://github.com/paritytech/substrate.git'246branch = 'polkadot-v0.9.8'247version = '3.0.0'248249[dependencies.sp-consensus-aura]250default-features = false251git = 'https://github.com/paritytech/substrate.git'252branch = 'polkadot-v0.9.8'253version = '0.9.0'254255[dependencies.sp-inherents]256default-features = false257git = 'https://github.com/paritytech/substrate.git'258branch = 'polkadot-v0.9.8'259version = '3.0.0'260261[dependencies.sp-io]262default-features = false263git = 'https://github.com/paritytech/substrate.git'264branch = 'polkadot-v0.9.8'265version = '3.0.0'266267[dependencies.sp-offchain]268default-features = false269git = 'https://github.com/paritytech/substrate.git'270branch = 'polkadot-v0.9.8'271version = '3.0.0'272273[dependencies.sp-runtime]274default-features = false275git = 'https://github.com/paritytech/substrate.git'276branch = 'polkadot-v0.9.8'277version = '3.0.0'278279[dependencies.sp-session]280default-features = false281git = 'https://github.com/paritytech/substrate.git'282branch = 'polkadot-v0.9.8'283version = '3.0.0'284285[dependencies.sp-std]286default-features = false287git = 'https://github.com/paritytech/substrate.git'288branch = 'polkadot-v0.9.8'289version = '3.0.0'290291[dependencies.sp-transaction-pool]292default-features = false293git = 'https://github.com/paritytech/substrate.git'294branch = 'polkadot-v0.9.8'295version = '3.0.0'296297[dependencies.sp-version]298default-features = false299git = 'https://github.com/paritytech/substrate.git'300branch = 'polkadot-v0.9.8'301version = '3.0.0'302303[dependencies.smallvec]304version = '1.4.1'305306################################################################################307# Cumulus dependencies308309[dependencies.parachain-info]310default-features = false311git = 'https://github.com/paritytech/cumulus.git'312branch = 'polkadot-v0.9.8'313version = '0.1.0'314315[dependencies.cumulus-pallet-aura-ext]316git = 'https://github.com/paritytech/cumulus.git'317branch = 'polkadot-v0.9.8'318default-features = false319320[dependencies.cumulus-pallet-parachain-system]321git = 'https://github.com/paritytech/cumulus.git'322branch = 'polkadot-v0.9.8'323default-features = false324325[dependencies.cumulus-primitives-core]326git = 'https://github.com/paritytech/cumulus.git'327branch = 'polkadot-v0.9.8'328default-features = false329330[dependencies.cumulus-pallet-xcm]331git = 'https://github.com/paritytech/cumulus.git'332branch = 'polkadot-v0.9.8'333default-features = false334335[dependencies.cumulus-pallet-dmp-queue]336git = 'https://github.com/paritytech/cumulus.git'337branch = 'polkadot-v0.9.8'338default-features = false339340[dependencies.cumulus-pallet-xcmp-queue]341git = 'https://github.com/paritytech/cumulus.git'342branch = 'polkadot-v0.9.8'343default-features = false344345[dependencies.cumulus-primitives-utility]346git = 'https://github.com/paritytech/cumulus.git'347branch = 'polkadot-v0.9.8'348default-features = false349350[dependencies.cumulus-primitives-timestamp]351git = 'https://github.com/paritytech/cumulus.git'352branch = 'polkadot-v0.9.8'353default-features = false354355################################################################################356# Polkadot dependencies357358[dependencies.polkadot-parachain]359git = 'https://github.com/paritytech/polkadot'360branch = 'release-v0.9.8'361default-features = false362363[dependencies.xcm]364git = 'https://github.com/paritytech/polkadot'365branch = 'release-v0.9.8'366default-features = false367368[dependencies.xcm-builder]369git = 'https://github.com/paritytech/polkadot'370branch = 'release-v0.9.8'371default-features = false372373[dependencies.xcm-executor]374git = 'https://github.com/paritytech/polkadot'375branch = 'release-v0.9.8'376default-features = false377378[dependencies.pallet-xcm]379git = 'https://github.com/paritytech/polkadot'380branch = 'release-v0.9.8'381default-features = false382383384################################################################################385# local dependencies386387[dependencies]388max-encoded-len = { default-features = false, features = ['derive'], version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }389derivative = "2.2.0"390pallet-nft = { path = '../pallets/nft', default-features = false, version = '3.0.0' }391pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }392nft-data-structs = { path = '../primitives/nft', default-features = false, version = '0.9.0' }393pallet-scheduler = { path = '../pallets/scheduler', default-features = false, version = '3.0.0' }394# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }395pallet-nft-transaction-payment = { path = '../pallets/nft-transaction-payment', default-features = false, version = '3.0.0' }396pallet-nft-charge-transaction = { path = '../pallets/nft-charge-transaction', default-features = false, version = '3.0.0' }397pallet-evm-migration = { path = '../pallets/evm-migration', default-features = false }398pallet-evm-contract-helpers = { path = '../pallets/evm-contract-helpers', default-features = false }399pallet-evm-transaction-payment = { path = '../pallets/evm-transaction-payment', default-features = false }400pallet-evm-coder-substrate = { default-features = false, path = "../pallets/evm-coder-substrate" }401402pallet-evm = { default-features = false, version = "5.0.0-dev", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }403pallet-ethereum = { default-features = false, version = "3.0.0-dev", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }404fp-rpc = { default-features = false, version = "2.0.0", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }405406################################################################################407# Build Dependencies408409[build-dependencies]410substrate-wasm-builder = '4.0.0'runtime/src/lib.rsdiffbeforeafterboth--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -252,6 +252,7 @@
type Currency = Balances;
type Event = Event;
type OnMethodCall = (
+ pallet_evm_migration::OnMethodCall<Self>,
pallet_nft::NftErcSupport<Self>,
pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,
);
@@ -263,6 +264,10 @@
type FindAuthor = EthereumFindAuthor<Aura>;
}
+impl pallet_evm_migration::Config for Runtime {
+ type WeightInfo = pallet_evm_migration::weights::SubstrateWeight<Self>;
+}
+
pub struct EthereumFindAuthor<F>(core::marker::PhantomData<F>);
impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F> {
fn find_author<'a, I>(digests: I) -> Option<H160>
@@ -819,6 +824,7 @@
EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
+ EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
}
);
@@ -1180,6 +1186,7 @@
let mut batches = Vec::<BenchmarkBatch>::new();
let params = (&config, &whitelist);
+ add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);
add_benchmark!(params, batches, pallet_nft, Nft);
add_benchmark!(params, batches, pallet_inflation, Inflation);