The getInputAmountBasedOnOutput
function calculates the amount of tokens a user should deposit given an amount of output tokens. However, the function currently miscalculates the amount. When calculating the fee, it multiplies the amount by 10,000 instead of 1,000.
This means that the protocol takes more fees than expected from users, as per the documentation. Anytime the swap happens, the fees would be wrong.
The test below shows that the getInputAmountBasedOnOutput
function does not return the expected value, the precision is off by a decimal place.
--Foundry
It is recommended to change the value ingetInputAmountBasedOnOutput
from 10,000 to 1,000
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.