Security advisory: The permissionless WAB deployment configures its own DVN set at deploy
time. Child bridges may have varying security assumptions. Before bridging significant value
through a WAB child, users should verify the DVN configuration via
endpoint.getConfig(childAddress, sendLibrary, destinationEid, 2). Configurations with fewer than
2 required DVN attestations should be treated as single-point-of-failure risk.
Use this guide when you want to bridge an existing ERC20 from another chain (e.g. Sepolia) to Berachain using LayerZero V2 and the OFT (Omnichain Fungible Token) standard.
Repository
Official documentation
Requirements
- Node
v20.11.0 or greater, npm
- Wallet with Berachain testnet $BERA — Bepolia Faucet
- Wallet with Sepolia $UNI (or other source token) — see README for faucet/Uniswap
- Foundry
Stack
Solidity, Foundry (Forge scripts), Node.js, LayerZero V2 OFT.
Quick start
- Clone and install
- Create
.env with PRIVATE_KEY, SEPOLIA_ADAPTER_ADDRESS, BERACHAIN_OFT_ADDRESS (fill addresses after deploying).
- Deploy adapter on Sepolia
Set
SEPOLIA_ADAPTER_ADDRESS in .env.
- Deploy OFT on Berachain
Set
BERACHAIN_OFT_ADDRESS in .env.
- Bridge tokens
Key files