Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: high
Valid

Decimals is not handled correctly while buying zeno tokens in ZENO auction.

Summary

The Auction::buy function allows users to purchase Zeno tokens in exchange for USDC. However, an incorrect handling of token decimals results in users paying significantly more USDC than intended.

Vulnerability Details

  • The buy function takes an amount of Zeno tokens (e.g., 100e18).

  • Zeno follows the ERC-20 standard with 18 decimals.

  • The price per Zeno token is determined via the getPrice function, which returns a value in 6 decimals (as seen in the test file).

  • When computing the total USDC cost:

    Cost = 100e18 * 2e6 = 200e24 , (price Assumed is 2e6)

    Since USDC has only 6 decimals, the user ends up paying 1e12 times more USDC than necessary.

Impact

Users are required to pay an excessively high amount of USDC due to incorrect decimal handling, leading to severe overpayment and potential loss of funds.

Tools Used

  • Manual review

Recommendations

  • Properly normalize USDC decimals when computing the price.

Updates

Lead Judging Commences

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Auction.sol's buy() function multiplies ZENO amount (18 decimals) by price (6 decimals) without normalization, causing users to pay 1 trillion times the intended USDC amount

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.