Cyfrin / 2023-07-escrow

17 stars 12 forks source link

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

Open codehawks-bot opened 11 months ago

codehawks-bot commented 11 months ago

The nonReentrant modifier should occur before all other modifiers

Severity

Gas Optimization / Informational

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-escrow/tree/main/src/Escrow.sol#112

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 (1):

File: src/Escrow.sol

112:     function resolveDispute(uint256 buyerAward) external onlyArbiter nonReentrant inState(State.Disputed) {

Link to code - https://github.com/Cyfrin/2023-07-escrow/tree/main/src/Escrow.sol

Tools Used

Manual Code Review

Recommendations

Add nonReentrant modifier before all other modifiers