-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to use Foundry keystore (#84)
# What 💻 * Updates 101 getting started to setup a keystore * Updates all 101 Foundry tutorials to use keystore in commands to deploy/send txs * Update all commands in Foundry guide with examples of keystore use and PK. * Additionally, fixes a partial not correctly displayed in paymaster page # Why ✋ * Fixes DEVRL676 * To be merged with matter-labs/zksync-contract-templates#14 # Evidence 📷 Include screenshots, screen recordings, or `console` output here demonstrating that your changes work as intended <!-- All sections below are optional. You can uncomment any section applicable to your Pull Request. --> <!-- # Notes 📝 * Any notes/thoughts that the reviewers should know prior to reviewing the code? --> --------- Co-authored-by: Nicolas Villanueva <[email protected]>
- Loading branch information
1 parent
a3976c8
commit ebf8b50
Showing
7 changed files
with
55 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: foundry create keystore | ||
--- | ||
|
||
Follow these steps to securely store your wallet's private key to use it in Foundry projects: | ||
|
||
1. **Extract Your Private Key:** If you are using the local era node, use a private key from the available rich | ||
accounts. Otherwise, find your personal wallet's private key. For MetaMask users, here's how to [export your wallet's | ||
private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key). | ||
|
||
2. **Create a Foundry keystore:** Create a keystore and import your private key by running | ||
|
||
```bash | ||
cast wallet import myKeystore --interactive | ||
# enter your PK when prompted, provide a password, and copy the returned address | ||
``` | ||
|
||
It'll return an address (keystore address). | ||
|
||
::callout{icon="i-heroicons-information-circle" color="blue"} | ||
Note that the name `myKeystore` is arbitrary and can be updated. For our docs, we've chosen this name for consistency. | ||
If you decide to use another name, be sure to reference it when using `cast`. | ||
:: | ||
|
||
#### Using the keystore | ||
|
||
When running commands that require a private key, like `forge create` or `cast send`, use `--account myKeystore --sender <KEYSTORE_ADDRESS>`. This will | ||
require you to enter the keystore password you provided before. |