getBeanAmountOut()
uses IBean(C.UNRIPE_BEAN).totalSupply()
wrongly instead of IBean(C.UNRIPE_LP).totalSupply()
.
getBeanAmountOut()
calculates the amount of UNRIPE_BEAN
that can be exchanged with UNRIPE_LP
.
For that, it calls LibUnripe.unripeToUnderlying()
to get the amount of UNRIPE_LP
underlying from UNRIPE_LP
.
In unripeToUnderlying()
, it calculates the underlying amount proportionally with UNRIPE_LP
supply and lp amount to swap.
But in getBeanAmountOut()
, it uses IBean(C.UNRIPE_BEAN).totalSupply()
instead of IBean(C.UNRIPE_LP).totalSupply()
and the output will be wrong.
As getBeanAmountOut()
is used in ConvertGettersFacet.getAmountOut()
, users may get a wrong estimate during UNRIPE_LP
to UNRIPE_BEAN
conversion.
When users estimate an output amount using getAmountOut()
, they will get a wrong result and it will make them impossible to set a proper minAmountOut
.
Manual Review
getBeanAmountOut()
should be modified like this.
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.