[chain] Binance Smart Chain (Bifrost Refactor Avalanche -> EVM)
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:
- Chain defined in
common
- Token list defined in
common/tokenlist
- Bifrost chain configuration defined in
config/default.yaml
If desired in mocknet the following additions are also required:
- Daemon added to Docker Compose configuration
- Extend
build/scripts/evm/evm-tool.py
with the new chain/endpoint - Extend the chain list in
build/scripts/core-unsafe.sh
- Extend
scripts/run-mocknet-fork.sh
andtools/hardhat/init.js
ifmake 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
.