code-423n4 / 2022-04-backd-findings

6 stars 4 forks source link

Gas Optimizations #156

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago
  1. Change the incremental logic from i++ to ++i in order to save some opcodes:

  2. Use delete instead of set to default value (false or 0)

  3. Cache static keccak256 in order to reduce the computation.

  4. Remove returns because always returns the same value.