The Auction contract's buy function performs price calculations without accounting for decimal differences between ZENO (18 decimals) and USDC (6 decimals), leading to incorrect cost calculations and potential loss of funds.
In the buy function, the cost calculation is performed without decimal handling:
uint256 cost = price * amount;
Example:
Buying 1.0 ZENO at 2 USDC price:
amount = 1e18 (1 ZENO)
price = 2e6 (2 USDC)
Current: cost = 2e6 * 1e18 - (overpriced)
Expected: cost = 2e6 (2 USDC)
Incorrect cost calculations leading to:
Failed transactions due to massive USDC amounts
If transaction succeeds, severe overcharging of users
Manual Review
Adjust the price calculation to account for the decimal difference between ZENO (18) and USDC (6)
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.