The Auction::buy
function calculates the cost incorrectly.
The calculation for cost in the buy
function does not include decimal precision, leading to an incorrect cost calculation.
the getPrice()
function will return price of zeno ( which will let say follows 6 or 8 decimals).
since the zeno are ERC20 tokens they follows 18 decimals.
the cost = price * amount;
= price in 8 decimals * amount in 18 decimlas
Now the usdc follows 6 decimals , The cost calculated will be way greater than intended, hence user will send more used than needed.
Lets take an example for that :-
Due to the incorrect cost calculation, the user spends more USDC than intended and receives fewer Zeno tokens than they should. This happens because the decimal misalignment inflates the cost, leading to an unfair exchange.
To normalize the cost and ensure it's in 6 decimals (USDC precision), divide by the appropriate decimal factor.
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.