-
Notifications
You must be signed in to change notification settings - Fork 809
fix: added warning about using private keys in plaintext #1031
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -842,6 +842,12 @@ Make sure you deposit funds on zkSync Era using [one of the available bridges](h | |
|
||
1. In the `deploy` folder, create the file `deploy-factory.ts` and copy/paste the following code, replacing `<WALLET_PRIVATE_KET>` with your private key. | ||
|
||
::: warning | ||
Remember to use a private key that only has testnet funds if you are going to paste your private key in plaintext. It is recommended to [never have a private key associated with real funds in plaintext.](https://github.com/Cyfrin/foundry-full-course-f23/discussions/5). | ||
|
||
If you wish to use hardhat with real funds, it's recommended to encrypt your key so it's not accidentally exposed. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have a link to an example we can link to for encrypting your Private Key for use with something like Hardhat? Also, as a general note, the upcoming new docs will lean more on tools like Foundry's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For Hardhat, you have to roll your own encryption script. They recommend using their variables setting, but I don't like it because the keys are still in plaintext and just moved elsewhere. I have used this example in the past to encrypt and decrypt your own keys. The project has an example of encrypting and decrypting the keys.
I'll add this example to the warning. |
||
::: | ||
|
||
```ts | ||
import { utils, Wallet } from "zksync-ethers"; | ||
import * as ethers from "ethers"; | ||
|
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.
Let's please update all instances where this warning should be added. I believe the other tutorials also need this warning.
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.
Done!