Here is OmniSwap's ethereum contract repository.
The deployment and testing of the project uses Brownie. Brownie is a Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.
pip install -r requirements.txt
Black is the uncompromising Python code formatter.
To get started right away with sensible defaults:
black {source_file_or_directory}
You can run Black as a package if running it as a script doesn't work:
python -m black {source_file_or_directory}
You can add your environment variables to a .env
file. You can use the .env.exmple as a template, just fill in the values and rename it to '.env'.
Here is what your .env
should look like:
export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
export PRIVATE_KEY=<PRIVATE_KEY>
brownie run --network {network} scripts/deploy.py
After deployment, all deployed contract addresses can be found in build/deployments/map.json
brownie run --network {network} scripts/initialize.py
Note that you need to Deploy and Initialize src-network and dst-network respectively before calling swap.py.
python -m scripts.swap
brownie networks modify polygon-test host=https://matic-mumbai.chainstacklabs.com chainid=80001
brownie networks add Arbitrum arbitrum-test host=https://rinkeby.arbitrum.io/rpc name=Testnet chainid=421611
brownie networks add Polygon zkevm-main host="https://zkevm-rpc.com" name="zkevm-main" chainid=1101