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

Nesting If Statement Can Be Gas Efficient

Summary

If statements that use && can be refactored into nested if statements

Vulnerability Details

Impact

Nesting if using AND can save gas to some extent

Tools Used

Manual Review

Recommendations

Here's Reference : C4 Caviar Contest Report
Use Nested if i.e,

if (msg.sender != i_buyer) {
if (msg.sender != i_seller) {
revert Escrow__OnlyBuyerOrSeller();
}
}

Support

FAQs

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