Skip to main content

Prerequisites

  • Foundry installed
  • Private key with funds on target chain
  • LayerZero endpoint addresses for source and destination chains

Environment Setup

Create a .env file from the template:
cp .env.example .env
Required variables:
# Deployer
PRIVATE_KEY=your_private_key

# RPC URLs
HYPER_EVM_RPC_URL=https://api.hyperliquid.xyz/evm
ETHEREUM_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
ARBITRUM_RPC_URL=https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY

# LayerZero
LZ_ENDPOINT_HYPER_EVM=0x...
LZ_ENDPOINT_ETHEREUM=0x...
HYPER_EVM_EID=...
ETHEREUM_EID=...

# Configuration
OWNER_ADDRESS=0x...
FEE_COLLECTOR_ADDRESS=0x...

Build & Test

# Build contracts
forge build

# Run tests
forge test

# Run tests with verbosity
forge test -vvv

Deployment Order

Contracts must be deployed in this order:
1

Deploy MeltHub (HyperEVM)

Deploy the central hub with LayerZero endpoint, owner, and fee collector.
2

Deploy MeltFactory (HyperEVM)

Deploy the factory with reference to MeltHub, LayerZero endpoint, and OFT owner.
3

Deploy MeltBridge (Source Chain)

Deploy on each source chain with LayerZero endpoint, owner, and HyperEVM endpoint ID.
4

Configure Peers

Set LayerZero peers between MeltHub and each MeltBridge instance.
5

Deploy Tokens

Use MeltFactory to deploy wrapped tokens for each asset.
6

Link to HyperCore

Use prepareForCore and completeCoreLinking to enable spot trading.