Core Contracts

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

Inconsistency Between Burn Amount and Emitted Event

Description

The DebtToken contract's burn function burns the non-scaled amount but emits an event with the scaled amount, leading to inconsistency between the actual state change and the emitted event. This makes it difficult for off-chain monitoring systems and users to track the correct burned amounts.

Affected code

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/tokens/DebtToken.sol#L170-L215

function burn(
address from,
uint256 amount,
uint256 index
) external override onlyReservePool returns (uint256, uint256, uint256, uint256) {
// ...
_burn(from, amount.toUint128()); // Burns non-scaled amount
emit Burn(from, amountScaled, index); // Emits scaled amount
// ...
}

Vulnerability details

The issue arises from:

  1. Burning the raw amount: _burn(from, amount.toUint128())

  2. But emitting the scaled amount: emit Burn(from, amountScaled, index)

  3. This inconsistency makes it impossible for observers to accurately track burning events

Impact:

  • Incorrect data in event logs

  • Difficulty in tracking actual burned amounts

  • Potential issues with off-chain monitoring systems

Tools Used

Manual Review

Recommended Mitigation Steps

Align the burned amount with the emitted event by either:

Option 1 - Burn scaled amount:

_burn(from, amountScaled.toUint128());
emit Burn(from, amountScaled, index);

Option 2 - Emit non-scaled amount:

_burn(from, amount.toUint128());
emit Burn(from, amount, index);
Updates

Lead Judging Commences

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