difftreelog
refactor switch to new eth log logic
in: master
33 files changed
Cargo.lockdiffbeforeafterboth2555[[package]]2555[[package]]2556name = "fc-consensus"2556name = "fc-consensus"2557version = "2.0.0-dev"2557version = "2.0.0-dev"2558source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2558source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2559dependencies = [2559dependencies = [2560 "async-trait",2560 "async-trait",2561 "fc-db",2561 "fc-db",2574[[package]]2574[[package]]2575name = "fc-db"2575name = "fc-db"2576version = "2.0.0-dev"2576version = "2.0.0-dev"2577source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2577source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2578dependencies = [2578dependencies = [2579 "fp-storage",2579 "fp-storage",2580 "kvdb-rocksdb",2580 "kvdb-rocksdb",2588[[package]]2588[[package]]2589name = "fc-mapping-sync"2589name = "fc-mapping-sync"2590version = "2.0.0-dev"2590version = "2.0.0-dev"2591source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2591source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2592dependencies = [2592dependencies = [2593 "fc-db",2593 "fc-db",2594 "fp-consensus",2594 "fp-consensus",2605[[package]]2605[[package]]2606name = "fc-rpc"2606name = "fc-rpc"2607version = "2.0.0-dev"2607version = "2.0.0-dev"2608source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2608source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2609dependencies = [2609dependencies = [2610 "ethereum",2610 "ethereum",2611 "ethereum-types",2611 "ethereum-types",2644[[package]]2644[[package]]2645name = "fc-rpc-core"2645name = "fc-rpc-core"2646version = "1.1.0-dev"2646version = "1.1.0-dev"2647source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2647source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2648dependencies = [2648dependencies = [2649 "ethereum",2649 "ethereum",2650 "ethereum-types",2650 "ethereum-types",2777[[package]]2777[[package]]2778name = "fp-consensus"2778name = "fp-consensus"2779version = "2.0.0-dev"2779version = "2.0.0-dev"2780source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2780source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2781dependencies = [2781dependencies = [2782 "ethereum",2782 "ethereum",2783 "parity-scale-codec",2783 "parity-scale-codec",2789[[package]]2789[[package]]2790name = "fp-evm"2790name = "fp-evm"2791version = "3.0.0-dev"2791version = "3.0.0-dev"2792source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2792source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2793dependencies = [2793dependencies = [2794 "evm",2794 "evm",2795 "impl-trait-for-tuples",2795 "impl-trait-for-tuples",2802[[package]]2802[[package]]2803name = "fp-evm-mapping"2803name = "fp-evm-mapping"2804version = "0.1.0"2804version = "0.1.0"2805source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2805source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2806dependencies = [2806dependencies = [2807 "frame-support",2807 "frame-support",2808 "sp-core",2808 "sp-core",2811[[package]]2811[[package]]2812name = "fp-rpc"2812name = "fp-rpc"2813version = "3.0.0-dev"2813version = "3.0.0-dev"2814source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2814source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2815dependencies = [2815dependencies = [2816 "ethereum",2816 "ethereum",2817 "ethereum-types",2817 "ethereum-types",2828[[package]]2828[[package]]2829name = "fp-self-contained"2829name = "fp-self-contained"2830version = "1.0.0-dev"2830version = "1.0.0-dev"2831source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2831source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2832dependencies = [2832dependencies = [2833 "ethereum",2833 "ethereum",2834 "frame-support",2834 "frame-support",2844[[package]]2844[[package]]2845name = "fp-storage"2845name = "fp-storage"2846version = "2.0.0"2846version = "2.0.0"2847source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"2847source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"2848dependencies = [2848dependencies = [2849 "parity-scale-codec",2849 "parity-scale-codec",2850]2850]5741[[package]]5741[[package]]5742name = "pallet-base-fee"5742name = "pallet-base-fee"5743version = "1.0.0"5743version = "1.0.0"5744source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"5744source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"5745dependencies = [5745dependencies = [5746 "fp-evm",5746 "fp-evm",5747 "frame-support",5747 "frame-support",5999[[package]]5999[[package]]6000name = "pallet-ethereum"6000name = "pallet-ethereum"6001version = "4.0.0-dev"6001version = "4.0.0-dev"6002source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"6002source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"6003dependencies = [6003dependencies = [6004 "ethereum",6004 "ethereum",6005 "ethereum-types",6005 "ethereum-types",6029[[package]]6029[[package]]6030name = "pallet-evm"6030name = "pallet-evm"6031version = "6.0.0-dev"6031version = "6.0.0-dev"6032source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21#4c0dea347d0388a7b261cbc36568170e288f3e7a"6032source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.21-logs#79cd4c4cf29106c431facd6779783fc887b21475"6033dependencies = [6033dependencies = [6034 "evm",6034 "evm",6035 "fp-evm",6035 "fp-evm",client/rpc/Cargo.tomldiffbeforeafterboth18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }19sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }19sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }20sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }20sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }21pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }21pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }2222node/cli/Cargo.tomldiffbeforeafterboth306jsonrpc-pubsub = "18.0.0"306jsonrpc-pubsub = "18.0.0"307tokio = { version = "1.17.0", features = ["time"] }307tokio = { version = "1.17.0", features = ["time"] }308308309fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }309fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }310fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }310fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }311fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }311fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }312fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }312fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }313fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }313fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }314fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }314fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }315pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }315pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }316316317unique-rpc = { default-features = false, path = "../rpc" }317unique-rpc = { default-features = false, path = "../rpc" }318318node/rpc/Cargo.tomldiffbeforeafterboth41substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }41substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }42tokio = { version = "0.2.25", features = ["macros", "sync"] }42tokio = { version = "0.2.25", features = ["macros", "sync"] }434344pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }44pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }45fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }45fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }46fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }46fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }47fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }47fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }48fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }48fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }49fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }49fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }50fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }50fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }515152pallet-common = { default-features = false, path = "../../pallets/common" }52pallet-common = { default-features = false, path = "../../pallets/common" }53unique-runtime-common = { default-features = false, path = "../../runtime/common" }53unique-runtime-common = { default-features = false, path = "../../runtime/common" }pallets/common/Cargo.tomldiffbeforeafterboth16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }19fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }19fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }20up-data-structs = { default-features = false, path = '../../primitives/data-structs' }20up-data-structs = { default-features = false, path = '../../primitives/data-structs' }21pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }21pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }22evm-coder = { default-features = false, path = '../../crates/evm-coder' }22evm-coder = { default-features = false, path = '../../crates/evm-coder' }23pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }23pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }24serde = { version = "1.0.130", default-features = false }24serde = { version = "1.0.130", default-features = false }25scale-info = { version = "2.0.1", default-features = false, features = [25scale-info = { version = "2.0.1", default-features = false, features = [26 "derive",26 "derive",pallets/common/src/dispatch.rsdiffbeforeafterboth53 _ => {}53 _ => {}54 }54 }5556 dispatched.into_inner().submit_logs();57 result55 result58}56}5957pallets/common/src/lib.rsdiffbeforeafterboth66 <CollectionById<T>>::get(id).map(|collection| Self {66 <CollectionById<T>>::get(id).map(|collection| Self {67 id,67 id,68 collection,68 collection,69 recorder: SubstrateRecorder::new(eth::collection_id_to_address(id), gas_limit),69 recorder: SubstrateRecorder::new(gas_limit),70 })70 })71 }71 }72 pub fn new(id: CollectionId) -> Option<Self> {72 pub fn new(id: CollectionId) -> Option<Self> {75 pub fn try_get(id: CollectionId) -> Result<Self, DispatchError> {75 pub fn try_get(id: CollectionId) -> Result<Self, DispatchError> {76 Ok(Self::new(id).ok_or(<Error<T>>::CollectionNotFound)?)76 Ok(Self::new(id).ok_or(<Error<T>>::CollectionNotFound)?)77 }77 }78 pub fn log_mirrored(&self, log: impl evm_coder::ToLog) {79 self.recorder.log_mirrored(log)80 }81 pub fn log_direct(&self, log: impl evm_coder::ToLog) {82 self.recorder.log_direct(log)83 }84 pub fn consume_store_reads(&self, reads: u64) -> evm_coder::execution::Result<()> {78 pub fn consume_store_reads(&self, reads: u64) -> evm_coder::execution::Result<()> {85 self.recorder79 self.recorder86 .consume_gas(T::GasWeightMapping::weight_to_gas(80 .consume_gas(T::GasWeightMapping::weight_to_gas(97 .saturating_mul(writes),91 .saturating_mul(writes),98 ))92 ))99 }93 }100 pub fn submit_logs(self) {101 self.recorder.submit_logs()102 }103 pub fn save(self) -> DispatchResult {94 pub fn save(self) -> DispatchResult {104 self.recorder.submit_logs();105 <CollectionById<T>>::insert(self.id, self.collection);95 <CollectionById<T>>::insert(self.id, self.collection);106 Ok(())96 Ok(())107 }97 }pallets/evm-coder-substrate/Cargo.tomldiffbeforeafterboth12sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }12sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }13ethereum = { version = "0.12.0", default-features = false }13ethereum = { version = "0.12.0", default-features = false }14evm-coder = { default-features = false, path = "../../crates/evm-coder" }14evm-coder = { default-features = false, path = "../../crates/evm-coder" }15pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }15pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }16pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }16pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }17frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }19frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }19frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }pallets/evm-coder-substrate/src/lib.rsdiffbeforeafterboth242425use core::marker::PhantomData;25use core::marker::PhantomData;26use sp_std::cell::RefCell;26use sp_std::cell::RefCell;27use sp_std::vec::Vec;282729use codec::Decode;28use codec::Decode;30use frame_support::pallet_prelude::DispatchError;29use frame_support::pallet_prelude::DispatchError;33use up_data_structs::budget;32use up_data_structs::budget;34use pallet_evm::{33use pallet_evm::{35 ExitError, ExitRevert, ExitSucceed, GasWeightMapping, PrecompileFailure, PrecompileOutput,34 ExitError, ExitRevert, ExitSucceed, GasWeightMapping, PrecompileFailure, PrecompileOutput,36 PrecompileResult, runner::stack::MaybeMirroredLog,35 PrecompileResult,37};36};38use sp_core::H160;37use sp_core::H160;39use pallet_ethereum::EthereumTransactionSender;40// #[cfg(feature = "runtime-benchmarks")]38// #[cfg(feature = "runtime-benchmarks")]41// pub mod benchmarking;39// pub mod benchmarking;424043use evm_coder::{41use evm_coder::{44 ToLog,45 abi::{AbiReader, AbiWrite, AbiWriter},42 abi::{AbiReader, AbiWrite, AbiWriter},46 execution::{self, Result},43 execution::{self, Result},47 types::{Msg, value},44 types::{Msg, value},706771 #[pallet::config]68 #[pallet::config]72 pub trait Config: frame_system::Config {69 pub trait Config: frame_system::Config {73 type EthereumTransactionSender: pallet_ethereum::EthereumTransactionSender;74 type GasWeightMapping: pallet_evm::GasWeightMapping;70 type GasWeightMapping: pallet_evm::GasWeightMapping;75 }71 }7672107103108#[derive(Default)]104#[derive(Default)]109pub struct SubstrateRecorder<T: Config> {105pub struct SubstrateRecorder<T: Config> {110 contract: H160,111 logs: RefCell<Vec<MaybeMirroredLog>>,112 initial_gas: u64,106 initial_gas: u64,113 gas_limit: RefCell<u64>,107 gas_limit: RefCell<u64>,114 _phantom: PhantomData<*const T>,108 _phantom: PhantomData<*const T>,115}109}116110117impl<T: Config> SubstrateRecorder<T> {111impl<T: Config> SubstrateRecorder<T> {118 pub fn new(contract: H160, gas_limit: u64) -> Self {112 pub fn new(gas_limit: u64) -> Self {119 Self {113 Self {120 contract,121 logs: RefCell::new(Vec::new()),122 initial_gas: gas_limit,114 initial_gas: gas_limit,123 gas_limit: RefCell::new(gas_limit),115 gas_limit: RefCell::new(gas_limit),124 _phantom: PhantomData,116 _phantom: PhantomData,125 }117 }126 }118 }127128 pub fn is_empty(&self) -> bool {129 self.logs.borrow().is_empty()130 }131 // Logs emitted with log_direct appear as substrate evm.Log event132 pub fn log_direct(&self, log: impl ToLog) {133 self.logs134 .borrow_mut()135 .push(MaybeMirroredLog::direct(log.to_log(self.contract)))136 }137 /// If log already has substrate equivalent - then we don't need to emit evm.Log138 pub fn log_mirrored(&self, log: impl ToLog) {139 self.logs140 .borrow_mut()141 .push(MaybeMirroredLog::mirrored(log.to_log(self.contract)))142 }143 pub fn retrieve_logs(self) -> Vec<MaybeMirroredLog> {144 self.logs.into_inner()145 }146119147 pub fn gas_left(&self) -> u64 {120 pub fn gas_left(&self) -> u64 {148 *self.gas_limit.borrow()121 *self.gas_limit.borrow()207 Ok(Some(v)) => Ok(PrecompileOutput {180 Ok(Some(v)) => Ok(PrecompileOutput {208 exit_status: ExitSucceed::Returned,181 exit_status: ExitSucceed::Returned,209 cost: self.initial_gas - self.gas_left(),182 cost: self.initial_gas - self.gas_left(),210 // TODO: preserve mirroring status183 // We don't use this interface211 logs: self.retrieve_logs().into_iter().map(|l| l.log).collect(),184 logs: sp_std::vec![],212 output: v.finish(),185 output: v.finish(),213 }),186 }),214 Ok(None) => return None,187 Ok(None) => return None,227 })200 })228 }201 }229230 pub fn submit_logs(self) {231 let logs = self.retrieve_logs();232 if logs.is_empty() {233 return;234 }235 T::EthereumTransactionSender::submit_logs_transaction(Default::default(), logs)236 }237}202}238203239pub fn dispatch_to_evm<T: Config>(err: DispatchError) -> evm_coder::execution::Error {204pub fn dispatch_to_evm<T: Config>(err: DispatchError) -> evm_coder::execution::Error {pallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth15sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }15sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16evm-coder = { default-features = false, path = '../../crates/evm-coder' }16evm-coder = { default-features = false, path = '../../crates/evm-coder' }17pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }17pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }18pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }18pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }19fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }19fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }20up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21" }20up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21" }21log = "0.4.14"21log = "0.4.14"2222pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth162 return None;162 return None;163 }163 }164164165 let helpers = ContractHelpers::<T>(SubstrateRecorder::<T>::new(*target, gas_left));165 let helpers = ContractHelpers::<T>(SubstrateRecorder::<T>::new(gas_left));166 pallet_evm_coder_substrate::call(*source, helpers, value, input)166 pallet_evm_coder_substrate::call(*source, helpers, value, input)167 }167 }168168pallets/evm-migration/Cargo.tomldiffbeforeafterboth15sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }15sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }18pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }19fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }19fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }202021[dependencies.codec]21[dependencies.codec]22default-features = false22default-features = falsepallets/evm-migration/src/lib.rsdiffbeforeafterboth28 use sp_core::{H160, H256};28 use sp_core::{H160, H256};29 use sp_std::vec::Vec;29 use sp_std::vec::Vec;30 use super::weights::WeightInfo;30 use super::weights::WeightInfo;31 use pallet_evm::Pallet as PalletEvm;313232 #[pallet::config]33 #[pallet::config]33 pub trait Config: frame_system::Config + pallet_evm::Config {34 pub trait Config: frame_system::Config + pallet_evm::Config {56 pub fn begin(origin: OriginFor<T>, address: H160) -> DispatchResult {57 pub fn begin(origin: OriginFor<T>, address: H160) -> DispatchResult {57 ensure_root(origin)?;58 ensure_root(origin)?;58 ensure!(59 ensure!(59 <pallet_evm::Pallet<T>>::is_account_empty(&address)60 <PalletEvm<T>>::is_account_empty(&address) && !<MigrationPending<T>>::get(&address),60 && !<MigrationPending<T>>::get(&address),61 <Error<T>>::AccountNotEmpty,61 <Error<T>>::AccountNotEmpty,62 );62 );pallets/evm-transaction-payment/Cargo.tomldiffbeforeafterboth14sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }14sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }15sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }15sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }17pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }18fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }18fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }19pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }19pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }20up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21" }20up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21" }21fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }21fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }222223[dependencies.codec]23[dependencies.codec]24default-features = false24default-features = falsepallets/fungible/Cargo.tomldiffbeforeafterboth23pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }23pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }24ethereum = { version = "0.12.0", default-features = false }24ethereum = { version = "0.12.0", default-features = false }25frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }25frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }26pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }26pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }27scale-info = { version = "2.0.1", default-features = false, features = [27scale-info = { version = "2.0.1", default-features = false, features = [28 "derive",28 "derive",29] }29] }pallets/fungible/src/lib.rsdiffbeforeafterboth17#![cfg_attr(not(feature = "std"), no_std)]17#![cfg_attr(not(feature = "std"), no_std)]181819use core::ops::Deref;19use core::ops::Deref;20use evm_coder::ToLog;20use frame_support::{ensure};21use frame_support::{ensure};21use pallet_evm::account::CrossAccountId;22use pallet_evm::account::CrossAccountId;22use up_data_structs::{23use up_data_structs::{25};26};26use pallet_common::{27use pallet_common::{27 Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, CollectionHandle,28 Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, CollectionHandle,28 dispatch::CollectionDispatch,29 dispatch::CollectionDispatch, eth::collection_id_to_address,29};30};31use pallet_evm::Pallet as PalletEvm;30use pallet_structure::Pallet as PalletStructure;32use pallet_structure::Pallet as PalletStructure;31use pallet_evm_coder_substrate::WithRecorder;33use pallet_evm_coder_substrate::WithRecorder;32use sp_core::H160;34use sp_core::H160;676968 #[pallet::config]70 #[pallet::config]69 pub trait Config:71 pub trait Config:70 frame_system::Config + pallet_common::Config + pallet_structure::Config72 frame_system::Config + pallet_common::Config + pallet_structure::Config + pallet_evm::Config71 {73 {72 type WeightInfo: WeightInfo;74 type WeightInfo: WeightInfo;73 }75 }179 }181 }180 <TotalSupply<T>>::insert(collection.id, total_supply);182 <TotalSupply<T>>::insert(collection.id, total_supply);181183182 collection.log_mirrored(ERC20Events::Transfer {184 <PalletEvm<T>>::deposit_log(185 ERC20Events::Transfer {183 from: *owner.as_eth(),186 from: *owner.as_eth(),184 to: H160::default(),187 to: H160::default(),185 value: amount.into(),188 value: amount.into(),186 });189 }190 .to_log(collection_id_to_address(collection.id)),191 );187 <PalletCommon<T>>::deposit_event(CommonEvent::ItemDestroyed(192 <PalletCommon<T>>::deposit_event(CommonEvent::ItemDestroyed(188 collection.id,193 collection.id,249 <Balance<T>>::insert((collection.id, to), balance_to);254 <Balance<T>>::insert((collection.id, to), balance_to);250 }255 }251256252 collection.log_mirrored(ERC20Events::Transfer {257 <PalletEvm<T>>::deposit_log(258 ERC20Events::Transfer {253 from: *from.as_eth(),259 from: *from.as_eth(),254 to: *to.as_eth(),260 to: *to.as_eth(),255 value: amount.into(),261 value: amount.into(),256 });262 }263 .to_log(collection_id_to_address(collection.id)),264 );257 <PalletCommon<T>>::deposit_event(CommonEvent::Transfer(265 <PalletCommon<T>>::deposit_event(CommonEvent::Transfer(258 collection.id,266 collection.id,318 for (user, amount) in balances {326 for (user, amount) in balances {319 <Balance<T>>::insert((collection.id, &user), amount);327 <Balance<T>>::insert((collection.id, &user), amount);320328321 collection.log_mirrored(ERC20Events::Transfer {329 <PalletEvm<T>>::deposit_log(330 ERC20Events::Transfer {322 from: H160::default(),331 from: H160::default(),323 to: *user.as_eth(),332 to: *user.as_eth(),324 value: amount.into(),333 value: amount.into(),325 });334 }335 .to_log(collection_id_to_address(collection.id)),336 );326 <PalletCommon<T>>::deposit_event(CommonEvent::ItemCreated(337 <PalletCommon<T>>::deposit_event(CommonEvent::ItemCreated(327 collection.id,338 collection.id,346 <Allowance<T>>::insert((collection.id, owner, spender), amount);357 <Allowance<T>>::insert((collection.id, owner, spender), amount);347 }358 }348359349 collection.log_mirrored(ERC20Events::Approval {360 <PalletEvm<T>>::deposit_log(361 ERC20Events::Approval {350 owner: *owner.as_eth(),362 owner: *owner.as_eth(),351 spender: *spender.as_eth(),363 spender: *spender.as_eth(),352 value: amount.into(),364 value: amount.into(),353 });365 }366 .to_log(collection_id_to_address(collection.id)),367 );354 <PalletCommon<T>>::deposit_event(CommonEvent::Approved(368 <PalletCommon<T>>::deposit_event(CommonEvent::Approved(355 collection.id,369 collection.id,pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth31 );32}23}2425// Selector: 56fd500b26contract CollectionProperties is Dummy, ERC165 {27 // Selector: setProperty(string,string) 62d9491f28 function setProperty(string memory key, string memory value) public {29 require(false, stub_error);30 key;31 value;32 dummy = 0;33 }34 // Selector: deleteProperty(string) 3424191435 function deleteProperty(string memory key) public {36 require(false, stub_error);37 key;38 dummy = 0;39 }40}4142// Selector: 79cc679043contract ERC20UniqueExtensions is Dummy, ERC165 {44 // Selector: burnFrom(address,uint256) 79cc679045 function burnFrom(address from, uint256 amount) public returns (bool) {46 require(false, stub_error);47 from;48 amount;49 dummy = 0;50 return false;51 }52}335334// Selector: 942e8b2254// Selector: 942e8b2235contract ERC20 is Dummy, ERC165, ERC20Events {55contract ERC20 is Dummy, ERC165, ERC20Events {115 }119 }116}120}117121118contract UniqueFungible is Dummy, ERC165, ERC20 {}122contract UniqueFungible is Dummy, ERC165, ERC20, ERC20UniqueExtensions, CollectionProperties {123}119124125pallets/nonfungible/Cargo.tomldiffbeforeafterboth16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }19pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }19pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }20pallet-common = { default-features = false, path = '../common' }20pallet-common = { default-features = false, path = '../common' }21pallet-structure = { default-features = false, path = '../structure' }21pallet-structure = { default-features = false, path = '../structure' }22up-data-structs = { default-features = false, path = '../../primitives/data-structs' }22up-data-structs = { default-features = false, path = '../../primitives/data-structs' }pallets/nonfungible/src/lib.rsdiffbeforeafterboth17#![cfg_attr(not(feature = "std"), no_std)]17#![cfg_attr(not(feature = "std"), no_std)]181819use erc::ERC721Events;19use erc::ERC721Events;20use evm_coder::ToLog;20use frame_support::{BoundedVec, ensure, fail};21use frame_support::{BoundedVec, ensure, fail};21use up_data_structs::{22use up_data_structs::{22 AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,23 AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,23 mapping::TokenAddressMapping, NestingRule, budget::Budget, Property, PropertyPermission,24 mapping::TokenAddressMapping, NestingRule, budget::Budget, Property, PropertyPermission,24 PropertyKey, PropertyKeyPermission, Properties, TrySet,25 PropertyKey, PropertyKeyPermission, Properties, TrySet,25};26};26use pallet_evm::account::CrossAccountId;27use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm};27use pallet_common::{28use pallet_common::{28 Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, CollectionHandle,29 Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, CollectionHandle,29 dispatch::CollectionDispatch,30 dispatch::CollectionDispatch, eth::collection_id_to_address,30};31};31use pallet_structure::Pallet as PalletStructure;32use pallet_structure::Pallet as PalletStructure;32use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};33use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};727373 #[pallet::config]74 #[pallet::config]74 pub trait Config:75 pub trait Config:75 frame_system::Config + pallet_common::Config + pallet_structure::Config76 frame_system::Config + pallet_common::Config + pallet_structure::Config + pallet_evm::Config76 {77 {77 type WeightInfo: WeightInfo;78 type WeightInfo: WeightInfo;78 }79 }245 ));246 ));246 }247 }247248248 collection.log_mirrored(ERC721Events::Transfer {249 <PalletEvm<T>>::deposit_log(250 ERC721Events::Transfer {249 from: *token_data.owner.as_eth(),251 from: *token_data.owner.as_eth(),250 to: H160::default(),252 to: H160::default(),251 token_id: token.into(),253 token_id: token.into(),252 });254 }255 .to_log(collection_id_to_address(collection.id)),256 );253 <PalletCommon<T>>::deposit_event(CommonEvent::ItemDestroyed(257 <PalletCommon<T>>::deposit_event(CommonEvent::ItemDestroyed(254 collection.id,258 collection.id,357 }361 }358362359 if token_owner {363 if token_owner {360 check_result.or(check_token_owner())364 check_result.and_then(|()| check_token_owner())361 } else {365 } else {362 check_result366 check_result363 }367 }483 }487 }484 Self::set_allowance_unchecked(collection, from, token, None, true);488 Self::set_allowance_unchecked(collection, from, token, None, true);485489486 collection.log_mirrored(ERC721Events::Transfer {490 <PalletEvm<T>>::deposit_log(491 ERC721Events::Transfer {487 from: *from.as_eth(),492 from: *from.as_eth(),488 to: *to.as_eth(),493 to: *to.as_eth(),489 token_id: token.into(),494 token_id: token.into(),490 });495 }496 .to_log(collection_id_to_address(collection.id)),497 );491 <PalletCommon<T>>::deposit_event(CommonEvent::Transfer(498 <PalletCommon<T>>::deposit_event(CommonEvent::Transfer(492 collection.id,499 collection.id,583 data.properties.into_inner(),590 data.properties.into_inner(),584 )?;591 )?;585592586 collection.log_mirrored(ERC721Events::Transfer {593 <PalletEvm<T>>::deposit_log(594 ERC721Events::Transfer {587 from: H160::default(),595 from: H160::default(),588 to: *data.owner.as_eth(),596 to: *data.owner.as_eth(),589 token_id: token.into(),597 token_id: token.into(),590 });598 }599 .to_log(collection_id_to_address(collection.id)),600 );591 <PalletCommon<T>>::deposit_event(CommonEvent::ItemCreated(601 <PalletCommon<T>>::deposit_event(CommonEvent::ItemCreated(592 collection.id,602 collection.id,610 <Allowance<T>>::insert((collection.id, token), spender);620 <Allowance<T>>::insert((collection.id, token), spender);611 // In ERC721 there is only one possible approved user of token, so we set621 // In ERC721 there is only one possible approved user of token, so we set612 // approved user to spender622 // approved user to spender613 collection.log_mirrored(ERC721Events::Approval {623 <PalletEvm<T>>::deposit_log(624 ERC721Events::Approval {614 owner: *sender.as_eth(),625 owner: *sender.as_eth(),615 approved: *spender.as_eth(),626 approved: *spender.as_eth(),616 token_id: token.into(),627 token_id: token.into(),617 });628 }629 .to_log(collection_id_to_address(collection.id)),630 );618 // In Unique chain, any token can have any amount of approved users, so we need to631 // In Unique chain, any token can have any amount of approved users, so we need to619 // set allowance of old owner to 0, and allowance of new owner to 1632 // set allowance of old owner to 0, and allowance of new owner to 1640 if !assume_implicit_eth {653 if !assume_implicit_eth {641 // In ERC721 there is only one possible approved user of token, so we set654 // In ERC721 there is only one possible approved user of token, so we set642 // approved user to zero address655 // approved user to zero address643 collection.log_mirrored(ERC721Events::Approval {656 <PalletEvm<T>>::deposit_log(657 ERC721Events::Approval {644 owner: *sender.as_eth(),658 owner: *sender.as_eth(),645 approved: H160::default(),659 approved: H160::default(),646 token_id: token.into(),660 token_id: token.into(),647 });661 }662 .to_log(collection_id_to_address(collection.id)),663 );648 }664 }649 // In Unique chain, any token can have any amount of approved users, so we need to665 // In Unique chain, any token can have any amount of approved users, so we need topallets/refungible/Cargo.tomldiffbeforeafterboth16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }19pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }19pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }20pallet-common = { default-features = false, path = '../common' }20pallet-common = { default-features = false, path = '../common' }21pallet-structure = { default-features = false, path = '../structure' }21pallet-structure = { default-features = false, path = '../structure' }22up-data-structs = { default-features = false, path = '../../primitives/data-structs' }22up-data-structs = { default-features = false, path = '../../primitives/data-structs' }pallets/unique/Cargo.tomldiffbeforeafterboth83scale-info = { version = "2.0.1", default-features = false, features = [83scale-info = { version = "2.0.1", default-features = false, features = [84 "derive",84 "derive",85] }85] }86pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }86pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }87pallet-common = { default-features = false, path = "../common" }87pallet-common = { default-features = false, path = "../common" }8888primitives/data-structs/Cargo.tomldiffbeforeafterboth23sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }23sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }24sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }24sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }25sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }25sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }26derivative = "2.2.0"26derivative = { version = "2.2.0", features = ["use_core"] }27struct-versioning = { path = "../../crates/struct-versioning" }27struct-versioning = { path = "../../crates/struct-versioning" }28pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }28pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }292930[features]30[features]31default = ["std"]31default = ["std"]primitives/rpc/Cargo.tomldiffbeforeafterboth14sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }14sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }15sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }15sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }17pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }17pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }181819[features]19[features]20default = ["std"]20default = ["std"]runtime/common/Cargo.tomldiffbeforeafterboth101[dependencies.fp-rpc]101[dependencies.fp-rpc]102default-features = false102default-features = false103git = "https://github.com/uniquenetwork/frontier"103git = "https://github.com/uniquenetwork/frontier"104branch = "unique-polkadot-v0.9.21"104branch = "unique-polkadot-v0.9.21-logs"105105106[dependencies]106[dependencies]107pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }107pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }108evm-coder = { default-features = false, path = '../../crates/evm-coder' }108evm-coder = { default-features = false, path = '../../crates/evm-coder' }109up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.21' }109up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.21' }110110runtime/opal/Cargo.tomldiffbeforeafterboth397derivative = "2.2.0"397derivative = "2.2.0"398pallet-unique = { path = '../../pallets/unique', default-features = false }398pallet-unique = { path = '../../pallets/unique', default-features = false }399up-rpc = { path = "../../primitives/rpc", default-features = false }399up-rpc = { path = "../../primitives/rpc", default-features = false }400fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }400fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }401pallet-inflation = { path = '../../pallets/inflation', default-features = false }401pallet-inflation = { path = '../../pallets/inflation', default-features = false }402up-data-structs = { path = '../../primitives/data-structs', default-features = false }402up-data-structs = { path = '../../primitives/data-structs', default-features = false }403pallet-common = { default-features = false, path = "../../pallets/common" }403pallet-common = { default-features = false, path = "../../pallets/common" }412pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }412pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }413pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }413pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }414pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }414pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }415pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }415pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }416pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }416pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }417pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }417pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }418fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }418fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }419fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }419fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }420420421################################################################################421################################################################################422# Build Dependencies422# Build Dependenciesruntime/opal/src/lib.rsdiffbeforeafterboth821);821);822822823impl pallet_evm_coder_substrate::Config for Runtime {823impl pallet_evm_coder_substrate::Config for Runtime {824 type EthereumTransactionSender = pallet_ethereum::Pallet<Self>;825 type GasWeightMapping = FixedGasWeightMapping;824 type GasWeightMapping = FixedGasWeightMapping;826}825}8278261070 frame_system::CheckWeight<Runtime>,1069 frame_system::CheckWeight<Runtime>,1071 pallet_charge_transaction::ChargeTransactionPayment<Runtime>,1070 pallet_charge_transaction::ChargeTransactionPayment<Runtime>,1072 //pallet_contract_helpers::ContractHelpersExtension<Runtime>,1071 //pallet_contract_helpers::ContractHelpersExtension<Runtime>,1072 pallet_ethereum::FakeTransactionFinalizer<Runtime>,1073);1073);1074/// Unchecked extrinsic type as expected by this runtime.1074/// Unchecked extrinsic type as expected by this runtime.1075pub type UncheckedExtrinsic =1075pub type UncheckedExtrinsic =runtime/quartz/Cargo.tomldiffbeforeafterboth397derivative = "2.2.0"397derivative = "2.2.0"398pallet-unique = { path = '../../pallets/unique', default-features = false }398pallet-unique = { path = '../../pallets/unique', default-features = false }399up-rpc = { path = "../../primitives/rpc", default-features = false }399up-rpc = { path = "../../primitives/rpc", default-features = false }400fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }400fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }401pallet-inflation = { path = '../../pallets/inflation', default-features = false }401pallet-inflation = { path = '../../pallets/inflation', default-features = false }402up-data-structs = { path = '../../primitives/data-structs', default-features = false }402up-data-structs = { path = '../../primitives/data-structs', default-features = false }403pallet-common = { default-features = false, path = "../../pallets/common" }403pallet-common = { default-features = false, path = "../../pallets/common" }412pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }412pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }413pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }413pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }414pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }414pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }415pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }415pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }416pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }416pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }417pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }417pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }418fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }418fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }419fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }419fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }420420421################################################################################421################################################################################422# Build Dependencies422# Build Dependenciesruntime/quartz/src/lib.rsdiffbeforeafterboth793);793);794794795impl pallet_evm_coder_substrate::Config for Runtime {795impl pallet_evm_coder_substrate::Config for Runtime {796 type EthereumTransactionSender = pallet_ethereum::Pallet<Self>;797 type GasWeightMapping = FixedGasWeightMapping;796 type GasWeightMapping = FixedGasWeightMapping;798}797}7997981048 frame_system::CheckWeight<Runtime>,1047 frame_system::CheckWeight<Runtime>,1049 pallet_charge_transaction::ChargeTransactionPayment<Runtime>,1048 pallet_charge_transaction::ChargeTransactionPayment<Runtime>,1050 //pallet_contract_helpers::ContractHelpersExtension<Runtime>,1049 //pallet_contract_helpers::ContractHelpersExtension<Runtime>,1050 pallet_ethereum::FakeTransactionFinalizer<Runtime>,1051);1051);1052/// Unchecked extrinsic type as expected by this runtime.1052/// Unchecked extrinsic type as expected by this runtime.1053pub type UncheckedExtrinsic =1053pub type UncheckedExtrinsic =runtime/tests/Cargo.tomldiffbeforeafterboth12sp-io = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }12sp-io = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }13sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }13sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }141415fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }15fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }161617frame-support = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }17frame-support = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }18frame-system = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }18frame-system = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }21pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }21pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }22pallet-timestamp = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }22pallet-timestamp = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.21' }232324pallet-evm = { default-features = false, git = 'https://github.com/uniquenetwork/frontier', branch = 'unique-polkadot-v0.9.21' }24pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }25pallet-ethereum = { default-features = false, git = 'https://github.com/uniquenetwork/frontier', branch = 'unique-polkadot-v0.9.21' }25pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }262627pallet-common = { path = '../../pallets/common' }27pallet-common = { path = '../../pallets/common' }28pallet-structure = { path = '../../pallets/structure' }28pallet-structure = { path = '../../pallets/structure' }runtime/tests/src/lib.rsdiffbeforeafterboth161617#![allow(clippy::from_over_into)]17#![allow(clippy::from_over_into)]181819use sp_core::{H160, H256};19use sp_core::{H256, U256};20use frame_support::{20use frame_support::{21 parameter_types,21 parameter_types,22 traits::{Everything, ConstU32},22 traits::{Everything, ConstU32, ConstU64},23 weights::IdentityFee,23 weights::IdentityFee,24};24};25use sp_runtime::{25use sp_runtime::{28};28};29use pallet_transaction_payment::{CurrencyAdapter};29use pallet_transaction_payment::{CurrencyAdapter};30use frame_system as system;30use frame_system as system;31use pallet_evm::{AddressMapping, runner::stack::MaybeMirroredLog, account::CrossAccountId};31use pallet_evm::{32 AddressMapping, account::CrossAccountId, EnsureAddressNever, SubstrateBlockHashMapping,33};32use fp_evm_mapping::EvmBackwardsAddressMapping;34use fp_evm_mapping::EvmBackwardsAddressMapping;33use parity_scale_codec::{Encode, Decode, MaxEncodedLen};35use parity_scale_codec::{Encode, Decode, MaxEncodedLen};181 }183 }182}184}183185186parameter_types! {184pub struct TestEtheremTransactionSender;187 pub BlockGasLimit: U256 = 0u32.into();188}189185impl pallet_ethereum::EthereumTransactionSender for TestEtheremTransactionSender {190impl pallet_evm::Config for Test {191 type Event = ();192 type FeeCalculator = ();193 type GasWeightMapping = ();194 type CallOrigin = EnsureAddressNever<Self::CrossAccountId>;195 type WithdrawOrigin = EnsureAddressNever<Self::CrossAccountId>;196 type AddressMapping = TestEvmAddressMapping;197 type Currency = Balances;198 type PrecompilesType = ();199 type PrecompilesValue = ();200 type Runner = pallet_evm::runner::stack::Runner<Self>;201 type ChainId = ConstU64<0>;202 type BlockGasLimit = BlockGasLimit;203 type OnMethodCall = ();204 type OnCreate = ();205 type OnChargeTransaction = ();206 type FindAuthor = ();186 fn submit_logs_transaction(_source: H160, _logs: Vec<MaybeMirroredLog>) {}207 type BlockHashMapping = SubstrateBlockHashMapping<Self>;208 type TransactionValidityHack = ();187}209}188189impl pallet_evm_coder_substrate::Config for Test {210impl pallet_evm_coder_substrate::Config for Test {190 type EthereumTransactionSender = TestEtheremTransactionSender;191 type GasWeightMapping = ();211 type GasWeightMapping = ();192}212}193213runtime/unique/Cargo.tomldiffbeforeafterboth411pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }411pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }412pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }412pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }413pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }413pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }414pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }414pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }415pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }415pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }416pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }416pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }417fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }417fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }418fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }418fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }419fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21" }419fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }420420421################################################################################421################################################################################422# Build Dependencies422# Build Dependenciesruntime/unique/src/lib.rsdiffbeforeafterboth792);792);793793794impl pallet_evm_coder_substrate::Config for Runtime {794impl pallet_evm_coder_substrate::Config for Runtime {795 type EthereumTransactionSender = pallet_ethereum::Pallet<Self>;796 type GasWeightMapping = FixedGasWeightMapping;795 type GasWeightMapping = FixedGasWeightMapping;797}796}7987971046 frame_system::CheckWeight<Runtime>,1045 frame_system::CheckWeight<Runtime>,1047 pallet_charge_transaction::ChargeTransactionPayment<Runtime>,1046 pallet_charge_transaction::ChargeTransactionPayment<Runtime>,1048 //pallet_contract_helpers::ContractHelpersExtension<Runtime>,1047 //pallet_contract_helpers::ContractHelpersExtension<Runtime>,1048 pallet_ethereum::FakeTransactionFinalizer<Runtime>,1049);1049);1050/// Unchecked extrinsic type as expected by this runtime.1050/// Unchecked extrinsic type as expected by this runtime.1051pub type UncheckedExtrinsic =1051pub type UncheckedExtrinsic =tests/src/substrate/substrate-api.tsdiffbeforeafterboth34 extrinsic: {},34 extrinsic: {},35 payload: {},35 payload: {},36 },36 },37 FakeTransactionFinalizer: {38 extrinsic: {},39 payload: {},40 },37 },41 },38 rpc: {42 rpc: {39 unique: defs.unique.rpc,43 unique: defs.unique.rpc,