Skip to content

Commit feb51a2

Browse files
committed
ci: add deployment workflow for ERC-20 token
build: set up Etherscan API and Infura PRC in Foundry config chore: add mnemonic in ".env.example"
1 parent 766cb21 commit feb51a2

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed

.env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
export ETH_FROM="YOUR_DEFAULT_SENDER_ACCOUNT"
2-
export ETH_RPC_URL="https://rinkeby.infura.io/v3/INFURA_API_KEY"
1+
API_KEY_ETHERSCAN="YOUR_API_KEY_ETHERSCAN"
2+
API_KEY_INFURA="YOUR_API_KEY_INFURA"
3+
MNEMONIC="YOUR_MNEMONIC"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Deploy Test Token"
2+
3+
env:
4+
API_KEY_ETHERSCAN: ${{ secrets.API_KEY_ETHERSCAN }}
5+
API_KEY_INFURA: ${{ secrets.API_KEY_INFURA }}
6+
MNEMONIC: ${{ secrets.MNEMONIC }}
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
chain:
12+
default: "goerli"
13+
description: 'Chain name. Defaults to "goerli" if unspecified'
14+
required: false
15+
16+
jobs:
17+
deploy-test-token:
18+
runs-on: "ubuntu-latest"
19+
steps:
20+
- name: "Check out the repo"
21+
uses: "actions/checkout@v3"
22+
with:
23+
submodules: "recursive"
24+
25+
- name: "Install Foundry"
26+
uses: "foundry-rs/foundry-toolchain@v1"
27+
28+
- name: "Deploy a test ERC-20 token contract"
29+
run: >-
30+
forge script script/deploy/DeployTestToken.s.sol --broadcast --rpc-url "${{ github.event.inputs.chain }}"
31+
-vvvv
32+
33+
- name: "Add summary"
34+
run: |
35+
echo "## Deployment result" >> $GITHUB_STEP_SUMMARY
36+
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

foundry.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
[profile.ci]
2222
fuzz = { runs = 10_000 }
2323

24+
[etherscan]
25+
ethereum = { key = "${API_KEY_ETHERSCAN}" }
26+
goerli = { key = "${API_KEY_ETHERSCAN}" }
27+
sepolia = { key = "${API_KEY_ETHERSCAN}" }
28+
2429
[fmt]
2530
bracket_spacing = true
2631
int_types = "long"
@@ -30,3 +35,10 @@
3035
quote_style = "double"
3136
tab_width = 4
3237
wrap_comments = true
38+
39+
40+
[rpc_endpoints]
41+
ethereum = "https://mainnet.infura.io/v3/${API_KEY_INFURA}"
42+
goerli = "https://goerli.infura.io/v3/${API_KEY_INFURA}"
43+
localhost = "http://localhost:8545"
44+
sepolia = "https://sepolia.infura.io/v3/${API_KEY_INFURA}"

0 commit comments

Comments
 (0)