The Auction
contract contains a critical vulnerability in its buy
function that fails to properly scale decimal places between USDC (6 decimals) and ZENO tokens (18 decimals). Due to this incorrect scaling, the contract calculates a massively inflated USDC price by multiplying unscaled values. As a result, users attempting to purchase ZENO
tokens will face a Denial of Service (DoS) condition since the required USDC amount will be astronomically high, causing all transactions to revert due to insufficient USDC balance.
In the Auction
contract's buy function, a critical calculation error occurs when determining the USDC cost for ZENO
tokens:
The vulnerability stems from the following:
The amount parameter represents ZENO tokens in their base units (18 decimals)
1 ZENO = 1,000,000,000,000,000,000 (1e18) base units
The getPrice() function returns the price in USDC base units (6 decimals)
1 USDC = 1,000,000 (1e6) base units
When calculating cost = price * amount, both numbers are multiplied directly without decimal adjustment:
For example, buying 1 ZENO at a price of 1 USDC:
cost = 1,000,000 * 1,000,000,000,000,000,000
cost = 1,000,000,000,000,000,000,000,000 (1e24)
This means the user needs to pay 1 quintillion USDC instead of 1 USDC
This calculation error inflates the required USDC amount by a factor of 10^18, making it impossible for any user to have sufficient USDC balance to complete the purchase, effectively creating a DoS condition.
Complete denial of service for token purchases as the inflated USDC amount required will most likely always exceed any user's balance
The auction becomes non-functional, blocking all token distribution through this contract
Paste the following code in remix:
Manual Review
Change the cost calculation as shown:
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.