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 useIf using MacOS:
pnpm i @nomicfoundation/edr-darwin-arm64We recommend using pnpm as a package manager (but you can of course use a package manager of your choice):
pnpm installCompile contracts:
forge compileRunning tests:
forge testSet 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:deployDefine chains to support within layerzero.config with list of supported networks
Wire up contracts:
npx hardhat lz:oapp:wire --oapp-config layerzero.config.tsSee configuration:
npx hardhat lz:oapp:config:get:defaultTo bridge from Sepolia Base to Seplia Ethereum:
npx hardhat run scripts/bridge.ts --network base_sepoliaAnd other way around:
npx hardhat run scripts/bridge.ts --network sepolia