Core Contracts

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

Unclear `allocateFunds()` function in `Treasury` contract

Summary

Unclear function or unimplemented code for allocateFunds()

Vulnerability Details

The Treasury contract is designed to manage protocol funds with role-based access control, supporting multiple tokens and tracking their balances. It includes functionalities for depositing, withdrawing, and allocating funds, with roles defined for managers and allocators. The contract maintains a _balances mapping to track the balance of each token and a _totalValue variable to represent the total value across all tokens.

The allocateFunds() function is intended to allow accounts with the ALLOCATOR_ROLE to allocate funds to a recipient without transferring tokens. This function records the allocation in the _allocations mapping, which tracks the amount allocated by each allocator to each recipient. However, the function is currently unused within the contract logic, meaning that the allocations recorded by this function do not have any effect on the contract's operations or the management of funds.

The highest impact scenario occurs when the allocateFunds() function is expected to play a role in the contract's logic, such as influencing fund transfers or affecting the balance of recipients. The absence of any logic utilizing these allocations could lead to confusion about the purpose of the function and the role of allocators within the contract. This could result in mismanagement of funds or incorrect assumptions about the contract's behavior.

Impact

The unused allocateFunds() function can lead to confusion about the role of allocators and the purpose of fund allocations within the Treasury contract. This could result in mismanagement of funds or incorrect assumptions about the contract's behavior, potentially affecting the integrity of the fund management system.

Tools Used

Manual Review

Recommendations

To address this issue, consider either removing the allocateFunds() function if it is not needed or integrating it into the contract's logic to ensure that allocations have a meaningful impact on fund management. If the function is to be used, implement logic that utilizes the _allocations mapping to influence fund transfers or other operations within the contract. Alternatively, if the function is not necessary, remove it to simplify the contract and avoid confusion.

Updates

Lead Judging Commences

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

What do people do with allocations

Support

FAQs

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