Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 1.28 KB

README.md

File metadata and controls

17 lines (12 loc) · 1.28 KB

4-byte-gen

Simple web app to generate optimized function selectors for Solidity.

Similar projects:

Example

Demonstration of the 4-byte-gen web UI finding optimized function names for standard ERC-20 functions.

  1. Input the standard ERC-20 functions transfer, transferFrom, and approve. You can copy the function definition directly from your Solidity code without modification.
  2. Adjust "Minimum number of zero bytes" to the desired number of zero bytes to mine for. Check out 4-byte-gas-test for a comparison of gas costs between functions with zero bytes.
  3. Click "Parse functions" and the tool will normalize the function definitions (i.e., remove spaces, input names, and extraneous keywords).
  4. Click "Start all" and the tool will start mining for optimized function names (each function is mined using its own web worker, so they are mined in parallel).