Quick demo on using OFT protocol to send tokens crosschain using LayerZero
Clone this repository. If you dont have foundry installed, set it up
Or, if your repo already exists, run:
forge build
Create a .env
file with following secrets
PRIV_KEY
MUMBAI_RPC
GOERLI_RPC
ETHERSCAN_API_KEY
POLYGONSCAN_API_KEY
At the moment, the codebase scripts are configured to bridge a token from mumbai testnet to goerli testnet. This can be changed by changing chain id and lz_endpoints in deploy.s.sol
- Run
make deploy_src
to deploy a sample token and proxy contract on the source chain - Run
make deploy_dest
to deploy receiver OFT contract on the destination chain - Run
make deploy_setup
to setup source chain contract to interact with destination contract - Run
make init_send
to initiate a token bridge call from source chain
This project uses Foundry. See the book for instructions on how to install and use Foundry.