The vaultCreditCapacityUsdX18
value in the Vault.sol
contract is not explicitly prevented from becoming negative. While the updateCreditDelegations
function ensures credit delegation only occurs when the vault's credit capacity is positive, there is no safeguard to prevent it from reaching a negative state due to accumulated debt or market losses.
The function getTotalCreditCapacityUsd(self)
determines the vault’s credit capacity but does not enforce a non-negative return.
The vaultCreditCapacityUsdX18
variable in _updateCreditDelegations()
is updated as:
If getTotalCreditCapacityUsd(self)
returns a negative value, the vault enters an invalid credit state.
The condition in updateCreditDelegations
ensures that delegation does not proceed if the value is negative but does not prevent the vault from becoming insolvent.
A negative credit state can lead to unrecoverable debt scenarios.
If not handled, attempts to delegate credit may fail unpredictably.
Malicious actors could manipulate credit capacity through debt accumulation to destabilize the system.
Manual Review
Enforce Non-Negative Credit Capacity:
Modify getTotalCreditCapacityUsd(self)
to ensure it never returns a negative value:
Require Non-Negative Value on Assignment:
Before assigning vaultCreditCapacityUsdX18
, add:
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.