Skip to content

Commit aab55a9

Browse files
Merge branch 'dev' into chore/update-subgraph-status-lib
2 parents 718eb3c + e67fc2a commit aab55a9

36 files changed

+1436
-1253
lines changed

.github/workflows/codeql.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- name: Harden Runner
41-
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.3
41+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
4242
with:
4343
egress-policy: audit
4444

@@ -47,7 +47,7 @@ jobs:
4747

4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
50+
uses: github/codeql-action/init@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1
5151
with:
5252
languages: ${{ matrix.language }}
5353
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -61,7 +61,7 @@ jobs:
6161
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
6262
# If this step fails, then you should remove it and run the build manually (see below)
6363
- name: Autobuild
64-
uses: github/codeql-action/autobuild@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
64+
uses: github/codeql-action/autobuild@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1
6565

6666
# ℹ️ Command-line programs to run using the OS shell.
6767
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -74,6 +74,6 @@ jobs:
7474
# ./location_of_script_within_repo/buildscript.sh
7575

7676
- name: Perform CodeQL Analysis
77-
uses: github/codeql-action/analyze@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
77+
uses: github/codeql-action/analyze@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1
7878
with:
7979
category: "/language:${{matrix.language}}"

.github/workflows/contracts-testing.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Harden Runner
27-
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.3
27+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
2828
with:
2929
disable-sudo: true
3030
egress-policy: block
@@ -50,13 +50,13 @@ jobs:
5050
yarn set version 4.5.1
5151
5252
- name: Setup Node.js environment
53-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
53+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
5454
with:
5555
node-version: 20.x
5656
cache: yarn
5757

5858
- name: Cache node modules
59-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
59+
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
6060
env:
6161
cache-name: cache-node-modules
6262
with:
@@ -71,7 +71,7 @@ jobs:
7171
run: yarn workspace @kleros/kleros-v2-contracts install
7272

7373
- name: Install Foundry
74-
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0
74+
uses: foundry-rs/foundry-toolchain@de808b1eea699e761c404bda44ba8f21aba30b2c # v1.3.1
7575

7676
- name: Install lcov
7777
run: sudo apt-get install -y lcov
@@ -81,7 +81,7 @@ jobs:
8181
working-directory: contracts
8282

8383
- name: Upload a build artifact
84-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
84+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
8585
with:
8686
name: code-coverage-report
8787
path: contracts/coverage

.github/workflows/dependency-review.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Harden Runner
22-
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.3
22+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
2323
with:
2424
disable-sudo: true
2525
egress-policy: block

.github/workflows/deploy-bots.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Harden Runner
11-
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.3
11+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
1212
with:
1313
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
1414

.github/workflows/deploy-subgraph.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
environment: ${{ inputs.graph_environment }}
3636
steps:
3737
- name: Harden Runner
38-
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.3
38+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
3939
with:
4040
egress-policy: audit
4141

.github/workflows/scorecards.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
steps:
3434
- name: Harden Runner
35-
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.3
35+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
3636
with:
3737
disable-sudo: true
3838
egress-policy: block
@@ -56,7 +56,7 @@ jobs:
5656
persist-credentials: false
5757

5858
- name: "Run analysis"
59-
uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0
59+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
6060
with:
6161
results_file: results.sarif
6262
results_format: sarif
@@ -78,14 +78,14 @@ jobs:
7878
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
7979
# format to the repository Actions tab.
8080
- name: "Upload artifact"
81-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
81+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
8282
with:
8383
name: SARIF file
8484
path: results.sarif
8585
retention-days: 5
8686

8787
# Upload the results to GitHub's code scanning dashboard.
8888
- name: "Upload to code-scanning"
89-
uses: github/codeql-action/upload-sarif@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
89+
uses: github/codeql-action/upload-sarif@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1
9090
with:
9191
sarif_file: results.sarif

.github/workflows/sentry-release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
version: ${{ steps.set-version.outputs.version }}
1818
steps:
1919
- name: Harden Runner
20-
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.3
20+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
2121
with:
2222
disable-sudo: true
2323
egress-policy: block
@@ -44,13 +44,13 @@ jobs:
4444
yarn set version 4.5.1
4545
4646
- name: Setup Node.js environment
47-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
47+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
4848
with:
4949
node-version: 20.x
5050
cache: yarn
5151

5252
- name: Cache node modules
53-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
53+
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
5454
env:
5555
cache-name: cache-node-modules
5656
with:
@@ -72,7 +72,7 @@ jobs:
7272
working-directory: web
7373

7474
- name: Create Sentry release
75-
uses: getsentry/action-release@f6dfa3d84a1c740b94aa45255c5e032b744a095d # v1.9.0
75+
uses: getsentry/action-release@ffb64465339ef6fb868e2fc261318d78ae0ed8d9 # v1.10.5
7676
env:
7777
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
7878
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}

.github/workflows/sonarcloud.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Harden Runner
22-
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.3
22+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
2323
with:
2424
egress-policy: audit
2525

contracts/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"node": ">=16.0.0"
1212
},
1313
"volta": {
14-
"node": "18.19.0"
14+
"node": "18.20.6"
1515
},
1616
"publishConfig": {
1717
"access": "public",
@@ -73,7 +73,7 @@
7373
"@kleros/kleros-v2-eslint-config": "workspace:^",
7474
"@kleros/kleros-v2-prettier-config": "workspace:^",
7575
"@kleros/kleros-v2-tsconfig": "workspace:^",
76-
"@logtail/pino": "^0.4.22",
76+
"@logtail/pino": "^0.5.0",
7777
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
7878
"@nomicfoundation/hardhat-ethers": "^3.0.8",
7979
"@nomiclabs/hardhat-solhint": "^4.0.1",

kleros-app/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ import { WagmiProvider } from 'wagmi'
2727
import { config } from './config'
2828
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
2929
import { AtlasProvider, Products } from "@kleros/kleros-app";
30+
import { useConfig } from 'wagmi'
3031

3132
const queryClient = new QueryClient()
3233

3334
function App() {
35+
const wagmiConfig = useConfig()
36+
3437
return
3538
<WagmiProvider config={config}>
3639
<QueryClientProvider client={queryClient}>
37-
<AtlasProvider config={{ uri: import.meta.env.REACT_APP_ATLAS_URI, product: Products.CourtV2 }}>
40+
<AtlasProvider config={{ uri: import.meta.env.REACT_APP_ATLAS_URI, product: Products.CourtV2, wagmiConfig: wagmiConfig }}>
3841
...
3942
</AtlasProvider>
4043
</QueryClientProvider>

kleros-app/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kleros/kleros-app",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"description": "Library for Kleros DApps with reusable abstractions and components.",
55
"repository": "[email protected]:kleros/kleros-v2.git",
66
"homepage": "https://github.com/kleros/kleros-v2/tree/master/kleros-app#readme",
@@ -14,7 +14,7 @@
1414
],
1515
"type": "module",
1616
"volta": {
17-
"node": "20.18.2"
17+
"node": "20.18.3"
1818
},
1919
"publishConfig": {
2020
"access": "public",
@@ -49,7 +49,8 @@
4949
"typescript": "^5.6.3",
5050
"vite": "^5.4.11",
5151
"vite-plugin-dts": "^4.3.0",
52-
"vite-plugin-node-polyfills": "^0.22.0"
52+
"vite-plugin-node-polyfills": "^0.23.0",
53+
"wagmi": "^2.14.0"
5354
},
5455
"dependencies": {
5556
"jose": "^5.9.6"
@@ -61,6 +62,6 @@
6162
"react": "^18.3.1",
6263
"react-dom": "^18.3.1",
6364
"viem": "^2.21.42",
64-
"wagmi": "^2.13.5"
65+
"wagmi": "^2.14.0"
6566
}
6667
}

kleros-app/src/lib/atlas/providers/AtlasProvider.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useMemo, createContext, useContext, useState, useCallback, useEf
22
import { useQuery, useQueryClient } from "@tanstack/react-query";
33
import { GraphQLClient } from "graphql-request";
44
import { decodeJwt } from "jose";
5-
import { useAccount, useChainId, useSignMessage } from "wagmi";
5+
import { useAccount, useChainId, useSignMessage, type Config } from "wagmi";
66
import {
77
createMessage,
88
getNonce,
@@ -53,11 +53,12 @@ const Context = createContext<IAtlasProvider | undefined>(undefined);
5353
interface AtlasConfig {
5454
uri: string;
5555
product: Products;
56+
wagmiConfig: Config;
5657
}
5758

5859
export const AtlasProvider: React.FC<{ config: AtlasConfig; children?: React.ReactNode }> = ({ children, config }) => {
59-
const { address } = useAccount();
60-
const chainId = useChainId();
60+
const { address } = useAccount({ config: config.wagmiConfig });
61+
const chainId = useChainId({ config: config.wagmiConfig });
6162
const queryClient = useQueryClient();
6263

6364
const [authToken, setAuthToken] = useSessionStorage<string | undefined>("authToken", undefined);
@@ -66,7 +67,7 @@ export const AtlasProvider: React.FC<{ config: AtlasConfig; children?: React.Rea
6667
const [isUpdatingUser, setIsUpdatingUser] = useState(false);
6768
const [isVerified, setIsVerified] = useState(false);
6869
const [isUploadingFile, setIsUploadingFile] = useState(false);
69-
const { signMessageAsync } = useSignMessage();
70+
const { signMessageAsync } = useSignMessage({ config: config.wagmiConfig });
7071

7172
const atlasGqlClient = useMemo(() => {
7273
const headers = authToken

kleros-sdk/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kleros/kleros-sdk",
3-
"version": "2.2.0",
3+
"version": "2.3.0",
44
"description": "SDK for Kleros version 2",
55
"repository": "[email protected]:kleros/kleros-v2.git",
66
"homepage": "https://github.com/kleros/kleros-v2/tree/master/kleros-sdk#readme",
@@ -15,7 +15,7 @@
1515
],
1616
"type": "commonjs",
1717
"volta": {
18-
"node": "20.18.2"
18+
"node": "20.18.3"
1919
},
2020
"publishConfig": {
2121
"access": "public",
@@ -43,7 +43,7 @@
4343
"vitest": "^1.6.0"
4444
},
4545
"dependencies": {
46-
"@reality.eth/reality-eth-lib": "^3.2.44",
46+
"@reality.eth/reality-eth-lib": "^3.2.60",
4747
"@urql/core": "^5.0.8",
4848
"mustache": "^4.2.0",
4949
"zod": "^3.23.8"

kleros-sdk/src/dataMappings/utils/populateTemplate.ts

+17-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,23 @@ export const populateTemplate = (mustacheTemplate: string, data: any): DisputeDe
1111
throw validation.error;
1212
}
1313

14-
// Filter out any existing answer with id 0 and add our standard Refuse to Arbitrate option
15-
(dispute as DisputeDetails).answers = [
16-
RefuseToArbitrateAnswer,
17-
...((dispute as DisputeDetails).answers.filter((answer) => answer.id && BigInt(answer.id) !== BigInt(0)) || []),
18-
];
14+
return findAndUpdateRTA(dispute);
15+
};
16+
17+
// Filter out any existing answer with id 0 and add customised Refuse to Arbitrate option
18+
const findAndUpdateRTA = (dispute: DisputeDetails) => {
19+
const templateRTAIndex = (dispute as DisputeDetails).answers.findIndex(
20+
(answer) => answer.id && BigInt(answer.id) === BigInt(0)
21+
);
22+
23+
if (templateRTAIndex !== -1) {
24+
dispute.answers[templateRTAIndex] = {
25+
...RefuseToArbitrateAnswer,
26+
description: dispute.answers[templateRTAIndex].description ?? RefuseToArbitrateAnswer.description,
27+
};
28+
} else {
29+
dispute.answers = [RefuseToArbitrateAnswer, ...dispute.answers];
30+
}
1931

2032
return dispute;
2133
};

0 commit comments

Comments
 (0)