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

nonReentrant modifier should be placed before all other modifiers.

Summary

The function Escrow.resolveDispute() uses the onlyArbiter and nonReentrant modifier, with this order.

Vulnerability Details

The nonReentrant modifier doesn't protect against reentrancy during the execution of the first modifier. Practically, there cannot be any reentrancy there when considering the current implementation of onlyArbiter, but it is still a best practice recommendation for safe programming.

File: 2023-07-escrow/src/Escrow.sol
109: function resolveDispute(uint256 buyerAward) external onlyArbiter nonReentrant inState(State.Disputed) {

Impact

Place modifiers in the right order as a best practice.

Tools Used

Manual code review.

Recommendations

Use the nonReentrant modifier before any other modifier.

Support

FAQs

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