In the rapidly evolving world of decentralized finance (DeFi), cross-chain interoperability has become a cornerstone for expanding token utility and user accessibility. One of the most effective ways to achieve this is through token bridging—a mechanism that allows digital assets to move seamlessly between different blockchain networks. This article explores how Harmony leverages LayerZero to deploy tokens across chains, specifically focusing on bridging assets from Binance Smart Chain (BSC) to the Harmony network.
By enabling cross-chain transfers, users gain increased liquidity, reduced transaction costs, and greater flexibility in managing their digital assets. For developers and project teams, understanding this deployment process is key to expanding token reach and enhancing ecosystem integration.
Understanding Token Bridging and Its Benefits
Token bridging enables the transfer of tokens from one blockchain to another, preserving value while adapting to new network environments. In the case of bridging from BSC to Harmony, users can leverage high-value tokens on a more scalable and cost-efficient chain.
Key Advantages:
- Increased Liquidity: Tokens become accessible across multiple ecosystems.
- Lower Transaction Fees: Harmony offers significantly cheaper gas fees than Ethereum or BSC during peak times.
- Enhanced User Flexibility: Users can interact with DeFi protocols, NFT markets, and dApps across chains.
- Network Congestion Relief: Distributing activity across blockchains reduces load on any single network.
The underlying architecture relies on LayerZero, a decentralized omnichain interoperability protocol, which ensures secure and trustless communication between blockchains.
👉 Learn how cross-chain asset transfers are revolutionizing DeFi ecosystems.
Harmony’s Bridge Architecture: A Technical Overview
Harmony’s bridge uses a two-contract system built on LayerZero's infrastructure:
ProxyERC20.sol– Deployed on BSC (or Ethereum)ProxyHRC20.sol– Deployed on Harmony
Bridging Workflow:
- Approve Transaction: The user grants the
ProxyERC20contract permission to transfer their token. - Estimate Gas Fee: Using
estimateSendFee, the required gas for the destination chain (Harmony) is calculated. - Send Transaction: The user calls
sendFromwith the estimated fee. - Minting Wrapped Tokens: Once validated, the
ProxyHRC20contract triggers a credit command to mint wrapped tokens on Harmony.
This process ensures that no central custodian holds funds—making it non-custodial and secure.
Step-by-Step Guide to Deploying Tokens via LayerZero
1. Selecting the Right Token
Not all tokens are suitable for bridging. Ideal candidates should have:
- High transaction volume
- Strong holder base
- Significant market cap
- Active usage on both source and target chains
These factors ensure sustained demand and justify the deployment effort.
2. Setting Up Development Environment
The required Solidity files are available in a Harmony-maintained fork of LayerZero’s examples:
https://github.com/harmony-one/solidity-examples
Specifically, you’ll need:
solidity-examples/contracts/token/oft/extension/ProxyERC20.solsolidity-examples/contracts/token/oft/extension/ProxyHRC20.sol
Install Hardhat to flatten these contracts (requires Node.js LTS v18.x or higher). Flattening combines all imported libraries into a single file for deployment.
After flattening:
- Remove all but the first
// SPDX-License-Identifierline - Copy the clean code into Remix IDE
👉 Discover tools that streamline smart contract deployment across chains.
3. Compiling Contracts in Remix
In Remix:
- Go to Compiler > Compiler and select the latest Solidity version (e.g., v0.8.18)
- Under Advanced Configurations, disable optimization
- Compile
ProxyERC20.solfirst; proceed only if successful
4. Deploying ProxyERC20 on BSC
Switch Remix environment to:
- Injected Provider - MetaMask
Ensure your MetaMask wallet is connected to BSC.
Set deployment parameters:
_lzEndpoint:0x3c2269811836af69497E5F486A85D7316753cf62(LayerZero BSC endpoint)_proxyToken: Address of the token being bridged
Click Transact and confirm in MetaMask.
⚠️ Gas fees on Ethereum can exceed $500—ensure sufficient ETH balance.
After deployment:
- Copy contract address from “Deployed Contracts”
Verify on BscScan:
- Select Contract > Verify and Publish
- Use Single File verification
- Compiler: Latest version used in Remix
- License: MIT
- Paste flattened code and click “Verify”
5. Deploying ProxyHRC20 on Harmony
Repeat the same steps in Remix with ProxyHRC20.sol.
Switch MetaMask to Harmony Mainnet before deploying.
Deployment parameters:
_lzEndpoint: Harmony’s LayerZero endpoint (check GitHub docs)_proxyToken: Token address on Harmony_multisig: Multisig address listed in Harmony’s repo_bridgeManager: BSC Bridge Manager address
Deploy and confirm via MetaMask. A small amount of ONE tokens is needed for gas.
After deployment:
- Find transaction in Harmony Explorer
Verify contract:
- Paste flattened code
- Click “Paste arguments from tx input” to auto-fill constructor data
6. Connecting Both Contracts
To enable bidirectional communication, set trusted remote addresses:
On ProxyHRC20 (Harmony side):
- Call
setTrustedRemoteAddress(chainId_BSC, ProxyERC20_Address)
On ProxyERC20 (BSC side):
- Call
setTrustedRemoteAddress(chainId_Harmony, ProxyHRC20_Address)
Chain IDs are available in Harmony’s GitHub documentation.
This step establishes trust between the two proxy contracts, allowing secure message relaying via LayerZero.
7. Configuring Gas Parameters
LayerZero defaults to 200k gas per transaction—insufficient for minting wrapped tokens via multisig.
Update minimum gas requirement:
- Call relevant method on
ProxyERC20to increase gas limit to at least 300,000
This ensures successful execution of cross-chain minting operations.
8. Final Steps and Activation
Once contracts are deployed and connected:
- Confirm ownership resides with the designated multisig wallet
- Ensure proxies are whitelisted by the bridge manager
- Update backend and frontend systems of https://bridge.harmony.one
- Announce token availability for bridging
The token is now fully operational across BSC and Harmony.
Frequently Asked Questions (FAQ)
Q: What is LayerZero’s role in cross-chain bridging?
A: LayerZero provides a decentralized messaging layer that enables secure, trustless communication between blockchains without relying on third-party custodians.
Q: Why do I need to flatten Solidity files before deployment?
A: Flattening combines all dependencies into a single file, which is required for contract verification on explorers like BscScan and Harmony Explorer.
Q: Can I bridge any ERC-20 token?
A: Technically yes, but only economically viable tokens with strong activity and demand should be bridged to ensure usage and justify maintenance costs.
Q: Why is optimization disabled during compilation?
A: Disabling optimization ensures bytecode consistency between local compilation and on-chain verification, avoiding mismatches during contract verification.
Q: How are wrapped tokens created on the destination chain?
A: When a user sends a token via sendFrom, LayerZero relays the message to the destination chain, where the ProxyHRC20 contract mints an equivalent amount of wrapped tokens.
Q: Is the bridge custodial?
A: No. The bridge operates non-custodially—users retain control of their assets throughout the process.
Core Keywords
- Token bridging
- LayerZero
- Harmony blockchain
- Cross-chain interoperability
- ProxyERC20
- ProxyHRC20
- Smart contract deployment
- Binance Smart Chain
This guide equips developers with a comprehensive understanding of deploying tokens across chains using Harmony’s LayerZero-powered bridge—enabling scalable, secure, and efficient cross-chain asset movement.