Core Contracts

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

Redundant transfer event emission in DebtToken::mint

Summary

The DebtToken::mint function emits duplicate Transfer events, violating ERC20 standards and causing unnecessary gas costs. While both events contain identical data, this redundancy could confuse off-chain monitoring systems.

Vulnerability Details

In DebtToken.sol, the mint function emits the same Transfer event twice:

function mint(
address user,
address onBehalfOf,
uint256 amount,
uint256 index
) external override onlyReservePool returns (bool, uint256, uint256) {
// ... other code ...
_mint(onBehalfOf, amountToMint.toUint128()); // @audit First Transfer event from ERC20._mint
emit Transfer(address(0), onBehalfOf, amountToMint); // @audit Duplicate Transfer event
emit Mint(user, onBehalfOf, amountToMint, balanceIncrease, index);
return (scaledBalance == 0, amountToMint, totalSupply());
}

Each mint operation produces two identical events:

// First event from _mint
event Transfer(address(0), onBehalfOf, amountToMint);
// Second duplicate event
event Transfer(address(0), onBehalfOf, amountToMint);

Impact

The OpenZeppelin ERC20 implementation already emits a Transfer event in _mint, making the explicit emission redundant.

Impact

  1. Gas Impact:

    • Unnecessary gas cost for emitting duplicate events

    • Each redundant event costs approximately 1,500 gas

  2. Standard Compliance:

    • Violates ERC20 standard expectations of single event per transfer

    • May cause confusion in protocol documentation and auditing

  3. Minor Integration Impact:

    • Event listeners may need to deduplicate events

    • Slightly increased indexing storage requirements

Tools Used

  • Manual review

Recommendations

Remove the redundant Transfer event in DebtToken::mint

function mint(
address user,
address onBehalfOf,
uint256 amount,
uint256 index
) external override onlyReservePool returns (bool, uint256, uint256) {
// ... other code ...
_mint(onBehalfOf, amountToMint.toUint128());
- emit Transfer(address(0), onBehalfOf, amountToMint); // Remove duplicate
emit Mint(user, onBehalfOf, amountToMint, balanceIncrease, index);
return (scaledBalance == 0, amountToMint, totalSupply());
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
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!