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

Use assembly to check for `address(0)`

It is more gas efficient to use assembly to check for address(0). Example code is at Solidity Assembly: Checking if an Address is 0 (Efficiently).

Vulnerability Details

There are 2 instances of this issue.

File: src/Lender.sol
167: if (pools[poolId].lender == address(0)) {
240: if (pool.lender == address(0)) revert PoolConfig();
File Link Instance Count Instance Links
Lender.sol 2 167,240

Impact

12 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.