Core Contracts

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

Treasury accounting is false as _totalValue account for different type of token

Summary

The Treasury contract maintains a _totalValue state variable that naively adds balances of different tokens without accounting for decimals or value differences in deposit() and withdraw()

Vulnerability Details

  1. User deposits 1 WBTC (8 decimals) = 100,000,000

  2. User deposits 1 USDC (6 decimals) = 1,000,000

  3. _totalValue = 101,000,000

Actually represents 1 WBTC (~$40,000) + 1 USDC ($1)
But treats them as equivalent units and equivalent value

Impact

_totalValue does not represent anything useful

Tools Used

Manual

Recommendations

  1. Track balances separately per token

  2. Add price oracle integration for true value aggregation

OR

  1. remove _totalValue and use external service like Debank to track that

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!