Overview
MeltAsset is the wrapped token contract deployed on HyperEVM for each bridged asset. It implements both ERC20 and LayerZero OFT (Omnichain Fungible Token) standards.
Inherits: OFTCore (LayerZero), ERC20, AccessControl
Constructor
| Parameter | Description |
|---|---|
name_ | Token name (e.g., “Melt Gold”) |
symbol_ | Token symbol (e.g., “mGOLD”) |
decimals_ | Token decimals |
originalToken_ | Address of original token on source chain |
sourceChainId_ | LayerZero endpoint ID of source chain |
lzEndpoint_ | LayerZero endpoint on HyperEVM |
admin_ | Receives DEFAULT_ADMIN_ROLE (typically MeltFactory) |
oftOwner_ | OFT owner/multisig (controls setPeer) |
Roles
| Role | Purpose | Granted To |
|---|---|---|
MINTER_ROLE | Can call mint() | MeltHub, MeltFactory |
BURNER_ROLE | Can call burnFrom() without approval | MeltHub |
DEFAULT_ADMIN_ROLE | Can grant/revoke other roles | MeltFactory → transferable |
Functions
mint
MINTER_ROLE. Reverts with Unauthorized otherwise.
burnFrom
- If caller has
BURNER_ROLE: burns without approval check - Otherwise: requires and spends allowance
OFT Functions
MeltAsset implements LayerZero OFT for potential cross-chain token transfers:_debit: Burns tokens for outbound cross-chain sends_credit: Mints tokens for inbound cross-chain receives
Immutable Properties
| Property | Description |
|---|---|
originalToken | Address of the original token on source chain |
sourceChainId | LayerZero endpoint ID of the source chain |
