Missing error in lvTokenValue function can cause failure of contract execution
The contract execution failure can cause the transaction to revert if totalSupply_ is zero, the division totalAsset_ * SAFE_MULTIPLIER / totalSupply_ could result in a runtime exception due to division by zero.
Any subsequent operations in the transaction would be rolled back thereby making the user or contract conducting the transaction to possibly lose gas fees
VS Code
An explicit else statement of this form below can be written to handle the error:
} else {
// Add a check for division by zero
require(totalSupply_ != 0, "Division by zero");
return totalAsset_ * SAFE_MULTIPLIER / totalSupply_;
}
}
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.