15,000 USDC
View results
Submission Details
Severity: gas
Valid

The `nonReentrant` `modifier` should occur before all other modifiers

Summary

The nonReentrant modifier should occur before all other modifiers

Vulnerability Details

This is a best-practice to protect against reentrancy in other modifiers

Instances (4):

File: src/DSCEngine.sol
154: nonReentrant
187: nonReentrant
198: function mintDsc(uint256 amountDscToMint) public moreThanZero(amountDscToMint) nonReentrant {
233: nonReentrant

Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol

Tools Used

Manual inspection

Recommendations

Consider placing the nonReentrant modifier as the first modifier.

Support

FAQs

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