difftreelog
feat add sponsoring fee limit
in: master
37 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -117,7 +117,7 @@
version = "0.1.0"
dependencies = [
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)",
"parity-scale-codec 3.1.5",
"sp-api",
"sp-core",
@@ -2324,7 +2324,7 @@
[[package]]
name = "fc-consensus"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"async-trait",
"fc-db",
@@ -2343,7 +2343,7 @@
[[package]]
name = "fc-db"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"fp-storage",
"kvdb-rocksdb",
@@ -2359,7 +2359,7 @@
[[package]]
name = "fc-mapping-sync"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"fc-db",
"fp-consensus",
@@ -2376,7 +2376,7 @@
[[package]]
name = "fc-rpc"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"ethereum",
"ethereum-types",
@@ -2416,7 +2416,7 @@
[[package]]
name = "fc-rpc-core"
version = "1.1.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"ethereum",
"ethereum-types",
@@ -2557,7 +2557,7 @@
[[package]]
name = "fp-consensus"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"ethereum",
"parity-scale-codec 3.1.5",
@@ -2581,6 +2581,20 @@
]
[[package]]
+name = "fp-evm"
+version = "3.0.0-dev"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
+dependencies = [
+ "evm",
+ "frame-support",
+ "impl-trait-for-tuples",
+ "parity-scale-codec 3.1.5",
+ "serde",
+ "sp-core",
+ "sp-std",
+]
+
+[[package]]
name = "fp-evm-mapping"
version = "0.1.0"
source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
@@ -2590,13 +2604,22 @@
]
[[package]]
+name = "fp-evm-mapping"
+version = "0.1.0"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
+dependencies = [
+ "frame-support",
+ "sp-core",
+]
+
+[[package]]
name = "fp-rpc"
version = "3.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"ethereum",
"ethereum-types",
- "fp-evm",
+ "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"parity-scale-codec 3.1.5",
"scale-info",
"sp-api",
@@ -2609,7 +2632,7 @@
[[package]]
name = "fp-self-contained"
version = "1.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"ethereum",
"frame-support",
@@ -2625,7 +2648,7 @@
[[package]]
name = "fp-storage"
version = "2.0.0"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"parity-scale-codec 3.1.5",
]
@@ -5152,7 +5175,7 @@
"cumulus-primitives-utility",
"derivative",
"evm-coder",
- "fp-evm-mapping",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"fp-rpc",
"fp-self-contained",
"frame-benchmarking",
@@ -5172,7 +5195,7 @@
"pallet-common",
"pallet-configuration",
"pallet-ethereum",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
@@ -5320,7 +5343,7 @@
"frame-system",
"pallet-balances",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-randomness-collective-flip",
@@ -5445,9 +5468,9 @@
[[package]]
name = "pallet-base-fee"
version = "1.0.0"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
- "fp-evm",
+ "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"frame-support",
"frame-system",
"parity-scale-codec 3.1.5",
@@ -5556,11 +5579,11 @@
dependencies = [
"ethereum",
"evm-coder",
- "fp-evm-mapping",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"frame-benchmarking",
"frame-support",
"frame-system",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"parity-scale-codec 3.1.5",
"scale-info",
@@ -5575,7 +5598,7 @@
name = "pallet-configuration"
version = "0.1.1"
dependencies = [
- "fp-evm",
+ "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"frame-support",
"frame-system",
"parity-scale-codec 3.1.5",
@@ -5660,21 +5683,21 @@
[[package]]
name = "pallet-ethereum"
version = "4.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
dependencies = [
"ethereum",
"ethereum-types",
"evm",
"fp-consensus",
- "fp-evm",
- "fp-evm-mapping",
+ "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"fp-rpc",
"fp-self-contained",
"fp-storage",
"frame-support",
"frame-system",
"log",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-timestamp",
"parity-scale-codec 3.1.5",
"rlp",
@@ -5692,8 +5715,35 @@
source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
dependencies = [
"evm",
- "fp-evm",
- "fp-evm-mapping",
+ "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)",
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "hex",
+ "impl-trait-for-tuples",
+ "log",
+ "pallet-timestamp",
+ "parity-scale-codec 3.1.5",
+ "primitive-types",
+ "rlp",
+ "scale-info",
+ "serde",
+ "sha3 0.10.2",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "pallet-evm"
+version = "6.0.0-dev"
+source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"
+dependencies = [
+ "evm",
+ "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -5723,7 +5773,7 @@
"frame-support",
"frame-system",
"pallet-ethereum",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"parity-scale-codec 3.1.5",
"scale-info",
"sp-core",
@@ -5737,12 +5787,12 @@
dependencies = [
"ethereum",
"evm-coder",
- "fp-evm-mapping",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"frame-support",
"frame-system",
"log",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"parity-scale-codec 3.1.5",
"scale-info",
@@ -5757,11 +5807,11 @@
name = "pallet-evm-migration"
version = "0.1.1"
dependencies = [
- "fp-evm",
+ "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"frame-benchmarking",
"frame-support",
"frame-system",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"parity-scale-codec 3.1.5",
"scale-info",
"sp-core",
@@ -5774,12 +5824,12 @@
name = "pallet-evm-transaction-payment"
version = "0.1.1"
dependencies = [
- "fp-evm",
- "fp-evm-mapping",
+ "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"frame-support",
"frame-system",
"pallet-ethereum",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"parity-scale-codec 3.1.5",
"scale-info",
"sp-core",
@@ -5799,7 +5849,7 @@
"frame-support",
"frame-system",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"pallet-structure",
"parity-scale-codec 3.1.5",
@@ -6041,7 +6091,7 @@
"frame-support",
"frame-system",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"pallet-structure",
"parity-scale-codec 3.1.5",
@@ -6164,7 +6214,7 @@
"frame-support",
"frame-system",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"pallet-structure",
"parity-scale-codec 3.1.5",
@@ -6185,7 +6235,7 @@
"frame-support",
"frame-system",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-nonfungible",
"pallet-structure",
"parity-scale-codec 3.1.5",
@@ -6205,7 +6255,7 @@
"frame-support",
"frame-system",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-nonfungible",
"pallet-rmrk-core",
"parity-scale-codec 3.1.5",
@@ -6335,7 +6385,7 @@
"frame-support",
"frame-system",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"parity-scale-codec 3.1.5",
"scale-info",
"sp-std",
@@ -6359,7 +6409,7 @@
[[package]]
name = "pallet-template-transaction-payment"
version = "3.0.0"
-source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04"
+source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3#a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6482,7 +6532,7 @@
"frame-support",
"frame-system",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"pallet-nonfungible",
"pallet-refungible",
@@ -8385,7 +8435,7 @@
"cumulus-primitives-utility",
"derivative",
"evm-coder",
- "fp-evm-mapping",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"fp-rpc",
"fp-self-contained",
"frame-benchmarking",
@@ -8405,7 +8455,7 @@
"pallet-common",
"pallet-configuration",
"pallet-ethereum",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
@@ -11650,13 +11700,13 @@
version = "0.1.1"
dependencies = [
"evm-coder",
- "fp-evm-mapping",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"frame-support",
"frame-system",
"pallet-balances",
"pallet-common",
"pallet-ethereum",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"pallet-fungible",
"pallet-nonfungible",
@@ -12153,7 +12203,7 @@
"app-promotion-rpc",
"jsonrpsee",
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"parity-scale-codec 3.1.5",
"rmrk-rpc",
"sp-api",
@@ -12379,7 +12429,7 @@
"cumulus-primitives-utility",
"derivative",
"evm-coder",
- "fp-evm-mapping",
+ "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"fp-rpc",
"fp-self-contained",
"frame-benchmarking",
@@ -12399,7 +12449,7 @@
"pallet-common",
"pallet-configuration",
"pallet-ethereum",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"pallet-evm-coder-substrate",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
@@ -12485,7 +12535,7 @@
dependencies = [
"fp-rpc",
"frame-support",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"sp-consensus-aura",
"sp-core",
"sp-runtime",
@@ -12499,7 +12549,7 @@
"derivative",
"frame-support",
"frame-system",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"parity-scale-codec 3.1.5",
"rmrk-traits",
"scale-info",
@@ -12515,7 +12565,7 @@
version = "0.1.3"
dependencies = [
"pallet-common",
- "pallet-evm",
+ "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",
"parity-scale-codec 3.1.5",
"sp-api",
"sp-core",
@@ -12527,7 +12577,7 @@
[[package]]
name = "up-sponsorship"
version = "0.1.0"
-source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04"
+source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3#a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3"
dependencies = [
"impl-trait-for-tuples",
]
client/rpc/Cargo.tomldiffbeforeafterboth--- a/client/rpc/Cargo.toml
+++ b/client/rpc/Cargo.toml
@@ -19,4 +19,4 @@
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -309,13 +309,13 @@
jsonrpsee = { version = "0.14.0", features = ["server", "macros"] }
tokio = { version = "1.19.2", features = ["time"] }
-fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fc-consensus = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fc-rpc = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fc-db = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-rpc = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
unique-rpc = { default-features = false, path = "../rpc" }
app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
node/rpc/Cargo.tomldiffbeforeafterboth--- a/node/rpc/Cargo.toml
+++ b/node/rpc/Cargo.toml
@@ -40,13 +40,13 @@
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
tokio = { version = "1.19.2", features = ["macros", "sync"] }
-pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
pallet-common = { default-features = false, path = "../../pallets/common" }
up-common = { path = "../../primitives/common" }
pallets/common/Cargo.tomldiffbeforeafterboth--- a/pallets/common/Cargo.toml
+++ b/pallets/common/Cargo.toml
@@ -17,12 +17,12 @@
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
ethereum = { version = "0.12.0", default-features = false }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
serde = { version = "1.0.130", default-features = false }
scale-info = { version = "2.0.1", default-features = false, features = [
pallets/configuration/Cargo.tomldiffbeforeafterboth--- a/pallets/configuration/Cargo.toml
+++ b/pallets/configuration/Cargo.toml
@@ -16,7 +16,7 @@
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
smallvec = "1.6.1"
[features]
pallets/evm-coder-substrate/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-coder-substrate/Cargo.toml
+++ b/pallets/evm-coder-substrate/Cargo.toml
@@ -12,8 +12,8 @@
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
ethereum = { version = "0.12.0", default-features = false }
evm-coder = { default-features = false, path = "../../crates/evm-coder" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
pallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-contract-helpers/Cargo.toml
+++ b/pallets/evm-contract-helpers/Cargo.toml
@@ -19,9 +19,9 @@
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
# Unique
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" }
# Locals
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -25,11 +25,11 @@
ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle,
account::CrossAccountId,
};
-use sp_core::H160;
+use sp_core::{H160, U256};
use up_data_structs::SponsorshipState;
use crate::{
- AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringRateLimit, SponsoringModeT,
- Sponsoring,
+ AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringFeeLimit,
+ SponsoringRateLimit, SponsoringModeT, Sponsoring,
};
use frame_support::traits::Get;
use up_sponsorship::SponsorshipHandler;
@@ -250,6 +250,23 @@
Ok(())
}
+ fn set_sponsoring_fee_limit(
+ &mut self,
+ caller: caller,
+ contract_address: address,
+ fee_limit: uint128,
+ ) -> Result<void> {
+ <Pallet<T>>::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::<T>)?;
+ <Pallet<T>>::set_sponsoring_fee_limit(contract_address, fee_limit.into());
+ Ok(())
+ }
+
+ fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result<uint128> {
+ Ok(<SponsoringFeeLimit<T>>::get(contract_address)
+ .try_into()
+ .map_err(|_| "fee limit > u128::MAX")?)
+ }
+
/// Is specified user present in contract allow list
/// @dev Contract owner always implicitly included
/// @param contractAddress Contract to check allowlist of
@@ -363,10 +380,14 @@
/// Bridge to pallet-sponsoring
pub struct HelpersContractSponsoring<T: Config>(PhantomData<*const T>);
-impl<T: Config> SponsorshipHandler<T::CrossAccountId, (H160, Vec<u8>)>
+impl<T: Config> SponsorshipHandler<T::CrossAccountId, (H160, Vec<u8>), u128>
for HelpersContractSponsoring<T>
{
- fn get_sponsor(who: &T::CrossAccountId, call: &(H160, Vec<u8>)) -> Option<T::CrossAccountId> {
+ fn get_sponsor(
+ who: &T::CrossAccountId,
+ call: &(H160, Vec<u8>),
+ fee_limit: &u128,
+ ) -> Option<T::CrossAccountId> {
let (contract_address, _) = call;
let mode = <Pallet<T>>::sponsoring_mode(*contract_address);
if mode == SponsoringModeT::Disabled {
@@ -394,6 +415,12 @@
}
}
+ let sponsored_fee_limit = <SponsoringFeeLimit<T>>::get(contract_address);
+
+ if *fee_limit > sponsored_fee_limit {
+ return None;
+ }
+
<SponsorBasket<T>>::insert(contract_address, who.as_eth(), block_number);
Some(sponsor)
pallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/lib.rs
+++ b/pallets/evm-contract-helpers/src/lib.rs
@@ -48,6 +48,9 @@
/// In case of enabled sponsoring, but no sponsoring rate limit set,
/// this value will be used implicitly
type DefaultSponsoringRateLimit: Get<Self::BlockNumber>;
+ /// In case of enabled sponsoring, but no sponsoring fee limit set,
+ /// this value will be used implicitly
+ type DefaultSponsoringFeeLimit: Get<u128>;
}
#[pallet::error]
@@ -118,6 +121,15 @@
/// * **Key2** - sponsored user address.
/// * **Value** - last sponsored block number.
#[pallet::storage]
+ pub(super) type SponsoringFeeLimit<T: Config> = StorageMap<
+ Hasher = Twox128,
+ Key = H160,
+ Value = u128,
+ QueryKind = ValueQuery,
+ OnEmpty = T::DefaultSponsoringFeeLimit,
+ >;
+
+ #[pallet::storage]
pub(super) type SponsorBasket<T: Config> = StorageDoubleMap<
Hasher1 = Twox128,
Key1 = H160,
@@ -353,6 +365,11 @@
<SponsoringRateLimit<T>>::insert(contract, rate_limit);
}
+ /// Set maximum for gas limit of transaction
+ pub fn set_sponsoring_fee_limit(contract: H160, fee_limit: u128) {
+ <SponsoringFeeLimit<T>>::insert(contract, fee_limit);
+ }
+
/// Is user added to allowlist, or he is owner of specified contract
pub fn allowed(contract: H160, user: H160) -> bool {
<Allowlist<T>>::get(&contract, &user) || <Owner<T>>::get(&contract) == user
pallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -203,6 +203,30 @@
dummy = 0;
}
+ /// @dev EVM selector for this function is: 0x1c362eb4,
+ /// or in textual repr: setSponsoringFeeLimit(address,uint128)
+ function setSponsoringFeeLimit(address contractAddress, uint128 feeLimit)
+ public
+ {
+ require(false, stub_error);
+ contractAddress;
+ feeLimit;
+ dummy = 0;
+ }
+
+ /// @dev EVM selector for this function is: 0xc3fdc9ee,
+ /// or in textual repr: getSponsoringFeeLimit(address)
+ function getSponsoringFeeLimit(address contractAddress)
+ public
+ view
+ returns (uint128)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return 0;
+ }
+
/// Is specified user present in contract allow list
/// @dev Contract owner always implicitly included
/// @param contractAddress Contract to check allowlist of
pallets/evm-migration/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-migration/Cargo.toml
+++ b/pallets/evm-migration/Cargo.toml
@@ -15,8 +15,8 @@
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
[dependencies.codec]
default-features = false
pallets/evm-transaction-payment/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-transaction-payment/Cargo.toml
+++ b/pallets/evm-transaction-payment/Cargo.toml
@@ -14,11 +14,11 @@
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev = "a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
[dependencies.codec]
default-features = false
pallets/evm-transaction-payment/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-transaction-payment/src/lib.rs
+++ b/pallets/evm-transaction-payment/src/lib.rs
@@ -22,8 +22,8 @@
use fp_evm::WithdrawReason;
use frame_support::traits::IsSubType;
pub use pallet::*;
-use pallet_evm::{EnsureAddressOrigin, account::CrossAccountId};
-use sp_core::H160;
+use pallet_evm::{account::CrossAccountId, EnsureAddressOrigin, FeeCalculator};
+use sp_core::{H160, U256};
use sp_runtime::{TransactionOutcome, DispatchError};
use up_sponsorship::SponsorshipHandler;
@@ -36,7 +36,7 @@
#[pallet::config]
pub trait Config: frame_system::Config + pallet_evm::account::Config {
/// Loosly-coupled handlers for evm call sponsoring
- type EvmSponsorshipHandler: SponsorshipHandler<Self::CrossAccountId, (H160, Vec<u8>)>;
+ type EvmSponsorshipHandler: SponsorshipHandler<Self::CrossAccountId, (H160, Vec<u8>), u128>;
}
#[pallet::pallet]
@@ -47,11 +47,19 @@
/// Implements [`fp_evm::TransactionValidityHack`], which provides sponsor address to pallet-evm
pub struct TransactionValidityHack<T: Config>(PhantomData<*const T>);
impl<T: Config> fp_evm::TransactionValidityHack<T::CrossAccountId> for TransactionValidityHack<T> {
- fn who_pays_fee(origin: H160, reason: &WithdrawReason) -> Option<T::CrossAccountId> {
+ fn who_pays_fee(
+ origin: H160,
+ max_fee: U256,
+ reason: &WithdrawReason,
+ ) -> Option<T::CrossAccountId> {
match reason {
WithdrawReason::Call { target, input } => {
let origin_sub = T::CrossAccountId::from_eth(origin);
- T::EvmSponsorshipHandler::get_sponsor(&origin_sub, &(*target, input.clone()))
+ T::EvmSponsorshipHandler::get_sponsor(
+ &origin_sub,
+ &(*target, input.clone()),
+ &max_fee.as_u128(),
+ )
}
_ => None,
}
@@ -60,17 +68,19 @@
/// Implements sponsoring for evm calls performed from pallet-evm (via api.tx.ethereum.transact/api.tx.evm.call)
pub struct BridgeSponsorshipHandler<T>(PhantomData<T>);
-impl<T, C> SponsorshipHandler<T::AccountId, C> for BridgeSponsorshipHandler<T>
+impl<T, C> SponsorshipHandler<T::AccountId, C, u128> for BridgeSponsorshipHandler<T>
where
T: Config + pallet_evm::Config,
C: IsSubType<pallet_evm::Call<T>>,
{
- fn get_sponsor(who: &T::AccountId, call: &C) -> Option<T::AccountId> {
+ fn get_sponsor(who: &T::AccountId, call: &C, _fee_limit: &u128) -> Option<T::AccountId> {
match call.is_sub_type()? {
pallet_evm::Call::call {
source,
target,
input,
+ gas_limit,
+ max_fee_per_gas,
..
} => {
let _ = T::CallOrigin::ensure_address_origin(
@@ -79,11 +89,16 @@
)
.ok()?;
let who = T::CrossAccountId::from_sub(who.clone());
+ let max_fee = max_fee_per_gas.saturating_mul((*gas_limit).into());
// Effects from EvmSponsorshipHandler are applied by pallet_evm::runner
// TODO: Should we implement simulation mode (test, but do not apply effects) in `up-sponsorship`?
let sponsor = frame_support::storage::with_transaction(|| {
TransactionOutcome::Rollback(Ok::<_, DispatchError>(
- T::EvmSponsorshipHandler::get_sponsor(&who, &(*target, input.clone())),
+ T::EvmSponsorshipHandler::get_sponsor(
+ &who,
+ &(*target, input.clone()),
+ &max_fee.try_into().unwrap(),
+ ),
))
})
// FIXME: it may fail with DispatchError in case of depth limit
pallets/fungible/Cargo.tomldiffbeforeafterboth--- a/pallets/fungible/Cargo.toml
+++ b/pallets/fungible/Cargo.toml
@@ -23,7 +23,7 @@
pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }
ethereum = { version = "0.12.0", default-features = false }
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
pallets/nonfungible/Cargo.tomldiffbeforeafterboth--- a/pallets/nonfungible/Cargo.toml
+++ b/pallets/nonfungible/Cargo.toml
@@ -16,7 +16,7 @@
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
pallet-common = { default-features = false, path = '../common' }
pallet-structure = { default-features = false, path = '../structure' }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
pallets/proxy-rmrk-core/Cargo.tomldiffbeforeafterboth--- a/pallets/proxy-rmrk-core/Cargo.toml
+++ b/pallets/proxy-rmrk-core/Cargo.toml
@@ -20,7 +20,7 @@
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-structure = { default-features = false, path = "../../pallets/structure" }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" }
scale-info = { version = "2.0.1", default-features = false, features = [
pallets/proxy-rmrk-equip/Cargo.tomldiffbeforeafterboth--- a/pallets/proxy-rmrk-equip/Cargo.toml
+++ b/pallets/proxy-rmrk-equip/Cargo.toml
@@ -19,7 +19,7 @@
pallet-common = { default-features = false, path = '../common' }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" }
scale-info = { version = "2.0.1", default-features = false, features = [
pallets/refungible/Cargo.tomldiffbeforeafterboth--- a/pallets/refungible/Cargo.toml
+++ b/pallets/refungible/Cargo.toml
@@ -16,7 +16,7 @@
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
pallet-common = { default-features = false, path = '../common' }
pallets/scheduler/Cargo.tomldiffbeforeafterboth--- a/pallets/scheduler/Cargo.toml
+++ b/pallets/scheduler/Cargo.toml
@@ -24,7 +24,7 @@
sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.27' }
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" }
+up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" }
log = { version = "0.4.14", default-features = false }
[dev-dependencies]
pallets/structure/Cargo.tomldiffbeforeafterboth--- a/pallets/structure/Cargo.toml
+++ b/pallets/structure/Cargo.toml
@@ -16,7 +16,7 @@
"derive",
] }
up-data-structs = { path = "../../primitives/data-structs", default-features = false }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
[features]
default = ["std"]
pallets/unique/Cargo.tomldiffbeforeafterboth--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -98,7 +98,7 @@
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
pallet-common = { default-features = false, path = "../common" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
primitives/common/Cargo.tomldiffbeforeafterboth--- a/primitives/common/Cargo.toml
+++ b/primitives/common/Cargo.toml
@@ -48,9 +48,9 @@
[dependencies.fp-rpc]
default-features = false
git = "https://github.com/uniquenetwork/frontier"
-branch = "unique-polkadot-v0.9.27"
+rev = "89a37c5a489f426cc7a42d7b94019974093a052d"
[dependencies.pallet-evm]
default-features = false
git = "https://github.com/uniquenetwork/frontier"
-branch = "unique-polkadot-v0.9.27"
+rev = "89a37c5a489f426cc7a42d7b94019974093a052d"
primitives/data-structs/Cargo.tomldiffbeforeafterboth--- a/primitives/data-structs/Cargo.toml
+++ b/primitives/data-structs/Cargo.toml
@@ -25,7 +25,7 @@
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
derivative = { version = "2.2.0", features = ["use_core"] }
struct-versioning = { path = "../../crates/struct-versioning" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
rmrk-traits = { default-features = false, path = "../rmrk-traits" }
[features]
primitives/rpc/Cargo.tomldiffbeforeafterboth--- a/primitives/rpc/Cargo.toml
+++ b/primitives/rpc/Cargo.toml
@@ -14,7 +14,7 @@
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
[features]
default = ["std"]
runtime/common/config/ethereum.rsdiffbeforeafterboth--- a/runtime/common/config/ethereum.rs
+++ b/runtime/common/config/ethereum.rs
@@ -7,8 +7,10 @@
use sp_runtime::{RuntimeAppPublic, Perbill};
use crate::{
runtime_common::{
- dispatch::CollectionDispatchT, ethereum::sponsoring::EvmSponsorshipHandler,
- config::sponsoring::DefaultSponsoringRateLimit, DealWithFees,
+ dispatch::CollectionDispatchT,
+ ethereum::sponsoring::EvmSponsorshipHandler,
+ config::sponsoring::{DefaultSponsoringFeeLimit, DefaultSponsoringRateLimit},
+ DealWithFees,
},
Runtime, Aura, Balances, Event, ChainId,
};
@@ -115,6 +117,7 @@
type Event = Event;
type ContractAddress = HelpersContractAddress;
type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
+ type DefaultSponsoringFeeLimit = DefaultSponsoringFeeLimit;
}
impl pallet_evm_coder_substrate::Config for Runtime {}
runtime/common/config/sponsoring.rsdiffbeforeafterboth--- a/runtime/common/config/sponsoring.rs
+++ b/runtime/common/config/sponsoring.rs
@@ -23,6 +23,7 @@
parameter_types! {
pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS;
+ pub const DefaultSponsoringFeeLimit: u128 = u128::MAX;
}
type SponsorshipHandler = (
runtime/common/ethereum/sponsoring.rsdiffbeforeafterboth--- a/runtime/common/ethereum/sponsoring.rs
+++ b/runtime/common/ethereum/sponsoring.rs
@@ -44,9 +44,13 @@
pub struct UniqueEthSponsorshipHandler<T: UniqueConfig>(PhantomData<*const T>);
impl<T: UniqueConfig + FungibleConfig + NonfungibleConfig + RefungibleConfig>
- SponsorshipHandler<T::CrossAccountId, (H160, Vec<u8>)> for UniqueEthSponsorshipHandler<T>
+ SponsorshipHandler<T::CrossAccountId, (H160, Vec<u8>), u128> for UniqueEthSponsorshipHandler<T>
{
- fn get_sponsor(who: &T::CrossAccountId, call: &(H160, Vec<u8>)) -> Option<T::CrossAccountId> {
+ fn get_sponsor(
+ who: &T::CrossAccountId,
+ call: &(H160, Vec<u8>),
+ _fee_limit: &u128,
+ ) -> Option<T::CrossAccountId> {
let collection_id = map_eth_to_id(&call.0)?;
let collection = <CollectionHandle<T>>::new(collection_id)?;
let sponsor = collection.sponsorship.sponsor()?.clone();
runtime/common/runtime_apis.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#[macro_export]18macro_rules! dispatch_unique_runtime {19 ($collection:ident.$method:ident($($name:ident),*)) => {{20 let collection = <Runtime as pallet_common::Config>::CollectionDispatch::dispatch(<pallet_common::CollectionHandle<Runtime>>::try_get($collection)?);21 let dispatch = collection.as_dyn();2223 Ok::<_, DispatchError>(dispatch.$method($($name),*))24 }};25}2627#[macro_export]28macro_rules! impl_common_runtime_apis {29 (30 $(31 #![custom_apis]3233 $($custom_apis:tt)+34 )?35 ) => {36 use sp_std::prelude::*;37 use sp_api::impl_runtime_apis;38 use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160};39 use sp_runtime::{40 Permill,41 traits::Block as BlockT,42 transaction_validity::{TransactionSource, TransactionValidity},43 ApplyExtrinsicResult, DispatchError,44 };45 use fp_rpc::TransactionStatus;46 use pallet_transaction_payment::{47 FeeDetails, RuntimeDispatchInfo,48 };49 use pallet_evm::{50 Runner, account::CrossAccountId as _,51 Account as EVMAccount, FeeCalculator,52 };53 use runtime_common::{54 sponsoring::{SponsorshipPredict, UniqueSponsorshipPredict},55 dispatch::CollectionDispatch,56 config::ethereum::CrossAccountId,57 };58 use up_data_structs::*;596061 impl_runtime_apis! {62 $($($custom_apis)+)?6364 impl up_rpc::UniqueApi<Block, CrossAccountId, AccountId> for Runtime {65 fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result<Vec<TokenId>, DispatchError> {66 dispatch_unique_runtime!(collection.account_tokens(account))67 }68 fn collection_tokens(collection: CollectionId) -> Result<Vec<TokenId>, DispatchError> {69 dispatch_unique_runtime!(collection.collection_tokens())70 }71 fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool, DispatchError> {72 dispatch_unique_runtime!(collection.token_exists(token))73 }7475 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {76 dispatch_unique_runtime!(collection.token_owner(token))77 }7879 fn token_owners(collection: CollectionId, token: TokenId) -> Result<Vec::<CrossAccountId>, DispatchError> {80 dispatch_unique_runtime!(collection.token_owners(token))81 }8283 fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {84 let budget = up_data_structs::budget::Value::new(10);8586 Ok(Some(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?))87 }88 fn token_children(collection: CollectionId, token: TokenId) -> Result<Vec<TokenChild>, DispatchError> {89 Ok(<pallet_nonfungible::Pallet<Runtime>>::token_children_ids(collection, token))90 }91 fn collection_properties(92 collection: CollectionId,93 keys: Option<Vec<Vec<u8>>>94 ) -> Result<Vec<Property>, DispatchError> {95 let keys = keys.map(96 |keys| Common::bytes_keys_to_property_keys(keys)97 ).transpose()?;9899 Common::filter_collection_properties(collection, keys)100 }101102 fn token_properties(103 collection: CollectionId,104 token_id: TokenId,105 keys: Option<Vec<Vec<u8>>>106 ) -> Result<Vec<Property>, DispatchError> {107 let keys = keys.map(108 |keys| Common::bytes_keys_to_property_keys(keys)109 ).transpose()?;110111 dispatch_unique_runtime!(collection.token_properties(token_id, keys))112 }113114 fn property_permissions(115 collection: CollectionId,116 keys: Option<Vec<Vec<u8>>>117 ) -> Result<Vec<PropertyKeyPermission>, DispatchError> {118 let keys = keys.map(119 |keys| Common::bytes_keys_to_property_keys(keys)120 ).transpose()?;121122 Common::filter_property_permissions(collection, keys)123 }124125 fn token_data(126 collection: CollectionId,127 token_id: TokenId,128 keys: Option<Vec<Vec<u8>>>129 ) -> Result<TokenData<CrossAccountId>, DispatchError> {130 let token_data = TokenData {131 properties: Self::token_properties(collection, token_id, keys)?,132 owner: Self::token_owner(collection, token_id)?,133 pieces: Self::total_pieces(collection, token_id)?.unwrap_or(0),134 };135136 Ok(token_data)137 }138139 fn total_supply(collection: CollectionId) -> Result<u32, DispatchError> {140 dispatch_unique_runtime!(collection.total_supply())141 }142 fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result<u32, DispatchError> {143 dispatch_unique_runtime!(collection.account_balance(account))144 }145 fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<u128, DispatchError> {146 dispatch_unique_runtime!(collection.balance(account, token))147 }148 fn allowance(149 collection: CollectionId,150 sender: CrossAccountId,151 spender: CrossAccountId,152 token: TokenId,153 ) -> Result<u128, DispatchError> {154 dispatch_unique_runtime!(collection.allowance(sender, spender, token))155 }156157 fn adminlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {158 Ok(<pallet_common::Pallet<Runtime>>::adminlist(collection))159 }160 fn allowlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {161 Ok(<pallet_common::Pallet<Runtime>>::allowlist(collection))162 }163 fn allowed(collection: CollectionId, user: CrossAccountId) -> Result<bool, DispatchError> {164 Ok(<pallet_common::Pallet<Runtime>>::allowed(collection, user))165 }166 fn last_token_id(collection: CollectionId) -> Result<TokenId, DispatchError> {167 dispatch_unique_runtime!(collection.last_token_id())168 }169 fn collection_by_id(collection: CollectionId) -> Result<Option<RpcCollection<AccountId>>, DispatchError> {170 Ok(<pallet_common::Pallet<Runtime>>::rpc_collection(collection))171 }172 fn collection_stats() -> Result<CollectionStats, DispatchError> {173 Ok(<pallet_common::Pallet<Runtime>>::collection_stats())174 }175 fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<Option<u64>, DispatchError> {176 Ok(<UniqueSponsorshipPredict<Runtime> as SponsorshipPredict<Runtime>>::predict(177 collection,178 account,179 token180 ))181 }182183 fn effective_collection_limits(collection: CollectionId) -> Result<Option<CollectionLimits>, DispatchError> {184 Ok(<pallet_common::Pallet<Runtime>>::effective_collection_limits(collection))185 }186187 fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result<Option<u128>, DispatchError> {188 dispatch_unique_runtime!(collection.total_pieces(token_id))189 }190 }191192 impl app_promotion_rpc::AppPromotionApi<Block, BlockNumber, CrossAccountId, AccountId> for Runtime {193 fn total_staked(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {194 #[cfg(not(feature = "app-promotion"))]195 return unsupported!();196197 #[cfg(feature = "app-promotion")]198 return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked(staker).unwrap_or_default());199 }200201 fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>, DispatchError> {202 #[cfg(not(feature = "app-promotion"))]203 return unsupported!();204205 #[cfg(feature = "app-promotion")]206 return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked_per_block(staker));207 }208209 fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {210 #[cfg(not(feature = "app-promotion"))]211 return unsupported!();212213 #[cfg(feature = "app-promotion")]214 return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake(staker));215 }216217 fn pending_unstake_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>, DispatchError> {218 #[cfg(not(feature = "app-promotion"))]219 return unsupported!();220221 #[cfg(feature = "app-promotion")]222 return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake_per_block(staker))223 }224 }225226 impl rmrk_rpc::RmrkApi<227 Block,228 AccountId,229 RmrkCollectionInfo<AccountId>,230 RmrkInstanceInfo<AccountId>,231 RmrkResourceInfo,232 RmrkPropertyInfo,233 RmrkBaseInfo<AccountId>,234 RmrkPartType,235 RmrkTheme236 > for Runtime {237 fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {238 #[cfg(feature = "rmrk")]239 return pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>();240241 #[cfg(not(feature = "rmrk"))]242 return unsupported!();243 }244245 #[allow(unused_variables)]246 fn collection_by_id(collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {247 #[cfg(feature = "rmrk")]248 return pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id);249250 #[cfg(not(feature = "rmrk"))]251 return unsupported!();252 }253254 #[allow(unused_variables)]255 fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {256 #[cfg(feature = "rmrk")]257 return pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id);258259 #[cfg(not(feature = "rmrk"))]260 return unsupported!();261 }262263 #[allow(unused_variables)]264 fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {265 #[cfg(feature = "rmrk")]266 return pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id);267268 #[cfg(not(feature = "rmrk"))]269 return unsupported!();270 }271272 #[allow(unused_variables)]273 fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {274 #[cfg(feature = "rmrk")]275 return pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id);276277 #[cfg(not(feature = "rmrk"))]278 return unsupported!();279 }280281 #[allow(unused_variables)]282 fn collection_properties(283 collection_id: RmrkCollectionId,284 filter_keys: Option<Vec<RmrkPropertyKey>>285 ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {286 #[cfg(feature = "rmrk")]287 return pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys);288289 #[cfg(not(feature = "rmrk"))]290 return unsupported!();291 }292293 #[allow(unused_variables)]294 fn nft_properties(295 collection_id: RmrkCollectionId,296 nft_id: RmrkNftId,297 filter_keys: Option<Vec<RmrkPropertyKey>>298 ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {299 #[cfg(feature = "rmrk")]300 return pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys);301302 #[cfg(not(feature = "rmrk"))]303 return unsupported!();304 }305306 #[allow(unused_variables)]307 fn nft_resources(collection_id: RmrkCollectionId,nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {308 #[cfg(feature = "rmrk")]309 return pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id);310311 #[cfg(not(feature = "rmrk"))]312 return unsupported!();313 }314315 #[allow(unused_variables)]316 fn nft_resource_priority(317 collection_id: RmrkCollectionId,318 nft_id: RmrkNftId,319 resource_id: RmrkResourceId320 ) -> Result<Option<u32>, DispatchError> {321 #[cfg(feature = "rmrk")]322 return pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id);323324 #[cfg(not(feature = "rmrk"))]325 return unsupported!();326 }327328 #[allow(unused_variables)]329 fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {330 #[cfg(feature = "rmrk")]331 return pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id);332333 #[cfg(not(feature = "rmrk"))]334 return unsupported!();335 }336337 #[allow(unused_variables)]338 fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {339 #[cfg(feature = "rmrk")]340 return pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id);341342 #[cfg(not(feature = "rmrk"))]343 return unsupported!();344 }345346 #[allow(unused_variables)]347 fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {348 #[cfg(feature = "rmrk")]349 return pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id);350351 #[cfg(not(feature = "rmrk"))]352 return unsupported!();353 }354355 #[allow(unused_variables)]356 fn theme(357 base_id: RmrkBaseId,358 theme_name: RmrkThemeName,359 filter_keys: Option<Vec<RmrkPropertyKey>>360 ) -> Result<Option<RmrkTheme>, DispatchError> {361 #[cfg(feature = "rmrk")]362 return pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys);363364 #[cfg(not(feature = "rmrk"))]365 return unsupported!();366 }367 }368369 impl sp_api::Core<Block> for Runtime {370 fn version() -> RuntimeVersion {371 VERSION372 }373374 fn execute_block(block: Block) {375 Executive::execute_block(block)376 }377378 fn initialize_block(header: &<Block as BlockT>::Header) {379 Executive::initialize_block(header)380 }381 }382383 impl sp_api::Metadata<Block> for Runtime {384 fn metadata() -> OpaqueMetadata {385 OpaqueMetadata::new(Runtime::metadata().into())386 }387 }388389 impl sp_block_builder::BlockBuilder<Block> for Runtime {390 fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {391 Executive::apply_extrinsic(extrinsic)392 }393394 fn finalize_block() -> <Block as BlockT>::Header {395 Executive::finalize_block()396 }397398 fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {399 data.create_extrinsics()400 }401402 fn check_inherents(403 block: Block,404 data: sp_inherents::InherentData,405 ) -> sp_inherents::CheckInherentsResult {406 data.check_extrinsics(&block)407 }408409 // fn random_seed() -> <Block as BlockT>::Hash {410 // RandomnessCollectiveFlip::random_seed().0411 // }412 }413414 impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {415 fn validate_transaction(416 source: TransactionSource,417 tx: <Block as BlockT>::Extrinsic,418 hash: <Block as BlockT>::Hash,419 ) -> TransactionValidity {420 Executive::validate_transaction(source, tx, hash)421 }422 }423424 impl sp_offchain::OffchainWorkerApi<Block> for Runtime {425 fn offchain_worker(header: &<Block as BlockT>::Header) {426 Executive::offchain_worker(header)427 }428 }429430 impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {431 fn chain_id() -> u64 {432 <Runtime as pallet_evm::Config>::ChainId::get()433 }434435 fn account_basic(address: H160) -> EVMAccount {436 let (account, _) = EVM::account_basic(&address);437 account438 }439440 fn gas_price() -> U256 {441 let (price, _) = <Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price();442 price443 }444445 fn account_code_at(address: H160) -> Vec<u8> {446 EVM::account_codes(address)447 }448449 fn author() -> H160 {450 <pallet_evm::Pallet<Runtime>>::find_author()451 }452453 fn storage_at(address: H160, index: U256) -> H256 {454 let mut tmp = [0u8; 32];455 index.to_big_endian(&mut tmp);456 EVM::account_storages(address, H256::from_slice(&tmp[..]))457 }458459 #[allow(clippy::redundant_closure)]460 fn call(461 from: H160,462 to: H160,463 data: Vec<u8>,464 value: U256,465 gas_limit: U256,466 max_fee_per_gas: Option<U256>,467 max_priority_fee_per_gas: Option<U256>,468 nonce: Option<U256>,469 estimate: bool,470 access_list: Option<Vec<(H160, Vec<H256>)>>,471 ) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {472 let config = if estimate {473 let mut config = <Runtime as pallet_evm::Config>::config().clone();474 config.estimate = true;475 Some(config)476 } else {477 None478 };479480 let is_transactional = false;481 <Runtime as pallet_evm::Config>::Runner::call(482 CrossAccountId::from_eth(from),483 to,484 data,485 value,486 gas_limit.low_u64(),487 max_fee_per_gas,488 max_priority_fee_per_gas,489 nonce,490 access_list.unwrap_or_default(),491 is_transactional,492 config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),493 ).map_err(|err| err.error.into())494 }495496 #[allow(clippy::redundant_closure)]497 fn create(498 from: H160,499 data: Vec<u8>,500 value: U256,501 gas_limit: U256,502 max_fee_per_gas: Option<U256>,503 max_priority_fee_per_gas: Option<U256>,504 nonce: Option<U256>,505 estimate: bool,506 access_list: Option<Vec<(H160, Vec<H256>)>>,507 ) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {508 let config = if estimate {509 let mut config = <Runtime as pallet_evm::Config>::config().clone();510 config.estimate = true;511 Some(config)512 } else {513 None514 };515516 let is_transactional = false;517 <Runtime as pallet_evm::Config>::Runner::create(518 CrossAccountId::from_eth(from),519 data,520 value,521 gas_limit.low_u64(),522 max_fee_per_gas,523 max_priority_fee_per_gas,524 nonce,525 access_list.unwrap_or_default(),526 is_transactional,527 config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),528 ).map_err(|err| err.error.into())529 }530531 fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {532 Ethereum::current_transaction_statuses()533 }534535 fn current_block() -> Option<pallet_ethereum::Block> {536 Ethereum::current_block()537 }538539 fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {540 Ethereum::current_receipts()541 }542543 fn current_all() -> (544 Option<pallet_ethereum::Block>,545 Option<Vec<pallet_ethereum::Receipt>>,546 Option<Vec<TransactionStatus>>547 ) {548 (549 Ethereum::current_block(),550 Ethereum::current_receipts(),551 Ethereum::current_transaction_statuses()552 )553 }554555 fn extrinsic_filter(xts: Vec<<Block as sp_api::BlockT>::Extrinsic>) -> Vec<pallet_ethereum::Transaction> {556 xts.into_iter().filter_map(|xt| match xt.0.function {557 Call::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction),558 _ => None559 }).collect()560 }561562 fn elasticity() -> Option<Permill> {563 None564 }565 }566567 impl fp_rpc::ConvertTransactionRuntimeApi<Block> for Runtime {568 fn convert_transaction(transaction: pallet_ethereum::Transaction) -> <Block as BlockT>::Extrinsic {569 UncheckedExtrinsic::new_unsigned(570 pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),571 )572 }573 }574575 impl sp_session::SessionKeys<Block> for Runtime {576 fn decode_session_keys(577 encoded: Vec<u8>,578 ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {579 SessionKeys::decode_into_raw_public_keys(&encoded)580 }581582 fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {583 SessionKeys::generate(seed)584 }585 }586587 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {588 fn slot_duration() -> sp_consensus_aura::SlotDuration {589 sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())590 }591592 fn authorities() -> Vec<AuraId> {593 Aura::authorities().to_vec()594 }595 }596597 impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {598 fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {599 ParachainSystem::collect_collation_info(header)600 }601 }602603 impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {604 fn account_nonce(account: AccountId) -> Index {605 System::account_nonce(account)606 }607 }608609 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {610 fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {611 TransactionPayment::query_info(uxt, len)612 }613 fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {614 TransactionPayment::query_fee_details(uxt, len)615 }616 }617618 /*619 impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash>620 for Runtime621 {622 fn call(623 origin: AccountId,624 dest: AccountId,625 value: Balance,626 gas_limit: u64,627 input_data: Vec<u8>,628 ) -> pallet_contracts_primitives::ContractExecResult {629 Contracts::bare_call(origin, dest, value, gas_limit, input_data, false)630 }631632 fn instantiate(633 origin: AccountId,634 endowment: Balance,635 gas_limit: u64,636 code: pallet_contracts_primitives::Code<Hash>,637 data: Vec<u8>,638 salt: Vec<u8>,639 ) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, BlockNumber>640 {641 Contracts::bare_instantiate(origin, endowment, gas_limit, code, data, salt, true, false)642 }643644 fn get_storage(645 address: AccountId,646 key: [u8; 32],647 ) -> pallet_contracts_primitives::GetStorageResult {648 Contracts::get_storage(address, key)649 }650651 fn rent_projection(652 address: AccountId,653 ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {654 Contracts::rent_projection(address)655 }656 }657 */658659 #[cfg(feature = "runtime-benchmarks")]660 impl frame_benchmarking::Benchmark<Block> for Runtime {661 fn benchmark_metadata(extra: bool) -> (662 Vec<frame_benchmarking::BenchmarkList>,663 Vec<frame_support::traits::StorageInfo>,664 ) {665 use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};666 use frame_support::traits::StorageInfoTrait;667668 let mut list = Vec::<BenchmarkList>::new();669670 list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);671 list_benchmark!(list, extra, pallet_common, Common);672 list_benchmark!(list, extra, pallet_unique, Unique);673 list_benchmark!(list, extra, pallet_structure, Structure);674 list_benchmark!(list, extra, pallet_inflation, Inflation);675 list_benchmark!(list, extra, pallet_app_promotion, AppPromotion);676 list_benchmark!(list, extra, pallet_fungible, Fungible);677 list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);678679 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]680 list_benchmark!(list, extra, pallet_refungible, Refungible);681682 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]683 list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler);684685 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]686 list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);687688 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]689 list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);690691 // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);692693 let storage_info = AllPalletsReversedWithSystemFirst::storage_info();694695 return (list, storage_info)696 }697698 fn dispatch_benchmark(699 config: frame_benchmarking::BenchmarkConfig700 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {701 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};702703 let allowlist: Vec<TrackedStorageKey> = vec![704 // Total Issuance705 hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),706707 // Block Number708 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),709 // Execution Phase710 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),711 // Event Count712 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),713 // System Events714 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),715716 // Evm CurrentLogs717 hex_literal::hex!("1da53b775b270400e7e61ed5cbc5a146547f210cec367e9af919603343b9cb56").to_vec().into(),718719 // Transactional depth720 hex_literal::hex!("3a7472616e73616374696f6e5f6c6576656c3a").to_vec().into(),721 ];722723 let mut batches = Vec::<BenchmarkBatch>::new();724 let params = (&config, &allowlist);725726 add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);727 add_benchmark!(params, batches, pallet_common, Common);728 add_benchmark!(params, batches, pallet_unique, Unique);729 add_benchmark!(params, batches, pallet_structure, Structure);730 add_benchmark!(params, batches, pallet_inflation, Inflation);731 add_benchmark!(params, batches, pallet_app_promotion, AppPromotion);732 add_benchmark!(params, batches, pallet_fungible, Fungible);733 add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);734735 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]736 add_benchmark!(params, batches, pallet_refungible, Refungible);737738 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]739 add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler);740741 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]742 add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);743744 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]745 add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);746747 // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);748749 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }750 Ok(batches)751 }752 }753754 #[cfg(feature = "try-runtime")]755 impl frame_try_runtime::TryRuntime<Block> for Runtime {756 fn on_runtime_upgrade() -> (frame_support::pallet_prelude::Weight, frame_support::pallet_prelude::Weight) {757 log::info!("try-runtime::on_runtime_upgrade unique-chain.");758 let weight = Executive::try_runtime_upgrade().unwrap();759 (weight, crate::config::substrate::RuntimeBlockWeights::get().max_block)760 }761762 fn execute_block_no_check(block: Block) -> frame_support::pallet_prelude::Weight {763 Executive::execute_block_no_check(block)764 }765 }766 }767 }768}runtime/common/sponsoring.rsdiffbeforeafterboth--- a/runtime/common/sponsoring.rs
+++ b/runtime/common/sponsoring.rs
@@ -224,12 +224,12 @@
}
pub struct UniqueSponsorshipHandler<T>(PhantomData<T>);
-impl<T, C> SponsorshipHandler<T::AccountId, C> for UniqueSponsorshipHandler<T>
+impl<T, C> SponsorshipHandler<T::AccountId, C, u128> for UniqueSponsorshipHandler<T>
where
T: Config,
C: IsSubType<UniqueCall<T>>,
{
- fn get_sponsor(who: &T::AccountId, call: &C) -> Option<T::AccountId> {
+ fn get_sponsor(who: &T::AccountId, call: &C, _fee_limit: &u128) -> Option<T::AccountId> {
match IsSubType::<UniqueCall<T>>::is_sub_type(call)? {
UniqueCall::set_token_properties {
collection_id,
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -417,7 +417,7 @@
up-rpc = { path = "../../primitives/rpc", default-features = false }
app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
@@ -431,18 +431,18 @@
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
-pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
+pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" }
################################################################################
# Build Dependencies
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -418,7 +418,7 @@
pallet-unique = { path = '../../pallets/unique', default-features = false }
up-rpc = { path = "../../primitives/rpc", default-features = false }
app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
@@ -432,18 +432,18 @@
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
-pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
+pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" }
################################################################################
# Build Dependencies
runtime/tests/Cargo.tomldiffbeforeafterboth--- a/runtime/tests/Cargo.toml
+++ b/runtime/tests/Cargo.toml
@@ -16,7 +16,7 @@
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
@@ -25,8 +25,8 @@
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
pallet-common = { path = '../../pallets/common' }
pallet-structure = { path = '../../pallets/structure' }
@@ -43,4 +43,4 @@
scale-info = "*"
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" }
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -425,19 +425,19 @@
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
-pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
+pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" }
################################################################################
# Build Dependencies
tests/src/eth/api/ContractHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -131,6 +131,18 @@
function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
external;
+ /// @dev EVM selector for this function is: 0x1c362eb4,
+ /// or in textual repr: setSponsoringFeeLimit(address,uint128)
+ function setSponsoringFeeLimit(address contractAddress, uint128 feeLimit)
+ external;
+
+ /// @dev EVM selector for this function is: 0xc3fdc9ee,
+ /// or in textual repr: getSponsoringFeeLimit(address)
+ function getSponsoringFeeLimit(address contractAddress)
+ external
+ view
+ returns (uint128);
+
/// Is specified user present in contract allow list
/// @dev Contract owner always implicitly included
/// @param contractAddress Contract to check allowlist of
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -14,8 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+import * as solc from 'solc';
import {expect} from 'chai';
import {expectSubstrateEventsAtBlock} from '../util/helpers';
+import Web3 from 'web3';
+
import {
contractHelpers,
createEthAccountWithBalance,
@@ -26,7 +29,11 @@
createEthAccount,
ethBalanceViaSub,
normalizeEvents,
+ CompiledContract,
+ GAS_ARGS,
+ subToEth,
} from './util/helpers';
+import { submitTransactionAsync } from '../substrate/substrate-api';
describe('Sponsoring EVM contracts', () => {
itWeb3('Self sponsored can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => {
@@ -478,3 +485,174 @@
expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
});
});
+
+describe('Sponsoring Fee Limit', () => {
+
+ let testContract: CompiledContract;
+
+ function compileTestContract() {
+ if (!testContract) {
+ const input = {
+ language: 'Solidity',
+ sources: {
+ ['TestContract.sol']: {
+ content:
+ `
+ // SPDX-License-Identifier: MIT
+ pragma solidity ^0.8.0;
+
+ contract TestContract {
+ event Result(bool);
+ function test1() public {
+ uint256 counter = 0;
+ while(true) {
+ counter ++;
+ }
+ emit Result(true);
+ }
+
+ function test2() public {
+ uint256 counter = 0;
+ while(true) {
+ counter ++;
+ if (counter > 1){
+ break;
+ }
+ }
+ emit Result(true);
+ }
+ }
+ `,
+ },
+ },
+ settings: {
+ outputSelection: {
+ '*': {
+ '*': ['*'],
+ },
+ },
+ },
+ };
+ const json = JSON.parse(solc.compile(JSON.stringify(input)));
+ const out = json.contracts['TestContract.sol']['TestContract'];
+
+ testContract = {
+ abi: out.abi,
+ object: '0x' + out.evm.bytecode.object,
+ };
+ }
+ return testContract;
+ }
+
+ async function deployTestContract(web3: Web3, owner: string) {
+ const compiled = compileTestContract();
+ const testContract = new web3.eth.Contract(compiled.abi, undefined, {
+ data: compiled.object,
+ from: owner,
+ ...GAS_ARGS,
+ });
+ return await testContract.deploy({data: compiled.object}).send({from: owner});
+ }
+
+ itWeb3('Default fee limit', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const flipper = await deployFlipper(web3, owner);
+ const helpers = contractHelpers(web3, owner);
+ expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('340282366920938463463374607431768211455');
+ });
+
+ itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const flipper = await deployFlipper(web3, owner);
+ const helpers = contractHelpers(web3, owner);
+ await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send();
+ expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
+ });
+
+ itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const stranger = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const flipper = await deployFlipper(web3, owner);
+ const helpers = contractHelpers(web3, owner);
+ await expect(helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send({from: stranger})).to.be.rejected;
+ });
+
+ itWeb3('Negative test - check that eth transactions exceeding fee limit are not executed', async ({api, web3, privateKeyWrapper}) => {
+ const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const user = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+
+ const testContract = await deployTestContract(web3, owner);
+ const helpers = contractHelpers(web3, owner);
+
+ await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner});
+ await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner});
+
+ await helpers.methods.setSponsor(testContract.options.address, sponsor).send();
+ await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor});
+
+ const gasPrice = BigInt(await web3.eth.getGasPrice());
+
+ await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 30000n * gasPrice).send();
+
+ const originalUserBalance = await web3.eth.getBalance(user);
+ await testContract.methods.test2().send({from: user, gas: 30000});
+ expect(await web3.eth.getBalance(user)).to.be.equal(originalUserBalance);
+
+ await testContract.methods.test2().send({from: user, gas: 40000});
+ expect(await web3.eth.getBalance(user)).to.not.be.equal(originalUserBalance);
+ });
+
+ itWeb3('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({api, web3, privateKeyWrapper}) => {
+ const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+
+ const testContract = await deployTestContract(web3, owner);
+ const helpers = contractHelpers(web3, owner);
+
+ await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner});
+ await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner});
+
+ await helpers.methods.setSponsor(testContract.options.address, sponsor).send();
+ await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor});
+
+ const gasPrice = BigInt(await web3.eth.getGasPrice());
+
+ await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 30000n * gasPrice).send();
+
+ const alice = privateKeyWrapper('//Alice');
+ const originalAliceBalance = (await api.query.system.account(alice.address)).data.free.toBigInt();
+
+ await submitTransactionAsync(
+ alice,
+ api.tx.evm.call(
+ subToEth(alice.address),
+ testContract.options.address,
+ testContract.methods.test2().encodeABI(),
+ Uint8Array.from([]),
+ 30000n,
+ gasPrice,
+ null,
+ null,
+ [],
+ ),
+ );
+ expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.be.equal(originalAliceBalance);
+
+ await submitTransactionAsync(
+ alice,
+ api.tx.evm.call(
+ subToEth(alice.address),
+ testContract.options.address,
+ testContract.methods.test2().encodeABI(),
+ Uint8Array.from([]),
+ 40000n,
+ gasPrice,
+ null,
+ null,
+ [],
+ ),
+ );
+ expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.not.be.equal(originalAliceBalance);
+ });
+});
tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -134,6 +134,19 @@
"type": "address"
}
],
+ "name": "getSponsoringFeeLimit",
+ "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ }
+ ],
"name": "getSponsoringRateLimit",
"outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
"stateMutability": "view",
@@ -212,6 +225,20 @@
"name": "contractAddress",
"type": "address"
},
+ { "internalType": "uint128", "name": "feeLimit", "type": "uint128" }
+ ],
+ "name": "setSponsoringFeeLimit",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ },
{ "internalType": "uint8", "name": "mode", "type": "uint8" }
],
"name": "setSponsoringMode",