Cvx3CrvOracle returns 0 for small baseAmount #93
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Handle
kenzo
Vulnerability details
Due to the precision of Chainlink oracle and Curve's virtual price,
Cvx3CrvOracle will return 0 for very small baseAmount.
Impact
As it only happens with very small amounts, the impact is not big as far as I can tell.
However one can imagine for example a scenario where a user will request to buy a small amount of Cvx3Crv, and a contract would use
peek
to know how much to charge. Sincepeek
returns 0, the user wouldn't be charged anything and still be able to receive a small amount of Cvx3Crv.Proof of Concept
For example, for real (taken from contracts) values of:
The oracle will return 0.
Recommended Mitigation Steps
Consider reverting the transaction if baseAmount > 0 and quoteAmount == 0.
The text was updated successfully, but these errors were encountered: