Skip to content

Commit

Permalink
fix(contracts): fix a deploy error in the hardhat task (#1702)
Browse files Browse the repository at this point in the history
* fix(contracts): fix a deploy error in the hardhat task

* ci: add a workflow to validate a hardhat tasks
  • Loading branch information
baumstern committed Jul 27, 2024
1 parent bd894d8 commit 0c01532
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/hardhat-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Hardhat Tasks

on:
push:
branches: [dev]
pull_request:

jobs:
hardhat-tasks:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install
run: |
pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: |
pnpm run build
- name: Run hardhat fork
run: |
cd contracts
pnpm run hardhat &
sleep 5
- name: Download zkeys
run: |
pnpm download-zkeys:test
- name: hardhat tasks
run: |
cd contracts
cp ./deploy-config-example.json ./deploy-config.json
pnpm deploy:localhost
pnpm deploy-poll:localhost
- name: Stop Hardhat
if: always()
run: kill $(lsof -t -i:8545)
62 changes: 62 additions & 0 deletions contracts/deploy-config-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,67 @@
"coordinatorPubkey": "macipk.9a59264310d95cfd8eb7083aebeba221b5c26e77427f12b7c0f50bc1cc35e621",
"useQuadraticVoting": false
}
},
"localhost": {
"ConstantInitialVoiceCreditProxy": {
"deploy": true,
"amount": 99
},
"FreeForAllGatekeeper": {
"deploy": true
},
"EASGatekeeper": {
"deploy": false,
"easAddress": "0xC2679fBD37d54388Ce493F1DB75320D236e1815e",
"schema": "0xe2636f31239f7948afdd9a9c477048b7fc2a089c347af60e3aa1251e5bf63e5c",
"attester": "the-attester-address"
},
"GitcoinPassportGatekeeper": {
"deploy": false,
"decoderAddress": "0xe53C60F8069C2f0c3a84F9B3DB5cf56f3100ba56",
"passingScore": 5
},
"ZupassGatekeeper": {
"deploy": false,
"signer1": "13908133709081944902758389525983124100292637002438232157513257158004852609027",
"signer2": "7654374482676219729919246464135900991450848628968334062174564799457623790084",
"eventId": "69c0caaa-c65d-5345-a20c-867774f18c67",
"zupassVerifier": "0x2272cdb3596617886d0F48524DA486044E0376d6"
},
"SemaphoreGatekeeper": {
"deploy": false,
"semaphoreContract": "0x0A09FB3f63c13F1C54F2fA41AFB1e7a98cffc774",
"groupId": 0
},
"MACI": {
"stateTreeDepth": 10,
"gatekeeper": "FreeForAllGatekeeper"
},
"VkRegistry": {
"stateTreeDepth": 10,
"intStateTreeDepth": 1,
"messageTreeDepth": 2,
"voteOptionTreeDepth": 2,
"messageBatchDepth": 1,
"zkeys": {
"qv": {
"processMessagesZkey": "../cli/zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey",
"tallyVotesZkey": "../cli/zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey",
"processWasm": "../cli/zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test_js/ProcessMessages_10-2-1-2_test.wasm",
"tallyWasm": "../cli/zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test_js/TallyVotes_10-1-2_test.wasm"
},
"nonQv": {
"processMessagesZkey": "../cli/zkeys/ProcessMessagesNonQv_10-2-1-2_test/ProcessMessagesNonQv_10-2-1-2_test.0.zkey",
"tallyVotesZkey": "../cli/zkeys/TallyVotesNonQv_10-1-2_test/TallyVotesNonQv_10-1-2_test.0.zkey",
"processWasm": "../cli/zkeys/ProcessMessagesNonQv_10-2-1-2_test/ProcessMessagesNonQv_10-2-1-2_test_js/ProcessMessagesNonQv_10-2-1-2_test.wasm",
"tallyWasm": "../cli/zkeys/TallyVotesNonQv_10-1-2_test/TallyVotesNonQv_10-1-2_test_js/TallyVotesNonQv_10-1-2_test.wasm"
}
}
},
"Poll": {
"pollDuration": 3600,
"coordinatorPubkey": "macipk.9a59264310d95cfd8eb7083aebeba221b5c26e77427f12b7c0f50bc1cc35e621",
"useQuadraticVoting": false
}
}
}
2 changes: 1 addition & 1 deletion contracts/tasks/deploy/maci/08-maci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ deployment.deployTask("full:deploy-maci", "Deploy MACI contract").then((task) =>
gatekeeperContractAddress,
constantInitialVoiceCreditProxyContractAddress,
stateTreeDepth,
emptyBallotRoots,
emptyBallotRoots.toString(),
],
network: hre.network.name,
});
Expand Down

0 comments on commit 0c01532

Please sign in to comment.