Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with CreateX salt scheme #17

Open
pcaversaccio opened this issue Dec 27, 2023 · 1 comment
Open

Compatibility with CreateX salt scheme #17

pcaversaccio opened this issue Dec 27, 2023 · 1 comment

Comments

@pcaversaccio
Copy link

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
  • The first 20 bytes (i.e. bebebebebebebebebebebebebebebebebebebebe) may be used to implement a permissioned deploy protection by setting them equal to msg.sender,
  • The 21st byte (i.e. ff) may be used to implement a cross-chain redeploy protection by setting it equal to 0x01,
  • The last random 11 bytes (i.e. 1212121212121212121212) allow for $2^{88}$ bits of entropy for mining a salt.

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
Copy link
Author

pcaversaccio commented Jan 29, 2024

See createXcrunch for a dedicated CreateX cruncher implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant