-
Notifications
You must be signed in to change notification settings - Fork 44
Read fee values from kvstore in the escrow contract #3812
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
37c51d4
remove HMToken related entities and handlers from subgraph
portuu3 f7568d2
Add Human HMT statistics subgraph
flopez7 91d10db
integrate HMT subgraph support and update related queries in Python SDK
flopez7 543e99b
Generated changeset for SDKs
flopez7 b494158
Move subgraphs into new /subgraph folder
flopez7 a3f4ff2
Read fee values from kvstore in the escrow contract
portuu3 0f6d084
Update matchstick.yaml libsFolder path and enhance internalTransactio…
flopez7 8ada099
Update libsFolder path in matchstick.yaml for correct module resolution
flopez7 6d20998
Add permissions section for subgraph CI workflow
flopez7 abc40f3
- implement PendingV3 event with manifest and fee percentages in Escr…
portuu3 245d616
Fix job launcher server tests
portuu3 f83c0a2
Add transaction creation and tests for fund events in Escrow
flopez7 0f334e5
remove script update
portuu3 e3e2e0c
Moved subgraphs from SDK to their own folder in package level
flopez7 aeb9d2d
Merge branch 'remove-hmt-subgraph' into escrow-fee-kvstore
portuu3 c17c40c
Update subgraph URL references to use NETWORKS configuration in Escro…
portuu3 3bb32ce
refactor getManifest backward-compatible
portuu3 302d03e
upgrade amoy and bsc testnet
portuu3 364cc72
Upgrade sepolia
portuu3 aa367f6
[Subgraph] Remove unused event entities and related logic from subgra…
flopez7 6226ef1
Update TS subgraph URLs for testnets
flopez7 631f780
Update cd/ci subgraphs
portuu3 9285cb0
Merge branch 'develop' into escrow-fee-kvstore
flopez7 9eee932
Fix subgraph package names in yarn.lock
flopez7 a6bc6dc
Fix USDC token address in tokens.ts
flopez7 0b7ff83
Update USDC and USDT token decimals from 6 to 18 in bsc testnet
flopez7 d8d2354
Add new Subpraph URLs to SDKs and update changeset to reflect core ch…
flopez7 2cfea32
Potential fix for code scanning alert no. 183: Workflow does not cont…
portuu3 cd63a43
Potential fix for code scanning alert no. 182: Workflow does not cont…
portuu3 cbfd134
[SDK] feat: kvstore.get to return none/undefined when no key found (#…
dnechay 7296738
Improve manifest fetching fallback logic
portuu3 b16196a
[SDK] feat: consistent kvstore.get in python sdk (#3820)
dnechay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@human-protocol/sdk": major | ||
| "@human-protocol/python-sdk": major | ||
| --- | ||
|
|
||
| Updated KV Store utils in sdk to return empty string in case no value in subgraph instead of throwing and error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| "@human-protocol/core": major | ||
| "@human-protocol/sdk": major | ||
| "@human-protocol/python-sdk": major | ||
| --- | ||
|
|
||
| Updated escrow contracts and SDKs to fetch oracle fees from `KVStore` instead of passing fee values during escrow setup. `Escrow.setup(...)` and factory setup flows no longer accept fee arguments, escrow deployments now require a `KVStore` address, and fee validation is enforced on-chain from `KVStore` values, including per-oracle and total fee limits. Added upgrade-safe `EscrowFactory` support for storing and updating the `KVStore` address. | ||
|
|
||
| Updated TypeScript and Python SDK escrow setup APIs to match the new contract signatures by removing fee arguments from `setup(...)` and create-and-setup helpers. Existing config fee fields remain optional for backward compatibility but are ignored by setup calls. | ||
|
|
||
| Updated SDKs to use a dedicated HMT stats subgraph endpoint for HMT statistics methods and removed `totalAmountPaid` and `averageAmountPerWorker` from `IDailyPayment`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| name: Human Protocol Subgraph Deployment | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| label: | ||
| description: "New version label" | ||
| required: true | ||
| networks: | ||
| description: "Comma-separated list of networks to deploy" | ||
| required: true | ||
|
|
||
| jobs: | ||
| subgraph: | ||
| name: Deploy Human Protocol Subgraph | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| network: | ||
| - name: amoy | ||
| - name: bsc-testnet | ||
| - name: bsc | ||
| - name: ethereum | ||
| - name: polygon | ||
| - name: sepolia | ||
| fail-fast: true | ||
| max-parallel: 3 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: yarn | ||
| - name: Filter Networks | ||
| id: filter_networks | ||
| run: | | ||
| INPUT_NETWORKS="${{ github.event.inputs.networks }}" | ||
| IFS=',' read -ra NETWORK_LIST <<< "$INPUT_NETWORKS" | ||
| echo "Input networks: $INPUT_NETWORKS" | ||
| echo "Current matrix network: ${{ matrix.network.name }}" | ||
| MATCH=false | ||
| for network in "${NETWORK_LIST[@]}"; do | ||
| if [[ "${network}" == "${{ matrix.network.name }}" ]]; then | ||
| MATCH=true | ||
| break | ||
| fi | ||
| done | ||
| echo "Match found: $MATCH" | ||
| echo "continue=$MATCH" >> "$GITHUB_OUTPUT" | ||
| - name: Install dependencies | ||
| if: steps.filter_networks.outputs.continue == 'true' | ||
| run: yarn workspaces focus @tools/subgraph-human-protocol | ||
| - name: Build packages (scoped) | ||
| if: steps.filter_networks.outputs.continue == 'true' | ||
| run: yarn workspaces foreach -Rpt --from @tools/subgraph-human-protocol run build | ||
| - name: Generate and build Subgraph | ||
| if: steps.filter_networks.outputs.continue == 'true' | ||
| run: yarn generate && yarn build | ||
| working-directory: ./packages/subgraph/human-protocol | ||
| env: | ||
| NETWORK: ${{ matrix.network.name }} | ||
| - name: Authenticate & Deploy | ||
| if: steps.filter_networks.outputs.continue == 'true' | ||
| env: | ||
| API_KEY: ${{ secrets.HP_GRAPH_API_KEY }} | ||
| NETWORK: ${{ matrix.network.name }} | ||
| LABEL: ${{ github.event.inputs.label }} | ||
| working-directory: ./packages/subgraph/human-protocol | ||
| run: | | ||
| yarn dlx @graphprotocol/graph-cli@0.71.2 \ | ||
| auth --studio "$API_KEY" | ||
| yarn dlx @graphprotocol/graph-cli@0.71.2 \ | ||
| deploy --studio human-${NETWORK} -l ${LABEL} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Human Protocol Subgraph check | ||
|
|
||
| on: | ||
| push: | ||
| branches: "**" | ||
| paths: | ||
| - "packages/core/**" | ||
| - "packages/subgraph/human-protocol/**" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| subgraph-test: | ||
| name: Human Protocol Subgraph Test | ||
| # TODO: Use ubuntu-latest when graph binary is not failing on ubuntu 24.04 | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: yarn | ||
| - name: Install dependencies | ||
| run: yarn workspaces focus @tools/subgraph-human-protocol | ||
| - name: Build core package | ||
| run: yarn workspace @human-protocol/core build | ||
| - name: Generate manifest for Polygon for tests | ||
| run: NETWORK=polygon yarn workspace @tools/subgraph-human-protocol generate | ||
| - name: Run subgraph test | ||
| run: yarn workspace @tools/subgraph-human-protocol test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.