Core Contracts

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

Treasury::allocateFunds does not specify token been alocated

Summary

The allocateFunds function allows an allocator (with ALLOCATOR_ROLE) to assign a specified amount of funds to a recipient. However, allocations are not tied to a specific token, which can lead to ambiguity and inconsistencies when funds are later withdrawn or managed.

Vulnerability Details

function allocateFunds(
address recipient,
uint256 amount
) external override onlyRole(ALLOCATOR_ROLE) {
if (recipient == address(0)) revert InvalidRecipient();
if (amount == 0) revert InvalidAmount();
_allocations[msg.sender][recipient] = amount;
emit FundsAllocated(recipient, amount);
}

The function does not specify which token the allocation applies to, Allocations are stored as a simple uint256 amount, without associating them with a specific token.

If allocations are later assumed to be in a default token (e.g., USDC) but were meant for another (e.g., WETH), mispricing issues can arise.

Example: Allocating 100 could mean 100 USDC (worth $100) or 100 WETH (worth significantly more), leading to huge financial discrepancies.

Impact

Incorrect token assumptions could lead to funds being distributed in an unintended way

Tools Used

Manual Review

Recommendations

Modify _allocations to track the token along with the amount:

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 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.