15,000 USDC
View results
Submission Details
Severity: gas

Missing Events

Summary

Critical and key functions are missing events.

Vulnerability Details

  • Function liquidation() DSCEngine.sol line 229 does not emit an event

  • Functions depositCollateralAndMintDsc(...) and depositCollateral(...) although emitting event. It may be critical to emit different events to differentiate a deposit with a mint of DSC tokens vs a deposit without minting DSC tokens

  • Functions redeemCollateralForDsc(...) and redeemCollateral(...) although emitting event. It may be critical to emit different events to differentiate a deposit with a burn of DSC tokens vs a deposit without burning DSC tokens

Impact

Informational: It is very important to keep track of the key aspects of the protocol e.g depositing collateral, redeeming collateral, liquidations. Events are important for front ends, off-chain tooling, off chain monitoring, security eg. if too many liquidations happening or unusual size liquidations can be tracked

Tools Used

Manual Analysis

Recommendations

It is recommended that all critical functions emit appropriate and unique and or relevant events. Consider the examples below

  1. To distinguish depositCollateralAndMintDsc(...) and depositCollateral(...) either create different events event CollateralDeposited(...) and event CollateralDepositedMint() or add an event DSCMintEvent(...) to mintDSC(..) function so that CollateralDepositedMint() emits two events to show difference

  2. To distinguish redeemCollateralForDsc(...) and redeemCollateral(...) either create different events event CollateralRedeemed(...) and event CollateralRedeemedBurn() or add an event DSCBurnEvent(...) to burnDSC(..) function so that CollateralRedeemedBurn() emits two events to show difference

  3. Add event for liquidate e.g event Liquidation(...)

Support

FAQs

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