Saw-mon-and-Natalie
ERC20-Golf

ERC20.⛳

Last updated Jan 21, 2025
20
Stars
0
Forks
0
Issues
0
Stars/day
Attention Score
4
Language breakdown
No language data available.
Files click to expand
README

ERC20-Golf

@the_ethernaut :

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

Notes

  • event topics are not stored in storage for gas optimization
  • storage is only used for balances and allowances

TODO

  • [ ] refactor allowance_slot macro
  • [ ] hoist up some of the repeated constants up and use dupN opcodes, might not be good for gas.

Issues

  • [x] etk doesn't allow comment only lines in macros

Ref

© 2026 GitRepoTrend · Saw-mon-and-Natalie/ERC20-Golf · Updated daily from GitHub