The mint
function in RAACNFT
contract fails to handle decimal precision differences between the oracle-provided house prices and the payment token (USDC), leading to incorrect price calculations during NFT minting.
In RAACNFT.sol
, prices are compared directly without decimal adjustment:
Stable coins can have different decimals. I.e: USDC/USDT 6 decimals, DAI 18 decimals, etc.
The oracle basically set the returned value into tokenToHousePrice
.
The key issues are:
Direct comparison between 18 decimal and 6 decimal numbers
No decimal normalization before price comparison
Incorrect transfer amount calculation
Potential for massive overpayment or underpayment
Users can pay exponentially more, i.e: 1000000000000x (10^12) than intended for minting NFTs due to decimal precision mismatch. This could lead to significant financial losses as house prices are substantial values.
Manual Review
Normalize the token amount before pulling the tokens from the user.
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.