Core Contracts

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

Allocations do not reserve tokens for the allocation which leads to chance of protocol not having enough balance to satisfy allocation

Summary

Allocations in the Treasury contract are done by a mapping, however there is no mechanism in place to actually reserve tokens for the allocation.

This will lead to the allocation being meaningless as the allocation simply doesn't have enough tokens backing it.

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 allocate funds is called and allocations mapping is updated, however there is no reservation from the balance of treasury. If Users simply withdraw more balance than the allocated amount, the allocations will fail.

Impact

The allocations will fail.

Tools Used

Manual analysis

Recommendations

The allocations once done should subtract _totalValue from the Treasury contract such that the allocation amount doesn't accidently end up being withdrawn.

This might lead to some Users not being able to withdraw but it comes at the cost of failing the allocation.

Updates

Lead Judging Commences

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