NexusOFT wrapper that exposes the standard IOFT interface, while the Nexus contract handles burn/mint, fee collection, and module delegation.
System Overview
Core Contracts
Nexus (Hub)
The Nexus contract is the only contract that interacts with the LayerZero endpoint. It handles OApp messaging, peer/delegate management, enforced options, fee deposit, and the OFT registry. It stores three mutable module pointers:address(0)), its extension is inactive — pause returns false, fee returns 0, rate limiter capacity returns type(uint256).max.
NexusOFT (Per-Token)
A stateless contract that implementsIOFT by forwarding all calls to Nexus:
quoteOFT()→Nexus.nexusQuoteOFT()quoteSend()→Nexus.nexusQuoteSend()send()→Nexus.nexusSend()
NexusOFT.nexusReceive() to emit events and forward compose messages.
NexusERC20 + NexusERC20Guard
See NexusERC20 for the token layer.OFT Registry
Tokens are registered in theNexus contract with a unique uint32 tokenId that maps to:
- An
oftAddress(theNexusOFTwrapper) - A
burnerMinterAddress(theNexusERC20or a wrapper contract)
NexusOFT.tokenId() matches the registered tokenId, and no duplicate registrations exist.
Nexus ID and Message Encoding
Cross-chain messages are encoded with a 4-bytetokenId prefix via NexusMsgCodec, allowing Nexus to route messages for multiple tokens over a single OApp channel:
uint256, enabling the 4-level priority resolution used by fee and pause modules. The rate limiter uses only the EID portion (per-destination).
Module Delegation
On an outboundnexusSend(), Nexus delegates to modules in this order:
_lzReceive():
Alt Variants
For chains where gas fees are paid via an ERC20 token (usingEndpointV2Alt):
NexusAlt— Hub variant that overrides_payNative()to no-op (native fee pushed byNexusOFTAlt)NexusOFTAlt— Wrapper that pushes both native ERC20 and LZ token fees to the endpoint before calling Nexus
Upgradeability
All upgradeable contracts use EIP-7201 namespaced storage.NexusOFT is not upgradeable — it is a thin stateless wrapper with only immutable state.
The Nexus contract and each module can be upgraded independently through their respective proxies. Module addresses are mutable, so a new module deployment can be swapped in by DEFAULT_ADMIN_ROLE without upgrading the Nexus proxy.
Next Steps
- Modules for fee, pause, and rate limiter configuration
- NexusERC20 for the token and guard layer
- RBAC Reference for the complete role mapping