Skip to content

[chain] Binance Smart Chain (Bifrost Refactor Avalanche -> EVM)

Ursa (9R) requested to merge ursa/bsc into develop

This contains refactoring of the avalanche client package into a common evm package and the addition of Binance Smart Chain. This extends the tooling to support a make run-mocknet-fork-<chain> target for EVM chains - which will fork the mainnet chain state and automatically mint 100K USDC for the corresponding chain to the admin key used by build/scripts/evm/evm-tool.py (for aggregator swap in/out testing). In order to support this functionality the mainnet USDC tokens have been added to the testnet whitelist and the mainnet aggregator contracts have been appended to the mocknet DEX aggregator list.

Future EVM chains should be a small addition, requiring just:

  1. Chain defined in common
  2. Token list defined in common/tokenlist
  3. Bifrost chain configuration defined in config/default.yaml

If desired in mocknet the following additions are also required:

  1. Daemon added to Docker Compose configuration
  2. Extend build/scripts/evm/evm-tool.py with the new chain/endpoint
  3. Extend the chain list in build/scripts/core-unsafe.sh
  4. Extend scripts/run-mocknet-fork.sh and tools/hardhat/init.js if make run-mocknet-fork-<chain> is desired

Future Work

This change consolidates the existing non-Ethereum EVM chains into a single chain client package, but there still remains some cleanup that should occur separately to consolidate bifrost/pkg/chainclients/ethereum and bifrost/pkg/chainclients/shared/evm into the new bifrost/pkg/chainclients/evm.

Merge request reports