Skip to content

Commit 1764e67

Browse files
committed
Merge branch 'feat/erc20-fees-on-arbitrator' into feat/interfaces-v2-rebased2
2 parents e46bffc + 28d492b commit 1764e67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+6144
-4741
lines changed

.github/workflows/deploy-subgraph.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
options:
1212
- arbitrum-goerli
1313
- arbitrum
14+
update:
15+
description: Whether to update the subgraph with the current artifacts for the selected network.
16+
required: true
17+
default: true
18+
type: boolean
1419

1520
permissions:
1621
contents: read
@@ -33,16 +38,38 @@ jobs:
3338
with:
3439
node-version: 16
3540

41+
- name: Install Yarn if running locally
42+
if: ${{ env.ACT }}
43+
run: npm install -g yarn
44+
3645
- name: Install the dependencies
3746
run: yarn install
3847

48+
- name: Install jq and yq
49+
if: ${{ inputs.update }}
50+
run: |
51+
mkdir bin
52+
wget -qO bin/jq https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64
53+
wget -qO bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
54+
chmod a+x bin/jq bin/yq
55+
56+
- name: Update the subgraph definition
57+
if: ${{ inputs.update }}
58+
run: |
59+
export PATH=$PWD/../bin:$PATH
60+
yarn update:${{ inputs.network }}
61+
working-directory: subgraph
62+
3963
- name: Build the subgraph
4064
run: |
4165
yarn codegen
4266
yarn build
43-
67+
working-directory: subgraph
68+
4469
- name: Authenticate with TheGraph
4570
run: yarn graph auth "${{ secrets.SUBGRAPH_AUTH_TOKEN }}" --product hosted-service
71+
working-directory: subgraph
4672

4773
- name: Deploy the subgraph
4874
run: yarn deploy:${{ inputs.network }}
75+
working-directory: subgraph

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@ jobs:
8484

8585
# Upload the results to GitHub's code scanning dashboard.
8686
- name: "Upload to code-scanning"
87-
uses: github/codeql-action/upload-sarif@807578363a7869ca324a79039e6db9c843e0e100 # v2.1.27
87+
uses: github/codeql-action/upload-sarif@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e # v2.20.0
8888
with:
8989
sarif_file: results.sarif

contracts/.solhint.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
22
"extends": "solhint:recommended",
3-
"plugins": ["prettier"],
3+
"plugins": [
4+
"prettier"
5+
],
46
"rules": {
5-
"compiler-version": ["error", "^0.8.0"],
7+
"compiler-version": [
8+
"error",
9+
"^0.8.0"
10+
],
611
"func-visibility": [
712
"warn",
813
{

contracts/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@
4141
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
4242
"@nomiclabs/hardhat-ethers": "^2.2.3",
4343
"@nomiclabs/hardhat-solhint": "^3.0.1",
44-
"@openzeppelin/contracts": "^4.9.1",
44+
"@openzeppelin/contracts": "^4.9.2",
4545
"@typechain/ethers-v5": "^11.0.0",
4646
"@typechain/hardhat": "^7.0.0",
4747
"@types/chai": "^4.3.5",
4848
"@types/mocha": "^10.0.1",
4949
"@types/node": "^16.18.36",
5050
"chai": "^4.3.7",
51-
"dotenv": "^16.1.4",
51+
"dotenv": "^16.3.1",
5252
"ethereumjs-util": "^7.1.5",
5353
"ethers": "^5.7.2",
5454
"hardhat": "^2.15.0",
5555
"hardhat-contract-sizer": "^2.10.0",
56-
"hardhat-deploy": "^0.11.30",
56+
"hardhat-deploy": "^0.11.31",
5757
"hardhat-deploy-ethers": "^0.4.0-next.1",
5858
"hardhat-deploy-tenderly": "^0.2.0",
5959
"hardhat-docgen": "^1.3.0",

contracts/tsconfig.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"extends": "@kleros/kleros-v2-tsconfig/base.json",
3-
"include": ["./src", "./scripts", "./test", "./typechain-types", "./deploy"],
4-
"files": ["./hardhat.config.ts"]
3+
"include": [
4+
"./src",
5+
"./scripts",
6+
"./test",
7+
"./typechain-types",
8+
"./deploy"
9+
],
10+
"files": [
11+
"./hardhat.config.ts"
12+
]
513
}

cspell.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"version": "0.2",
44
"ignorePaths": [],
55
"dictionaryDefinitions": [],
6-
"dictionaries": ["en_US", "companies", "softwareTerms"],
6+
"dictionaries": [
7+
"en_US",
8+
"companies",
9+
"softwareTerms"
10+
],
711
"words": [
812
"arbitrum",
913
"commitlint",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"devDependencies": {
3737
"@commitlint/cli": "^17.6.5",
3838
"@commitlint/config-conventional": "^17.6.5",
39+
"buffer": "^5.5.0",
3940
"conventional-changelog-cli": "^2.2.2",
4041
"husky": "^8.0.3",
4142
"lint-staged": "^13.2.2",

prettier-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"main": "index.js",
55
"license": "MIT",
66
"dependencies": {
7-
"eslint": "^8.42.0",
7+
"eslint": "^8.43.0",
88
"prettier": "^2.8.8",
99
"prettier-plugin-solidity": "^1.1.3"
1010
},

scripts/act-subgraph.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
act workflow_dispatch -j buildAndDeploy --input network=arbitrum-goerli,update=true

scripts/check-prerequisites.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,22 @@ function require() #cmd
1111
fi
1212
}
1313

14+
# for the NPM and toolchain version management
15+
require volta
16+
17+
# for the local subgraph node
1418
require docker
1519
require docker-compose
20+
21+
# for some contracts utilities
22+
require cast
23+
require forge
24+
25+
# for the subgraph and contracts utilities
1626
require jq
1727
require yq
18-
require volta
28+
29+
# for the local testing of Github Actions
30+
require act
1931

2032
exit $status

tsconfig/base.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@
1515
"resolveJsonModule": true,
1616
"experimentalDecorators": true
1717
},
18-
"exclude": ["node_modules"]
18+
"exclude": [
19+
"node_modules"
20+
]
1921
}

tsconfig/react-library.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
"extends": "./base.json",
55
"compilerOptions": {
66
"jsx": "react",
7-
"lib": ["es6", "dom", "esnext.asynciterable", "es2017"],
7+
"lib": [
8+
"es6",
9+
"dom",
10+
"esnext.asynciterable",
11+
"es2017"
12+
],
813
"module": "ESNext",
914
"target": "es6"
1015
}

web/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"max-len": [
6161
"warn",
6262
{
63-
"code": 80
63+
"code": 120
6464
}
6565
],
6666
"react/prop-types": 0,

web/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ parcel-bundle-reports
2222
.env.development.local
2323
.env.test.local
2424
.env.production.local
25+
src/hooks/contracts/*
2526

2627
npm-debug.log*
2728
yarn-debug.log*

web/package.json

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,29 @@
2727
"clean": "rm dist/bundle.js",
2828
"start": "parcel",
2929
"start-local": "REACT_APP_SUBGRAPH_ENDPOINT=http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local parcel",
30-
"build": "parcel build",
30+
"build": "yarn run generate-hooks && yarn run parcel build",
3131
"check-style": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
3232
"check-types": "tsc --noEmit",
33-
"generate": "graphql-codegen"
33+
"generate-gql": "graphql-codegen",
34+
"generate-hooks": "wagmi generate"
3435
},
36+
"prettier": "@kleros/kleros-v2-prettier-config",
3537
"devDependencies": {
3638
"@kleros/kleros-v2-eslint-config": "workspace:^",
3739
"@kleros/kleros-v2-prettier-config": "workspace:^",
3840
"@kleros/kleros-v2-tsconfig": "workspace:^",
3941
"@netlify/functions": "^1.6.0",
40-
"@parcel/transformer-svg-react": "~2.9.2",
42+
"@parcel/transformer-svg-react": "~2.8.0",
4143
"@parcel/watcher": "~2.1.0",
4244
"@types/react": "^18.2.12",
4345
"@types/react-dom": "^18.2.5",
4446
"@types/styled-components": "^5.1.26",
47+
"@typescript-eslint/eslint-plugin": "^5.58.0",
48+
"@typescript-eslint/parser": "^5.58.0",
49+
"@typescript-eslint/utils": "^5.58.0",
50+
"@wagmi/cli": "^1.1.0",
51+
"eslint": "^8.38.0",
52+
"eslint-config-prettier": "^8.8.0",
4553
"eslint-import-resolver-parcel": "^1.10.6",
4654
"eslint-plugin-react": "^7.32.2",
4755
"eslint-plugin-react-hooks": "^4.6.0",
@@ -57,17 +65,16 @@
5765
"@sentry/react": "^7.55.2",
5866
"@sentry/tracing": "^7.55.2",
5967
"@types/react-modal": "^3.16.0",
60-
"@web3-react/core": "^6.1.9",
61-
"@web3-react/injected-connector": "^6.0.7",
62-
"@web3-react/types": "^6.0.7",
68+
"@web3modal/ethereum": "^2.2.2",
69+
"@web3modal/react": "^2.2.2",
6370
"chart.js": "^3.9.1",
6471
"chartjs-adapter-moment": "^1.0.1",
6572
"core-js": "^3.31.0",
6673
"ethers": "^5.7.2",
6774
"graphql": "^16.6.0",
6875
"graphql-request": "~5.1.0",
6976
"moment": "^2.29.4",
70-
"parcel": "~2.9.2",
77+
"parcel": "~2.8.0",
7178
"react": "^18.2.0",
7279
"react-chartjs-2": "^4.3.1",
7380
"react-dom": "^18.2.0",
@@ -82,8 +89,10 @@
8289
"react-scripts": "^5.0.1",
8390
"react-toastify": "^9.1.3",
8491
"react-use": "^17.4.0",
85-
"styled-components": "^5.3.11",
86-
"swr": "^1.3.0"
92+
"styled-components": "^5.3.9",
93+
"swr": "^1.3.0",
94+
"viem": "^0.3.48",
95+
"wagmi": "^1.1.0"
8796
},
8897
"volta": {
8998
"node": "16.18.1",

web/src/app.tsx

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import { Routes, Route } from "react-router-dom";
55
import "react-loading-skeleton/dist/skeleton.css";
66
import Web3Provider from "context/Web3Provider";
77
import StyledComponentsProvider from "context/StyledComponentsProvider";
8-
import WrongChainBoundary from "components/WrongChainBoundary";
98
import Layout from "layout/index";
109
import Home from "./pages/Home";
1110
import Cases from "./pages/Cases";
1211
import Dashboard from "./pages/Dashboard";
1312
import Courts from "./pages/Courts";
14-
1513
import "react-toastify/dist/ReactToastify.css";
1614

1715
const fetcherBuilder =
@@ -27,26 +25,20 @@ const App: React.FC = () => {
2725
<SWRConfig
2826
value={{
2927
fetcher: fetcherBuilder(
30-
process.env.REACT_APP_SUBGRAPH_ENDPOINT ??
31-
"https://api.thegraph.com/subgraphs/name/alcercu/kleroscoretest"
28+
process.env.REACT_APP_SUBGRAPH_ENDPOINT ?? "https://api.thegraph.com/subgraphs/name/alcercu/kleroscoretest"
3229
),
3330
}}
3431
>
3532
<Web3Provider>
36-
<WrongChainBoundary>
37-
<Routes>
38-
<Route path="/" element={<Layout />}>
39-
<Route index element={<Home />} />
40-
<Route path="cases/*" element={<Cases />} />
41-
<Route path="courts/*" element={<Courts />} />
42-
<Route path="dashboard" element={<Dashboard />} />
43-
<Route
44-
path="*"
45-
element={<h1>Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯</h1>}
46-
/>
47-
</Route>
48-
</Routes>
49-
</WrongChainBoundary>
33+
<Routes>
34+
<Route path="/" element={<Layout />}>
35+
<Route index element={<Home />} />
36+
<Route path="cases/*" element={<Cases />} />
37+
<Route path="courts/*" element={<Courts />} />
38+
<Route path="dashboard" element={<Dashboard />} />
39+
<Route path="*" element={<h1>Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯</h1>} />
40+
</Route>
41+
</Routes>
5042
</Web3Provider>
5143
</SWRConfig>
5244
</StyledComponentsProvider>

web/src/components/ConnectButton.tsx

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)