This ERC20 token implementation utilizes LayerZero library for Omnichain Fungible token (OFT) and Permit functionality which allows gasless token approvals.
Use proper node version:
nvm use
If using MacOS:
pnpm i @nomicfoundation/edr-darwin-arm64
We recommend using pnpm
as a package manager (but you can of course use a package manager of your choice):
pnpm install
Compile contracts:
forge compile
Running tests:
forge test
Set up deployer wallet/account:
Please read carefully: To achieve same contract addresses on both network use the same nonce on both chains.
- Rename
.env.example
->.env
- Choose your preferred means of setting up your deployer wallet/account:
To deploy your contracts to your desired blockchains, run the following command in your project's folder:
npx hardhat lz:deploy
Define chains to support within layerzero.config with list of supported networks
Wire up contracts:
npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts
See configuration:
npx hardhat lz:oapp:config:get:default
To bridge from Sepolia Base to Seplia Ethereum:
npx hardhat run scripts/bridge.ts --network base_sepolia
And other way around:
npx hardhat run scripts/bridge.ts --network sepolia