Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonofmosiah/evm-vanity-address-generator
Rust application for hashing deterministic addresses for smart contracts on EVM chains
https://github.com/sonofmosiah/evm-vanity-address-generator
blockchain ethereum evm smart-contracts vanity-address
Last synced: 9 days ago
JSON representation
Rust application for hashing deterministic addresses for smart contracts on EVM chains
- Host: GitHub
- URL: https://github.com/sonofmosiah/evm-vanity-address-generator
- Owner: SonOfMosiah
- License: mit
- Created: 2022-07-14T17:28:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-31T06:52:27.000Z (over 2 years ago)
- Last Synced: 2024-11-23T05:10:36.671Z (2 months ago)
- Topics: blockchain, ethereum, evm, smart-contracts, vanity-address
- Language: C
- Homepage:
- Size: 2.6 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EVM Vanity Address Generator
> A Rust program for finding salts that create gas-efficient Ethereum addresses via CREATE2.
Provide three arguments: a factory address (or contract that will call CREATE2), a caller address (for factory addresses that require it as a protection against frontrunning), and the keccak-256 hash of the bytecode of the contract that the factory will deploy.
```sh
$ git clone https://github.com/ammonwerner1/evm-vanity-address-generator
$ cd evm-vanity-address-generator
$ export FACTORY=""
$ export CALLER=""
$ export INIT_CODE_HASH=""
$ cargo run --release $FACTORY $CALLER $BYTECODE_HASH
```For each efficient address found, the salt, resultant addresses, and value _(i.e. approximate rarity)_ will be written to `efficient_addresses.txt`. Verify that one of the salts actually results in the intended address before getting in too deep - ideally, the CREATE2 factory will have a view method for checking what address you'll get for submitting a particular salt. Be sure not to change the factory address or the init code without first removing any existing data to prevent the two salt types from becoming commingled. There's also a _very_ simple monitoring tool available if you run `$python3 analysis.py` in another tab.
There is also an experimental OpenCL feature that can be used to search for addresses using a GPU. To give it a try, include a fourth parameter specifying the device ID to use, and optionally a fifth and sixth parameter to filter returned results by a threshold based on leading zero bytes and total zero bytes, respectively. By way of example, to perform the same search as above, but using OpenCL device 2 and only returning results that create addresses with at least four leading zeroes or six total zeroes, use `$ cargo run --release $FACTORY $CALLER $BYTECODE_HASH 2 4 6` (you'll also probably want to try tweaking the `WORK_SIZE` parameter in `src/lib.rs`).
PRs welcome!