Conflux Native Adapter and OFT contracts on Conflux, Ethereum, Kaia (Klaytn) and HyperEVM.
- Install dependencies with your preferred package manager (e.g.
pnpm install). - Copy
.env.exampleto.env, populatePRIVATE_KEY, and add any missingRPC_URL_*endpoints found inhardhat.config.ts. - Compile everything locally with
npx hardhat compile(orpnpm run compile) before deploying. - Use the LayerZero Hardhat tasks below to deploy, wire, and test token flows. Their behavior is driven by the configs in
layerzero.testnet.config.tsandlayerzero.mainnet.config.ts.
# 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.tsTo 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.tsMainnet 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.tsTo 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