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

feat(anvil/cast): mnemonic generation #6066

Merged
merged 6 commits into from
Nov 3, 2023

Conversation

teddav
Copy link
Contributor

@teddav teddav commented Oct 19, 2023

Added some new options in Anvil and Cast to ease mnemonic generation.

Cast

Added a "new-mnemonic" (or nm) option to generate a new mnemonic and generate a requested number of accounts from the mnemonic.
Example: cast wallet nm --words 12 --accounts 6
Generates a 12 words mnemonic and displays the first 6 accounts derived from that mnemonic.

Anvil

Added 2 options:

  • mnemonic-random to start Anvil with a randomly generated mnemonic
  • mnemonic-seed to provide a seed that generates a mnemonic. Useful for testing so that the base accounts are always the same
    Examples:
anvil --mnemonic-seed 42
anvil --mnemonic-random

@teddav
Copy link
Contributor Author

teddav commented Oct 19, 2023

I'll update the doc once it's merged
https://book.getfoundry.sh/reference/cast/cast-wallet

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

straightforward! some convo around output/commands:

crates/cast/bin/cmd/wallet/mod.rs Outdated Show resolved Hide resolved
crates/anvil/src/cmd.rs Outdated Show resolved Hide resolved
@Evalir
Copy link
Member

Evalir commented Nov 1, 2023

This is also gonna need a rebase—sorry, lots of moving parts right now!

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! pushed a smol commit to remove unwraps—thanks!

@Evalir Evalir merged commit 691e1bd into foundry-rs:master Nov 3, 2023
17 checks passed
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

Successfully merging this pull request may close these issues.

3 participants