Omnichain Token (OFT) Development with LayerZero
In our practice, the standard approach to multi-chain tokens is the wrap/bridge model. The original token on Ethereum, with a wrapped version on each other chain via a bridge. Problem: liquidity is fragmented, the canonical supply is unclear, the user holds 'USDC-Polygon' separate from 'USDC-Arbitrum', and bridge risks multiply with the number of chains. This leads to confusion and increased vulnerability: if the bridge contract is hacked, the entire locked TVL is at risk.
OFT (Omnichain Fungible Token) from LayerZero solves this differently: one contract on each chain, unified supply, transfers between chains work via burn-and-mint without wrapping. The token on Arbitrum is the same token, not a wrapped copy. Over 5+ years in the market, we have implemented 30+ such projects for DeFi protocols, NFT marketplaces, and gaming.
How OFT Differs from the Wrap/Bridge Model
| Characteristic | OFT (burn-and-mint) | Wrap/Bridge Model |
|---|---|---|
| Liquidity | Unified across all networks | Fragmented per network |
| Hack risk | Only LayerZero messaging layer (distributed) | Bridge contract — single point of failure |
| User experience | One token address, consistent balance | Different addresses for different networks |
| Deployment complexity | N contracts, wire-up | 1 contract + bridge router |
| Gas costs | 30% lower (depends on DVN configuration) | High (bridge + wrap) |
OFT reduces risks by 10x, eliminating the single point of failure of a bridge.
How the Burn-and-Mint Mechanism Works
Transfer: Arbitrum → Optimism 1. User calls oft.send() on Arbitrum 2. OFT contract burns X tokens on Arbitrum (decreases supply) 3. LayerZero relayer sends message to Optimism 4. OFT contract on Optimism mints X tokens (increases supply) 5. Total supply across chains unchanged In OFT, there is no central bridge contract with locked assets. There is no 'TVL in the bridge' that can be hacked. Only the LayerZero messaging layer can be attacked — that's a separate risk, not an 'all-in-one' compromise.
How to Implement an OFT Contract in Solidity
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { OFT } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFT.sol"; contract MyOFT is OFT { constructor( string memory _name, string memory _symbol, address _lzEndpoint, // LayerZero endpoint for this chain address _delegate // owner/admin ) OFT(_name, _symbol, _lzEndpoint, _delegate) {} // Mint only on home chain (usually) function mint(address to, uint256 amount) external onlyOwner { _mint(to, amount); } } Deploy the same contract on each target chain. The only difference is _lzEndpoint — the LayerZero endpoint address is specific to each chain.
Configuring Peers (Wire-up)
After deploying on all chains, connect the contracts to each other. Each OFT must know the addresses of its peers.
import { ethers } from "ethers" import { Options } from "@layerzerolabs/lz-v2-utilities" const oftArbitrum = new ethers.Contract(OFT_ARBITRUM, OFT_ABI, signerArbitrum) const optimismPeerBytes32 = ethers.zeroPadValue(OFT_OPTIMISM, 32) await oftArbitrum.setPeer(LZ_EIDS.optimism, optimismPeerBytes32) const oftOptimism = new ethers.Contract(OFT_OPTIMISM, OFT_ABI, signerOptimism) await oftOptimism.setPeer(LZ_EIDS.arbitrum, ethers.zeroPadValue(OFT_ARBITRUM, 32)) This is not automatic — you must call setPeer for each pair of chains. For N chains: N*(N-1) calls.
Sending Tokens Between Chains
const oft = new ethers.Contract(OFT_ARBITRUM, OFT_ABI, signer) const sendParam = { dstEid: LZ_EIDS.optimism, to: ethers.zeroPadValue(recipientAddress, 32), amountLD: ethers.parseEther("100"), minAmountLD: ethers.parseEther("99"), extraOptions: "0x", composeMsg: "0x", oftCmd: "0x", } const [nativeFee, lzTokenFee] = await oft.quoteSend(sendParam, false) const tx = await oft.send(sendParam, { nativeFee, lzTokenFee: 0n }, signer.address, { value: nativeFee }) const receipt = await tx.wait() // Tokens on Arbitrum burned // After ~15-60 seconds, they appear on Optimism Decimals: A Potential Pitfall
Different chains may have different native decimals. Solana uses 6 decimals (lamports), EVM uses 18. OFT v2 solves this with shared decimals: all chains work with the smaller number (usually 6), converting on send. When sending from EVM (18 decimals), extra digits after the decimal point are truncated — this is called dust. It's important to show the user the actual received amount amountReceivedLD, not the original input.
What is OFTAdapter and When Is It Needed?
If a token already exists on Ethereum and its contract cannot be modified (no mint/burn functions in the needed context) — we use OFTAdapter. On Ethereum: Lock&Release (tokens locked in adapter). On other chains: OFT with burn&mint. Compromise: Ethereum-locked tokens reintroduce bridge risk. For critical projects, we use multisig and a cap on locked amount.
How to Configure DVN for Maximum Security
LayerZero V2 allows configuring DVN (Decentralized Verifier Network) — who verifies cross-chain messages. For production OFT with large TVL, we configure at least two independent DVNs (LayerZero + Google Cloud DVN or Polyhedra). Compromise: more DVNs = higher fees, but better security. We guarantee correct DVN configuration for your budget.
Monitoring and Handling Failed Messages
A message can get stuck if the destination chain is temporarily unavailable or gas insufficient. LayerZero V2 stores failed messages; they can be retried via the LayerZero Scan API. For UX: show the user the cross-chain transaction status via custom polling or an embeddable widget.
Work Process
| Step | Duration | Description |
|---|---|---|
| Preparation | 3-5 days | Chain list, tokenomics, security requirements |
| Development | 1-2 weeks | OFT contracts, Foundry tests, deploy scripts, wire-up |
| Testing | 1 week | Testnet deploy, functional tests, decimals check, load test |
| Mainnet deploy | 2-3 days | Verification on explorers, test small-amount transaction |
A basic OFT for 3-5 chains takes 3-4 weeks. With OFTAdapter for an existing token, custom DVN, and monitoring dashboard — 5-7 weeks.
What's included
- Tokenomics audit and target network selection
- Writing and testing OFT / OFTAdapter smart contracts
- Creating deployment scripts for all networks (Hardhat/Foundry)
- DVN and enforced options configuration
- Contract verification on each chain's explorer
- Frontend integration (ethers.js / viem)
- Integration documentation
- One month post-deployment support
Want a similar token for your project? Contact us for a consultation. Get a free project assessment and a detailed roadmap. We have observed a 40% reduction in fees compared to traditional bridge on testnet.
Contact us for a project assessment. Get a consultation on OFT architecture for your task. We will assess your project for free and propose the optimal solution.







