Contract Architecture
Melt’s smart contracts implement a Lock & Mint bridge pattern using LayerZero V2 for cross-chain messaging.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 |
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 aconfigKey — 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 |
DEFAULT_ADMIN_ROLE | MeltFactory (then transferable) | Manage roles |
owner | Multisig | Admin operations (register tokens, set fees, pause) |
