3.1 Constraints & Limits
The Modulexo system enforces explicit constraints at contract level.
These constraints are designed to:
• Prevent misuse
• Enforce accounting integrity
• Block invalid state transitions
• Protect deterministic distribution
All constraints are implemented through revert conditions and bounded parameter logic.
I. Asset Enablement Constraint
Recycle execution requires asset registration.
If a token is not enabled in the Registry:
ENGINE_ASSET_NOT_ENABLED
The transaction reverts.
There is no fallback path.
II. Unit Availability Constraint
Recycle execution requires sufficient accounting units.
If insufficient units are available:
The transaction reverts.
Units cannot go negative.
III. Cap Enforcement (Ledger)
If a registry-defined cap exists:
Ledger enforces:
This prevents excessive allocation per beneficiary or per token.
Cap logic is enforced before state mutation.
The Ledger prevents:
This ensures providers cannot artificially create circular inventory relationships.
V. Engine-Only Consumption
Ledger consumption is restricted:
Only RecyclingEngine may consume units.
Users cannot directly manipulate unit balances.
VI. Native Value Constraint
Recycle execution requires non-zero native payment.
If msg.value == 0:
Execution reverts.
VII. Router Safety Checks
Before routing native rails:
Engine verifies:
• Router address valid
• Rail values non-zero
If invalid:
Execution reverts.
No partial rail allocation occurs.
VIII. Division Safety
If distribution math would divide by zero:
Execution reverts.
This protects:
from invalid calculation.
IX. Claim Safety
During claim:
If native transfer fails:
The entire transaction reverts.
No partial debt update.
No inconsistent state.
X. Parameter Bounds
RecyclingEngine parameters:
May be subject to bounded validation (if implemented).
Out-of-bounds input reverts:
Parameter updates emit:
No silent changes.
XI. Ownership Safeguards
Ownership transfer requires:
Incorrect caller reverts:
Ownership cannot be hijacked.
XII. Reentrancy Protection
RecyclingEngine includes:
Prevents nested execution during recycle or claim.
This protects distribution math and rail routing.
XIII. Atomicity Constraint
All recycle operations execute atomically.
If any of the following fails:
• Unit consumption
• Rail routing
• Weight minting
• Distribution update
The entire transaction reverts.
There is no partial execution path.
XIV. No Negative Ledger States
The following invariants are enforced:
• recyclableBalance ≥ 0
• weightOf ≥ 0
• totalWeight ≥ 0
• rewardDebt ≤ accrued entitlement
State cannot drift negative.
XV. Separation Constraints
Recycle contracts cannot:
• Modify Fund share balances
• Override governance
• Access treasury directly
Fund contracts cannot:
• Modify recycle ledger
• Alter distribution math
These boundaries prevent systemic coupling.
XVI. Constraint Summary
Constraint
Enforced By
Failure Result
No silent failure modes exist.
Last updated