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

📝 cast create2 #1038

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/reference/cast/cast-create2.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,44 @@ Generate a deterministic contract address using CREATE2

### OPTIONS

`--starts-with` *hex*
    Prefix for the contract address.

`--ends-with` *hex*
    Suffix for the contract address

`--matching` *hex*
    Sequence that the address has to match

`--case-sensitive`
    Case sensitive matching

`--deployer` *address*
    Address of the contract deployer [default: `0x4e59b44847b379578588920ca78fbf26c0b4956c`]

`--init-code` *hex*
    Init code of the contract to be deployed [default: ]
Evalir marked this conversation as resolved.
Show resolved Hide resolved

`--init-code-hash` *hash*
    Init code hash of the contract to be deployed

{{#include common-options.md}}

### EXAMPLES

1. Generate a contract address that starts with `dead`:
```sh
cast create2 --starts-with dead
```
2. Generate a contract address that ends with `beef`:
```sh
cast create2 --ends-with beef
```
3. A more complex example:
```sh
cast create2 --starts-with dead --case-sensitive --deployer 0x0000000000FFe8B47B3e2130213B802212439497 --init-code-hash 0x0c591f26891d6443cf08c5be3584c1e6ae10a4c2f07c5c53218741e9755fb9cd
```

### SEE ALSO

[cast](./cast.md), [cast compute-address](./cast-compute-address.md)
Expand Down