> ## 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.

# Contracts Overview

> Architecture of the Melt smart contract suite

## Contract Architecture

Melt's smart contracts implement a **Lock & Mint** bridge pattern using LayerZero V2 for cross-chain messaging.

```
Source Chain                    HyperEVM
┌──────────────┐               ┌──────────────────────┐
│  MeltBridge  │──LayerZero──▶│      MeltHub         │
│  (Lock)      │◀─────────────│  (Mint/Burn)         │
└──────────────┘               │                      │
                               │  ┌─── MeltFactory    │
                               │  │    (Deploy)       │
                               │  │                   │
                               │  └─── MeltAsset[]    │
                               │       (ERC20+OFT)    │
                               └──────────┬───────────┘
                                          │
                                    HyperCore
                                  (Precompiles)
                               ┌──────────────────┐
                               │  Spot Trading    │
                               │  Asset Bridges   │
                               └──────────────────┘
```

## Contracts

| Contract          | Chain         | Purpose                                                           |
| ----------------- | ------------- | ----------------------------------------------------------------- |
| MeltHub           | HyperEVM      | Central hub — receives bridges, mints tokens, routes to HyperCore |
| MeltBridge        | Source chains | Locks tokens, sends cross-chain messages to MeltHub               |
| MeltAsset         | HyperEVM      | ERC20 + OFT wrapped token with role-based access                  |
| MeltFactory       | HyperEVM      | Deploys new MeltAsset tokens, manages HyperCore integration       |
| MeltFeeController | HyperEVM      | Per-user fee overrides for market makers and special integrations |
| MeltDebridgeHook  | HyperEVM      | Auto-deposits USDC from deBridge into HyperCore spot balance      |

## Tech Stack

* **Solidity** 0.8.22
* **Foundry** (Forge + Cast) for testing and deployment
* **LayerZero V2** OApp for cross-chain messaging
* **OpenZeppelin** Contracts for ERC20, AccessControl, Pausable, ReentrancyGuard

## Key Concepts

### Config Key

Tokens are identified by a `configKey` — the keccak256 hash of `(originalToken, sourceEid)`. This allows the same underlying token to have different configs when bridged from different source chains.

### Roles

| Role                 | Granted To                      | Purpose                                     |
| -------------------- | ------------------------------- | ------------------------------------------- |
| `MINTER_ROLE`        | MeltHub, MeltFactory            | Mint wrapped tokens                         |
| `BURNER_ROLE`        | MeltHub                         | Burn wrapped tokens without approval        |
| `ADMIN_ROLE`         | Multisig                        | Admin operations (set fees, pause tokens)   |
| `REGISTRAR_ROLE`     | MeltFactory                     | Register tokens and configure HyperCore     |
| `DEFAULT_ADMIN_ROLE` | MeltFactory (then transferable) | Manage roles on MeltAsset                   |
| `owner`              | Multisig                        | Owner operations on MeltBridge, MeltFactory |

## Next Steps

* [Integration Guide](/developers/integration-guide) — flows, code examples, events, and fee structure
* [Deployment Addresses](/developers/deployment-addresses) — all mainnet and testnet contract addresses
