Skip to content

Commit

Permalink
Add evm support (#17)
Browse files Browse the repository at this point in the history
* WIP: Upgrade substrate

* Upgrade substrate to ce1746ddf6588c8f9ecfb77411c3cac7a2c09db3

* Update Cargo.lock

* Fix cargo check --features=runtime-benchmarks

* Upgrade substrate to e1ddbb3ffec3c8f05de6cb05d9f5f7a922788c3f

* Add `LightSyncStateExtension` to the chain spec as an extension

* Upgrade substrate to eb4de697ccd45948254db422abbcd735ae3c295a

* cargo fmt

* Upgrade substrate to ba153b9ae050eda022f002d74d76f98d1e339a81

Enrich metadata with type information paritytech/substrate#8615

* Upgrade substrate to 435f56edc14a3a7e895ff5370f6e5179dc547cc4

* Upgrade substrate to 88b4fc861129b63b445492e3088d7f12382f0128

* Upgrade substrate to ce3c31f2bfa7e10817a8a0833faddeaee818910d

* Upgrade substrate to 7fcebc86856164a346f6762d339e8cc3b6ec9d30

* Upgrade substrate to bf9683eee40f82cc4e01a05cd375b0e8bba3c8ef

* Upgrade substrate to 12b6441ef138303f50fa2fb20895fbf57c8e4735 (polkadot-v0.9.12-without-cache)

* Upgrade substrate to e09e70a3d14b3757de0be427c6ac22dfc6fcd498 (purestake/substrate-polkadot-0.9.12)

* bump to edition 2021; fix compile errors

* Upgrade substrate to 3a5aa8c1a48b015b12e2419fa76b2e2530b3ac75 (purestake/substrate-polkadot-0.9.13)

* Fix node compile error

* Downgrade substrate to c881b9c86df5d0e4e3607921598768a3ab8ccdc8 (PureStake/frontier#moonbeam-polkadot-v0.9.13)

* init pallet-evm from purestake

* Use purestake/substrate branch moonbeam-polkadot-v0.9.13 for consistency

* Add evm to genesis config

* CI: bump rust toolchain version to nightly-2021-12-13

* add pallet-ethereum: init

* install pallet ethereum and self contained unchecked extrinsic

* impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime

* disable node/testing

* Add NetApi RPC endpoint

* debug1

* fix compile error

* add transaction converter

* use opaque::Block

* Add Eth RPC

* add pallet-deposit for transferring fund from substrate to evm

* prefund accounts

* set eth chainid to 12191

* set ss58prefix to 42

* use forked frontier

* bump frontier: add evm decimal converter

* patch ss58-registry

* Revert "set ss58prefix to 42"

This reverts commit c7d6c0d.

* bump frontier: add TokenDecimals support in pallet-evm

* pallet-evm: set CallOrigin/WithdrawOrigin to EnsureAddressTruncated

* drop FrontierBlockImport consensus support to maintain backward compatibility

* add pallet-template

* upgrade frontier(pallet-evm): add fn token_decimals() -> u8

* add standard precompiles

* add PalletTemplatePrecompile

* create pallet-template-precompiles under /precompiles

* deposit: add benchmarking

* add PalletTemplateInterface.sol

* pallet-template-precompiles: fix do_something() dispatch

* add pallet-evm-precompile-balances-erc20 from moonbeam

* pallet-template-precompiles: fix deps repo

* init withdraw-balance-precompiles

* add withdraw-balance-precompiles to runtime

* pallet-evm: impl custom FeeCalculator and GasWeightMapping

* withdraw balance debug

* withdraw-balance: fix compile errors

* add nftmart-nft-precompiles

* init nftmart-{auction,order}-precompiles

* update nftmart-* precompiles contract interface

* add pallet-nop and precompiles for debugging

* add frame-system-precompiles

* initialize precompile opcode placeholder to allow calling from other contracts

* nftmart-nft-precompiles: add arg parsing logic

* add account type conversion

* nftmart-nft-precompiles: dispatch_call: burn

* nftmart-nft-precompiles: dispatch_call: mint

* nftmart-nft-precompiles: dispatch_call: destroy_class

* nftmart-nft-precompiles: dispatch_call: create_class

* nftmart-nft-precompiles: dispatch_call: proxy_mint

* sp-arithmetic: turn off default-features to make compiler happy

* precompiles: add write methods for all nft pallets

* rewrite precompiles with BTreeMap

* Add return value to createClass()

* impl EvmData for NftItem

* add pallet-ethereum-chain-id to make chain_id configurable

* fix token decimals

* fix withdraw-balance precompile gasometer

* init pallet-staking-precompiles

* pallet-staking-precompiles: add chill()

* init pallet-identity

* pallet-staking-precompiles: add more methods

* nftmart-nft-precompiles: add read methods

* debug: disable non essential precompiles

* precompiles/utils: reduce warning

* pallet-identity-precompiles: add set_name()

* ethereum-chain-id: add setter method

* runtime: expose EthereumChainId's methods

* bump runtime version to 280

* housekeeping

* fix cargo bench --features runtime-benchmarks

* bump frontier

* fix readme

* add cargo doc workflow build step

* frontier: use associated const for TOKEN_DECIMAL

git grep github.com/purestake/substrate | cut -d : -f 1 | sort -u | xargs sed -i -e s,github.com/purestake/substrate,github.com/nftt-studio/substrate,g

Co-authored-by: navigaid <navigaid@gmail.com>
  • Loading branch information
btwiuse and navigaid authored Jun 23, 2022
1 parent b6f6107 commit 424ffcc
Show file tree
Hide file tree
Showing 135 changed files with 13,399 additions and 4,198 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:

- name: Install Rustup
run: |
rustup install nightly-2021-09-01
rustup default nightly-2021-09-01
rustup install nightly-2021-12-13
rustup default nightly-2021-12-13
rustup target add wasm32-unknown-unknown
- name: Setup Cache
Expand All @@ -43,6 +43,15 @@ jobs:
./target/release/nftmart-node
./target/release/nftmart-aura-node
- run: cargo doc

- name: archive doc
uses: actions/upload-artifact@v2
with:
name: doc
path: |
./target/doc/
push:
needs:
- build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:

- name: Install Rustup
run: |
rustup install nightly-2021-09-01
rustup default nightly-2021-09-01
rustup install nightly-2021-12-13
rustup default nightly-2021-12-13
rustup target add wasm32-unknown-unknown
- name: Check Build
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
node_modules/

/data

target
5 changes: 4 additions & 1 deletion .maintain/frame-weight-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(clippy::all)]

use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use sp_std::marker::PhantomData;
Expand All @@ -47,7 +46,11 @@ pub trait WeightInfo {

/// Weights for {{pallet}} using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
{{~#if (eq pallet "frame_system")}}
impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {
{{~else}}
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
{{~/if}}
{{~#each benchmarks as |benchmark|}}
{{~#each benchmark.comments as |comment|}}
// {{comment}}
Expand Down
Loading

0 comments on commit 424ffcc

Please sign in to comment.