Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(contracts): add deploy scripts #269

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/hardhat-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Hardhat Tasks

on:
push:
branches: [main]
pull_request:

env:
NEXT_PUBLIC_CHAIN_NAME: ${{ vars.NEXT_PUBLIC_CHAIN_NAME }}
NEXT_PUBLIC_ADMIN_ADDRESS: ${{ vars.NEXT_PUBLIC_ADMIN_ADDRESS }}
NEXT_PUBLIC_APPROVAL_SCHEMA: ${{ vars.NEXT_PUBLIC_APPROVAL_SCHEMA }}
NEXT_PUBLIC_METADATA_SCHEMA: ${{ vars.NEXT_PUBLIC_METADATA_SCHEMA }}
NEXT_PUBLIC_ROUND_ID: ${{ vars.NEXT_PUBLIC_ROUND_ID }}
NEXT_PUBLIC_MACI_ADDRESS: ${{ vars.NEXT_PUBLIC_MACI_ADDRESS }}
NEXT_PUBLIC_TALLY_URL: ${{ vars.NEXT_PUBLIC_TALLY_URL }}
NEXT_PUBLIC_WALLETCONNECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_ID }}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

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
working-directory: packages/contracts

- name: Run hardhat fork
run: |
pnpm run hardhat &
sleep 5
working-directory: packages/contracts

- name: Download zkeys
run: |
pnpm download-zkeys:test

- name: hardhat tasks
run: |
cp ./deploy-config-example.json ./deploy-config.json
pnpm deploy:localhost
working-directory: packages/contracts

- name: Stop Hardhat
if: always()
run: kill $(lsof -t -i:8545)
3 changes: 2 additions & 1 deletion packages/contracts/contracts/mocks/Mocker.sol
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "maci-contracts/contracts/crypto/Hasher.sol";

Check warning on line 4 in packages/contracts/contracts/mocks/Mocker.sol

View workflow job for this annotation

GitHub Actions / check (lint:sol)

global import of path maci-contracts/contracts/crypto/Hasher.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "maci-contracts/contracts/crypto/Verifier.sol";

Check warning on line 5 in packages/contracts/contracts/mocks/Mocker.sol

View workflow job for this annotation

GitHub Actions / check (lint:sol)

global import of path maci-contracts/contracts/crypto/Verifier.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "maci-contracts/contracts/crypto/MockVerifier.sol";

Check warning on line 6 in packages/contracts/contracts/mocks/Mocker.sol

View workflow job for this annotation

GitHub Actions / check (lint:sol)

global import of path maci-contracts/contracts/crypto/MockVerifier.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "maci-contracts/contracts/gatekeepers/FreeForAllSignUpGatekeeper.sol";
import "maci-contracts/contracts/gatekeepers/FreeForAllGatekeeper.sol";

Check warning on line 7 in packages/contracts/contracts/mocks/Mocker.sol

View workflow job for this annotation

GitHub Actions / check (lint:sol)

global import of path maci-contracts/contracts/gatekeepers/FreeForAllGatekeeper.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "maci-contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol";

Check warning on line 8 in packages/contracts/contracts/mocks/Mocker.sol

View workflow job for this annotation

GitHub Actions / check (lint:sol)

global import of path maci-contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "maci-contracts/contracts/VkRegistry.sol";

Check warning on line 9 in packages/contracts/contracts/mocks/Mocker.sol

View workflow job for this annotation

GitHub Actions / check (lint:sol)

global import of path maci-contracts/contracts/VkRegistry.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "maci-contracts/contracts/TallyFactory.sol";

Check warning on line 10 in packages/contracts/contracts/mocks/Mocker.sol

View workflow job for this annotation

GitHub Actions / check (lint:sol)

global import of path maci-contracts/contracts/TallyFactory.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "maci-contracts/contracts/MessageProcessorFactory.sol";

Check warning on line 11 in packages/contracts/contracts/mocks/Mocker.sol

View workflow job for this annotation

GitHub Actions / check (lint:sol)

global import of path maci-contracts/contracts/MessageProcessorFactory.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)

/// @title Mocker
/// @notice import all MACI protocol related contract for tests
contract Mocker {

Check warning on line 15 in packages/contracts/contracts/mocks/Mocker.sol

View workflow job for this annotation

GitHub Actions / check (lint:sol)

Code contains empty blocks

}
Loading
Loading