Security Considerations
Settlement Layer Security Priorities
Critical Invariants:
- Zero-Sum Settlements: Batch transfers neither create nor destroy value
- Liquidity Protection: Reserved settlement funds cannot be invested
- Withdrawal Safety: The permit system blocks unauthorized exits
- Atomic Settlements: All transfers in a batch succeed together or all revert
Attack Vectors to Consider:
- Manipulating batch netting calculations to extract value
- Withdrawing mid-settlement to force a failure
- Double-spending settlement obligations
- Injecting false rBalance adjustments to fabricate profits
Investment Layer Security Priorities
Critical Invariants:
- Reserved Asset Protection: Pending and claimable funds stay off-limits for investment
- Share Accounting: duPRT is backed by vault assets and settlement positions at all times
- Fulfillment Accuracy: Pending-to-claimable conversions must be exact
- Investment Safety: The contract cannot invest beyond the available balance
Attack Vectors to Consider:
- Inflating the reserved-asset calculation to justify over-investment
- Exploiting the async flow to claim assets twice
- Front-running fulfillment transactions
- Corrupting storage slots during contract upgrades