> ## Documentation Index
> Fetch the complete documentation index at: https://docs.melt.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# LayerZero V2

> Cross-chain messaging infrastructure powering the Melt bridge

## Overview

Melt uses [LayerZero V2](https://layerzero.network/) 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

| Operation                     | Gas Limit               |
| ----------------------------- | ----------------------- |
| Standard bridge               | 200,000                 |
| Bridge with HyperCore routing | 400,000 (2x multiplier) |

The `toCore` flag doubles the gas limit because HyperCore precompile calls require additional gas.

## OFT Support

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