Core Contracts

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

Incorrect Token Valuation in `Treasury.sol`

Summary

In contracts/core/collectors/Treasury.sol, the internal variable _totalValue is used to track the total value across all tokens. However, the contract assumes that all tokens have the same value, which is incorrect and can lead to inaccurate accounting of treasury assets.

Vulnerability Details

The _totalValue variable is updated in the deposit and withdraw functions as follows:

_totalValue += amount;
_totalValue -= amount;

This implementation fails to account for the differing values of tokens. It assumes that all deposited and withdrawn tokens have the same unit value, which is not the case in real-world scenarios where token prices fluctuate. As a result, _totalValue does not reflect the true value of the treasury’s holdings.

Impact

This vulnerability can lead to:

  • Inaccurate tracking of the total treasury value.

  • Potential mismanagement of funds due to incorrect value representation.

Tools Used

Manual code review.

Recommendations

To address this issue, the contract should integrate an oracle to fetch real-time token prices and adjust _totalValue accordingly. Instead of directly adding or subtracting the raw amount, the contract should compute the value of tokens in a common denomination (e.g., USD or ETH) before updating _totalValue.

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!