code-423n4 / 2022-10-inverse-findings

0 stars 0 forks source link

Gas Optimizations #520

Closed code423n4 closed 1 year ago

code423n4 commented 2 years ago

Avoid use of '&&' within a require function

Splitting into separate require() statements saves gas


DBR.sol: L249

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

Recommendation:

            require(recoveredAddress != address(0), "INVALID_SIGNER");
            recoveredAddress == owner, "INVALID_SIGNER");

Similarly for the following:

Market.sol: L75

Market.sol: L162

Market.sol: L173

Market.sol: L184

Market.sol: L195

Market.sol: L448

Market.sol: L512



c4-judge commented 1 year ago

0xean marked the issue as grade-c