Core Contracts

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

Incorrect `Burn` event emission (scaled amount instead of amount in underlying asset unit) in DebtToken contract.

Summary

The burn function in DebtToken contract emits the following event:

emit Burn(from, amountScaled, index);

with:

/**
* @notice Emitted when debt tokens are burned
* @param from The address from which tokens are burned
* @param amount The amount burned (in underlying asset units)
* @param index The usage index at the time of burning
*/
event Burn(address indexed from, uint256 amount, uint256 index);

amount should be in underlying asset units, but the burn function actually passes the amount in debt token units:

uint256 amountScaled = amount.rayDiv(index);
if (amountScaled == 0) revert InvalidAmount();
_burn(from, amount.toUint128());
emit Burn(from, amountScaled, index);

amountScaled is the amount divided by the index to get the amount in debt token index. amount should be passed when emitting the event.

Impact

The impact of this issue is medium as it leads to event emission with incorrect data, leading to important front-end integration issues.

Tools Used

Manual review.

Recommendations

Make sure to pass the right value to for the amount key in the Burn event:

emit Burn(from, amount, index);
Updates

Lead Judging Commences

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

DebtToken::burn emits Burn event with scaled amount instead of raw amount, contradicting documentation and causing incorrect off-chain data

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

DebtToken::burn emits Burn event with scaled amount instead of raw amount, contradicting documentation and causing incorrect off-chain data

Support

FAQs

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