Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy uniswap v1 and addLiquidity encounter InvalidJump #11

Open
CaptainVincent opened this issue Apr 26, 2021 · 0 comments
Open

Deploy uniswap v1 and addLiquidity encounter InvalidJump #11

CaptainVincent opened this issue Apr 26, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@CaptainVincent
Copy link

Reproduce issue in local node

Prepare local chain: https://github.com/ParaState/frontier/

  • Add default accounts with balance into chain spec for testing (used to deploy uniswap contract, erc20 token contract ...etc)

Modify frontier/template/node/src/chain_spec.rs

fn testnet_genesis(
	(...)
	// Alice
	vm_genesis.insert(H160::from_str(&"0x1BbE5edc5Caabf4517e40b766D64c3DEd86822Df").unwrap(), ETHAccount {
		nonce: U256::zero(),
		balance: "0x115eec47f6cf7e35000000".into(), // 21M Ether
		storage: BTreeMap::new(),
		code: [].into(),
	});
	// Bob
	vm_genesis.insert(H160::from_str(&"0x987652e1C2B3B953354A43171063499DCE16dC8f").unwrap(), ETHAccount {
		nonce: U256::zero(),
		balance: "0x115eec47f6cf7e35000000".into(), // 21M Ether
		storage: BTreeMap::new(),
		code: [].into(),
	});
	// Charlie
	vm_genesis.insert(H160::from_str(&"0x9f0764D2027c25aC68F341CA568BC3D51aab57A6").unwrap(), ETHAccount {
		nonce: U256::zero(),
		balance: "0x115eec47f6cf7e35000000".into(), // 21M Ether
		storage: BTreeMap::new(),
		code: [].into(),
	});
	(...)
}
  • Run node
cargo run --release --bin frontier-template-node -- \
  --dev \
  --validator \
  --execution=Native \
  --tmp \
  --unsafe-ws-external \
  --unsafe-rpc-external \
  --rpc-port=8545 \
  --rpc-methods=Unsafe

Test steps

使用 official frontier: https://github.com/paritytech/frontier

使用官方最新的 frontier 961e992, 也有相同的錯誤訊息, 要可以驗證的話除了以上流程, 有以下 4 點要注意

  1. ae1f911 chan id 要配合目前的環境改成 123
  2. c5ddafa block 相關的修正要跟
  3. chain_spec.rs 設定 account 是原來的 pallet_evm::GenesisAccount 而非我們 rename 的 ETHAccount
  4. frontier/frame/ethereum/src/lib.rs, 有擋 gas >= gaslimit, parastate-setup 網頁裡面是直接帶入 gas = gaslimit, 看是要改 UI 或是在這邊判斷式拿掉等於的 case
if transaction.gas_limit >= T::BlockGasLimit::get()
@CaptainVincent CaptainVincent added the bug Something isn't working label Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant