Core Contracts

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

Un-updated boostState during withdrawals leaves contract is a stale state

Summary

The withdraw() and emergencyWithdraw() functions in the veRAACToken contract do not call the _updateBoostState() function after veRAAC tokens are burned. This oversight results in a stale boost state, which reflects inaccurate total supply of veRAAC tokens.

Vulnerability Details

The _updateBoostState() function is responsible for updating critical state variables, including totalVotingPower, whenever tokens are locked or increased. This ensures that the contract accurately reflects the current total supply of veRAAC tokens in circulation.

function _updateBoostState(address user, uint256 newAmount) internal {
---SNIP---
>> _boostState.totalVotingPower = totalSupply();
---SNIP---
}

However, during the withdraw() and emergencyWithdraw() functions, while veRAAC tokens are burned (which decreases the total supply), _updateBoostState() is not called.

// @audit Burn veTokens and transfer RAAC
_burn(msg.sender, currentPower);
>> // @audit-issue Fails to update boosstate

As a result, the boost state remains unchanged, and in an inconsistent state that do not accurately reflect the real status of the contract.

Impact

The totalVotingPower may not accurately reflect the current supply of veRAAC tokens, which can be misleading.

Tools Used

Manual Review

Recommendations

Call _updateBoostState() after burning veRAAC tokens to ensure that the boost state reflects the current total supply.

// @audit Burn veTokens and transfer RAAC
_burn(msg.sender, currentPower);
+ // @audit update boosstate
+ _updateBoostState(msg.sender, 0);
Updates

Lead Judging Commences

inallhonesty Lead Judge
10 months ago
inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!