The contract Escrow.sol uses reentrancy guard contract and nonReentrant modifier to not allow someone to reenter into the same function twice but it is not required as inState modifier ensures that a function can only be called by a particular State type. And all of these State types are updated before any external calls so, Reentrancy is not possible. So, they can be removed to save some gas.
The contract Escrow inherits reentrancy guard and function resolveDispute uses nonReentrant modifier which is not necessary and can be removed. It can save up to 276 gas for resolveDispute function and 40525 gas in deployment cost.
Gas Savings for resolveDispute function:
| Average | Median | Max | |
|---|---|---|---|
| Before | 27017 | 22342 | 62460 |
| After | 26794 | 22094 | 62184 |
Deployment cost and deployment size:
| Deployment cost | Deployment size | |
|---|---|---|
| Before | 591900 | 3666 |
| After | 551375 | 3569 |
Manual Analysis and Gas savings are calculated using $ forge test --gas-report
Don't inherit from reentrancy guard and don't use nonReentrant modifier in the resolveDispute function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.