From 53d045743d086c1ed138fa74061fb5264f6bb600 Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Sun, 8 Jan 2023 22:15:38 +0200 Subject: [PATCH] feat: add "[etherscan]" and "[rpc_endpoints]" configuration docs: update deployment script usage in README feat: add "INFURA_API_KEY", "ETHERSCAN_API_KEY" refactor: replace "PRIVATE_KEY" with "MNEMONIC" --- .env.example | 6 ++++-- README.md | 3 +-- foundry.toml | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 67c5d3a..729b6a3 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,4 @@ -export ETH_RPC_URL="https://sepolia.infura.io/v3/INFURA_API_KEY" -export PRIVATE_KEY="YOUR_PRIVATE_KEY" +ETH_RPC_URL="https://goerli.infura.io/v3/INFURA_API_KEY" +ETHERSCAN_API_KEY="YOUR_ETHERSCAN_API_KEY" +INFURA_API_KEY="YOUR_INFURA_API_KEY" +MNEMONIC="YOUR_MNEMONIC" diff --git a/README.md b/README.md index a2fc446..ae9bd31 100644 --- a/README.md +++ b/README.md @@ -139,8 +139,7 @@ $ forge coverage Deploy to Anvil: ```sh -$ forge script script/Foo.s.sol:FooScript --fork-url http://localhost:8545 \ - --broadcast --private-key $PRIVATE_KEY +$ forge script script/Foo.s.sol --broadcast --fork-url http://localhost:8545 ``` For instructions on how to deploy to a testnet or mainnet, check out the diff --git a/foundry.toml b/foundry.toml index 568725e..c0d8d6e 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,5 +1,8 @@ # Full reference https://github.com/foundry-rs/foundry/tree/master/config +[etherscan] +goerli = { key = "${ETHERSCAN_API_KEY}" } + [fmt] bracket_spacing = true int_types = "long" @@ -27,3 +30,6 @@ test = "test" fuzz = { runs = 10_000 } verbosity = 4 +[rpc_endpoints] +localhost="http://localhost:8545" +goerli="https://goerli.infura.io/v3/${INFURA_API_KEY}"