Core Contracts

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

Calculation of raac rewards is done incorrectly in stability pool

Summary

Calculation of raac rewards is done incorrectly in stability pool

Vulnerability Details

Following is how calculation is done

function calculateRaacRewards(address user) public view returns (uint256) {
uint256 userDeposit = userDeposits[user];
uint256 totalDeposits = deToken.totalSupply();
uint256 totalRewards = raacToken.balanceOf(address(this));
if (totalDeposits < 1e6) return 0;
return (totalRewards * userDeposit) / totalDeposits;
}

Now we know that de token has different decimals and user deposits are in r token decimals therefore two variables which have different variables are used which can will cause either over estimation of rewarda or underestimation of the rewards.

Impact

Wrong calculation of the rewards

Tools Used

Recommendations

Instead of detoken.Totalsupply use total rtoken balance of the contract.

Updates

Lead Judging Commences

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!