diff --git a/.env.example b/.env.example index fe295b73..14d938c8 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ MAINNET_RPC= -MAINNET_DEPLOYER_PK= +MAINNET_DEPLOYER_NAME= SEPOLIA_RPC= -SEPOLIA_DEPLOYER_PK= +SEPOLIA_DEPLOYER_NAME= ETHERSCAN_API_KEY= diff --git a/README.md b/README.md index 7f350720..5a4d6546 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,21 @@ yarn coverage ### Setup -Configure the `.env` variables. +Configure the `.env` variables and source them: + +```bash +source .env +``` + +Import your private keys into Foundry's encrypted keystore: + +```bash +cast wallet import $MAINNET_DEPLOYER_NAME --interactive +``` + +```bash +cast wallet import $SEPOLIA_DEPLOYER_NAME --interactive +``` ### Sepolia diff --git a/foundry.toml b/foundry.toml index f3644c39..fcadc272 100644 --- a/foundry.toml +++ b/foundry.toml @@ -32,5 +32,5 @@ mainnet = "${MAINNET_RPC}" sepolia = "${SEPOLIA_RPC}" [etherscan] -mainnet = { key = "${ETHERSCAN_API_KEY}", chain = "mainnet" } -sepolia = { key = "${ETHERSCAN_API_KEY}", chain = "sepolia" } +mainnet = { key = "${ETHERSCAN_API_KEY}" } +sepolia = { key = "${ETHERSCAN_API_KEY}" } diff --git a/package.json b/package.json index b92bb27c..911a004b 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "build": "forge build", "build:optimized": "FOUNDRY_PROFILE=optimized forge build", "coverage": "forge coverage --report summary --report lcov --match-path 'test/unit/*'", - "deploy:mainnet": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK'", - "deploy:sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK'", + "deploy:mainnet": "bash -c 'source .env && forge script Deploy --rpc-url $MAINNET_RPC --account $MAINNET_DEPLOYER_NAME --broadcast --verify --chain mainnet -vvvvv'", + "deploy:sepolia": "bash -c 'source .env && forge script Deploy --rpc-url $SEPOLIA_RPC --account $SEPOLIA_DEPLOYER_NAME --broadcast --verify --chain sepolia -vvvvv'", "lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check", "lint:fix": "sort-package-json && forge fmt && yarn lint:sol-tests --fix && yarn lint:sol-logic --fix", "lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js",