diff --git a/.env.example b/.env.example index 53f820f..68be281 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,3 @@ -export ETH_FROM="YOUR_DEFAULT_SENDER_ACCOUNT" -export ETH_RPC_URL="https://rinkeby.infura.io/v3/INFURA_API_KEY" +API_KEY_ETHERSCAN="YOUR_API_KEY_ETHERSCAN" +API_KEY_INFURA="YOUR_API_KEY_INFURA" +MNEMONIC="YOUR_MNEMONIC" diff --git a/.github/workflows/deploy-test-token.yml b/.github/workflows/deploy-test-token.yml new file mode 100644 index 0000000..cb04c29 --- /dev/null +++ b/.github/workflows/deploy-test-token.yml @@ -0,0 +1,36 @@ +name: "Deploy Test Token" + +env: + API_KEY_ETHERSCAN: ${{ secrets.API_KEY_ETHERSCAN }} + API_KEY_INFURA: ${{ secrets.API_KEY_INFURA }} + MNEMONIC: ${{ secrets.MNEMONIC }} + +on: + workflow_dispatch: + inputs: + chain: + default: "goerli" + description: 'Chain name. Defaults to "goerli" if unspecified' + required: false + +jobs: + deploy-test-token: + runs-on: "ubuntu-latest" + steps: + - name: "Check out the repo" + uses: "actions/checkout@v3" + with: + submodules: "recursive" + + - name: "Install Foundry" + uses: "foundry-rs/foundry-toolchain@v1" + + - name: "Deploy a test ERC-20 token contract" + run: >- + forge script script/deploy/DeployTestToken.s.sol --broadcast --rpc-url "${{ github.event.inputs.chain }}" + -vvvv + + - name: "Add summary" + run: | + echo "## Deployment result" >> $GITHUB_STEP_SUMMARY + echo "✅ Passed" >> $GITHUB_STEP_SUMMARY diff --git a/foundry.toml b/foundry.toml index 2e89a91..e1251e0 100644 --- a/foundry.toml +++ b/foundry.toml @@ -21,6 +21,11 @@ [profile.ci] fuzz = { runs = 10_000 } +[etherscan] + ethereum = { key = "${API_KEY_ETHERSCAN}" } + goerli = { key = "${API_KEY_ETHERSCAN}" } + sepolia = { key = "${API_KEY_ETHERSCAN}" } + [fmt] bracket_spacing = true int_types = "long" @@ -30,3 +35,10 @@ quote_style = "double" tab_width = 4 wrap_comments = true + + +[rpc_endpoints] + ethereum = "https://mainnet.infura.io/v3/${API_KEY_INFURA}" + goerli = "https://goerli.infura.io/v3/${API_KEY_INFURA}" + localhost = "http://localhost:8545" + sepolia = "https://sepolia.infura.io/v3/${API_KEY_INFURA}"