Skip to content

Commit

Permalink
use ethers v6
Browse files Browse the repository at this point in the history
  • Loading branch information
yuetloo committed Jan 18, 2024
1 parent 2af42d0 commit 8224941
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cancel-round.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Cancel current round
on: workflow_dispatch

env:
NODE_VERSION: 16.x
NODE_VERSION: 18.x
SUBGRPAH_URL: "https://api.thegraph.com/subgraphs/name/clrfund/clrfund-arbitrum-goerli"
WALLET_PRIVATE_KEY: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_WALLET_PRIVATE_KEY }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- major

env:
NODE_VERSION: 16.x
NODE_VERSION: 18.x
VITE_CLRFUND_FACTORY_ADDRESS: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707"
VITE_ETHEREUM_API_CHAINID: 1
VITE_ETHEREUM_API_URL: "dummy"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/finalize-round.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ on:
default: 'yuetloo/clrfund-dev'

env:
NODE_VERSION: 16.x
NODE_VERSION: 18.x
NETWORK: "arbitrum-goerli"
COORDINATOR_ETH_PK: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_WALLET_PRIVATE_KEY }}
COORDINATOR_PK: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_MACI_PRIVATE_KEY }}
JSONRPC_HTTP_URL: ${{ secrets.JSONRPC_HTTP_URL }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_ARBITRUM }}
ETHERSCAN_URL: "https://api-goerli.arbiscan.io"
CIRCUIT_TYPE: micro
ZKEYS_DOWNLOAD_SCRIPT: "download-6-8-2-3.sh"

jobs:
finalize:
Expand Down Expand Up @@ -47,7 +49,7 @@ jobs:
- name: Download batch 64 params
run: |
ls -la $GITHUB_WORKSPACE
$GITHUB_WORKSPACE/.github/scripts/download-batch64-params.sh
$GITHUB_WORKSPACE/monorepo/.github/scripts/${ZKEYS_DOWNLOAD_SCRIPT}
- name: Build
run: |
# use https to avoid error: unable to connect to github.com
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
- '.github/workflows/test-scripts.yml'

env:
NODE_VERSION: 16.x
NODE_VERSION: 18.x
ZKEYS_DOWNLOAD_SCRIPT: "download-6-8-2-3.sh"

jobs:
script-tests:
Expand Down Expand Up @@ -56,7 +57,7 @@ jobs:
path: monorepo
- name: Download batch 64 params
run: |
$GITHUB_WORKSPACE/monorepo/.github/scripts/download-6-8-2-3.sh
$GITHUB_WORKSPACE/monorepo/.github/scripts/${ZKEYS_DOWNLOAD_SCRIPT}
- name: Build CLR
run: |
cd monorepo
Expand Down
4 changes: 2 additions & 2 deletions contracts/cli/newRound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ async function main(args: any) {
})

const setUserRegistryTx = await clrfundContract.setUserRegistry(
userRegistryContract.address
userRegistryContract.target
)

await setUserRegistryTx.wait()
console.log(
`New ${args.userRegistryType} user registry: ${userRegistryContract.address}`
`New ${args.userRegistryType} user registry: ${userRegistryContract.target}`
)
}

Expand Down
28 changes: 25 additions & 3 deletions contracts/tasks/verifyAll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,27 @@ async function verifyClrFund(clrfund: Contract, run: any): Promise<string> {
}
}

async function verifyFundingRoundFactory(
clrfund: Contract,
run: any
): Promise<string> {
try {
const address = await clrfund.roundFactory()
if (address !== ZERO_ADDRESS) {
await run('verify:verify', { address })
}
return SUCCESS
} catch (error) {
return (error as Error).message
}
}

async function verifyRecipientRegistry(
factory: Contract,
clrfund: Contract,
run: any
): Promise<string> {
try {
const address = await factory.recipientRegistry()
const address = await clrfund.recipientRegistry()
if (address !== ZERO_ADDRESS) {
await run('verify-recipient-registry', { address })
}
Expand Down Expand Up @@ -101,7 +116,12 @@ async function verifyMaci(maciAddress: string, run: any): Promise<string> {

async function verifyTally(tally: Contract, run: any): Promise<string> {
try {
const constructorArguments = await Promise.all([tally.verifier()])
const constructorArguments = await Promise.all([
tally.verifier(),
tally.vkRegistry(),
tally.poll(),
tally.mp(),
])
await run('verify:verify', { address: tally.target, constructorArguments })
return SUCCESS
} catch (error) {
Expand Down Expand Up @@ -198,6 +218,8 @@ task('verify-all', 'Verify all clrfund contracts')
if (sponsor) {
await verifyContract('Sponsor', sponsor, run, results)
}
status = await verifyFundingRoundFactory(clrfundContract, run)
results.push({ name: 'Funding Round Factory', status })

const roundAddress = await clrfundContract.getCurrentRound()
if (roundAddress !== ZERO_ADDRESS) {
Expand Down
5 changes: 5 additions & 0 deletions contracts/tasks/verifyMaci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ task('verify-maci', 'Verify a MACI contract')
const maci = await ethers.getContractAt('MACI', maciAddress)
const constructorArguments = await Promise.all([
maci.pollFactory(),
maci.messageProcessorFactory(),
maci.tallyFactory(),
maci.subsidyFactory(),
maci.signUpGatekeeper(),
maci.initialVoiceCreditProxy(),
maci.topupCredit(),
maci.stateTreeDepth(),
])

console.log('Verifying the MACI contract', maciAddress)
Expand Down

0 comments on commit 8224941

Please sign in to comment.