code-423n4 / 2023-01-biconomy-findings

6 stars 8 forks source link

Gas Optimizations #539

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

See the markdown file with the details of this report here.

livingrockrises commented 1 year ago

https://ethereum.stackexchange.com/questions/139313/why-is-0-better-than-0-for-unsigned-integer-comparison

livingrockrises commented 1 year ago

^ above change I did on two of the contracts on Infinitism repo and ran their gas calcs to generate report. here is the PR diff view. https://github.com/eth-infinitism/account-abstraction/pull/177/files

does not seem like it's doing any gas savings, in-fact increases usage for most cases.

c4-sponsor commented 1 year ago

livingrockrises requested judge review

livingrockrises commented 1 year ago

on += COSTS MORE GAS THAN = + FOR STATE VARIABLES

I replace and getting below compilation error

`SyntaxError: Use of unary + is disallowed.
at (contracts/core/EntryPoint.sol:556)
actualGas =+ preGas - gasleft();

TypeError: Unary operator + cannot be applied to type uint256.
c4-sponsor commented 1 year ago

livingrockrises marked the issue as sponsor confirmed

livingrockrises commented 1 year ago

confirmed for long revert strings. Shift Right/Left instead of Division/Multiplication - potentially will be acknowledged

c4-judge commented 1 year ago

gzeon-c4 marked the issue as grade-c