Open codehawks-bot opened 1 year ago
Gas Optimization / Informational
https://github.com/Cyfrin/2023-07-escrow/tree/main/src/Escrow.sol
Constants in comparisons should appear on the left side
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
Manual Code Review
Use constants on the left side
Constants in comparisons should appear on the left side
Severity
Gas Optimization / Informational
Relevant GitHub Links
https://github.com/Cyfrin/2023-07-escrow/tree/main/src/Escrow.sol
Summary
Constants in comparisons should appear on the left side
Vulnerability Details
Doing so will prevent typo bugs
Instances (6):
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