Skip to content

Conflux-Chain/layerzero-OFT

Repository files navigation

LayerZero

LayerZero Docs

Conflux OFT Contracts

Overview

Conflux Native Adapter and OFT contracts on Conflux, Ethereum, Kaia (Klaytn) and HyperEVM.

Operating This Repo

  1. Install dependencies with your preferred package manager (e.g. pnpm install).
  2. Copy .env.example to .env, populate PRIVATE_KEY, and add any missing RPC_URL_* endpoints found in hardhat.config.ts.
  3. Compile everything locally with npx hardhat compile (or pnpm run compile) before deploying.
  4. Use the LayerZero Hardhat tasks below to deploy, wire, and test token flows. Their behavior is driven by the configs in layerzero.testnet.config.ts and layerzero.mainnet.config.ts.

Deployment

Testnet

# Compile contracts.
npx hardhat compile

# Deploy OFT contracts. Prompts will appear to confirm HyperEVM block size switching.
npx hardhat lz:deploy --networks conflux-testnet,sepolia-testnet --ci

# Wire OFT contracts.
npx hardhat lz:oapp:wire --oapp-config layerzero.testnet.config.ts

# transfer ownership
pnpm hardhat lz:ownable:transfer-ownership --oapp-config layerzero.testnet.config.ts

To verify that the mesh is fully wired, you can test sending tokens:

# Sends 1 $CFX from Conflux to Sepolia
npx hardhat lz:oft:send --src-eid 40211 --dst-eid 40161 --amount 1 \
  --to 0xffffffffff \
  --oapp-config layerzero.testnet.config.ts

Mainnet

Mainnet deployments follow the same flow but rely on the accounts and RPC endpoints configured in .env. Ensure you have production-ready gas strategies and balances on Conflux, Ethereum, Kaia, and HyperLiquid before running the commands.

# Compile contracts.
npx hardhat compile

# Deploy the OFT adapter and tokens across all mainnet EIDs.
npx hardhat lz:deploy --networks conflux-mainnet,ethereum-mainnet,klaytn-mainnet,hyperliquid-mainnet --ci

# Wire the mesh using the mainnet topology file.
npx hardhat lz:oapp:wire --oapp-config layerzero.mainnet.config.ts

# transfer ownership
pnpm hardhat lz:ownable:transfer-ownership --oapp-config layerzero.mainnet.config.ts

To smoke-test the mainnet mesh, send a small amount through LayerZero. The example below moves 1 $CFX from Conflux (EID 30212) to Hyperliquid (EID 30367):

npx hardhat lz:oft:send --src-eid 30212 --dst-eid 30367 --amount 1 \
  --to 0xffffffffff \
  --oapp-config layerzero.mainnet.config.ts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors