Core Contracts

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

Inaccurate _totalValue Calculation Due to Lack of Decimal Normalization Across ERC-20 Tokens

Summary

The _totalValue variable in the Treasury contract misrepresents the actual value of assets held by summing raw token amounts without accounting for different decimal places. This leads to incorrect fund accounting, causing inaccurate treasury valuation and potential misallocation of resources.

Vulnerability Details

ERC-20 tokens have varying decimal places, but the contract updates _totalValue in the deposit() and withdraw() functions by directly adding or subtracting raw token amounts without normalizing them. This results in inaccurate treasury valuation, as tokens with different decimal precisions are treated the same, leading to misrepresentation of actual asset holdings.

References:

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/Treasury.sol#L52 https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/Treasury.sol#L74

Impact

Low

Tools Used

Manual

Recommendations

Normalize Token Values Based on Decimals

Updates

Lead Judging Commences

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

Treasury::deposit increments _totalValue regardless of the token, be it malicious, different decimals, FoT etc.

Support

FAQs

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

Give us feedback!