code-423n4 / 2022-09-nouns-builder-findings

10 stars 6 forks source link

Gas Optimizations #637

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Check if uint256 is not zero with num != 0 instead of num > 0 to save gas

https://github.com/code-423n4/2022-09-nouns-builder/blob/debe9b792cc70510eadf9b3728cde5b0f2ec9a1f/src/lib/token/ERC721Votes.sol#L203

Use private instead of public for constants to save gas

https://github.com/code-423n4/2022-09-nouns-builder/blob/debe9b792cc70510eadf9b3728cde5b0f2ec9a1f/src/governance/governor/Governor.sol#L27

GalloDaSballo commented 2 years ago

Both are not going to save gas for end users