sstore2 icon indicating copy to clipboard operation
sstore2 copied to clipboard

A few low-level gas optimizations.

Open Saw-mon-and-Natalie opened this issue 3 years ago • 0 comments

Changes to contracts/utils/Bytecode.sol:

  • creationCodeFor has been changed to use PUSH2 instead of PUSH4 since there is a max contract size limit of 24576 bytes which is less than 2^16 = 65536 (uint16). Also PUSH1 0 instructions have been changed to RETURNDATASIZE.
  • codeAt has been changed so that only one subtraction is used to calculate size and also an extra addition in the assembly block has been removed to replace 0x20 + 0x1f with 0x3f.

All tests are passing.

Saw-mon-and-Natalie avatar Jun 14 '22 04:06 Saw-mon-and-Natalie