The credit delta calculation in _updateCreditDelegations() uses UD60x18 which causes underflow when vault's credit delegation decreases.
In _updateCreditDelegations(), the credit delta is calculated using unsigned integers which will underflow when the new credit delegation value is less than the previous value:
The credit delegation can decrease in several scenarios including LP redemptions, in this case, recalculateVaultsCreditCapacity() won't work as expected.
The underflow causes reverts in recalculateVaultsCreditCapacity() which breaks core protocol functionality like deposits, withdrawals, staking and rewards distribution.
Use SD59x18 instead of UD60x18 when calculating the credit delta to properly handle decreases in credit delegation.
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.