Beginner FriendlyFoundryDeFiOracle
100 EXP
View results
Submission Details
Severity: low
Invalid

Save gas from zero address check

Summary

Reduce contract gas usage

Vulnerability Details

Checking if an address is zero is best done with assembly as this is way more safe and efficient than compoaring with addres(0)

Impact

excessive gas usage can rendered protocol useless

Tools Used

manual

Recommendations

replace line with the following assembly code

  bool isZero;
    assembly {
        mstore(0, 0x00)
        isZero := eq(someAddress, mload(0))
    }
    if (isZero) { // @audit - assembly can be used to reduce gas fee
        revert AssetToken__ZeroAddress();
    }
Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Gas optimizations

Support

FAQs

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