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

Constants in comparisons should appear on the left side

Summary

Constants in comparisons should appear on the left side

Vulnerability Details

Doing so will prevent typo bugs

Instances (6):

File: src/Escrow.sol
41: if (buyer == address(0)) revert Escrow__BuyerZeroAddress();
42: if (seller == address(0)) revert Escrow__SellerZeroAddress();
106: if (i_arbiter == address(0)) revert Escrow__DisputeRequiresArbiter();
128: if (buyerAward > 0) {
131: if (i_arbiterFee > 0) {
135: if (tokenBalance > 0) {

Link to code - https://github.com/Cyfrin/2023-07-escrow/tree/main/src/Escrow.sol

Tools Used

Manual Code Review

Recommendations

Use constants on the left side

Support

FAQs

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