Shadow Arena/Shadow Arena #011: Gravita Protocol
CDP / StablecoinIntermediate

Shadow Arena #011: Gravita Protocol

Gravita is the textbook multi-collateral Liquity V1 fork. VesselManager is TroveManager renamed, StabilityPool keeps the P/S/scale decay machinery, redemptions keep the base-rate decay with the same MINUTE_DECAY_FACTOR = 999037758833783000 (12-hour half-life) — but every per-system accumulator (L_ETH, totalStakes, baseRate, lastFeeOperationTime) is now a per-asset mapping keyed by collateral address. Three audits graded the code in April-May 2023: Dedaub (1 Medium + 5 Low + 2 Centralization), Omniscia (3 Major + 4 Medium), and Hats Finance (3 Medium + 11 Low). You just finished the Liquity V1 Build module — single-collateral, one set of accumulators, one base rate. Gravita is what you ship next: same architecture, but now mapping(address => uint256) on every accumulator. The audits caught the places the multi-collateral refactor forgot to re-scope: oracle plumbing that silently returns stale prices, a try/catch designed to be robust that becomes a gas grief vector, a setter without access control, a redistribution path that drives totalStakes to zero, and a whitelisted-minting backdoor that Liquity never had. Find the bugs the diff introduced.

Scope (4885 SLOC)

FileSLOC
contracts/BorrowerOperations.sol798
contracts/VesselManager.sol746
contracts/VesselManagerOperations.sol999
contracts/StabilityPool.sol951
contracts/PriceFeed.sol320
contracts/AdminContract.sol480
contracts/DebtToken.sol175
contracts/FeeCollector.sol416
contracts/ActivePool.sol165
contracts/DefaultPool.sol122
contracts/SortedVessels.sol493

Documentation

Part of the Liquity V1 Path

This shadow audit connects to the Liquity V1 Build module. Students who built the CDP protocol have an advantage because they understand Trove accounting, Stability Pool P/S decay, redistribution liquidations, and redemption-driven peg mechanics.

View Build Module
Duration14 days
Total Findings13
Scope4885 SLOC
PriceFree