Skip to content

Commit 0cba9be

Browse files
authored
Merge branch 'dev' into feat/add-stats-court-page
2 parents fd3aa44 + d1a6020 commit 0cba9be

19 files changed

+5064
-5294
lines changed

.yarn/releases/yarn-4.0.2.cjs

-893
This file was deleted.

.yarn/releases/yarn-4.5.1.cjs

+934
Large diffs are not rendered by default.

.yarnrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ enableGlobalCache: false
44

55
nodeLinker: node-modules
66

7-
yarnPath: .yarn/releases/yarn-4.0.2.cjs
7+
yarnPath: .yarn/releases/yarn-4.5.1.cjs

contracts/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@kleros/kleros-v2-eslint-config": "workspace:^",
6565
"@kleros/kleros-v2-prettier-config": "workspace:^",
6666
"@kleros/kleros-v2-tsconfig": "workspace:^",
67-
"@logtail/pino": "^0.4.19",
67+
"@logtail/pino": "^0.4.22",
6868
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
6969
"@nomiclabs/hardhat-ethers": "^2.2.3",
7070
"@nomiclabs/hardhat-solhint": "^3.0.1",
@@ -73,14 +73,14 @@
7373
"@typechain/hardhat": "^7.0.0",
7474
"@types/chai": "^4.3.11",
7575
"@types/mocha": "^10.0.6",
76-
"@types/node": "^20.11.3",
77-
"@wagmi/cli": "^2.0.3",
76+
"@types/node": "^20.17.1",
77+
"@wagmi/cli": "^2.1.16",
7878
"abitype": "^0.10.3",
7979
"chai": "^4.4.1",
8080
"dotenv": "^16.3.1",
8181
"ethereumjs-util": "^7.1.5",
8282
"ethers": "^5.7.2",
83-
"graphql": "^16.8.1",
83+
"graphql": "^16.9.0",
8484
"graphql-request": "^6.1.0",
8585
"hardhat": "2.15.0",
8686
"hardhat-contract-sizer": "^2.10.0",
@@ -92,7 +92,7 @@
9292
"hardhat-tracer": "^2.7.0",
9393
"hardhat-watcher": "^2.5.0",
9494
"node-fetch": "^3.3.2",
95-
"pino": "^8.17.2",
95+
"pino": "^8.21.0",
9696
"pino-pretty": "^10.3.1",
9797
"shelljs": "^0.8.5",
9898
"solhint-plugin-prettier": "^0.1.0",
@@ -103,6 +103,6 @@
103103
},
104104
"dependencies": {
105105
"@kleros/vea-contracts": "^0.4.0",
106-
"viem": "^2.21.26"
106+
"viem": "^2.21.35"
107107
}
108108
}

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.1.7",
3+
"version": "2.1.8",
44
"description": "SDK for Kleros version 2",
55
"repository": "[email protected]:kleros/kleros-v2.git",
66
"author": "Kleros",
@@ -44,10 +44,10 @@
4444
"vitest": "^1.1.3"
4545
},
4646
"dependencies": {
47-
"@reality.eth/reality-eth-lib": "^3.2.30",
47+
"@reality.eth/reality-eth-lib": "^3.2.43",
4848
"@urql/core": "^5.0.8",
4949
"mustache": "^4.2.0",
50-
"viem": "^2.21.26",
50+
"viem": "^2.21.35",
5151
"zod": "^3.22.4"
5252
}
5353
}

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
"prettier-config",
2828
"tsconfig"
2929
],
30-
"packageManager": "yarn@4.0.2+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
30+
"packageManager": "yarn@4.5.1",
3131
"volta": {
3232
"node": "20.11.0",
33-
"yarn": "4.3.1"
33+
"yarn": "4.5.1"
3434
},
3535
"devDependencies": {
3636
"@commitlint/cli": "^17.8.1",
@@ -62,7 +62,10 @@
6262
"eth-sig-util@npm:^1.4.2": "3.0.0",
6363
"fast-xml-parser": "^4.2.5",
6464
"@babel/traverse:^7.22.5": "^7.23.6",
65-
"yargs-unparser@npm:1.6.0": "1.6.4"
65+
"yargs-unparser@npm:1.6.0": "1.6.4",
66+
"dompurify@npm:^2.4.0": "2.5.7",
67+
"secp256k1@npm:^4.0.1": "4.0.4",
68+
"ws@npm:^8.11.0": "8.18.0"
6669
},
6770
"scripts": {
6871
"check-prerequisites": "scripts/check-prerequisites.sh",

subgraph/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"@graphprotocol/graph-cli": "0.64.1",
7979
"@kleros/kleros-v2-eslint-config": "workspace:^",
8080
"@kleros/kleros-v2-prettier-config": "workspace:^",
81-
"gluegun": "^5.1.6",
81+
"gluegun": "^5.2.0",
8282
"matchstick-as": "0.6.0"
8383
},
8484
"dependenciesComments": {

web-devtools/.env.devnet-neo.public

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../web/.env.devnet-neo.public
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../web/.env.devnet-university.public

web-devtools/.env.devnet.public

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../web/.env.devnet.public

web-devtools/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dist
2626
.env.development.local
2727
.env.test.local
2828
.env.production.local
29+
.env.devnet-university
2930

3031
# generated code
3132
src/hooks/contracts/generated.ts
@@ -43,4 +44,4 @@ yarn-error.log*
4344

4445
# typescript
4546
*.tsbuildinfo
46-
next-env.d.ts
47+
next-env.d.ts

web-devtools/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"packageManager": "[email protected]+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
1111
"volta": {
1212
"node": "20.11.0",
13-
"yarn": "4.3.1"
13+
"yarn": "4.5.1"
1414
},
1515
"scripts": {
1616
"clean": "rimraf .next src/graphql-generated src/hooks/contracts/generated.ts",
@@ -28,13 +28,13 @@
2828
"@graphql-codegen/cli": "^5.0.2",
2929
"@graphql-codegen/client-preset": "^4.3.2",
3030
"@svgr/webpack": "^8.1.0",
31-
"@types/node": "^20",
31+
"@types/node": "^20.17.1",
3232
"@types/react": "18.2.0",
3333
"@types/react-dom": "^18.2.18",
3434
"@typescript-eslint/eslint-plugin": "^8.8.1",
3535
"@typescript-eslint/parser": "^8.8.1",
3636
"@typescript-eslint/utils": "^8.8.1",
37-
"@wagmi/cli": "^2.0.3",
37+
"@wagmi/cli": "^2.1.16",
3838
"eslint": "^8.57.1",
3939
"eslint-config-next": "^14.2.15",
4040
"eslint-config-prettier": "^9.1.0",
@@ -49,7 +49,7 @@
4949
"@kleros/kleros-sdk": "workspace:^",
5050
"@kleros/ui-components-library": "^2.15.0",
5151
"@web3modal/wagmi": "^5.1.11",
52-
"graphql": "^16.8.1",
52+
"graphql": "^16.9.0",
5353
"graphql-request": "^7.1.0",
5454
"next": "14.2.14",
5555
"react": "^18.2.0",
@@ -58,7 +58,7 @@
5858
"react-toastify": "^10.0.5",
5959
"typewriter-effect": "^2.21.0",
6060
"vanilla-jsoneditor": "^0.21.4",
61-
"viem": "^2.1.0",
62-
"wagmi": "^2.2.1"
61+
"viem": "^2.21.35",
62+
"wagmi": "^2.12.25"
6363
}
6464
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import retrieveVariables from "@kleros/kleros-sdk/src/dataMappings/utils/retrieveVariables";
2+
import { Field } from "@kleros/ui-components-library";
3+
import { useMemo, useState } from "react";
4+
import styled from "styled-components";
5+
import { useDebounce } from "react-use";
6+
import WithHelpTooltip from "components/WithHelpTooltip";
7+
8+
const Container = styled.div`
9+
width: 100%;
10+
display: flex;
11+
flex-direction: column;
12+
gap: 16px;
13+
margin-top: 32px;
14+
`;
15+
16+
const Header = styled.h2`
17+
margin: 0;
18+
`;
19+
20+
const InputContainer = styled.div`
21+
display: flex;
22+
gap: 16px;
23+
flex-wrap: wrap;
24+
`;
25+
const VariableName = styled.p`
26+
font-family: "Roboto Mono", monospace;
27+
`;
28+
29+
// prevent duplicating input fields
30+
const DisputeRequestParams = [
31+
"arbitrator",
32+
"arbitrable",
33+
"arbitratorDisputeID",
34+
"externalDisputeID",
35+
"templateID",
36+
"templateUri",
37+
];
38+
39+
interface ICustomContextInputs {
40+
dataMapping: string;
41+
setCustomContext: (context: Record<string, string>) => void;
42+
}
43+
const CustomContextInputs: React.FC<ICustomContextInputs> = ({ dataMapping, setCustomContext }) => {
44+
const [customContextInputs, setCustomContextInputs] = useState<Record<string, string>>();
45+
46+
const requiredVariables = useMemo(() => {
47+
try {
48+
return retrieveVariables(dataMapping);
49+
} catch (error) {
50+
console.error("Failed to parse dataMapping:", error);
51+
return [];
52+
}
53+
}, [dataMapping]);
54+
55+
useDebounce(
56+
() => {
57+
if (!customContextInputs) return;
58+
setCustomContext(customContextInputs);
59+
},
60+
300,
61+
[customContextInputs]
62+
);
63+
64+
return requiredVariables.length ? (
65+
<Container>
66+
<WithHelpTooltip tooltipMsg="These are additional variables required by the data mapping to be passed as initial context. Please ignore the variables that will come from the result of the preceeding data mappings">
67+
<Header>Additional Context</Header>
68+
</WithHelpTooltip>
69+
{requiredVariables.map((variable, index) =>
70+
DisputeRequestParams.includes(variable) ? null : (
71+
<InputContainer key={`${variable}-${index}`}>
72+
<VariableName>{variable}:</VariableName>
73+
<Field
74+
type="text"
75+
name={variable}
76+
value={customContextInputs?.[variable]}
77+
onChange={(e) => {
78+
setCustomContextInputs((prev) => ({ ...prev, [variable]: e.target.value }));
79+
}}
80+
placeholder="0x..."
81+
/>
82+
</InputContainer>
83+
)
84+
)}
85+
</Container>
86+
) : null;
87+
};
88+
89+
export default CustomContextInputs;

web-devtools/src/app/(main)/dispute-template/FetchDisputeRequestInput.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ const StyledA = styled.a`
4646
const presets = [
4747
{
4848
title: "Escrow",
49-
txnHash: "0x85e60cb407c9a38e625263cc762ff4283d01f38201825e1d20109d8664cfa7d4",
49+
txnHash: "0x2565b756e500240544f7fc36f938462c7efbbd2e343c57979f81fecdf1054e23",
5050
chainId: 421614,
5151
},
5252
{
5353
title: "Curated Lists",
54-
txnHash: "0x6e5ad6f7436ef8570b50b0fbec76a11ccedbed85030c670e59d8f6617a499108",
54+
txnHash: "0xa7981830bf8144ab2070f3a639bd36b204c4c48ee1fafef66abaf60272418ed4",
5555
chainId: 421614,
5656
},
5757
{
58-
title: "Trump-Biden",
59-
txnHash: "0x9a3a420174f3c55c2b3eb2e77266777b74028b845e528a90142b5b57aafbdb90",
58+
title: "Trump-Harris",
59+
txnHash: "0x86db91678cf3f8c4503e37340cf2cd93bffcba84f9c43a98c090f6a4c76d8793",
6060
chainId: 421614,
6161
},
6262
];

web-devtools/src/app/(main)/dispute-template/page.tsx

+11-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import ReactMarkdown from "components/ReactMarkdown";
2525

2626
import FetchDisputeRequestInput, { DisputeRequest } from "./FetchDisputeRequestInput";
2727
import FetchFromIDInput from "./FetchFromIdInput";
28+
import CustomContextInputs from "./CustomContextInputs";
2829

2930
const Container = styled.div`
3031
height: auto;
@@ -105,6 +106,7 @@ const UpperContainer = styled.div`
105106
`
106107
)}
107108
`;
109+
108110
const StyledForm = styled.form`
109111
display: flex;
110112
flex-direction: column;
@@ -150,6 +152,7 @@ const DisputeTemplateView = () => {
150152
const [disputeDetails, setDisputeDetails] = useState<DisputeDetails | undefined>(undefined);
151153
const [disputeTemplateInput, setDisputeTemplateInput] = useState<string>("");
152154
const [dataMappingsInput, setDataMappingsInput] = useState<string>("");
155+
const [customContext, setCustomContext] = useState<Record<string, string>>();
153156

154157
const [params, setParams] = useState<DisputeRequest>({
155158
_arbitrable: "0x10f7A6f42Af606553883415bc8862643A6e63fdA",
@@ -178,7 +181,7 @@ const DisputeTemplateView = () => {
178181
setLoading(true);
179182

180183
setTimeout(() => {
181-
const initialContext = {
184+
let initialContext = {
182185
arbitrator: debouncedParams._arbitrator,
183186
arbitrable: debouncedParams._arbitrable,
184187
arbitratorDisputeID: debouncedParams._arbitratorDisputeID,
@@ -187,6 +190,8 @@ const DisputeTemplateView = () => {
187190
templateUri: debouncedParams._templateUri,
188191
};
189192

193+
if (customContext) initialContext = { ...initialContext, ...customContext };
194+
190195
const fetchData = async () => {
191196
try {
192197
const data = dataMappingsInput ? await executeActions(JSON.parse(dataMappingsInput), initialContext) : {};
@@ -210,7 +215,7 @@ const DisputeTemplateView = () => {
210215
if (disputeTemplateInput || dataMappingsInput || debouncedParams) {
211216
scheduleFetchData();
212217
}
213-
}, [disputeTemplateInput, dataMappingsInput, debouncedParams]);
218+
}, [disputeTemplateInput, dataMappingsInput, debouncedParams, customContext]);
214219

215220
return (
216221
<>
@@ -277,9 +282,12 @@ const DisputeTemplateView = () => {
277282
name="_templateUri"
278283
value={params._templateUri}
279284
onChange={handleFormUpdate}
280-
placeholder="ipfs://... (optional)"
285+
placeholder="/ipfs/... (optional)"
281286
/>
282287
</StyledRow>
288+
<StyledRow>
289+
<CustomContextInputs dataMapping={dataMappingsInput} setCustomContext={setCustomContext} />
290+
</StyledRow>
283291
</StyledForm>
284292
<div>
285293
<FetchFromIDInput

web-devtools/src/components/JSONEditor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ const JSONEditor = (props: any) => {
5959
}
6060
}, [props]);
6161

62-
return <Container ref={refContainer}></Container>;
62+
return <Container ref={refContainer} className={props.className}></Container>;
6363
};
6464
export default JSONEditor;

web-devtools/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"./*"
3333
],
3434
"src*": [
35-
"../../kleros-sdk/src/*",
3635
"./*"
3736
],
3837
"svgs*": [

web/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@typescript-eslint/eslint-plugin": "^8.8.1",
6262
"@typescript-eslint/parser": "^8.8.1",
6363
"@typescript-eslint/utils": "^8.8.1",
64-
"@wagmi/cli": "^2.0.3",
64+
"@wagmi/cli": "^2.1.16",
6565
"eslint": "^8.57.1",
6666
"eslint-config-prettier": "^9.1.0",
6767
"eslint-import-resolver-typescript": "^3.6.3",
@@ -95,7 +95,7 @@
9595
"chartjs-plugin-datalabels": "^2.2.0",
9696
"core-js": "^3.35.0",
9797
"ethers": "^5.7.2",
98-
"graphql": "^16.8.1",
98+
"graphql": "^16.9.0",
9999
"graphql-request": "~6.1.0",
100100
"jose": "^5.2.3",
101101
"moment": "^2.30.1",
@@ -114,9 +114,9 @@
114114
"react-scripts": "^5.0.1",
115115
"react-toastify": "^9.1.3",
116116
"react-use": "^17.4.3",
117-
"siwe": "^2.3.1",
117+
"siwe": "^2.3.2",
118118
"styled-components": "^5.3.11",
119-
"viem": "^2.17.3",
120-
"wagmi": "^2.12.8"
119+
"viem": "^2.21.35",
120+
"wagmi": "^2.12.25"
121121
}
122122
}

0 commit comments

Comments
 (0)