foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(cast): derive accounts from mnemonic

Open leovct opened this issue 2 weeks ago • 7 comments

Closes #12676

MNEMONIC="code code code code code code code code code code code quality"
cast wallet derive "$MNEMONIC" --accounts 3 --insecure --json

will produce:

[
  {
    "address": "0x85dA99c8a7C2C95964c8EfD687E95E632Fc533D6",
    "private_key": "0x42b6e34dc21598a807dc19d7784c71b2a7a01f6480dc6f58258f78e539f1a1fa"
  },
  {
    "address": "0x125FB391bA829e0865963D3B91711610049a9e78",
    "private_key": "0x0903a9a721167e2abaa0a33553cbeb209dc9300d28e4e4d6d2fac2452f93e357"
  },
  {
    "address": "0x964ec59D0E05Db08440c822d7C588e63BBDE8c4e",
    "private_key": "0x6421222a9964cbe1b411191dcac1afda173ed99346c47302c6fe88f65d83583e"
  }
]

leovct avatar Dec 01 '25 06:12 leovct

@zerosnacks would you mind re-triggering the failing job? I believe it failed because of an unrelated flaky test - thank you!

leovct avatar Dec 01 '25 06:12 leovct

lgtm! would you mind adding a test case for the text and json variants?

zerosnacks avatar Dec 01 '25 10:12 zerosnacks

wallet derive tests seem to pass but the ci is failing because of a flaky test once again

PASS [   0.240s] ( 593/1640) cast::cli wallet_derive_mnemonic_insecure
PASS [   0.245s] ( 594/1640) cast::cli wallet_derive_mnemonic
PASS [   0.238s] ( 595/1640) cast::cli wallet_derive_mnemonic_insecure_json
PASS [   0.305s] ( 596/1640) cast::cli wallet_change_password
PASS [   3.836s] ( 597/1640) cast::cli run_succeeds
PASS [   0.242s] ( 598/1640) cast::cli wallet_derive_mnemonic_json

leovct avatar Dec 02 '25 06:12 leovct

it seems like the CI failure for Win is a legit one, need to investigate it why happens

grandizzy avatar Dec 02 '25 13:12 grandizzy

it seems like the CI failure for Win is a legit one, need to investigate it why happens

I tried to rebase but CI is now failing because of another error :(

leovct avatar Dec 03 '25 14:12 leovct

it seems like the CI failure for Win is a legit one, need to investigate it why happens

I tried to rebase but CI is now failing because of another error :(

checking, most probably related to post release support added in svm-rs and now 0.8.31 out

grandizzy avatar Dec 03 '25 14:12 grandizzy

I see win failing with same overflow I get locally re WalletOpts, checking why this happens 👀

grandizzy avatar Dec 10 '25 07:12 grandizzy

https://github.com/foundry-rs/foundry/pull/12867 should fix the win failure, will rebase this PR when merged

grandizzy avatar Dec 18 '25 08:12 grandizzy