foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Home Page:https://getfoundry.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support loading mnemonic + HD path as encrypted keystore

GopherJ opened this issue · comments

Component

Cast

Describe the feature you would like

Currently cast only support generating random keypair, it'll be great to support creating encrypted keystore using existing mnemonic + HD path.

Metamask didn't support exporting as encrypted json. That's why I'm seeking tools to export without re-inventing wheels

Additional context

No response

An API like:

cast wallet import <NAME> <KEY>

Which then prompts the user for a password, and ecrypts it locally. Somewhere like:

~/.cast/wallets/<name>_keystore.json

Then, have a command to list stored keystores:

cast wallet list

And, then, when deploying commands with forge or cast, add the option to prompt the user to decrypt their password:

$ forge script script/Deploy.s.sol --rpc-url $RPC_URL --cast-wallet <WALLET_NAME>

enter password to decrypt <WALLET_NAME>
_

Or

$ cast send [TO] [SIG] [ARGS] --cast-wallet <WALLET_NAME>

enter password to decrypt <WALLET_NAME>
_

I believe this feature has been added in #5551. Should this issue be closed?

Done on #5551