Core Contracts

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

Token address missing in allocations mapping of Treasury.sol

Description & Impact

The current implementation of allocateFunds() and the _allocations mapping in Treasury.sol have a significant limitation in their design.

The allocations mapping only tracks numeric amounts without specifying which token they correspond to. This is problematic because:

  • The Treasury can hold multiple types of tokens (it accepts any ERC20 token in its deposit() function)

  • There's no way to associate an allocation with a specific token

This could lead to confusion or inconsistencies when managing allocations for different tokens

Mitigation

Change the mapping to:

mapping(address => mapping(address => mapping(address => uint256))) private _allocations; // Allocator => recipient => token => amount

and add a parameter tokenAddress to allocateFunds().

Updates

Lead Judging Commences

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

Treasury::allocateFunds doesn't say what token you are actually allocating, doesn't check balances, or existing allocations to other recipients

Support

FAQs

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