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

Use assembly to check for `address(0)`

Summary

Example code is at Solidity Assembly: Checking if an Address is 0 (Efficiently).

Vulnerability Details

There are 4 instances of this issue.

File: 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();
File Link Instance Count Instance Links
Escrow.sol 4 40,41,42,103

Impact

24 gas

Tools Used

baudit: a custom static code analysis tool; manual review

Recommendations

Use assembly to check for address(0).

Support

FAQs

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