Design Philosophy
Security modules (fee, rate limiting, pause-by-destination) are independent, upgradeable layers that compose through inheritance without modifying core OFT logic. Allowlist controls live on the token (ERC20Plus), not in the extension stack.
Token logic (ERC20Plus) is fully decoupled from cross-chain OFT logic (OFT variants). The token can exist without an OFT, and the OFT works with any ERC20 that implements IERC20Metadata and the necessary mint/burn functions with appropriate role-based access control.
All storage uses EIP-7201 namespaced storage slots, preventing storage collisions across inheritance chains and making proxy upgrades safe by construction.
Four-Layer Architecture
IERC20Plus interface.
Token Core (Layer 1): Standard ERC20 functionality built on OpenZeppelin’s ERC20Upgradeable and ERC20PermitUpgradeable. Transfers, approvals, balances, and gasless permit signatures.
Token Controls (Layer 2): Allowlist (three-mode address restrictions), global pause, fund recovery, and role-based mint/burn access control. These apply to all token operations — a paused token blocks local transfers as well as cross-chain sends. Deployed as the ERC20Plus contract independently of any OFT.
Cross-Chain Transport (Layer 3): Manages cross-chain send/receive. Each OFT variant implements a different transfer model (burn/mint, burn-self/mint, lock/unlock, native).
Cross-Chain Extensions (Layer 4): Per-destination fee collection, rate limiting, and pause-by-destination controls. These modules intercept _debit and _credit to enforce policies before the underlying transfer executes.
Inheritance Hierarchy
Each green box is a deployable contract. Everything above is abstract. TheAlt variants (OFTBurnMintAlt, OFTLockUnlockAlt, OFTBurnSelfMintAlt) follow the same hierarchy but target EndpointV2Alt for chains where ERC20 tokens are used for gas fees.
ERC20Plus Inheritance
Cross-Chain Message Flow
Send Path (Source Chain)
Receive Path (Destination Chain)
Transfer Model Mechanics
Burn/Mint
MINTER_ROLE and BURNER_ROLE on the ERC20Plus token. Total supply across all chains remains constant.
Burn-Self/Mint
burn(uint256) selector. The OFT must hold MINTER_ROLE on the destination token.
Lock/Unlock
Native
msg.value must include both the transfer amount and the LayerZero messaging fee.
Upgradeability Model
All contracts support Transparent Upgradeable Proxy (TUP) and Beacon proxy patterns:- Proxy contract holds state (storage) and delegates calls to the implementation
- Implementation contract holds logic and is stateless
- EIP-7201 namespaced storage ensures each module’s storage is isolated at a deterministic slot, preventing collisions
Next Steps
- ERC20Plus for the token core (layer 1)
- OFTs for the cross-chain transport (layer 3)
- Extensions for token controls and cross-chain extensions (layers 2 and 4)