setPauseModule, setFeeConfigModule, setRateLimiterModule). If a module is not set, its extension is inactive.
The fee and pause modules share the same 4-level priority resolution over composite Nexus IDs, giving operators fine-grained control per token, per destination, or globally. The rate limiter operates per destination (EID) only — all tokens on the same destination share the same bucket.
Priority Resolution
Nexus IDs encode both the token and destination:| Level | Key | Scope |
|---|---|---|
| Global | 0 | All tokens, all destinations |
| Destination-only | nexusId & 0xFFFFFFFF | All tokens for a specific destination |
| Token-only | nexusId & 0xFFFFFFFF00000000 | All destinations for a specific token |
| Composite | nexusId | Specific token + destination pair |
MAX_PRIORITY (type(uint128).max) short-circuits resolution immediately.
This means you can set a global default and override it for specific tokens or destinations without touching the global config.
Fee Config Module
Same BPS-based fee calculation as Stablecoin OFT’s fee extension, but with priority resolution. Fees are collected by burningamountSentLD from the sender and minting the fee portion to the configured feeDeposit address.
Configuration
Each config entry stores:| Field | Type | Description |
|---|---|---|
priority | uint128 | Resolution priority (higher wins) |
feeBps | uint16 | Fee in basis points (0–10000) |
priority = 0 and feeBps = 0 removes the config entry.
Role
FEE_CONFIG_MANAGER_ROLE (authenticated via Nexus access control).
Pause Module
Controls whether outbound transfers are allowed for a given pathway. Nexus checks_isPaused(nexusId) before every send — if paused, the transaction reverts.
Configuration
Each config entry stores:| Field | Type | Description |
|---|---|---|
priority | uint128 | Resolution priority (higher wins) |
paused | bool | Whether the pathway is paused |
Role Logic
The pause module enforces a nuanced role check per batch based on the effective impact of each config change:PAUSER_ROLE— required when the net effect is pausing or strengthening a pause configUNPAUSER_ROLE— required when the net effect is unpausing, weakening a pause config, or a no-op (to prevent unauthorized no-ops)- Mixed batch (some entries pause, some unpause) → requires both roles
Pause vs NexusERC20Guard Pause
| Concern | Controlled By | Scope |
|---|---|---|
| Cross-chain sends | NexusPauseModule | Per (token, destination) with priority resolution |
| Local transfers | NexusERC20Guard | Per token (uint160(tokenAddress)) |
Rate Limiter Module
Enforces token bucket rate limits on inbound and outbound transfers, shared across all tokens per destination EID.How It Works
Rate limits are tracked per EID (not per Nexus ID). All tokens on the same destination share a single bucket. Token amounts are converted to a common unit via per-token scales before consumption, allowing heterogeneous tokens to share a meaningful limit.Token Scales
Because all tokens on a destination share one rate limit bucket, raw token amounts aren’t directly comparable — transferring 1,000 of a stablecoin is not the same as transferring 1,000 of a governance token. Token scales assign a relative price to each token so that higher-value tokens consume proportionally more of the shared limit.| Field | Type | Description |
|---|---|---|
scale | uint256 | Fixed-point price multiplier (denominator: 1e18) |
enabled | bool | Whether scaling is active for this token |
1e18 means the token’s amount counts at face value (1:1). A scale of 2e18 means each token unit consumes twice as much of the bucket. Setting enabled = true with scale = 0 effectively prices the token at zero, exempting it from rate limit consumption.
Configuration
Same as Stablecoin OFT’s rate limiter — token bucket with linear decay, configurable capacity and refill rate, address exemptions, net/gross accounting. The key difference is that limits operate on scaled amounts rather than raw token amounts.Role
RATE_LIMITER_MANAGER_ROLE (authenticated via Nexus access control). Controls rate limit configs, states, address exemptions, checkpoints, and token scales.
Module Execution Order
On an outboundnexusSend():
_lzReceive():
Next Steps
- Architecture for system design and message flow
- RBAC Reference for the complete role-to-function mapping
- Security and Compliance for the threat model