The _updateCreditDelegations() function calculates a vault’s share of credit delegation using the formula:
However, if totalCreditDelegationWeightCache == 0
, the function attempts to divide by zero, causing a revert and preventing credit delegation updates. This scenario can occur when:
A vault has no active credit delegations.
The vault’s total credit delegation weight has been reset but _updateCreditDelegations()
is still called.
A market is removed, causing the total delegation weight to drop to zero.
Since this function plays a key role in recalculating credit allocations during vault updates, a single zero-weight scenario can halt the entire credit delegation process for the protocol.
Credit delegation updates will fail, preventing vaults from properly redistributing credit, leading to stalled lending operations and potential financial inefficiencies across the system.
Before performing division, explicitly check if totalCreditDelegationWeightCache == 0
and set creditDelegationShareX18 = UD60x18_ZERO
to avoid division errors.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.