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

Use assembly to check for address(0)

Summary

Use assembly to check for address(0).

Vulnerability Details

You can save about 6 gas per instance if using assembly to check for address(0)

Impact

There are 4 instances of this issue:

File: 2023-07-escrow/src/Escrow.sol

40: if (address(tokenContract) == address(0)) revert Escrow__TokenZeroAddress();
41: if (buyer == address(0)) revert Escrow__BuyerZeroAddress();
42: if (seller == address(0)) revert Escrow__SellerZeroAddress();
103: if (i_arbiter == address(0)) revert Escrow__DisputeRequiresArbiter();

Tools Used

Manual code review.

Recommendations

Consider using assembly instead.

Support

FAQs

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