EVM golf #9:
Warning: Hardcore level!
Smallest bytecode fully compliant ERC20 implementation.
Deployed contract on Rinkeby: 0xf8B33db61c072264bEBB1333c8064BA43C3a6347
| bytecode | deployed bytecode |
|---|---|
| 360 bytes | 337 bytes |
Added more opcode optimization in the expense of gas costs. You can have look at the funky-optimizations branch.
Benchmark for modified funky-optimizations:
| bytecode | deployed bytecode |
|---|---|
| 273 bytes | 187 bytes |
Deployed funky optimized contract on Rinkeby: 0x8b38be1ff7c640079acc30833148055086631a1e
- event topics are not stored in storage for gas optimization
- storage is only used for balances and allowances
- refactor
allowance_slotmacro - hoist up some of the repeated constants up and use
dupNopcodes, might not be good for gas.
-
etkdoesn't allow comment only lines in macros