F-2026-0016·missing-aggregate-state

No on-chain cumulative bad-debt tracking

Acknowledgedvaultleveragedprediction-marketgithub.com/bloom-art/dripster-lend
TL;DR

badDebtUsdcUnits is computed and emitted per finalize event but never accumulated on-chain, so cumulative protocol bad-debt requires off-chain event indexing rather than a single on-chain read.

Severity
INFO
Impact
LOW
Likelihood
LOW
Method
MManual review
CAT.
Complexity
LOW
Exploitability
LOW
02Section · Description

Description

badDebtUsdcUnits is computed in CloseLib.calculateCloseDistribution and emitted in PositionClosed / PositionSettled / PositionLiquidated / PositionForceUnwound events, but never accumulated in a storage variable. Determining cumulative protocol bad-debt exposure for governance, capital-pool sizing, or solvency assessment requires off-chain event indexing rather than a single on-chain read.

03Section · Recommendation

Recommendation

Add a totalBadDebtUsdcUnits storage variable, incremented in finalizeClose, finalizeSettle, finalizeLiquidate, and the terminal branch of finalizeForceUnwind, to enable on-chain solvency queries.

04Section · Resolution

Resolution

Acknowledged. On-chain bad-debt accumulator deferred on contract-size grounds; off-chain indexing of finalize events covers the same data.

F-2026-0016

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx