From 43ac446381e573e4d39650c0e303753b50e9465a Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 12:01:15 -0400 Subject: [PATCH 01/17] add set duration action and adjust script for mantle network --- .github/workflows/cancel-round.yml | 24 ++++++++++--- .github/workflows/finalize-round.yml | 34 ++++++++++-------- .github/workflows/new-round.yml | 23 +++++++++--- .github/workflows/set-duration.yml | 52 ++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/set-duration.yml diff --git a/.github/workflows/cancel-round.yml b/.github/workflows/cancel-round.yml index a44508f0e..cf24f0770 100644 --- a/.github/workflows/cancel-round.yml +++ b/.github/workflows/cancel-round.yml @@ -1,11 +1,25 @@ name: Cancel current round -on: workflow_dispatch +on: + workflow_dispatch + inputs: + branch_name: + description: 'Clrfund branch name' + required: true + default: 'cohort/EthSingapore' + subgraph_url: + description: 'Clrfund subgraph url' + required: true + default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + network: + description: 'Network' + required: true + default: 'mantle-testnet' + env: NODE_VERSION: 16.x - SUBGRPAH_URL: "https://api.thegraph.com/subgraphs/name/clrfund/clrfund-arbitrum-goerli" - WALLET_PRIVATE_KEY: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_WALLET_PRIVATE_KEY }} + WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} jobs: cancel-round: @@ -23,6 +37,8 @@ jobs: - name: Run the cancel round script run: | cd contracts + export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" + echo $SUBGRAPH_URL export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') - yarn hardhat cancel-round --factory ${FACTORY_ADDRESS} --network arbitrum-goerli + yarn hardhat cancel-round --factory ${FACTORY_ADDRESS} --network "${{ github.event.inputs.network }}" diff --git a/.github/workflows/finalize-round.yml b/.github/workflows/finalize-round.yml index d1e8e5219..ec653ce38 100644 --- a/.github/workflows/finalize-round.yml +++ b/.github/workflows/finalize-round.yml @@ -6,20 +6,25 @@ on: branch_name: description: 'Clrfund branch name' required: true - default: 'develop' - subgraph_name: - description: 'Clrfund subgraph name' + default: 'cohort/EthSingapore' + maci_start_block: + description: 'MACI contract creation block' required: true - default: 'yuetloo/clrfund-dev' + default: '1' + subgraph_url: + description: 'Clrfund subgraph url' + required: true + default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + network: + description: 'Network' + required: true + default: 'mantle-testnet' env: NODE_VERSION: 16.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" + COORDINATOR_ETH_PK: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} + COORDINATOR_PK: ${{ secrets.MANTLE_TESTNET_COORDINATOR_MACI_PRIVATE_KEY }} jobs: finalize: @@ -53,16 +58,17 @@ jobs: yarn && yarn build - name: Run finalize scripts run: | - export SUBGRPAH_URL="https://api.thegraph.com/subgraphs/name/${{ github.event.inputs.subgraph_name }}" + export SUBGRPAH_URL="${{ github.event.inputs.subgraph_url }}" echo $SUBGRAPH_URL export NODE_CONFIG=$(node -e "const snarkParamsPath=process.env.GITHUB_WORKSPACE + '/params'; console.log(JSON.stringify({ snarkParamsPath }));") export ROUND=$(curl -X POST -d '{"query":"{fundingRoundFactories {id currentRound {id maci}}}"}' $SUBGRPAH_URL) export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].id)') export ROUND_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].currentRound.id)') export MACI_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].currentRound.maci)') - export TX_URL="${ETHERSCAN_URL}/api?module=account&action=txlistinternal&address=${MACI_ADDRESS}&startblock=0&page=10&offset=1&sort=asc&apikey=${ETHERSCAN_API_KEY}" - export TXLIST=$(curl $TX_URL) - export MACI_START_BLOCK=$(node -e 'console.log(JSON.parse(process.env.TXLIST).result[0].blockNumber)') + #export TX_URL="${ETHERSCAN_URL}/api?module=account&action=txlistinternal&address=${MACI_ADDRESS}&startblock=0&page=10&offset=1&sort=asc&apikey=${ETHERSCAN_API_KEY}" + #export TXLIST=$(curl $TX_URL) + #export MACI_START_BLOCK=$(node -e 'console.log(JSON.parse(process.env.TXLIST).result[0].blockNumber)') + export MACI_START_BLOCK="${{ github.event.inputs.maci_start_block }}" echo "MACI_START_BLOCK:" $MACI_START_BLOCK # tally and finalize cd contracts @@ -70,4 +76,4 @@ jobs: curl --location --request POST 'https://api.pinata.cloud/pinning/pinFileToIPFS' \ --header "Authorization: Bearer ${{ secrets.PINATA_JWT }}" \ --form 'file=@"tally.json"' - JSONRPC_HTTP_URL=${{env.JSONRPC_HTTP_URL}} yarn hardhat run --network "${NETWORK}" scripts/finalize.ts + yarn hardhat run --network "${NETWORK}" scripts/finalize.ts diff --git a/.github/workflows/new-round.yml b/.github/workflows/new-round.yml index a25fa09ff..793fc0b65 100644 --- a/.github/workflows/new-round.yml +++ b/.github/workflows/new-round.yml @@ -1,11 +1,24 @@ name: Create new round -on: workflow_dispatch +on: + workflow_dispatch + inputs: + branch_name: + description: 'Clrfund branch name' + required: true + default: 'cohort/EthSingapore' + subgraph_url: + description: 'Clrfund subgraph url' + required: true + default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + network: + description: 'Network' + required: true + default: 'mantle-testnet' env: NODE_VERSION: 16.x - SUBGRPAH_URL: "https://api.thegraph.com/subgraphs/name/clrfund/clrfund-arbitrum-goerli" - WALLET_PRIVATE_KEY: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_WALLET_PRIVATE_KEY }} + WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} jobs: create-new-round: @@ -23,6 +36,8 @@ jobs: - name: Run create new round script run: | cd contracts + export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" + echo $SUBGRAPH_URL export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') - yarn hardhat run scripts/newRound.ts --network arbitrum-goerli + yarn hardhat run scripts/newRound.ts --network "${{ github.event.inputs.network }}" diff --git a/.github/workflows/set-duration.yml b/.github/workflows/set-duration.yml new file mode 100644 index 000000000..cbaca7db8 --- /dev/null +++ b/.github/workflows/set-duration.yml @@ -0,0 +1,52 @@ +name: Set the next round duration + +on: + workflow_dispatch + inputs: + voting_period: + description: 'Voting period in minutes' + required: true + default: '120' + reallocation_period: + description: 'Reallocation period in minutes' + required: true + default: '1' + branch_name: + description: 'Clrfund branch name' + required: true + default: 'cohort/EthSingapore' + subgraph_url: + description: 'Clrfund subgraph url' + required: true + default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + network: + description: 'Network' + required: true + default: 'mantle-testnet' + + +env: + NODE_VERSION: 16.x + WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} + +jobs: + cancel-round: + runs-on: ubuntu-22.04 + steps: + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Checkout source code + uses: actions/checkout@v3 + - name: Build CLR + run: | + yarn && yarn build + - name: Run the set duration script + run: | + cd contracts + export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" + echo $SUBGRAPH_URL + export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) + export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') + yarn hardhat set-duration --factory ${FACTORY_ADDRESS} --signup "${{ github.event.inputs.signup }}" --voting "${{ github.event.inputs.voting }}" --network "${{ github.event.inputs.network }}" From b949d8d6b5a136f2bae85650ca9e6dcacf271543 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 12:15:50 -0400 Subject: [PATCH 02/17] add action for mantle-testnet --- .github/workflows/_mantle_cancel_round.yml | 44 +++++++++++ .../workflows/_mantle_create_new_round.yml | 43 ++++++++++ .github/workflows/_mantle_finalize_round.yml | 79 +++++++++++++++++++ .github/workflows/_mantle_set_duration.yml | 51 ++++++++++++ .github/workflows/cancel-round.yml | 24 +----- .github/workflows/finalize-round.yml | 34 ++++---- .github/workflows/new-round.yml | 23 +----- 7 files changed, 239 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/_mantle_cancel_round.yml create mode 100644 .github/workflows/_mantle_create_new_round.yml create mode 100644 .github/workflows/_mantle_finalize_round.yml create mode 100644 .github/workflows/_mantle_set_duration.yml diff --git a/.github/workflows/_mantle_cancel_round.yml b/.github/workflows/_mantle_cancel_round.yml new file mode 100644 index 000000000..cf24f0770 --- /dev/null +++ b/.github/workflows/_mantle_cancel_round.yml @@ -0,0 +1,44 @@ +name: Cancel current round + +on: + workflow_dispatch + inputs: + branch_name: + description: 'Clrfund branch name' + required: true + default: 'cohort/EthSingapore' + subgraph_url: + description: 'Clrfund subgraph url' + required: true + default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + network: + description: 'Network' + required: true + default: 'mantle-testnet' + + +env: + NODE_VERSION: 16.x + WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} + +jobs: + cancel-round: + runs-on: ubuntu-22.04 + steps: + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Checkout source code + uses: actions/checkout@v3 + - name: Build CLR + run: | + yarn && yarn build + - name: Run the cancel round script + run: | + cd contracts + export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" + echo $SUBGRAPH_URL + export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) + export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') + yarn hardhat cancel-round --factory ${FACTORY_ADDRESS} --network "${{ github.event.inputs.network }}" diff --git a/.github/workflows/_mantle_create_new_round.yml b/.github/workflows/_mantle_create_new_round.yml new file mode 100644 index 000000000..793fc0b65 --- /dev/null +++ b/.github/workflows/_mantle_create_new_round.yml @@ -0,0 +1,43 @@ +name: Create new round + +on: + workflow_dispatch + inputs: + branch_name: + description: 'Clrfund branch name' + required: true + default: 'cohort/EthSingapore' + subgraph_url: + description: 'Clrfund subgraph url' + required: true + default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + network: + description: 'Network' + required: true + default: 'mantle-testnet' + +env: + NODE_VERSION: 16.x + WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} + +jobs: + create-new-round: + runs-on: ubuntu-22.04 + steps: + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Checkout source code + uses: actions/checkout@v3 + - name: Build CLR + run: | + yarn && yarn build + - name: Run create new round script + run: | + cd contracts + export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" + echo $SUBGRAPH_URL + export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) + export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') + yarn hardhat run scripts/newRound.ts --network "${{ github.event.inputs.network }}" diff --git a/.github/workflows/_mantle_finalize_round.yml b/.github/workflows/_mantle_finalize_round.yml new file mode 100644 index 000000000..ec653ce38 --- /dev/null +++ b/.github/workflows/_mantle_finalize_round.yml @@ -0,0 +1,79 @@ +name: Finalize a test round + +on: + workflow_dispatch: + inputs: + branch_name: + description: 'Clrfund branch name' + required: true + default: 'cohort/EthSingapore' + maci_start_block: + description: 'MACI contract creation block' + required: true + default: '1' + subgraph_url: + description: 'Clrfund subgraph url' + required: true + default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + network: + description: 'Network' + required: true + default: 'mantle-testnet' + +env: + NODE_VERSION: 16.x + NETWORK: "arbitrum-goerli" + COORDINATOR_ETH_PK: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} + COORDINATOR_PK: ${{ secrets.MANTLE_TESTNET_COORDINATOR_MACI_PRIVATE_KEY }} + +jobs: + finalize: + runs-on: ubuntu-22.04 + steps: + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Install g++ library dependencies + run: | + sudo apt update + sudo apt-get install build-essential libgmp-dev libsodium-dev nlohmann-json3-dev nasm g++ curl + - name: Install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - name: Install zkutil + run: | + cargo install zkutil --version 0.3.2 + - name: Checkout source code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.branch_name }} + - name: Download batch 64 params + run: | + ls -la $GITHUB_WORKSPACE + $GITHUB_WORKSPACE/.github/scripts/download-batch64-params.sh + - name: Build + run: | + yarn && yarn build + - name: Run finalize scripts + run: | + export SUBGRPAH_URL="${{ github.event.inputs.subgraph_url }}" + echo $SUBGRAPH_URL + export NODE_CONFIG=$(node -e "const snarkParamsPath=process.env.GITHUB_WORKSPACE + '/params'; console.log(JSON.stringify({ snarkParamsPath }));") + export ROUND=$(curl -X POST -d '{"query":"{fundingRoundFactories {id currentRound {id maci}}}"}' $SUBGRPAH_URL) + export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].id)') + export ROUND_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].currentRound.id)') + export MACI_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].currentRound.maci)') + #export TX_URL="${ETHERSCAN_URL}/api?module=account&action=txlistinternal&address=${MACI_ADDRESS}&startblock=0&page=10&offset=1&sort=asc&apikey=${ETHERSCAN_API_KEY}" + #export TXLIST=$(curl $TX_URL) + #export MACI_START_BLOCK=$(node -e 'console.log(JSON.parse(process.env.TXLIST).result[0].blockNumber)') + export MACI_START_BLOCK="${{ github.event.inputs.maci_start_block }}" + echo "MACI_START_BLOCK:" $MACI_START_BLOCK + # tally and finalize + cd contracts + yarn hardhat tally --round-address "${ROUND_ADDRESS}" --network "${NETWORK}" + curl --location --request POST 'https://api.pinata.cloud/pinning/pinFileToIPFS' \ + --header "Authorization: Bearer ${{ secrets.PINATA_JWT }}" \ + --form 'file=@"tally.json"' + yarn hardhat run --network "${NETWORK}" scripts/finalize.ts diff --git a/.github/workflows/_mantle_set_duration.yml b/.github/workflows/_mantle_set_duration.yml new file mode 100644 index 000000000..8b80c3cc4 --- /dev/null +++ b/.github/workflows/_mantle_set_duration.yml @@ -0,0 +1,51 @@ +name: Set the next round duration + +on: + workflow_dispatch + inputs: + voting_period: + description: 'Voting period in minutes' + required: true + default: '120' + reallocation_period: + description: 'Reallocation period in minutes' + required: true + default: '1' + branch_name: + description: 'Clrfund branch name' + required: true + default: 'cohort/EthSingapore' + subgraph_url: + description: 'Clrfund subgraph url' + required: true + default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + network: + description: 'Network' + required: true + default: 'mantle-testnet' + +env: + NODE_VERSION: 16.x + WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} + +jobs: + cancel-round: + runs-on: ubuntu-22.04 + steps: + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Checkout source code + uses: actions/checkout@v3 + - name: Build CLR + run: | + yarn && yarn build + - name: Run the set duration script + run: | + cd contracts + export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" + echo $SUBGRAPH_URL + export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) + export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') + yarn hardhat set-duration --factory ${FACTORY_ADDRESS} --signup "${{ github.event.inputs.signup }}" --voting "${{ github.event.inputs.voting }}" --network "${{ github.event.inputs.network }}" diff --git a/.github/workflows/cancel-round.yml b/.github/workflows/cancel-round.yml index cf24f0770..a44508f0e 100644 --- a/.github/workflows/cancel-round.yml +++ b/.github/workflows/cancel-round.yml @@ -1,25 +1,11 @@ name: Cancel current round -on: - workflow_dispatch - inputs: - branch_name: - description: 'Clrfund branch name' - required: true - default: 'cohort/EthSingapore' - subgraph_url: - description: 'Clrfund subgraph url' - required: true - default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' - network: - description: 'Network' - required: true - default: 'mantle-testnet' - +on: workflow_dispatch env: NODE_VERSION: 16.x - WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} + SUBGRPAH_URL: "https://api.thegraph.com/subgraphs/name/clrfund/clrfund-arbitrum-goerli" + WALLET_PRIVATE_KEY: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_WALLET_PRIVATE_KEY }} jobs: cancel-round: @@ -37,8 +23,6 @@ jobs: - name: Run the cancel round script run: | cd contracts - export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" - echo $SUBGRAPH_URL export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') - yarn hardhat cancel-round --factory ${FACTORY_ADDRESS} --network "${{ github.event.inputs.network }}" + yarn hardhat cancel-round --factory ${FACTORY_ADDRESS} --network arbitrum-goerli diff --git a/.github/workflows/finalize-round.yml b/.github/workflows/finalize-round.yml index ec653ce38..d1e8e5219 100644 --- a/.github/workflows/finalize-round.yml +++ b/.github/workflows/finalize-round.yml @@ -6,25 +6,20 @@ on: branch_name: description: 'Clrfund branch name' required: true - default: 'cohort/EthSingapore' - maci_start_block: - description: 'MACI contract creation block' + default: 'develop' + subgraph_name: + description: 'Clrfund subgraph name' required: true - default: '1' - subgraph_url: - description: 'Clrfund subgraph url' - required: true - default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' - network: - description: 'Network' - required: true - default: 'mantle-testnet' + default: 'yuetloo/clrfund-dev' env: NODE_VERSION: 16.x NETWORK: "arbitrum-goerli" - COORDINATOR_ETH_PK: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} - COORDINATOR_PK: ${{ secrets.MANTLE_TESTNET_COORDINATOR_MACI_PRIVATE_KEY }} + 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" jobs: finalize: @@ -58,17 +53,16 @@ jobs: yarn && yarn build - name: Run finalize scripts run: | - export SUBGRPAH_URL="${{ github.event.inputs.subgraph_url }}" + export SUBGRPAH_URL="https://api.thegraph.com/subgraphs/name/${{ github.event.inputs.subgraph_name }}" echo $SUBGRAPH_URL export NODE_CONFIG=$(node -e "const snarkParamsPath=process.env.GITHUB_WORKSPACE + '/params'; console.log(JSON.stringify({ snarkParamsPath }));") export ROUND=$(curl -X POST -d '{"query":"{fundingRoundFactories {id currentRound {id maci}}}"}' $SUBGRPAH_URL) export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].id)') export ROUND_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].currentRound.id)') export MACI_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].currentRound.maci)') - #export TX_URL="${ETHERSCAN_URL}/api?module=account&action=txlistinternal&address=${MACI_ADDRESS}&startblock=0&page=10&offset=1&sort=asc&apikey=${ETHERSCAN_API_KEY}" - #export TXLIST=$(curl $TX_URL) - #export MACI_START_BLOCK=$(node -e 'console.log(JSON.parse(process.env.TXLIST).result[0].blockNumber)') - export MACI_START_BLOCK="${{ github.event.inputs.maci_start_block }}" + export TX_URL="${ETHERSCAN_URL}/api?module=account&action=txlistinternal&address=${MACI_ADDRESS}&startblock=0&page=10&offset=1&sort=asc&apikey=${ETHERSCAN_API_KEY}" + export TXLIST=$(curl $TX_URL) + export MACI_START_BLOCK=$(node -e 'console.log(JSON.parse(process.env.TXLIST).result[0].blockNumber)') echo "MACI_START_BLOCK:" $MACI_START_BLOCK # tally and finalize cd contracts @@ -76,4 +70,4 @@ jobs: curl --location --request POST 'https://api.pinata.cloud/pinning/pinFileToIPFS' \ --header "Authorization: Bearer ${{ secrets.PINATA_JWT }}" \ --form 'file=@"tally.json"' - yarn hardhat run --network "${NETWORK}" scripts/finalize.ts + JSONRPC_HTTP_URL=${{env.JSONRPC_HTTP_URL}} yarn hardhat run --network "${NETWORK}" scripts/finalize.ts diff --git a/.github/workflows/new-round.yml b/.github/workflows/new-round.yml index 793fc0b65..a25fa09ff 100644 --- a/.github/workflows/new-round.yml +++ b/.github/workflows/new-round.yml @@ -1,24 +1,11 @@ name: Create new round -on: - workflow_dispatch - inputs: - branch_name: - description: 'Clrfund branch name' - required: true - default: 'cohort/EthSingapore' - subgraph_url: - description: 'Clrfund subgraph url' - required: true - default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' - network: - description: 'Network' - required: true - default: 'mantle-testnet' +on: workflow_dispatch env: NODE_VERSION: 16.x - WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} + SUBGRPAH_URL: "https://api.thegraph.com/subgraphs/name/clrfund/clrfund-arbitrum-goerli" + WALLET_PRIVATE_KEY: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_WALLET_PRIVATE_KEY }} jobs: create-new-round: @@ -36,8 +23,6 @@ jobs: - name: Run create new round script run: | cd contracts - export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" - echo $SUBGRAPH_URL export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') - yarn hardhat run scripts/newRound.ts --network "${{ github.event.inputs.network }}" + yarn hardhat run scripts/newRound.ts --network arbitrum-goerli From 907d3600ce845a747291bd38ac27c53089e12803 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 12:24:57 -0400 Subject: [PATCH 03/17] pass factory address as input --- .github/workflows/_mantle_cancel_round.yml | 14 +++++--------- .github/workflows/_mantle_create_new_round.yml | 13 +++++-------- .github/workflows/_mantle_finalize_round.yml | 5 +---- .github/workflows/_mantle_set_duration.yml | 16 ++++++---------- 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/.github/workflows/_mantle_cancel_round.yml b/.github/workflows/_mantle_cancel_round.yml index cf24f0770..7dc908df7 100644 --- a/.github/workflows/_mantle_cancel_round.yml +++ b/.github/workflows/_mantle_cancel_round.yml @@ -1,4 +1,4 @@ -name: Cancel current round +name: Cancel current round on the Mantle testnet on: workflow_dispatch @@ -7,10 +7,10 @@ on: description: 'Clrfund branch name' required: true default: 'cohort/EthSingapore' - subgraph_url: - description: 'Clrfund subgraph url' + factory: + description: 'Clrfund factory address' required: true - default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + default: '0x006f39E6a6D15323334Be1db34C73088550BB20a' network: description: 'Network' required: true @@ -37,8 +37,4 @@ jobs: - name: Run the cancel round script run: | cd contracts - export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" - echo $SUBGRAPH_URL - export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) - export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') - yarn hardhat cancel-round --factory ${FACTORY_ADDRESS} --network "${{ github.event.inputs.network }}" + yarn hardhat cancel-round --factory "${{ github.event.inputs.factory }}" --network "${{ github.event.inputs.network }}" diff --git a/.github/workflows/_mantle_create_new_round.yml b/.github/workflows/_mantle_create_new_round.yml index 793fc0b65..8427569fc 100644 --- a/.github/workflows/_mantle_create_new_round.yml +++ b/.github/workflows/_mantle_create_new_round.yml @@ -1,4 +1,4 @@ -name: Create new round +name: Create new round on the Mantle testnet on: workflow_dispatch @@ -7,10 +7,10 @@ on: description: 'Clrfund branch name' required: true default: 'cohort/EthSingapore' - subgraph_url: - description: 'Clrfund subgraph url' + factory: + description: 'Clrfund factory address' required: true - default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' + default: '0x006f39E6a6D15323334Be1db34C73088550BB20a' network: description: 'Network' required: true @@ -36,8 +36,5 @@ jobs: - name: Run create new round script run: | cd contracts - export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" - echo $SUBGRAPH_URL - export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) - export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') + export FACTORY_ADDRESS="${{ github.event.inputs.factory }}" yarn hardhat run scripts/newRound.ts --network "${{ github.event.inputs.network }}" diff --git a/.github/workflows/_mantle_finalize_round.yml b/.github/workflows/_mantle_finalize_round.yml index ec653ce38..270be8c2d 100644 --- a/.github/workflows/_mantle_finalize_round.yml +++ b/.github/workflows/_mantle_finalize_round.yml @@ -1,4 +1,4 @@ -name: Finalize a test round +name: Finalize a test round on the Mantle testnet on: workflow_dispatch: @@ -65,9 +65,6 @@ jobs: export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].id)') export ROUND_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].currentRound.id)') export MACI_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.fundingRoundFactories[0].currentRound.maci)') - #export TX_URL="${ETHERSCAN_URL}/api?module=account&action=txlistinternal&address=${MACI_ADDRESS}&startblock=0&page=10&offset=1&sort=asc&apikey=${ETHERSCAN_API_KEY}" - #export TXLIST=$(curl $TX_URL) - #export MACI_START_BLOCK=$(node -e 'console.log(JSON.parse(process.env.TXLIST).result[0].blockNumber)') export MACI_START_BLOCK="${{ github.event.inputs.maci_start_block }}" echo "MACI_START_BLOCK:" $MACI_START_BLOCK # tally and finalize diff --git a/.github/workflows/_mantle_set_duration.yml b/.github/workflows/_mantle_set_duration.yml index 8b80c3cc4..c8d2cfa15 100644 --- a/.github/workflows/_mantle_set_duration.yml +++ b/.github/workflows/_mantle_set_duration.yml @@ -1,4 +1,4 @@ -name: Set the next round duration +name: Set the next round duration on the Mantle testnet on: workflow_dispatch @@ -11,14 +11,14 @@ on: description: 'Reallocation period in minutes' required: true default: '1' + factory: + description: 'Clrfund factory address' + required: true + default: '0x006f39E6a6D15323334Be1db34C73088550BB20a' branch_name: description: 'Clrfund branch name' required: true default: 'cohort/EthSingapore' - subgraph_url: - description: 'Clrfund subgraph url' - required: true - default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' network: description: 'Network' required: true @@ -44,8 +44,4 @@ jobs: - name: Run the set duration script run: | cd contracts - export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" - echo $SUBGRAPH_URL - export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) - export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') - yarn hardhat set-duration --factory ${FACTORY_ADDRESS} --signup "${{ github.event.inputs.signup }}" --voting "${{ github.event.inputs.voting }}" --network "${{ github.event.inputs.network }}" + yarn hardhat set-duration --factory "${{ github.event.inputs.factory }}" --signup "${{ github.event.inputs.signup }}" --voting "${{ github.event.inputs.voting }}" --network "${{ github.event.inputs.network }}" From 7307bce679c3ad436cb52ec258b422a5ed9635f4 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 12:28:38 -0400 Subject: [PATCH 04/17] changed action name --- .github/workflows/_mantle_set_duration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_mantle_set_duration.yml b/.github/workflows/_mantle_set_duration.yml index c8d2cfa15..bd4a15566 100644 --- a/.github/workflows/_mantle_set_duration.yml +++ b/.github/workflows/_mantle_set_duration.yml @@ -1,7 +1,7 @@ -name: Set the next round duration on the Mantle testnet +name: 0 - Mantle network - set the next round duration on: - workflow_dispatch + workflow_dispatch: inputs: voting_period: description: 'Voting period in minutes' From bc4285b6dd3ad2d479637203776a37040d92fa5d Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 12:30:31 -0400 Subject: [PATCH 05/17] Updated action name --- .github/workflows/_mantle_cancel_round.yml | 2 +- .github/workflows/_mantle_create_new_round.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_mantle_cancel_round.yml b/.github/workflows/_mantle_cancel_round.yml index 7dc908df7..2deb3b801 100644 --- a/.github/workflows/_mantle_cancel_round.yml +++ b/.github/workflows/_mantle_cancel_round.yml @@ -1,7 +1,7 @@ name: Cancel current round on the Mantle testnet on: - workflow_dispatch + workflow_dispatch: inputs: branch_name: description: 'Clrfund branch name' diff --git a/.github/workflows/_mantle_create_new_round.yml b/.github/workflows/_mantle_create_new_round.yml index 8427569fc..1ec174dc5 100644 --- a/.github/workflows/_mantle_create_new_round.yml +++ b/.github/workflows/_mantle_create_new_round.yml @@ -1,7 +1,7 @@ name: Create new round on the Mantle testnet on: - workflow_dispatch + workflow_dispatch: inputs: branch_name: description: 'Clrfund branch name' From 7a0fcf9c0442c69526a264a65fe7dbb0791b581c Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 12:32:50 -0400 Subject: [PATCH 06/17] remove set-duration.yml --- .github/workflows/set-duration.yml | 52 ------------------------------ 1 file changed, 52 deletions(-) delete mode 100644 .github/workflows/set-duration.yml diff --git a/.github/workflows/set-duration.yml b/.github/workflows/set-duration.yml deleted file mode 100644 index cbaca7db8..000000000 --- a/.github/workflows/set-duration.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Set the next round duration - -on: - workflow_dispatch - inputs: - voting_period: - description: 'Voting period in minutes' - required: true - default: '120' - reallocation_period: - description: 'Reallocation period in minutes' - required: true - default: '1' - branch_name: - description: 'Clrfund branch name' - required: true - default: 'cohort/EthSingapore' - subgraph_url: - description: 'Clrfund subgraph url' - required: true - default: 'https://graph.testnet.mantle.xyz/subgraphs/name/clrfund-ethsingapore-test' - network: - description: 'Network' - required: true - default: 'mantle-testnet' - - -env: - NODE_VERSION: 16.x - WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} - -jobs: - cancel-round: - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Checkout source code - uses: actions/checkout@v3 - - name: Build CLR - run: | - yarn && yarn build - - name: Run the set duration script - run: | - cd contracts - export SUBGRPAH_URL="${{ github.event.inputs.subgraph_name }}" - echo $SUBGRAPH_URL - export FACTORY=$(curl -X POST -d '{"query":"{fundingRoundFactories {id}}"}' $SUBGRPAH_URL) - export FACTORY_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.FACTORY).data.fundingRoundFactories[0].id)') - yarn hardhat set-duration --factory ${FACTORY_ADDRESS} --signup "${{ github.event.inputs.signup }}" --voting "${{ github.event.inputs.voting }}" --network "${{ github.event.inputs.network }}" From 631a7bcc43f10298a4eb063ae0486ea8d8a31cd2 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 12:36:10 -0400 Subject: [PATCH 07/17] rename file --- .../{_mantle_cancel_round.yml => mantle_cancel_round.yml} | 0 .../{_mantle_create_new_round.yml => mantle_create_new_round.yml} | 0 .../{_mantle_finalize_round.yml => mantle_finalize_round.yml} | 0 .../{_mantle_set_duration.yml => mantle_set_duration.yml} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{_mantle_cancel_round.yml => mantle_cancel_round.yml} (100%) rename .github/workflows/{_mantle_create_new_round.yml => mantle_create_new_round.yml} (100%) rename .github/workflows/{_mantle_finalize_round.yml => mantle_finalize_round.yml} (100%) rename .github/workflows/{_mantle_set_duration.yml => mantle_set_duration.yml} (100%) diff --git a/.github/workflows/_mantle_cancel_round.yml b/.github/workflows/mantle_cancel_round.yml similarity index 100% rename from .github/workflows/_mantle_cancel_round.yml rename to .github/workflows/mantle_cancel_round.yml diff --git a/.github/workflows/_mantle_create_new_round.yml b/.github/workflows/mantle_create_new_round.yml similarity index 100% rename from .github/workflows/_mantle_create_new_round.yml rename to .github/workflows/mantle_create_new_round.yml diff --git a/.github/workflows/_mantle_finalize_round.yml b/.github/workflows/mantle_finalize_round.yml similarity index 100% rename from .github/workflows/_mantle_finalize_round.yml rename to .github/workflows/mantle_finalize_round.yml diff --git a/.github/workflows/_mantle_set_duration.yml b/.github/workflows/mantle_set_duration.yml similarity index 100% rename from .github/workflows/_mantle_set_duration.yml rename to .github/workflows/mantle_set_duration.yml From fc93c6dfa9fe36b2b5b38e17bda61e6a1beb6f52 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 12:37:32 -0400 Subject: [PATCH 08/17] update action name --- .github/workflows/mantle_cancel_round.yml | 2 +- .github/workflows/mantle_create_new_round.yml | 2 +- .github/workflows/mantle_finalize_round.yml | 2 +- .github/workflows/mantle_set_duration.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mantle_cancel_round.yml b/.github/workflows/mantle_cancel_round.yml index 2deb3b801..902b0e2d1 100644 --- a/.github/workflows/mantle_cancel_round.yml +++ b/.github/workflows/mantle_cancel_round.yml @@ -1,4 +1,4 @@ -name: Cancel current round on the Mantle testnet +name: Mantle network - Cancel current round on: workflow_dispatch: diff --git a/.github/workflows/mantle_create_new_round.yml b/.github/workflows/mantle_create_new_round.yml index 1ec174dc5..40de9dac0 100644 --- a/.github/workflows/mantle_create_new_round.yml +++ b/.github/workflows/mantle_create_new_round.yml @@ -1,4 +1,4 @@ -name: Create new round on the Mantle testnet +name: Mantle testnet - Create new round on: workflow_dispatch: diff --git a/.github/workflows/mantle_finalize_round.yml b/.github/workflows/mantle_finalize_round.yml index 270be8c2d..1298cd77c 100644 --- a/.github/workflows/mantle_finalize_round.yml +++ b/.github/workflows/mantle_finalize_round.yml @@ -1,4 +1,4 @@ -name: Finalize a test round on the Mantle testnet +name: Mantle testnet - Finalize round on: workflow_dispatch: diff --git a/.github/workflows/mantle_set_duration.yml b/.github/workflows/mantle_set_duration.yml index bd4a15566..5cc9296b3 100644 --- a/.github/workflows/mantle_set_duration.yml +++ b/.github/workflows/mantle_set_duration.yml @@ -1,4 +1,4 @@ -name: 0 - Mantle network - set the next round duration +name: Mantle testnet - set the next round duration on: workflow_dispatch: From 48fd44d41baa8d2d9f420a08af8b3cff43001c1f Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 12:46:44 -0400 Subject: [PATCH 09/17] update action description --- .github/workflows/mantle_cancel_round.yml | 2 +- .github/workflows/mantle_set_duration.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mantle_cancel_round.yml b/.github/workflows/mantle_cancel_round.yml index 902b0e2d1..80254827a 100644 --- a/.github/workflows/mantle_cancel_round.yml +++ b/.github/workflows/mantle_cancel_round.yml @@ -1,4 +1,4 @@ -name: Mantle network - Cancel current round +name: Mantle testnet - Cancel current round on: workflow_dispatch: diff --git a/.github/workflows/mantle_set_duration.yml b/.github/workflows/mantle_set_duration.yml index 5cc9296b3..4dcd34dbf 100644 --- a/.github/workflows/mantle_set_duration.yml +++ b/.github/workflows/mantle_set_duration.yml @@ -1,4 +1,4 @@ -name: Mantle testnet - set the next round duration +name: Mantle testnet - Set voting duration on: workflow_dispatch: From 9e56aa46c9a0195f393dbcec53705bf838d383a2 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 13:43:40 -0400 Subject: [PATCH 10/17] add mantle testnet --- contracts/hardhat.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index e9b5b931e..be598ff63 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -59,6 +59,10 @@ const config: HardhatUserConfig = { process.env.JSONRPC_HTTP_URL || 'https://goerli-rollup.arbitrum.io/rpc', accounts, }, + 'mantle-testnet': { + url: process.env.JSONRPC_HTTP_URL || 'https://rpc.testnet.mantle.xyz', + accounts, + }, rinkarby: { url: process.env.JSONRPC_HTTP_URL || 'https://rinkeby.arbitrum.io/rpc', accounts, From 3f39bb5284c4d0ba07c13380514cdeb68bfab816 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 14:57:31 -0400 Subject: [PATCH 11/17] fix action failure --- .github/workflows/mantle_set_duration.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/mantle_set_duration.yml b/.github/workflows/mantle_set_duration.yml index 4dcd34dbf..669ddddb5 100644 --- a/.github/workflows/mantle_set_duration.yml +++ b/.github/workflows/mantle_set_duration.yml @@ -15,10 +15,6 @@ on: description: 'Clrfund factory address' required: true default: '0x006f39E6a6D15323334Be1db34C73088550BB20a' - branch_name: - description: 'Clrfund branch name' - required: true - default: 'cohort/EthSingapore' network: description: 'Network' required: true @@ -44,4 +40,4 @@ jobs: - name: Run the set duration script run: | cd contracts - yarn hardhat set-duration --factory "${{ github.event.inputs.factory }}" --signup "${{ github.event.inputs.signup }}" --voting "${{ github.event.inputs.voting }}" --network "${{ github.event.inputs.network }}" + yarn hardhat set-durations --factory "${{ github.event.inputs.factory }}" --signup "${{ github.event.inputs.voting_period }}" --voting "${{ github.event.inputs.reallocation_period }}" --network "${{ github.event.inputs.network }}" From 2a543170ce64207537e0635ce62e8ee2b555cebb Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 9 Oct 2023 15:18:31 -0400 Subject: [PATCH 12/17] fix job name --- .github/workflows/mantle_set_duration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mantle_set_duration.yml b/.github/workflows/mantle_set_duration.yml index 669ddddb5..ccfa8cf5e 100644 --- a/.github/workflows/mantle_set_duration.yml +++ b/.github/workflows/mantle_set_duration.yml @@ -25,7 +25,7 @@ env: WALLET_PRIVATE_KEY: ${{ secrets.MANTLE_TESTNET_COORDINATOR_WALLET_PRIVATE_KEY }} jobs: - cancel-round: + set-durations: runs-on: ubuntu-22.04 steps: - name: Use Node.js ${{ env.NODE_VERSION }} From 55a92b7dad18aeeb5f622867073ad6a145df170d Mon Sep 17 00:00:00 2001 From: yuetloo Date: Fri, 3 Nov 2023 18:53:21 -0400 Subject: [PATCH 13/17] make recipient id unique for different registries --- .../BaseRecipientRegistry.sol | 15 ++++ .../OptimisticRecipientRegistry.sol | 2 +- .../PermissionedRecipientRegistry.sol | 2 +- .../SimpleRecipientRegistry.sol | 2 +- contracts/tests/recipientRegistry.ts | 79 +++++++++++++++---- 5 files changed, 83 insertions(+), 17 deletions(-) diff --git a/contracts/contracts/recipientRegistry/BaseRecipientRegistry.sol b/contracts/contracts/recipientRegistry/BaseRecipientRegistry.sol index dcf66048e..6cd022472 100644 --- a/contracts/contracts/recipientRegistry/BaseRecipientRegistry.sol +++ b/contracts/contracts/recipientRegistry/BaseRecipientRegistry.sol @@ -146,4 +146,19 @@ abstract contract BaseRecipientRegistry is IRecipientRegistry { function getRecipientCount() public view returns(uint256) { return slots.length - removed.length; } + + /** + * @dev Make a unique recipient id for different registries + * @param _registry Recipient registry address + * @param _recipient Recipient address + * @param _metadata Recipient metadata + * @return recipient id + */ + function makeRecipientId(address _registry, address _recipient, string calldata _metadata) + internal + pure + returns(bytes32) + { + return keccak256(abi.encodePacked(_registry, _recipient, _metadata)); + } } diff --git a/contracts/contracts/recipientRegistry/OptimisticRecipientRegistry.sol b/contracts/contracts/recipientRegistry/OptimisticRecipientRegistry.sol index 9b479ebf3..d10afe677 100644 --- a/contracts/contracts/recipientRegistry/OptimisticRecipientRegistry.sol +++ b/contracts/contracts/recipientRegistry/OptimisticRecipientRegistry.sol @@ -97,7 +97,7 @@ contract OptimisticRecipientRegistry is Ownable, BaseRecipientRegistry { { require(_recipient != address(0), 'RecipientRegistry: Recipient address is zero'); require(bytes(_metadata).length != 0, 'RecipientRegistry: Metadata info is empty string'); - bytes32 recipientId = keccak256(abi.encodePacked(_recipient, _metadata)); + bytes32 recipientId = makeRecipientId(address(this), _recipient, _metadata); require(recipients[recipientId].index == 0, 'RecipientRegistry: Recipient already registered'); require(requests[recipientId].submissionTime == 0, 'RecipientRegistry: Request already submitted'); require(msg.value == baseDeposit, 'RecipientRegistry: Incorrect deposit amount'); diff --git a/contracts/contracts/recipientRegistry/PermissionedRecipientRegistry.sol b/contracts/contracts/recipientRegistry/PermissionedRecipientRegistry.sol index 02265f2d5..744c31b6f 100644 --- a/contracts/contracts/recipientRegistry/PermissionedRecipientRegistry.sol +++ b/contracts/contracts/recipientRegistry/PermissionedRecipientRegistry.sol @@ -97,7 +97,7 @@ contract PermissionedRecipientRegistry is Ownable, BaseRecipientRegistry { { require(_recipient != address(0), 'RecipientRegistry: Recipient address is zero'); require(bytes(_metadata).length != 0, 'RecipientRegistry: Metadata info is empty string'); - bytes32 recipientId = keccak256(abi.encodePacked(_recipient, _metadata)); + bytes32 recipientId = makeRecipientId(address(this), _recipient, _metadata); require(recipients[recipientId].index == 0, 'RecipientRegistry: Recipient already registered'); require(requests[recipientId].submissionTime == 0, 'RecipientRegistry: Request already submitted'); require(msg.value == baseDeposit, 'RecipientRegistry: Incorrect deposit amount'); diff --git a/contracts/contracts/recipientRegistry/SimpleRecipientRegistry.sol b/contracts/contracts/recipientRegistry/SimpleRecipientRegistry.sol index 9f37215e8..efa40a093 100644 --- a/contracts/contracts/recipientRegistry/SimpleRecipientRegistry.sol +++ b/contracts/contracts/recipientRegistry/SimpleRecipientRegistry.sol @@ -47,7 +47,7 @@ contract SimpleRecipientRegistry is Ownable, BaseRecipientRegistry { { require(_recipient != address(0), 'RecipientRegistry: Recipient address is zero'); require(bytes(_metadata).length != 0, 'RecipientRegistry: Metadata info is empty string'); - bytes32 recipientId = keccak256(abi.encodePacked(_recipient, _metadata)); + bytes32 recipientId = makeRecipientId(address(this), _recipient, _metadata); uint256 recipientIndex = _addRecipient(recipientId, _recipient); emit RecipientAdded(recipientId, _recipient, _metadata, recipientIndex, block.timestamp); } diff --git a/contracts/tests/recipientRegistry.ts b/contracts/tests/recipientRegistry.ts index 2b1b76c0b..180a8bca6 100644 --- a/contracts/tests/recipientRegistry.ts +++ b/contracts/tests/recipientRegistry.ts @@ -6,7 +6,7 @@ import { keccak256 } from '@ethersproject/solidity' import { gtcrEncode } from '@kleros/gtcr-encoder' import { UNIT, ZERO_ADDRESS } from '../utils/constants' -import { getTxFee } from '../utils/contracts' +import { getTxFee, getEventArg } from '../utils/contracts' import { deployContract } from '../utils/deployment' use(solidity) @@ -18,6 +18,17 @@ async function getCurrentTime(): Promise { return (await provider.getBlock('latest')).timestamp } +function getRecipientId( + registryAddress: string, + address: string, + metadata: string +): string { + return keccak256( + ['address', 'address', 'string'], + [registryAddress, address, metadata] + ) +} + describe('Simple Recipient Registry', () => { const [, deployer, controller, recipient] = provider.getWallets() @@ -69,10 +80,6 @@ describe('Simple Recipient Registry', () => { let metadata: string let recipientId: string - function getRecipientId(address: string, metadata: string): string { - return keccak256(['address', 'string'], [address, metadata]) - } - beforeEach(async () => { await registry.connect(controller).setMaxRecipients(MAX_RECIPIENTS) recipientAddress = recipient.address @@ -81,7 +88,7 @@ describe('Simple Recipient Registry', () => { description: 'Description', imageHash: 'Ipfs imageHash', }) - recipientId = getRecipientId(recipientAddress, metadata) + recipientId = getRecipientId(registry.address, recipientAddress, metadata) }) it('allows owner to add recipient', async () => { @@ -110,6 +117,7 @@ describe('Simple Recipient Registry', () => { const anotherRecipientAddress = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' const anotherRecipientId = getRecipientId( + registry.address, anotherRecipientAddress, metadata ) @@ -256,9 +264,17 @@ describe('Simple Recipient Registry', () => { // Replace recipients const removedRecipient1 = '0x0000000000000000000000000000000000000001' - const removedRecipient1Id = getRecipientId(removedRecipient1, metadata) + const removedRecipient1Id = getRecipientId( + registry.address, + removedRecipient1, + metadata + ) const removedRecipient2 = '0x0000000000000000000000000000000000000002' - const removedRecipient2Id = getRecipientId(removedRecipient2, metadata) + const removedRecipient2Id = getRecipientId( + registry.address, + removedRecipient2, + metadata + ) await registry.removeRecipient(removedRecipient1Id) await registry.removeRecipient(removedRecipient2Id) const addedRecipient1 = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' @@ -571,10 +587,6 @@ describe('Optimistic recipient registry', () => { let metadata: string let recipientId: string - function getRecipientId(address: string, metadata: string): string { - return keccak256(['address', 'string'], [address, metadata]) - } - beforeEach(async () => { await registry.connect(controller).setMaxRecipients(MAX_RECIPIENTS) recipientAddress = recipient.address @@ -583,7 +595,7 @@ describe('Optimistic recipient registry', () => { description: 'Description', imageHash: 'Ipfs imageHash', }) - recipientId = getRecipientId(recipientAddress, metadata) + recipientId = getRecipientId(registry.address, recipientAddress, metadata) }) it('allows anyone to submit registration request', async () => { @@ -808,7 +820,11 @@ describe('Optimistic recipient registry', () => { imageHash: 'Ipfs imageHash', }) recipientAddress = `0x000000000000000000000000000000000000${recipientName}` - recipientId = getRecipientId(recipientAddress, metadata) + recipientId = getRecipientId( + registry.address, + recipientAddress, + metadata + ) if (i < MAX_RECIPIENTS) { await registry.addRecipient(recipientAddress, metadata, { value: baseDeposit, @@ -953,5 +969,40 @@ describe('Optimistic recipient registry', () => { ) ).to.equal(ZERO_ADDRESS) }) + + it('creates different recipient id for different recipient registries', async () => { + const txOne = await registry.addRecipient(recipientAddress, metadata, { + value: baseDeposit, + }) + const idOne = await getEventArg( + txOne, + registry, + 'RequestSubmitted', + '_recipientId' + ) + + const anotherRegistry = await deployContract( + deployer, + 'OptimisticRecipientRegistry', + [baseDeposit, challengePeriodDuration, controller.address] + ) + const txTwo = await anotherRegistry.addRecipient( + recipientAddress, + metadata, + { + value: baseDeposit, + } + ) + const idTwo = await getEventArg( + txTwo, + anotherRegistry, + 'RequestSubmitted', + '_recipientId' + ) + + expect(idOne.length).to.be.gt(0) + expect(idTwo.length).to.be.gt(0) + expect(idOne).to.not.eq(idTwo) + }) }) }) From 5366abf33361cd9e3a3170705f749a295cb720f2 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Tue, 7 Nov 2023 20:54:40 -0500 Subject: [PATCH 14/17] create missing recipient registry and filter out foreign events --- subgraph/src/FundingRoundFactoryMapping.ts | 51 +---------------- .../src/OptimisticRecipientRegistryMapping.ts | 9 +-- subgraph/src/RecipientRegistry.ts | 56 +++++++++++++++++++ 3 files changed, 63 insertions(+), 53 deletions(-) create mode 100644 subgraph/src/RecipientRegistry.ts diff --git a/subgraph/src/FundingRoundFactoryMapping.ts b/subgraph/src/FundingRoundFactoryMapping.ts index 5233214e6..460f0fcf9 100644 --- a/subgraph/src/FundingRoundFactoryMapping.ts +++ b/subgraph/src/FundingRoundFactoryMapping.ts @@ -17,6 +17,7 @@ import { FundingRound as FundingRoundContract } from '../generated/FundingRoundF import { OptimisticRecipientRegistry as RecipientRegistryContract } from '../generated/FundingRoundFactory/OptimisticRecipientRegistry' import { BrightIdUserRegistry as BrightIdUserRegistryContract } from '../generated/FundingRoundFactory/BrightIdUserRegistry' +import { loadRecipientRegistry } from './RecipientRegistry' import { FundingRound as FundingRoundTemplate, @@ -31,48 +32,6 @@ import { Token, } from '../generated/schema' -function createRecipientRegistry( - fundingRoundFactoryAddress: Address, - recipientRegistryAddress: Address -): RecipientRegistry { - log.info('New recipientRegistry {}', [recipientRegistryAddress.toHex()]) - let recipientRegistryId = recipientRegistryAddress.toHexString() - let recipientRegistry = new RecipientRegistry(recipientRegistryId) - - recipientRegistryTemplate.create(recipientRegistryAddress) - let recipientRegistryContract = RecipientRegistryContract.bind( - recipientRegistryAddress - ) - let baseDeposit = recipientRegistryContract.try_baseDeposit() - if (baseDeposit.reverted) { - recipientRegistry.baseDeposit = BigInt.fromI32(0) - recipientRegistry.challengePeriodDuration = BigInt.fromI32(0) - } else { - recipientRegistry.baseDeposit = baseDeposit.value - let challengePeriodDuration = - recipientRegistryContract.challengePeriodDuration() - recipientRegistry.challengePeriodDuration = challengePeriodDuration - } - let controller = recipientRegistryContract.try_controller() - let maxRecipients = recipientRegistryContract.try_maxRecipients() - let owner = recipientRegistryContract.try_owner() - - if (!controller.reverted) { - recipientRegistry.controller = controller.value - } - if (!maxRecipients.reverted) { - recipientRegistry.maxRecipients = maxRecipients.value - } - if (!owner.reverted) { - recipientRegistry.owner = owner.value - } - recipientRegistry.fundingRoundFactory = - fundingRoundFactoryAddress.toHexString() - recipientRegistry.save() - - return recipientRegistry -} - function createContributorRegistry( fundingRoundFactoryAddress: Address, contributorRegistryAddress: Address @@ -189,13 +148,7 @@ function createOrUpdateFundingRoundFactory( //Check if these registries already exist/are being tracked let recipientRegistryAddress = fundingRoundFactoryContract.recipientRegistry() let recipientRegistryId = recipientRegistryAddress.toHexString() - let recipientRegistry = RecipientRegistry.load(recipientRegistryId) - if (!recipientRegistry) { - createRecipientRegistry( - fundingRoundFactoryAddress, - recipientRegistryAddress - ) - } + let recipientRegistry = loadRecipientRegistry(recipientRegistryAddress) let contributorRegistryAddress = fundingRoundFactoryContract.userRegistry() let contributorRegistryId = contributorRegistryAddress.toHexString() diff --git a/subgraph/src/OptimisticRecipientRegistryMapping.ts b/subgraph/src/OptimisticRecipientRegistryMapping.ts index 24394f231..41c83aa3f 100644 --- a/subgraph/src/OptimisticRecipientRegistryMapping.ts +++ b/subgraph/src/OptimisticRecipientRegistryMapping.ts @@ -5,7 +5,8 @@ import { RequestSubmitted, } from '../generated/OptimisticRecipientRegistry/OptimisticRecipientRegistry' -import { Recipient, RecipientRegistry } from '../generated/schema' +import { Recipient } from '../generated/schema' +import { loadRecipientRegistry } from './RecipientRegistry' // It is also possible to access smart contracts from mappings. For // example, the contract that has emitted the event can be connected to @@ -34,7 +35,7 @@ export function handleRequestResolved(event: RequestResolved): void { log.info('handleRequestResolved', []) let recipientRegistryId = event.address.toHexString() - let recipientRegistry = RecipientRegistry.load(recipientRegistryId) + let recipientRegistry = loadRecipientRegistry(event.address) if (!recipientRegistry) { log.warning( 'handleRequestResolved - ignore unknown recipient registry {} hash {}', @@ -81,8 +82,8 @@ export function handleRequestSubmitted(event: RequestSubmitted): void { log.info('handleRequestSubmitted', []) let recipientRegistryId = event.address.toHexString() - let recipientRegistery = RecipientRegistry.load(recipientRegistryId) - if (!recipientRegistery) { + let recipientRegistry = loadRecipientRegistry(event.address) + if (!recipientRegistry) { log.warning( 'handleRequestSubmitted - ignore unknown recipient registry {} hash {}', [event.address.toHexString(), event.transaction.hash.toHex()] diff --git a/subgraph/src/RecipientRegistry.ts b/subgraph/src/RecipientRegistry.ts new file mode 100644 index 000000000..4d6c687e3 --- /dev/null +++ b/subgraph/src/RecipientRegistry.ts @@ -0,0 +1,56 @@ +import { Address, BigInt } from '@graphprotocol/graph-ts' +import { OptimisticRecipientRegistry as RecipientRegistryContract } from '../generated/OptimisticRecipientRegistry/OptimisticRecipientRegistry' + +import { RecipientRegistry, FundingRoundFactory } from '../generated/schema' +import { OptimisticRecipientRegistry as recipientRegistryTemplate } from '../generated/templates' + +/* + * Load the recipient registry entity from the subgraph with the given address + */ +export function loadRecipientRegistry( + address: Address +): RecipientRegistry | null { + let recipientRegistryId = address.toHexString() + let recipientRegistry = RecipientRegistry.load(recipientRegistryId) + if (!recipientRegistry) { + let recipientRegistryContract = RecipientRegistryContract.bind(address) + let controller = recipientRegistryContract.try_controller() + if (!controller.reverted) { + // Recipient registry's controller must be the factory + let factoryId = controller.value.toHexString() + let factory = FundingRoundFactory.load(factoryId) + if (factory) { + /* This is our registry, create it */ + recipientRegistry = new RecipientRegistry(recipientRegistryId) + recipientRegistryTemplate.create(address) + let baseDeposit = recipientRegistryContract.try_baseDeposit() + if (baseDeposit.reverted) { + recipientRegistry.baseDeposit = BigInt.fromI32(0) + recipientRegistry.challengePeriodDuration = BigInt.fromI32(0) + } else { + recipientRegistry.baseDeposit = baseDeposit.value + let challengePeriodDuration = + recipientRegistryContract.challengePeriodDuration() + recipientRegistry.challengePeriodDuration = challengePeriodDuration + } + let controller = recipientRegistryContract.try_controller() + let maxRecipients = recipientRegistryContract.try_maxRecipients() + let owner = recipientRegistryContract.try_owner() + + if (!controller.reverted) { + recipientRegistry.controller = controller.value + } + if (!maxRecipients.reverted) { + recipientRegistry.maxRecipients = maxRecipients.value + } + if (!owner.reverted) { + recipientRegistry.owner = owner.value + } + recipientRegistry.fundingRoundFactory = factory.id + recipientRegistry.save() + } + } + } + + return recipientRegistry +} From 99ecef18c7e49668ec35495e4bd0ac276232a427 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Tue, 7 Nov 2023 23:43:03 -0500 Subject: [PATCH 15/17] refactor code --- subgraph/src/FundingRoundFactoryMapping.ts | 7 +- subgraph/src/RecipientRegistry.ts | 78 ++++++++++++++-------- vue-app/src/api/projects.ts | 13 ---- vue-app/src/views/RecipientProfile.vue | 6 +- 4 files changed, 59 insertions(+), 45 deletions(-) diff --git a/subgraph/src/FundingRoundFactoryMapping.ts b/subgraph/src/FundingRoundFactoryMapping.ts index 460f0fcf9..6a081c229 100644 --- a/subgraph/src/FundingRoundFactoryMapping.ts +++ b/subgraph/src/FundingRoundFactoryMapping.ts @@ -17,7 +17,7 @@ import { FundingRound as FundingRoundContract } from '../generated/FundingRoundF import { OptimisticRecipientRegistry as RecipientRegistryContract } from '../generated/FundingRoundFactory/OptimisticRecipientRegistry' import { BrightIdUserRegistry as BrightIdUserRegistryContract } from '../generated/FundingRoundFactory/BrightIdUserRegistry' -import { loadRecipientRegistry } from './RecipientRegistry' +import { createRecipientRegistry } from './RecipientRegistry' import { FundingRound as FundingRoundTemplate, @@ -148,7 +148,10 @@ function createOrUpdateFundingRoundFactory( //Check if these registries already exist/are being tracked let recipientRegistryAddress = fundingRoundFactoryContract.recipientRegistry() let recipientRegistryId = recipientRegistryAddress.toHexString() - let recipientRegistry = loadRecipientRegistry(recipientRegistryAddress) + let recipientRegistry = RecipientRegistry.load(recipientRegistryId) + if (!recipientRegistry) { + createRecipientRegistry(fundingRoundFactoryId, recipientRegistryAddress) + } let contributorRegistryAddress = fundingRoundFactoryContract.userRegistry() let contributorRegistryId = contributorRegistryAddress.toHexString() diff --git a/subgraph/src/RecipientRegistry.ts b/subgraph/src/RecipientRegistry.ts index 4d6c687e3..f809b70f6 100644 --- a/subgraph/src/RecipientRegistry.ts +++ b/subgraph/src/RecipientRegistry.ts @@ -2,7 +2,50 @@ import { Address, BigInt } from '@graphprotocol/graph-ts' import { OptimisticRecipientRegistry as RecipientRegistryContract } from '../generated/OptimisticRecipientRegistry/OptimisticRecipientRegistry' import { RecipientRegistry, FundingRoundFactory } from '../generated/schema' -import { OptimisticRecipientRegistry as recipientRegistryTemplate } from '../generated/templates' +import { OptimisticRecipientRegistry as RecipientRegistryTemplate } from '../generated/templates' + +/* + * Create the recipient registry entity + */ +export function createRecipientRegistry( + fundingRoundFactoryId: string, + recipientRegistryAddress: Address +): RecipientRegistry { + let recipientRegistryId = recipientRegistryAddress.toHexString() + let recipientRegistry = new RecipientRegistry(recipientRegistryId) + RecipientRegistryTemplate.create(recipientRegistryAddress) + + let recipientRegistryContract = RecipientRegistryContract.bind( + recipientRegistryAddress + ) + let baseDeposit = recipientRegistryContract.try_baseDeposit() + if (baseDeposit.reverted) { + recipientRegistry.baseDeposit = BigInt.fromI32(0) + recipientRegistry.challengePeriodDuration = BigInt.fromI32(0) + } else { + recipientRegistry.baseDeposit = baseDeposit.value + let challengePeriodDuration = + recipientRegistryContract.challengePeriodDuration() + recipientRegistry.challengePeriodDuration = challengePeriodDuration + } + let controller = recipientRegistryContract.try_controller() + let maxRecipients = recipientRegistryContract.try_maxRecipients() + let owner = recipientRegistryContract.try_owner() + + if (!controller.reverted) { + recipientRegistry.controller = controller.value + } + if (!maxRecipients.reverted) { + recipientRegistry.maxRecipients = maxRecipients.value + } + if (!owner.reverted) { + recipientRegistry.owner = owner.value + } + recipientRegistry.fundingRoundFactory = fundingRoundFactoryId + recipientRegistry.save() + + return recipientRegistry +} /* * Load the recipient registry entity from the subgraph with the given address @@ -21,33 +64,12 @@ export function loadRecipientRegistry( let factory = FundingRoundFactory.load(factoryId) if (factory) { /* This is our registry, create it */ - recipientRegistry = new RecipientRegistry(recipientRegistryId) - recipientRegistryTemplate.create(address) - let baseDeposit = recipientRegistryContract.try_baseDeposit() - if (baseDeposit.reverted) { - recipientRegistry.baseDeposit = BigInt.fromI32(0) - recipientRegistry.challengePeriodDuration = BigInt.fromI32(0) - } else { - recipientRegistry.baseDeposit = baseDeposit.value - let challengePeriodDuration = - recipientRegistryContract.challengePeriodDuration() - recipientRegistry.challengePeriodDuration = challengePeriodDuration - } - let controller = recipientRegistryContract.try_controller() - let maxRecipients = recipientRegistryContract.try_maxRecipients() - let owner = recipientRegistryContract.try_owner() - - if (!controller.reverted) { - recipientRegistry.controller = controller.value - } - if (!maxRecipients.reverted) { - recipientRegistry.maxRecipients = maxRecipients.value - } - if (!owner.reverted) { - recipientRegistry.owner = owner.value - } - recipientRegistry.fundingRoundFactory = factory.id - recipientRegistry.save() + recipientRegistry = createRecipientRegistry(factory.id, address) + + // update factory + factory.recipientRegistry = recipientRegistryId + factory.recipientRegistryAddress = address + factory.save() } } } diff --git a/vue-app/src/api/projects.ts b/vue-app/src/api/projects.ts index 7bcc19164..c1a065bd8 100644 --- a/vue-app/src/api/projects.ts +++ b/vue-app/src/api/projects.ts @@ -61,19 +61,6 @@ export async function getRecipientRegistryAddress(roundAddress: string | null): } } -export async function getCurrentRecipientRegistryAddress(): Promise { - const data = await sdk.GetRecipientRegistryInfo({ - factoryAddress: factory.address.toLowerCase(), - }) - - const registryAddress = - data.fundingRoundFactory?.currentRound?.recipientRegistry?.id || - data.fundingRoundFactory?.recipientRegistry?.id || - '' - - return registryAddress -} - export async function getProjects(registryAddress: string, startTime?: number, endTime?: number): Promise { if (recipientRegistryType === 'simple') { return await SimpleRegistry.getProjects(registryAddress, startTime, endTime) diff --git a/vue-app/src/views/RecipientProfile.vue b/vue-app/src/views/RecipientProfile.vue index 7a5a9ada5..cb2c548eb 100644 --- a/vue-app/src/views/RecipientProfile.vue +++ b/vue-app/src/views/RecipientProfile.vue @@ -72,10 +72,11 @@ diff --git a/vue-app/src/components/RoundInformation.vue b/vue-app/src/components/RoundInformation.vue index 020980fbe..d0c9a2b16 100644 --- a/vue-app/src/components/RoundInformation.vue +++ b/vue-app/src/components/RoundInformation.vue @@ -166,6 +166,12 @@ +
+
{{ $t('roundInfo.round_period') }}
+
+ +
+
@@ -280,8 +286,9 @@