Core Contracts

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

Problematic Downcasting in Token Minting

Summary

The mint function performs an unsafe downcast of amountToMint from uint256 to uint128 before calling OpenZeppelin's _mint. This unnecessary conversion risks overflow issues when amountToMint exceeds uint128 maximum value, potentially causing silent failures or errors.

Vulnerability Details

_mint(onBehalfOf, amountToMint.toUint128());

The downcast is unnecessary since _mint accepts uint256. The conversion creates truncation risks for values above 2^128 - 1.

Impact

  • Potential function reverts for large amountToMint values

  • Risk of incorrect token minting amounts through truncation

  • Unnecessary contract scalability limitations

  • Added complexity without benefits

Tools Used

  • Manual code review

Recommendations

Remove uint128 casting since _mint supports uint256 natively.

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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