Closed code423n4 closed 2 years ago
300 gas, mostly the storage pointer
Disagree with anonymous types and also with making variables private as they just change the functionality
Closing as unsatisfactory although it's one of the best "automated looking" reports, just missing substance
GAS OPTIMIZED CYCLE PATTERN
Inside the code:
GAS OPTIMIZED CYCLE WITH CACHING
Any calculations/loadings mut be done out of the cycle initialization Inside the code:
REPLACE != to == WHERE IT IS POSSIBLE
*Don't replace != 0 because the optimizer optimizes this structure very well Inside the code:
CACHE THE SAME CALCULATIONS/LOADINGS
Inside the code:
MAKE POINTER TO ELEMENTS OF MAPPING IF THEY REPEAT
Inside the code:
REPLACE TERNARY OPERATORS IN MOST CASES
Also check @audit comment here Inside the code:
REPALCE += 1 AND -= 1 TO ++ AND -- RESPECTIVELY
Inside the code:
ADD PAYABLE TYPE TO EVERY FUNCTION IF YOU FIND THIS NEEDED
It save about 24 gas per function call Inside the code:
ADD ANONYMOUS TYPE TO EVERY EVENT IF YOU FIND THIS NEEDED
Anonymous type make the event non-filterable from blockchain but it saves about 400 gas per event emition Inside the code:
MAKE CONSTANTS PRIVATE
Inside the code: