When minting the user's gvToken
in ProcessDeposit.sol
, if equityAfter is 0 and equityBefore is a positive number, an evmRevert will occur due to arithmetic underflow.
The calculation for minting the user's gvToken (share token) after the user deposits into the vault is based on the equity value of the vault.
If we examine the equity value calculation, it is simply the difference between the GM token value and the total debt value. If the equity value is less than the debt, the function returns 0 to avoid underflow within the function.
After a deposit, if _debtValue
is less than assetValue
, then equityValue
will return 0. This value is used in the processDeposit
function, so 0 - equityBefore
will always result in an underflow, causing a DoS of the system.
The severity of this issue depends on the GM token value and the debt value of the vault. If the debt is greater, for example, for 10 days, the vault will be unusable for 10 days.
DoS of the system until assetValue > _debtValue.
manual review
Do not allow the deposit if debt > equity until the rebalance has occurred.
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.