Open codehawks-bot opened 1 year ago
nonReentrant
modifier
Gas Optimization / Informational
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol
The nonReentrant modifier should occur before all other modifiers
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
Code Review using VSCode
Put the nonReentrant modifier as the first modifier
The
nonReentrant
modifier
should occur before all other modifiersSeverity
Gas Optimization / Informational
Relevant GitHub Links
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol
Summary
The
nonReentrant
modifier
should occur before all other modifiersVulnerability Details
This is a best-practice to protect against reentrancy in other modifiers
Instances (4):
Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol
Tools Used
Code Review using VSCode
Recommendations
Put the
nonReentrant
modifier
as the first modifier