Skip to main content

Overview

Melt uses LayerZero V2 as its cross-chain messaging layer. Both MeltHub and MeltBridge extend the OApp (Omnichain Application) base contract.

Message Flow

Bridge In (Source → HyperEVM)

MeltBridge.bridge()
  └─ Encodes payload: (originalToken, recipient, amount, toCore)
  └─ Calls _lzSend() with gas options
       └─ LayerZero DVN validates & delivers
            └─ MeltHub._lzReceive() processes mint

Bridge Out (HyperEVM → Source)

MeltHub.bridgeOut()
  └─ Burns wrapped tokens
  └─ Encodes payload: (originalToken, recipient, amount)
  └─ Calls _lzSend()
       └─ LayerZero delivers
            └─ MeltBridge._lzReceive() releases locked tokens

Gas Configuration

OperationGas Limit
Standard bridge200,000
Bridge with HyperCore routing400,000 (2x multiplier)
The toCore flag doubles the gas limit because HyperCore precompile calls require additional gas.

Peer Configuration

MeltHub and MeltBridge must be registered as peers:
// On MeltHub (HyperEVM)
hub.setPeer(sourceEid, bytes32(uint256(uint160(bridgeAddress))));

// On MeltBridge (Source Chain)
bridge.setPeer(hyperEvmEid, bytes32(uint256(uint160(hubAddress))));

OFT Support

MeltAsset also extends OFTCore, enabling potential future cross-chain token transfers without going through the Hub/Bridge path.