22 lines
493 B
Markdown
22 lines
493 B
Markdown
# Private Key Best Practice
|
|
|
|
Utilize `cast wallet`
|
|
|
|
```bash
|
|
cast wallet import nameOfWalletOrAddress --interactive
|
|
```
|
|
|
|
Then run everything with private key from account
|
|
|
|
Previously:
|
|
|
|
```bash
|
|
forge script script/DeploySimpleStorage.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY
|
|
```
|
|
|
|
Now:
|
|
|
|
```bash
|
|
forge script script/DeploySimpleStorage.s.sol --rpc-url http://127.0.0.1:8545 --broadcast --account nameOfAccountGoesHere --sender 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
|
|
```
|