Cyfrin / 2023-07-foundry-defi-stablecoin

37 stars 32 forks source link

Lack of event emissions for some operations #1105

Closed codehawks-bot closed 1 year ago

codehawks-bot commented 1 year ago

Lack of event emissions for some operations

Severity

Gas Optimization / Informational

Summary

Lack of event emissions for some operations, including minting and burning of the Decentralized Stablecoin

Vulnerability Details

The contract does not emit events for all state-modifying operations.

Impact

This could potentially make it difficult to monitor the health of the contract and the stable coin off chain, impacting information about liquidation possibilities.

Tools Used

Manual Review

Recommendations

It is recommended to emit events for all state-modifying operations. I would recommend doing this in the DSCEngine Contract to be uniform with events and because this is where the functionality as the owner of the Decentralised Stablecoin resides. Furthermore, the Engine contract is where the state of what is burned and minted as per the "debt" owing is stored so this is where the events should be emitted from.

PatrickAlphaC commented 1 year ago

You gotta list the events. This is too vague.