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

Use != 0 instead of > 0 for unsigned integer comparison

Summary

[G-11] Use != 0 instead of > 0 for unsigned integer comparison

it's generally more gas-efficient to use != 0 instead of > 0 when
comparing unsigned integer types.

file: /src/Escrow.sol
119 if (buyerAward > 0) {

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

file: /src/Escrow.sol
122 if (i_arbiterFee > 0) {

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

Support

FAQs

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