0age / create2crunch

A Rust program for finding salts that create gas-efficient Ethereum addresses via CREATE2.
MIT License
483 stars 85 forks source link

Compatibility with `CreateX` `salt` scheme #17

Open pcaversaccio opened 10 months ago

pcaversaccio commented 10 months ago

Background

CreateX is now live on 56 EVM chains (see also createx.rocks). TL;DR: CreateX is a factory smart contract to make easier and safer usage of the CREATE and CREATE2 EVM opcodes as well as of CREATE3-based (i.e. without an initcode factor) contract creations.

CreateX salt scheme

The full documentation can be viewed here.

CreateX implements some special features:

  1. Permissioned Deploy Protection
  2. Cross-Chain Redeploy Protection

The salt value implements these different safeguarding mechanisms depending on the encoded values in the salt (|| stands for byte-wise concatenation):

=> salt (32 bytes) = 0xbebebebebebebebebebebebebebebebebebebebe||ff||1212121212121212121212

Feature Request

Make create2crunch compatible with CreateX's salt scheme. I'm pretty sure some of the Foundry contributors can be motivated to tackle this challenge :). Cc: @mds1 @Vectorized

pcaversaccio commented 9 months ago

See createXcrunch for a dedicated CreateX cruncher implementation.