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

Use nested if and, avoid multiple check combinations

Summary

[G-7] Use nested if and, avoid multiple check combinations

Using nested if is cheaper than using && multiple check combinations. There are more advantages, such as easier to read code and better coverage reports.

file: /src/Escrow.sol
67 if (msg.sender != i_buyer && msg.sender != i_seller) {

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

Support

FAQs

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