difftreelog
feat add sponsoring fee limit
in: master
37 files changed
Cargo.lockdiffbeforeafterboth117version = "0.1.0"117version = "0.1.0"118dependencies = [118dependencies = [119 "pallet-common",119 "pallet-common",120 "pallet-evm",120 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)",121 "parity-scale-codec 3.1.5",121 "parity-scale-codec 3.1.5",122 "sp-api",122 "sp-api",123 "sp-core",123 "sp-core",2324[[package]]2324[[package]]2325name = "fc-consensus"2325name = "fc-consensus"2326version = "2.0.0-dev"2326version = "2.0.0-dev"2327source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"2327source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2328dependencies = [2328dependencies = [2329 "async-trait",2329 "async-trait",2330 "fc-db",2330 "fc-db",2343[[package]]2343[[package]]2344name = "fc-db"2344name = "fc-db"2345version = "2.0.0-dev"2345version = "2.0.0-dev"2346source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"2346source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2347dependencies = [2347dependencies = [2348 "fp-storage",2348 "fp-storage",2349 "kvdb-rocksdb",2349 "kvdb-rocksdb",2359[[package]]2359[[package]]2360name = "fc-mapping-sync"2360name = "fc-mapping-sync"2361version = "2.0.0-dev"2361version = "2.0.0-dev"2362source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"2362source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2363dependencies = [2363dependencies = [2364 "fc-db",2364 "fc-db",2365 "fp-consensus",2365 "fp-consensus",2376[[package]]2376[[package]]2377name = "fc-rpc"2377name = "fc-rpc"2378version = "2.0.0-dev"2378version = "2.0.0-dev"2379source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"2379source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2380dependencies = [2380dependencies = [2381 "ethereum",2381 "ethereum",2382 "ethereum-types",2382 "ethereum-types",2416[[package]]2416[[package]]2417name = "fc-rpc-core"2417name = "fc-rpc-core"2418version = "1.1.0-dev"2418version = "1.1.0-dev"2419source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"2419source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2420dependencies = [2420dependencies = [2421 "ethereum",2421 "ethereum",2422 "ethereum-types",2422 "ethereum-types",2557[[package]]2557[[package]]2558name = "fp-consensus"2558name = "fp-consensus"2559version = "2.0.0-dev"2559version = "2.0.0-dev"2560source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"2560source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2561dependencies = [2561dependencies = [2562 "ethereum",2562 "ethereum",2563 "parity-scale-codec 3.1.5",2563 "parity-scale-codec 3.1.5",2580 "sp-std",2580 "sp-std",2581]2581]25822583[[package]]2584name = "fp-evm"2585version = "3.0.0-dev"2586source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2587dependencies = [2588 "evm",2589 "frame-support",2590 "impl-trait-for-tuples",2591 "parity-scale-codec 3.1.5",2592 "serde",2593 "sp-core",2594 "sp-std",2595]258225962583[[package]]2597[[package]]2584name = "fp-evm-mapping"2598name = "fp-evm-mapping"2589 "sp-core",2603 "sp-core",2590]2604]26052606[[package]]2607name = "fp-evm-mapping"2608version = "0.1.0"2609source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2610dependencies = [2611 "frame-support",2612 "sp-core",2613]259126142592[[package]]2615[[package]]2593name = "fp-rpc"2616name = "fp-rpc"2594version = "3.0.0-dev"2617version = "3.0.0-dev"2595source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"2618source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2596dependencies = [2619dependencies = [2597 "ethereum",2620 "ethereum",2598 "ethereum-types",2621 "ethereum-types",2599 "fp-evm",2622 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",2600 "parity-scale-codec 3.1.5",2623 "parity-scale-codec 3.1.5",2601 "scale-info",2624 "scale-info",2602 "sp-api",2625 "sp-api",2609[[package]]2632[[package]]2610name = "fp-self-contained"2633name = "fp-self-contained"2611version = "1.0.0-dev"2634version = "1.0.0-dev"2612source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"2635source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2613dependencies = [2636dependencies = [2614 "ethereum",2637 "ethereum",2615 "frame-support",2638 "frame-support",2625[[package]]2648[[package]]2626name = "fp-storage"2649name = "fp-storage"2627version = "2.0.0"2650version = "2.0.0"2628source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"2651source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"2629dependencies = [2652dependencies = [2630 "parity-scale-codec 3.1.5",2653 "parity-scale-codec 3.1.5",2631]2654]5152 "cumulus-primitives-utility",5175 "cumulus-primitives-utility",5153 "derivative",5176 "derivative",5154 "evm-coder",5177 "evm-coder",5155 "fp-evm-mapping",5178 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5156 "fp-rpc",5179 "fp-rpc",5157 "fp-self-contained",5180 "fp-self-contained",5158 "frame-benchmarking",5181 "frame-benchmarking",5172 "pallet-common",5195 "pallet-common",5173 "pallet-configuration",5196 "pallet-configuration",5174 "pallet-ethereum",5197 "pallet-ethereum",5175 "pallet-evm",5198 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5176 "pallet-evm-coder-substrate",5199 "pallet-evm-coder-substrate",5177 "pallet-evm-contract-helpers",5200 "pallet-evm-contract-helpers",5178 "pallet-evm-migration",5201 "pallet-evm-migration",5320 "frame-system",5343 "frame-system",5321 "pallet-balances",5344 "pallet-balances",5322 "pallet-common",5345 "pallet-common",5323 "pallet-evm",5346 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)",5324 "pallet-evm-contract-helpers",5347 "pallet-evm-contract-helpers",5325 "pallet-evm-migration",5348 "pallet-evm-migration",5326 "pallet-randomness-collective-flip",5349 "pallet-randomness-collective-flip",5445[[package]]5468[[package]]5446name = "pallet-base-fee"5469name = "pallet-base-fee"5447version = "1.0.0"5470version = "1.0.0"5448source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"5471source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"5449dependencies = [5472dependencies = [5450 "fp-evm",5473 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5451 "frame-support",5474 "frame-support",5452 "frame-system",5475 "frame-system",5453 "parity-scale-codec 3.1.5",5476 "parity-scale-codec 3.1.5",5556dependencies = [5579dependencies = [5557 "ethereum",5580 "ethereum",5558 "evm-coder",5581 "evm-coder",5559 "fp-evm-mapping",5582 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5560 "frame-benchmarking",5583 "frame-benchmarking",5561 "frame-support",5584 "frame-support",5562 "frame-system",5585 "frame-system",5563 "pallet-evm",5586 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5564 "pallet-evm-coder-substrate",5587 "pallet-evm-coder-substrate",5565 "parity-scale-codec 3.1.5",5588 "parity-scale-codec 3.1.5",5566 "scale-info",5589 "scale-info",5575name = "pallet-configuration"5598name = "pallet-configuration"5576version = "0.1.1"5599version = "0.1.1"5577dependencies = [5600dependencies = [5578 "fp-evm",5601 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5579 "frame-support",5602 "frame-support",5580 "frame-system",5603 "frame-system",5581 "parity-scale-codec 3.1.5",5604 "parity-scale-codec 3.1.5",5660[[package]]5683[[package]]5661name = "pallet-ethereum"5684name = "pallet-ethereum"5662version = "4.0.0-dev"5685version = "4.0.0-dev"5663source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"5686source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"5664dependencies = [5687dependencies = [5665 "ethereum",5688 "ethereum",5666 "ethereum-types",5689 "ethereum-types",5667 "evm",5690 "evm",5668 "fp-consensus",5691 "fp-consensus",5669 "fp-evm",5692 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5670 "fp-evm-mapping",5693 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5671 "fp-rpc",5694 "fp-rpc",5672 "fp-self-contained",5695 "fp-self-contained",5673 "fp-storage",5696 "fp-storage",5674 "frame-support",5697 "frame-support",5675 "frame-system",5698 "frame-system",5676 "log",5699 "log",5677 "pallet-evm",5700 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5678 "pallet-timestamp",5701 "pallet-timestamp",5679 "parity-scale-codec 3.1.5",5702 "parity-scale-codec 3.1.5",5680 "rlp",5703 "rlp",5692source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"5715source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"5693dependencies = [5716dependencies = [5694 "evm",5717 "evm",5695 "fp-evm",5718 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)",5696 "fp-evm-mapping",5719 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)",5697 "frame-benchmarking",5720 "frame-benchmarking",5698 "frame-support",5721 "frame-support",5699 "frame-system",5722 "frame-system",5713 "sp-std",5736 "sp-std",5714]5737]57385739[[package]]5740name = "pallet-evm"5741version = "6.0.0-dev"5742source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d"5743dependencies = [5744 "evm",5745 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5746 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5747 "frame-benchmarking",5748 "frame-support",5749 "frame-system",5750 "hex",5751 "impl-trait-for-tuples",5752 "log",5753 "pallet-timestamp",5754 "parity-scale-codec 3.1.5",5755 "primitive-types",5756 "rlp",5757 "scale-info",5758 "serde",5759 "sha3 0.10.2",5760 "sp-core",5761 "sp-io",5762 "sp-runtime",5763 "sp-std",5764]571557655716[[package]]5766[[package]]5717name = "pallet-evm-coder-substrate"5767name = "pallet-evm-coder-substrate"5723 "frame-support",5773 "frame-support",5724 "frame-system",5774 "frame-system",5725 "pallet-ethereum",5775 "pallet-ethereum",5726 "pallet-evm",5776 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5727 "parity-scale-codec 3.1.5",5777 "parity-scale-codec 3.1.5",5728 "scale-info",5778 "scale-info",5729 "sp-core",5779 "sp-core",5737dependencies = [5787dependencies = [5738 "ethereum",5788 "ethereum",5739 "evm-coder",5789 "evm-coder",5740 "fp-evm-mapping",5790 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5741 "frame-support",5791 "frame-support",5742 "frame-system",5792 "frame-system",5743 "log",5793 "log",5744 "pallet-common",5794 "pallet-common",5745 "pallet-evm",5795 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5746 "pallet-evm-coder-substrate",5796 "pallet-evm-coder-substrate",5747 "parity-scale-codec 3.1.5",5797 "parity-scale-codec 3.1.5",5748 "scale-info",5798 "scale-info",5757name = "pallet-evm-migration"5807name = "pallet-evm-migration"5758version = "0.1.1"5808version = "0.1.1"5759dependencies = [5809dependencies = [5760 "fp-evm",5810 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5761 "frame-benchmarking",5811 "frame-benchmarking",5762 "frame-support",5812 "frame-support",5763 "frame-system",5813 "frame-system",5764 "pallet-evm",5814 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5765 "parity-scale-codec 3.1.5",5815 "parity-scale-codec 3.1.5",5766 "scale-info",5816 "scale-info",5767 "sp-core",5817 "sp-core",5774name = "pallet-evm-transaction-payment"5824name = "pallet-evm-transaction-payment"5775version = "0.1.1"5825version = "0.1.1"5776dependencies = [5826dependencies = [5777 "fp-evm",5827 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5778 "fp-evm-mapping",5828 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5779 "frame-support",5829 "frame-support",5780 "frame-system",5830 "frame-system",5781 "pallet-ethereum",5831 "pallet-ethereum",5782 "pallet-evm",5832 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5783 "parity-scale-codec 3.1.5",5833 "parity-scale-codec 3.1.5",5784 "scale-info",5834 "scale-info",5785 "sp-core",5835 "sp-core",5799 "frame-support",5849 "frame-support",5800 "frame-system",5850 "frame-system",5801 "pallet-common",5851 "pallet-common",5802 "pallet-evm",5852 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",5803 "pallet-evm-coder-substrate",5853 "pallet-evm-coder-substrate",5804 "pallet-structure",5854 "pallet-structure",5805 "parity-scale-codec 3.1.5",5855 "parity-scale-codec 3.1.5",6041 "frame-support",6091 "frame-support",6042 "frame-system",6092 "frame-system",6043 "pallet-common",6093 "pallet-common",6044 "pallet-evm",6094 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",6045 "pallet-evm-coder-substrate",6095 "pallet-evm-coder-substrate",6046 "pallet-structure",6096 "pallet-structure",6047 "parity-scale-codec 3.1.5",6097 "parity-scale-codec 3.1.5",6164 "frame-support",6214 "frame-support",6165 "frame-system",6215 "frame-system",6166 "pallet-common",6216 "pallet-common",6167 "pallet-evm",6217 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",6168 "pallet-evm-coder-substrate",6218 "pallet-evm-coder-substrate",6169 "pallet-structure",6219 "pallet-structure",6170 "parity-scale-codec 3.1.5",6220 "parity-scale-codec 3.1.5",6185 "frame-support",6235 "frame-support",6186 "frame-system",6236 "frame-system",6187 "pallet-common",6237 "pallet-common",6188 "pallet-evm",6238 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",6189 "pallet-nonfungible",6239 "pallet-nonfungible",6190 "pallet-structure",6240 "pallet-structure",6191 "parity-scale-codec 3.1.5",6241 "parity-scale-codec 3.1.5",6205 "frame-support",6255 "frame-support",6206 "frame-system",6256 "frame-system",6207 "pallet-common",6257 "pallet-common",6208 "pallet-evm",6258 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",6209 "pallet-nonfungible",6259 "pallet-nonfungible",6210 "pallet-rmrk-core",6260 "pallet-rmrk-core",6211 "parity-scale-codec 3.1.5",6261 "parity-scale-codec 3.1.5",6335 "frame-support",6385 "frame-support",6336 "frame-system",6386 "frame-system",6337 "pallet-common",6387 "pallet-common",6338 "pallet-evm",6388 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",6339 "parity-scale-codec 3.1.5",6389 "parity-scale-codec 3.1.5",6340 "scale-info",6390 "scale-info",6341 "sp-std",6391 "sp-std",6359[[package]]6409[[package]]6360name = "pallet-template-transaction-payment"6410name = "pallet-template-transaction-payment"6361version = "3.0.0"6411version = "3.0.0"6362source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04"6412source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3#a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3"6363dependencies = [6413dependencies = [6364 "frame-benchmarking",6414 "frame-benchmarking",6365 "frame-support",6415 "frame-support",6482 "frame-support",6532 "frame-support",6483 "frame-system",6533 "frame-system",6484 "pallet-common",6534 "pallet-common",6485 "pallet-evm",6535 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",6486 "pallet-evm-coder-substrate",6536 "pallet-evm-coder-substrate",6487 "pallet-nonfungible",6537 "pallet-nonfungible",6488 "pallet-refungible",6538 "pallet-refungible",8385 "cumulus-primitives-utility",8435 "cumulus-primitives-utility",8386 "derivative",8436 "derivative",8387 "evm-coder",8437 "evm-coder",8388 "fp-evm-mapping",8438 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",8389 "fp-rpc",8439 "fp-rpc",8390 "fp-self-contained",8440 "fp-self-contained",8391 "frame-benchmarking",8441 "frame-benchmarking",8405 "pallet-common",8455 "pallet-common",8406 "pallet-configuration",8456 "pallet-configuration",8407 "pallet-ethereum",8457 "pallet-ethereum",8408 "pallet-evm",8458 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",8409 "pallet-evm-coder-substrate",8459 "pallet-evm-coder-substrate",8410 "pallet-evm-contract-helpers",8460 "pallet-evm-contract-helpers",8411 "pallet-evm-migration",8461 "pallet-evm-migration",11650version = "0.1.1"11700version = "0.1.1"11651dependencies = [11701dependencies = [11652 "evm-coder",11702 "evm-coder",11653 "fp-evm-mapping",11703 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",11654 "frame-support",11704 "frame-support",11655 "frame-system",11705 "frame-system",11656 "pallet-balances",11706 "pallet-balances",11657 "pallet-common",11707 "pallet-common",11658 "pallet-ethereum",11708 "pallet-ethereum",11659 "pallet-evm",11709 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",11660 "pallet-evm-coder-substrate",11710 "pallet-evm-coder-substrate",11661 "pallet-fungible",11711 "pallet-fungible",11662 "pallet-nonfungible",11712 "pallet-nonfungible",12153 "app-promotion-rpc",12203 "app-promotion-rpc",12154 "jsonrpsee",12204 "jsonrpsee",12155 "pallet-common",12205 "pallet-common",12156 "pallet-evm",12206 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",12157 "parity-scale-codec 3.1.5",12207 "parity-scale-codec 3.1.5",12158 "rmrk-rpc",12208 "rmrk-rpc",12159 "sp-api",12209 "sp-api",12379 "cumulus-primitives-utility",12429 "cumulus-primitives-utility",12380 "derivative",12430 "derivative",12381 "evm-coder",12431 "evm-coder",12382 "fp-evm-mapping",12432 "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",12383 "fp-rpc",12433 "fp-rpc",12384 "fp-self-contained",12434 "fp-self-contained",12385 "frame-benchmarking",12435 "frame-benchmarking",12399 "pallet-common",12449 "pallet-common",12400 "pallet-configuration",12450 "pallet-configuration",12401 "pallet-ethereum",12451 "pallet-ethereum",12402 "pallet-evm",12452 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",12403 "pallet-evm-coder-substrate",12453 "pallet-evm-coder-substrate",12404 "pallet-evm-contract-helpers",12454 "pallet-evm-contract-helpers",12405 "pallet-evm-migration",12455 "pallet-evm-migration",12485dependencies = [12535dependencies = [12486 "fp-rpc",12536 "fp-rpc",12487 "frame-support",12537 "frame-support",12488 "pallet-evm",12538 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",12489 "sp-consensus-aura",12539 "sp-consensus-aura",12490 "sp-core",12540 "sp-core",12491 "sp-runtime",12541 "sp-runtime",12499 "derivative",12549 "derivative",12500 "frame-support",12550 "frame-support",12501 "frame-system",12551 "frame-system",12502 "pallet-evm",12552 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",12503 "parity-scale-codec 3.1.5",12553 "parity-scale-codec 3.1.5",12504 "rmrk-traits",12554 "rmrk-traits",12505 "scale-info",12555 "scale-info",12515version = "0.1.3"12565version = "0.1.3"12516dependencies = [12566dependencies = [12517 "pallet-common",12567 "pallet-common",12518 "pallet-evm",12568 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)",12519 "parity-scale-codec 3.1.5",12569 "parity-scale-codec 3.1.5",12520 "sp-api",12570 "sp-api",12521 "sp-core",12571 "sp-core",12527[[package]]12577[[package]]12528name = "up-sponsorship"12578name = "up-sponsorship"12529version = "0.1.0"12579version = "0.1.0"12530source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04"12580source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3#a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3"12531dependencies = [12581dependencies = [12532 "impl-trait-for-tuples",12582 "impl-trait-for-tuples",12533]12583]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.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -48,7 +48,8 @@
};
use pallet_evm::{
Runner, account::CrossAccountId as _,
- Account as EVMAccount, FeeCalculator,
+ Account as EVMAccount,
+ FeeCalculator
};
use runtime_common::{
sponsoring::{SponsorshipPredict, UniqueSponsorshipPredict},
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",