Skip to content

Commit

Permalink
Merge pull request #386 from humanprotocol/develop
Browse files Browse the repository at this point in the history
Release 20230414
  • Loading branch information
portuu3 authored Apr 26, 2023
2 parents c3aea94 + 64711ce commit 0510ccf
Show file tree
Hide file tree
Showing 229 changed files with 9,838 additions and 4,271 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/cd-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18.15
- run: yarn --ignore-scripts
name: Install dependencies
- run: yarn compile
Expand Down
50 changes: 34 additions & 16 deletions .github/workflows/cd-deploy-contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
deploy-contracts:
name: Deploy contracts
runs-on: ubuntu-latest
environment: deploy-contracts
strategy:
matrix:
network: [
Expand All @@ -22,6 +23,7 @@ jobs:
reward_pool: '0x0376D26246Eb35FF4F9924cF13E6C05fd0bD7Fb4',
reputation: '0x6B220A6306D8D86C9878A1FBb3F49707b3E2b405',
private_key: TESTNET_PRIVATE_KEY,
subgraph: 'goerli-v1'
},
{
name: polygon,
Expand All @@ -30,6 +32,7 @@ jobs:
reward_pool: '0xa8e32d777a3839440cc7c24D591A64B9481753B3',
# reputation:
private_key: MAINNET_PRIVATE_KEY,
subgraph: 'polygon-v1'
},
{
name: polygonMumbai,
Expand All @@ -38,6 +41,7 @@ jobs:
reward_pool: '0xf0145eD99AC3c4f877aDa7dA4D1E059ec9116BAE',
reputation: '0xC522463d36f76b881bE66484e3068F11e7038Ace',
private_key: TESTNET_PRIVATE_KEY,
subgraph: 'mumbai-v1'
},
{
name: bsc,
Expand All @@ -46,6 +50,7 @@ jobs:
reward_pool: '0x4A5963Dd6792692e9147EdC7659936b96251917a',
# reputation:
private_key: MAINNET_PRIVATE_KEY,
subgraph: 'bsc-v1'
},
{
name: bscTestnet,
Expand All @@ -54,6 +59,7 @@ jobs:
reward_pool: '0xB0A0500103eCEc431b73F6BAd923F0a2774E6e29',
reputation: '0xb8F62639aA3DD51A39d6AACD969363e7F87dcc98',
private_key: TESTNET_PRIVATE_KEY,
subgraph: 'bsctest-v1'
},
{
name: moonbeam,
Expand All @@ -62,6 +68,7 @@ jobs:
reward_pool: '0x4A5963Dd6792692e9147EdC7659936b96251917a',
# reputation:
private_key: MAINNET_PRIVATE_KEY,
subgraph: 'moonbeam-v1'
},
{
name: moonbaseAlpha,
Expand All @@ -70,7 +77,16 @@ jobs:
reward_pool: '0xf46B45Df3d956369726d8Bd93Ba33963Ab692920',
reputation: '0x87469B4f2Fcf37cBd34E54244c0BD4Fa0603664c',
private_key: TESTNET_PRIVATE_KEY,
subgraph: 'moonbase-alpha-v1'
},
{
name: mainnet,
escrow_factory: '0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a',
staking: '0x05398211bA2046E296fBc9a9D3EB49e3F15C3123',
reward_pool: '0x4A5963Dd6792692e9147EdC7659936b96251917a',
private_key: MAINNET_PRIVATE_KEY,
subgraph: 'mainnet-v1'
}
# {
# name: avalanche,
# escrow_factory,
Expand Down Expand Up @@ -107,6 +123,7 @@ jobs:
ETH_BSC_TESTNET_URL: ${{ secrets.ETH_BSC_TESTNET_URL }}å
ETH_MOONBEAM_URL: ${{ secrets.ETH_MOONBEAM_URL }}
ETH_MOONBASE_ALPHA_URL: ${{ secrets.ETH_MOONBASE_ALPHA_URL }}
ETH_MAINNET_TESTNET_URL: ${{ secrets.ETH_MAINNET_TESTNET_URL }}
# ETH_SKALE_URL: ${{ secrets.ETH_SKALE_URL }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
POLYGONSCAN_API_KEY: ${{ secrets.POLYGONSCAN_API_KEY }}
Expand All @@ -115,29 +132,34 @@ jobs:
# SKALE_API_KEY: ${{ secrets.SKALE_API_KEY }}
# SKALE_BROWSER_API_URL: ${{ secrets.SKALE_BROWSER_API_URL }}
# SKALE_BROWSER_URL: ${{ secrets.SKALE_BROWSER_URL }}
SUBGRAPH: ${{ matrix.network.subgraph }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18

node-version: 18.15
- name: Install dependencies
run: npm install --global yarn && yarn --ignore-scripts

- name: Check changes in files
uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref }}
filters: |
escrow_factory:
- 'packages/core/contracts/Escrow*.sol'
- 'packages/core/contracts/interfaces/IStaking.sol'
staking:
- 'packages/core/contracts/Staking.sol'
- 'packages/core/contracts/libs/Stakes.sol'
- 'packages/core/contracts/interfaces/IStaking.sol'
- 'packages/core/contracts/interfaces/IRewardPool.sol'
- 'packages/core/contracts/interfaces/IEscrow.sol'
reward_pool:
- 'packages/core/contracts/RewardPool.sol'
- 'packages/core/contracts/interfaces/IRewardPool.sol'
reputation:
- 'packages/core/contracts/Reputation.sol'
- name: Compile smart contracts
if: |
steps.filter.outputs.escrow_factory == 'true' ||
Expand All @@ -146,59 +168,55 @@ jobs:
steps.filter.outputs.reputation == 'true'
run: yarn compile
working-directory: ./packages/core

- name: Upgrade Escrow Factory Proxy
if: steps.filter.outputs.escrow_factory == 'true'
run: yarn upgrade:proxy --network ${{ matrix.network.name }}
working-directory: ./packages/core
env:
ESCROW_FACTORY_ADDRESS: ${{ matrix.network.escrow_factory }}

- name: Verify Escrow Factory Proxy
if: steps.filter.outputs.escrow_factory == 'true'
run: npx hardhat verify --network ${{ matrix.network.name }} ${{ matrix.network.escrow_factory }}
working-directory: ./packages/core

- name: Upgrade Staking Proxy
if: steps.filter.outputs.staking == 'true'
run: yarn upgrade:proxy --network ${{ matrix.network.name }}
working-directory: ./packages/core
env:
STAKING_ADDRESS: ${{ matrix.network.staking }}

- name: Verify Staking Proxy
if: steps.filter.outputs.staking == 'true'
run: npx hardhat verify --network ${{ matrix.network.name }} ${{ matrix.network.staking }}
working-directory: ./packages/core

- name: Upgrade Reward Pool Proxy
if: steps.filter.outputs.reward_pool == 'true'
run: yarn upgrade:proxy --network ${{ matrix.network.name }}
working-directory: ./packages/core
env:
REWARD_POOL_ADDRESS: ${{ matrix.network.reward_pool }}

- name: Verify Reward Pool Proxy
if: steps.filter.outputs.reward_pool == 'true'
run: npx hardhat verify --network ${{ matrix.network.name }} ${{ matrix.network.reward_pool }}
working-directory: ./packages/core

- name: Upgrade Reputation Proxy
if: steps.filter.outputs.reputation == 'true' && matrix.network.reputation != ''
run: yarn upgrade:proxy --network ${{ matrix.network.name }}
working-directory: ./packages/core
env:
REPUTATION_ADDRESS: ${{ matrix.network.reputation }}

- name: Verify Reputation Proxy
if: steps.filter.outputs.reputation == 'true' && matrix.network.reputation != ''
run: npx hardhat verify --network ${{ matrix.network.name }} ${{ matrix.network.reputation }}
working-directory: ./packages/core

- name: Commit changes
if: ${{ success() }}
uses: EndBug/add-and-commit@v9
with:
add: './packages/core/.openzeppelin'
message: 'chore(generated): update generated network data automatically'
add: "['./packages/core/.openzeppelin', './packages/sdk/typescript/subgraph/config']"
message: 'Update grafting and upgrade file from CD'
default_author: github_actions
- name: Trigger Another Workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Subgraph deployment
inputs: '{ "subgraph-name": "${{ matrix.network.subgraph }}" }'
6 changes: 6 additions & 0 deletions .github/workflows/cd-node-basemodels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18.15
- run: yarn --ignore-scripts
name: Install dependencies
- run: yarn compile
name: Compile smart contracts
working-directory: ./packages/core
- name: Change Package version
uses: jossef/action-set-json-field@v2
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/cd-node-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18.15
- run: yarn --ignore-scripts
name: Install dependencies
- run: yarn compile
name: Compile smart contracts
working-directory: ./packages/core
- name: Change Node.js SDK version
uses: jossef/action-set-json-field@v2
with:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/cd-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,32 @@ on:
paths:
- packages/sdk/typescript/subgraph/**
- .github/workflows/cd-subgraph.yaml
workflow_dispatch:
inputs:
subgraph-name:
description: 'subgraph name'
required: true

jobs:
contracts-check:
runs-on: ubuntu-latest
outputs:
contracts_updated: ${{ steps.filter.outputs.contracts }}
steps:
- uses: actions/checkout@v3
- name: Check changes in files
uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref }}
filters: |
contracts:
- 'packages/core/contracts/**'
subgraph:
name: Deploy Subgraph
needs: contracts-check
runs-on: ubuntu-latest

strategy:
matrix:
network:
Expand All @@ -29,6 +50,8 @@ jobs:
graph: mumbai-v1
- name: mbase
graph: moonbase-alpha-v1
- name: mainnet
graph: mainnet-v1
# - name: avalanche
# graph: avalanche
# - name: fuji
Expand All @@ -37,22 +60,41 @@ jobs:
# graph: skale
fail-fast: true
max-parallel: 3
if: ${{ needs.contracts-check.outputs.contracts_updated != 'true' || github.event.inputs.subgraph-name }}
steps:
- uses: actions/checkout@v3
- name: Continue check
id: continue_check
run: |
if [[ ${{ needs.contracts-check.outputs.contracts_updated}} == 'true' && "${{ github.event.inputs.subgraph-name }}" != "${{ matrix.network.graph }}" ]]; then
echo "stop=true" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18.15
- run: yarn --ignore-scripts
if: ${{steps.continue_check.outputs.stop != 'true'}}
name: Install dependencies
- run: yarn compile
if: ${{steps.continue_check.outputs.stop != 'true'}}
name: Compile smart contracts
working-directory: ./packages/core
- run: yarn global add @graphprotocol/graph-cli
if: ${{steps.continue_check.outputs.stop != 'true'}}
name: Install Graph CLI
- run: graph auth --product hosted-service ${API_KEY}
if: ${{steps.continue_check.outputs.stop != 'true'}}
name: Authenticate Graph CLI
env:
API_KEY: ${{ secrets.HP_GRAPH_API_KEY }}
- run: yarn generate
if: ${{steps.continue_check.outputs.stop != 'true'}}
name: Generate Subgraph
working-directory: ./packages/sdk/typescript/subgraph
env:
NETWORK: ${{ matrix.network.graph }}
- run: graph deploy --product hosted-service humanprotocol/${NETWORK}
if: ${{steps.continue_check.outputs.stop != 'true'}}
name: Deploy Subgraph
working-directory: ./packages/sdk/typescript/subgraph
env:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/ci-dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Dependency Review"
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
- name: "Dependency Review"
uses: actions/dependency-review-action@v3
6 changes: 6 additions & 0 deletions .github/workflows/ci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18.15
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn compile
name: Compile smart contracts
working-directory: ./packages/core
- run: yarn lint
name: Run lint
3 changes: 3 additions & 0 deletions .github/workflows/ci-test-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18.15
- run: npm install --global yarn && yarn --ignore-scripts
name: Install dependencies
- run: yarn core:test
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci-test-escrow-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18.15
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn compile
name: Compile smart contracts
working-directory: ./packages/core
- run: yarn escrow-dashboard:test
name: Run escrow-dashboard test
6 changes: 6 additions & 0 deletions .github/workflows/ci-test-faucet-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18.15
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn compile
name: Compile smart contracts
working-directory: ./packages/core
- run: yarn faucet-server:test
name: Run faucet-server test
11 changes: 7 additions & 4 deletions .github/workflows/ci-test-fortune.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-node@v3 #Temporal until this gets fixed https://github.com/NomicFoundation/hardhat/issues/3877
with:
node-version: 18
- run: npm install --global yarn && yarn --ignore-scripts
name: npm Install dependencies
node-version: 18.15
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn compile
name: Compile smart contracts
working-directory: ./packages/core
- run: yarn fortune:test
name: Run fortune test
Loading

2 comments on commit 0510ccf

@vercel
Copy link

@vercel vercel bot commented on 0510ccf Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

escrow-dashboard – ./packages/apps/escrow-dashboard

escrow-dashboard-humanprotocol.vercel.app
escrow-dashboard-git-main-humanprotocol.vercel.app
dashboard.humanprotocol.org

@vercel
Copy link

@vercel vercel bot commented on 0510ccf Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

faucet-server – ./packages/apps/faucet-server/

faucet-server-git-main-humanprotocol.vercel.app
faucet-server.vercel.app
faucet-server-humanprotocol.vercel.app

Please sign in to comment.