-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(cast): add options to randomize initial nonce #6443
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help message not specific enough
crates/cast/bin/cmd/create2.rs
Outdated
#[clap(long, value_name = "HEX")] | ||
seed: Option<B256>, | ||
|
||
/// Don't initialize the nonce with a random value, and instead use the default value of 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which nonce?
crates/cast/bin/cmd/create2.rs
Outdated
|
||
/// Address of the caller. Used for the first 20 bytes of the salt. | ||
#[clap(long, value_name = "ADDRESS")] | ||
caller: Option<Address>, | ||
|
||
/// Seed for the random number generator that's used to initialize the nonce. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which nonce?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops meant salt not nonce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Motivation
There is currently no way to randomize the initial nonce since it always starts at 0.
Solution
Randomize the nonce by default, with an optional
--seed
. This randomization can be disabled with--no-random
.Also fix a panic with
-j0
.