Core Contracts

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

Wrong event param used in RAACMinter.sol::mintRewards()

Summary

The emitted event will give false data of how many RAACs were minted.

Vulnerability Details

function mintRewards(address to, uint256 amount) external nonReentrant whenNotPaused {
if (msg.sender != address(stabilityPool)) revert OnlyStabilityPool();
uint256 toMint = excessTokens >= amount ? 0 : amount - excessTokens;
excessTokens = excessTokens >= amount ? excessTokens - amount : 0;
if (toMint > 0) {
raacToken.mint(address(this), toMint);
}
raacToken.safeTransfer(to, amount);
// @audit wrong param used, should be toMint
emit RAACMinted(amount);
}

It emits with amount instead of toMint, which makes it to report false data.

Impact

Off chain applications and Dapps relie on informations given by events, this could lead to several problems in applications, misleading the end user.

Tools Used

Manual

Recommendations

function mintRewards(address to, uint256 amount) external nonReentrant whenNotPaused {
if (msg.sender != address(stabilityPool)) revert OnlyStabilityPool();
uint256 toMint = excessTokens >= amount ? 0 : amount - excessTokens;
excessTokens = excessTokens >= amount ? excessTokens - amount : 0;
if (toMint > 0) {
raacToken.mint(address(this), toMint);
}
raacToken.safeTransfer(to, amount);
// @audit wrong param used, should be toMint
- emit RAACMinted(amount);
+ emit RAACMinted(toMint);
}
Updates

Lead Judging Commences

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

RAACMinter.mintRewards() emits incorrect event value when called

suggestion is something that is done by ERC20.mint() function

Appeal created

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

RAACMinter.mintRewards() emits incorrect event value when called

suggestion is something that is done by ERC20.mint() function

Support

FAQs

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