Skip to content

Release #2076

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

Draft
wants to merge 58 commits into
base: master
Choose a base branch
from
Draft

Release #2076

Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
4594536
chore: changed contracts viem dependency as peer dependency
jaybuidl Aug 5, 2025
5a81f9e
feat: dispute kit helper
jaybuidl Aug 5, 2025
4c2277b
chore: override viem resolution from viem@npm:2.x to npm:^2.23.2 beca…
jaybuidl Aug 5, 2025
efb2aad
chore: changelog
jaybuidl Aug 5, 2025
29aee53
Merge pull request #2066 from kleros/feat/contracts-disputekits-helper
jaybuidl Aug 5, 2025
e3ed3c9
chore: published @kleros/[email protected]
jaybuidl Aug 5, 2025
77c8549
chore: enabled Hardhat viaIR compilation with solc v0.8.30, bumped ha…
jaybuidl Aug 7, 2025
0cdc07d
Merge pull request #2069 from kleros/chore/solc-0.8.30-viaIR
jaybuidl Aug 7, 2025
e41ee56
chore: viaIR compilation enabled for Foundry with explicit solc v0.8.30
jaybuidl Aug 7, 2025
9b1f5fd
Merge pull request #2073 from kleros/chore/solc-0.8.30-viaIR-foundry
jaybuidl Aug 7, 2025
2d94bfd
chore: changelog
jaybuidl Aug 7, 2025
bfe11a7
feat: rng fallback
jaybuidl Jul 24, 2025
63ecf4a
fix: re-added removed variables to preserve storage layout, marked as…
jaybuidl Jul 24, 2025
937fb97
feat(RNG): fallback contract update
unknownunknown1 Aug 6, 2025
752b64a
feat: court llms.txt, adding header `X-Robots-Tag: llms-txt`
jaybuidl Aug 6, 2025
9140890
Merge pull request #2067 from kleros/feat/court-llms-txt
jaybuidl Aug 7, 2025
4a72da5
fix: shutter flash
kemuru Aug 7, 2025
d3a1293
chore: better return structure
kemuru Aug 7, 2025
9d3ba90
fix: usevotingcontext dynamic disputekit hook calling
kemuru Aug 8, 2025
3080c8f
chore: comment tweaking
kemuru Aug 8, 2025
a8942cd
fix: add shutter api check
kemuru Aug 9, 2025
89848ea
chore: check that its not empty too just in case
kemuru Aug 9, 2025
a130a6a
Merge pull request #2077 from kleros/fix/add-shutter-api-check
jaybuidl Aug 11, 2025
b8628bb
fix: coverage script breaking after enabling viaIR
jaybuidl Aug 11, 2025
d10251b
chore: interfaces pragma set to any 0.8 solc version
jaybuidl Aug 12, 2025
41e8998
chore: changelog
jaybuidl Aug 12, 2025
34f6a65
Merge branch 'dev' into feat/rng-fallback2
jaybuidl Aug 12, 2025
da7eea1
refactor: minor improvement
jaybuidl Aug 12, 2025
a8f3415
chore: deployment script support for RNGWithFallback
jaybuidl Aug 12, 2025
78b3169
docs: metrics for upcoming audit
jaybuidl Aug 12, 2025
738ef2c
docs: metrics for upcoming audit
jaybuidl Aug 12, 2025
82f8b1c
feat: replace requires with custom errors
unknownunknown1 Aug 13, 2025
a0cb09d
feat: replace requires with custom errors for the gateways
jaybuidl Aug 13, 2025
5353ccf
chore: changelog
jaybuidl Aug 13, 2025
831b062
Merge branch 'dev' into feat/rng-fallback2
jaybuidl Aug 13, 2025
3d211cc
refactor: removed CappedMath, moved SortitionSumTreeFactory to `klero…
jaybuidl Aug 13, 2025
95f2803
refactor: consolidated ALPHA_DIVISOR and ONE_BASIS_POINTS
jaybuidl Aug 13, 2025
277457c
feat(RNG): foundry test
unknownunknown1 Aug 14, 2025
d1910ca
fix(web): timeline-bug-fix
tractorss Aug 14, 2025
8d0edf4
chore: rabbit-review
tractorss Aug 14, 2025
c1bad1d
docs: comment
jaybuidl Aug 14, 2025
be33847
fix: typo in local variable
jaybuidl Aug 14, 2025
cabc743
chore: label text improvements
kemuru Aug 14, 2025
b19b82d
chore: add urgency and more clarity that it's right now
kemuru Aug 14, 2025
1dbfedf
feat: multi-dimensional degree of coherence for reward/penalties/pnk/eth
jaybuidl Aug 14, 2025
37bd43f
fix: no passing to voting period if commits are all cast
jaybuidl Aug 13, 2025
0a10ad2
chore: changelog
jaybuidl Aug 13, 2025
257870c
test: fix by warping to pass the period
jaybuidl Aug 15, 2025
4a451a5
chore: tweak didnotvote text
kemuru Aug 16, 2025
5ca5c3b
Merge pull request #2088 from kleros/chore/label-text-improvements
jaybuidl Aug 18, 2025
bd4e169
Merge pull request #2087 from kleros/fix/timeline-bug-fix
jaybuidl Aug 20, 2025
31efb24
feat(RNG): custom errors
unknownunknown1 Aug 20, 2025
96e48f8
Merge pull request #2090 from kleros/feat/multi-dimensional-coherence
jaybuidl Aug 20, 2025
0f31e0e
chore: changelog
jaybuidl Aug 20, 2025
d63d000
Merge branch 'dev' into feat/rng-fallback2
jaybuidl Aug 20, 2025
78f180a
chore: changelog
jaybuidl Aug 20, 2025
413a85a
Merge pull request #2054 from kleros/feat/rng-fallback2
jaybuidl Aug 20, 2025
9895c7c
refactor: using the template syntax for hardhat-deploy-ethers getCont…
jaybuidl Aug 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,26 @@ All notable changes to this package will be documented in this file.

The format is based on [Common Changelog](https://common-changelog.org/).

## [0.11.0] - 2025-08-01
## [0.13.0] - 2025-08-07 (Not published yet)

### Changed

- Set the Hardhat Solidity version to v0.8.30 and enable the IR pipeline ([#2069](https://github.com/kleros/kleros-v2/issues/2069))
- Set the Foundry Solidity version to v0.8.30 and enable the IR pipeline ([#2073](https://github.com/kleros/kleros-v2/issues/2073))
- Bump `hardhat` to v2.26.2 ([#2069](https://github.com/kleros/kleros-v2/issues/2069))
- Bump `@kleros/vea-contracts` to v0.7.0 ([#2073](https://github.com/kleros/kleros-v2/issues/2073))

## [0.12.0] - 2025-08-05

### Changed

- **Breaking:** Make `viem` a peer dependency, it should be provided by the consuming package ([`4594536`](https://github.com/kleros/kleros-v2/commit/4594536c))

### Added

- Add helper function `getDisputeKitsViem` to retrieve a deployment's available dispute kit infos including their capabilities (`isShutter`, `isGated`) ([`5a81f9e`](https://github.com/kleros/kleros-v2/commit/5a81f9ec))

## [0.11.0] - 2025-08-02

### Changed

Expand Down Expand Up @@ -107,6 +126,8 @@ The format is based on [Common Changelog](https://common-changelog.org/).

## [0.8.1] - 2025-04-10

[0.13.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
[0.12.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
Comment on lines +142 to +143
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Avoid adding a release link for an unpublished tag.

If 0.13.0 isn’t published, this link will 404. Add it only when the release is live.

-[0.13.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
+<!-- [0.13.0]: (add after publishing) -->

Optionally confirm release existence before merging:


🏁 Script executed:

#!/bin/bash
# Prints 200 if the tag exists, otherwise likely 404
curl -s -o /dev/null -w "%{http_code}\n" \
"https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]"

Length of output: 132


Remove unpublished release link for v0.13.0 in CHANGELOG.md

The 0.13.0 release tag currently returns 404, so we should not include its link until the release is live.

• File: contracts/CHANGELOG.md
Lines: 129–130

Recommended change:

-[0.13.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
+<!-- [0.13.0]: (add after publishing) -->
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[0.13.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
[0.12.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
<!-- [0.13.0]: (add after publishing) -->
[0.12.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
🤖 Prompt for AI Agents
In contracts/CHANGELOG.md at lines 129 to 130, the release link for version
0.13.0 leads to a 404 error because the release is not yet published. Remove or
comment out the line containing the 0.13.0 release link to prevent broken links
in the changelog until the release is officially live.

[0.11.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
[0.10.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
[0.9.4]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
Expand Down
85 changes: 85 additions & 0 deletions contracts/deployments/disputeKitsViem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { getContracts } from "./contractsViem";
import { Abi, AbiEvent, getAbiItem, PublicClient } from "viem";
import { DeploymentName } from "./utils";

export type DisputeKitContracts = ReturnType<typeof getContracts>;
export type DisputeKit =
| NonNullable<DisputeKitContracts["disputeKitClassic"]>
| NonNullable<DisputeKitContracts["disputeKitShutter"]>
| NonNullable<DisputeKitContracts["disputeKitGated"]>
| NonNullable<DisputeKitContracts["disputeKitGatedShutter"]>
| null;
export type DisputeKitInfos = {
address: `0x${string}`;
contract: DisputeKit;
isGated: boolean;
isShutter: boolean;
};
export type DisputeKitByIds = Record<string, DisputeKitInfos>;

const fetchDisputeKits = async (client: PublicClient, klerosCoreAddress: `0x${string}`, klerosCoreAbi: Abi) => {
const DisputeKitCreated = getAbiItem({
abi: klerosCoreAbi,
name: "DisputeKitCreated",
}) as AbiEvent;
Comment on lines +21 to +24
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Unsafe type assertion - add runtime validation.

The type assertion as AbiEvent on line 24 could fail if the ABI doesn't contain the expected event structure.

-  const DisputeKitCreated = getAbiItem({
-    abi: klerosCoreAbi,
-    name: "DisputeKitCreated",
-  }) as AbiEvent;
+  const DisputeKitCreated = getAbiItem({
+    abi: klerosCoreAbi,
+    name: "DisputeKitCreated",
+  });
+  
+  if (!DisputeKitCreated || DisputeKitCreated.type !== 'event') {
+    throw new Error('DisputeKitCreated event not found in ABI');
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const DisputeKitCreated = getAbiItem({
abi: klerosCoreAbi,
name: "DisputeKitCreated",
}) as AbiEvent;
const DisputeKitCreated = getAbiItem({
abi: klerosCoreAbi,
name: "DisputeKitCreated",
});
if (!DisputeKitCreated || DisputeKitCreated.type !== 'event') {
throw new Error('DisputeKitCreated event not found in ABI');
}
🤖 Prompt for AI Agents
In contracts/deployments/disputeKitsViem.ts around lines 21 to 24, the code uses
a direct type assertion 'as AbiEvent' which can be unsafe if the ABI item does
not match the expected event structure. To fix this, add runtime validation to
check that the returned object from getAbiItem has the required properties of an
AbiEvent before asserting its type. If the validation fails, handle the error
appropriately instead of blindly asserting the type.

const logs = await client.getLogs({
address: klerosCoreAddress,
event: DisputeKitCreated,
fromBlock: 0n,
toBlock: "latest",
});
Comment on lines +20 to +30
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider performance implications of unbounded block range.

Fetching events from block 0 to latest will become increasingly expensive as the chain grows. Consider adding block range parameters or caching mechanisms for production use.

-const fetchDisputeKits = async (client: PublicClient, klerosCoreAddress: `0x${string}`, klerosCoreAbi: Abi) => {
+const fetchDisputeKits = async (
+  client: PublicClient, 
+  klerosCoreAddress: `0x${string}`, 
+  klerosCoreAbi: Abi,
+  fromBlock: bigint = 0n
+) => {
   const DisputeKitCreated = getAbiItem({
     abi: klerosCoreAbi,
     name: "DisputeKitCreated",
   }) as AbiEvent;
   const logs = await client.getLogs({
     address: klerosCoreAddress,
     event: DisputeKitCreated,
-    fromBlock: 0n,
+    fromBlock,
     toBlock: "latest",
   });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const fetchDisputeKits = async (client: PublicClient, klerosCoreAddress: `0x${string}`, klerosCoreAbi: Abi) => {
const DisputeKitCreated = getAbiItem({
abi: klerosCoreAbi,
name: "DisputeKitCreated",
}) as AbiEvent;
const logs = await client.getLogs({
address: klerosCoreAddress,
event: DisputeKitCreated,
fromBlock: 0n,
toBlock: "latest",
});
const fetchDisputeKits = async (
client: PublicClient,
klerosCoreAddress: `0x${string}`,
klerosCoreAbi: Abi,
fromBlock: bigint = 0n
) => {
const DisputeKitCreated = getAbiItem({
abi: klerosCoreAbi,
name: "DisputeKitCreated",
}) as AbiEvent;
const logs = await client.getLogs({
address: klerosCoreAddress,
event: DisputeKitCreated,
fromBlock,
toBlock: "latest",
});
// ...rest of the implementation
};
🤖 Prompt for AI Agents
In contracts/deployments/disputeKitsViem.ts around lines 20 to 30, the event log
fetching uses an unbounded block range from 0 to latest, which can cause
performance issues as the blockchain grows. Modify the function to accept
optional fromBlock and toBlock parameters to limit the block range for fetching
logs, or implement caching to avoid repeated full-range queries. Update the
client.getLogs call to use these parameters instead of fixed values.

return Object.fromEntries(
logs
.filter((log) => {
const args = log.args as Record<string, unknown>;
return "_disputeKitID" in args && "_disputeKitAddress" in args;
})
.map((log) => {
const { _disputeKitID, _disputeKitAddress } = log.args as {
_disputeKitID: bigint;
_disputeKitAddress: string;
};
return {
disputeKitID: _disputeKitID,
disputeKitAddress: _disputeKitAddress,
};
})
.map(({ disputeKitID, disputeKitAddress }) => [disputeKitID!.toString(), disputeKitAddress as `0x${string}`])
);
};
Comment on lines +31 to +49
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add error handling for blockchain interactions.

The function lacks error handling for potential RPC failures or malformed event data.

Wrap the blockchain interaction in try-catch:

+  try {
     const logs = await client.getLogs({
       address: klerosCoreAddress,
       event: DisputeKitCreated,
       fromBlock: 0n,
       toBlock: "latest",
     });
+  } catch (error) {
+    throw new Error(`Failed to fetch DisputeKitCreated events: ${error}`);
+  }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In contracts/deployments/disputeKitsViem.ts around lines 31 to 49, the code
processes blockchain event logs without any error handling, which risks
unhandled exceptions from RPC failures or malformed data. Wrap the entire log
processing logic inside a try-catch block to catch and handle any errors
gracefully. In the catch block, log or rethrow the error with a clear message to
aid debugging and prevent the application from crashing unexpectedly.


export const getDisputeKits = async (client: PublicClient, deployment: DeploymentName): Promise<DisputeKitByIds> => {
const { klerosCore, disputeKitClassic, disputeKitShutter, disputeKitGated, disputeKitGatedShutter } = getContracts({
publicClient: client,
deployment: deployment,
});

const isDefined = <T>(kit: T): kit is NonNullable<T> => kit != null;
const disputeKitContracts = [disputeKitClassic, disputeKitShutter, disputeKitGated, disputeKitGatedShutter].filter(
isDefined
);
const shutterEnabled = [disputeKitShutter, disputeKitGatedShutter].filter(isDefined);
const gatedEnabled = [disputeKitGated, disputeKitGatedShutter].filter(isDefined);

const disputeKitMap = await fetchDisputeKits(client, klerosCore.address, klerosCore.abi);

return Object.fromEntries(
Object.entries(disputeKitMap).map(([disputeKitID, address]) => {
const contract =
disputeKitContracts.find((contract) => contract.address.toLowerCase() === address.toLowerCase()) ?? null;
return [
disputeKitID,
{
address,
contract: contract satisfies DisputeKit,
isGated: contract
? gatedEnabled.some((gated) => contract.address.toLowerCase() === gated.address.toLowerCase())
: false,
isShutter: contract
? shutterEnabled.some((shutter) => contract.address.toLowerCase() === shutter.address.toLowerCase())
: false,
},
];
})
);
};
3 changes: 3 additions & 0 deletions contracts/deployments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ export * from "./utils";
// Contracts getters
export { getContracts as getContractsEthers } from "./contractsEthers";
export { getContracts as getContractsViem } from "./contractsViem";

// Dispute kits getters
export { getDisputeKits as getDisputeKitsViem, type DisputeKitByIds, type DisputeKitInfos } from "./disputeKitsViem";
13 changes: 11 additions & 2 deletions contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@

[profile.default]
solc = "0.8.30"
via_ir = true
optimizer = true
optimizer_runs = 500
optimizer_details = { yulDetails = { stackAllocation = true } }
additional_compiler_profiles = [
{ name = "tests", via_ir = false }
]
compilation_restrictions = [
{ paths = "test/foundry/KlerosCore.t.sol", via_ir = false },
]
src = 'src'
out = 'out'
libs = ['../node_modules', 'lib']

[rpc_endpoints]
arbitrumSepolia = "https://sepolia-rollup.arbitrum.io/rpc"
arbitrumGoerli = "https://goerli-rollup.arbitrum.io/rpc"
arbitrum = "https://arb1.arbitrum.io/rpc"
sepolia = "https://sepolia.infura.io/v3/${INFURA_API_KEY}"
goerli = "https://goerli.infura.io/v3/${INFURA_API_KEY}"
mainnet = "https://mainnet.infura.io/v3/${INFURA_API_KEY}"
chiado = "https://rpc.chiado.gnosis.gateway.fm"
gnosischain = "https://rpc.gnosis.gateway.fm"
Expand Down
22 changes: 3 additions & 19 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,12 @@ const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.28",
version: "0.8.30",
settings: {
// viaIR: true,
viaIR: true,
optimizer: {
enabled: true,
runs: 100,
},
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
},
},
{
// For Vea
version: "0.8.24",
settings: {
// viaIR: true,
optimizer: {
enabled: true,
runs: 100,
runs: 10000,
},
outputSelection: {
"*": {
Expand Down
17 changes: 12 additions & 5 deletions contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kleros/kleros-v2-contracts",
"version": "0.11.0",
"version": "0.12.0",
"description": "Smart contracts for Kleros version 2",
"main": "./cjs/deployments/index.js",
"module": "./esm/deployments/index.js",
Expand Down Expand Up @@ -121,7 +121,7 @@
"@types/mocha": "^10.0.10",
"@types/node": "^20.17.6",
"@types/sinon": "^17.0.4",
"@wagmi/cli": "^2.2.0",
"@wagmi/cli": "^2.3.2",
"abitype": "^0.10.3",
"chai": "^4.5.0",
"dotenv": "^16.6.1",
Expand All @@ -131,7 +131,7 @@
"gluegun": "^5.2.0",
"graphql": "^16.9.0",
"graphql-request": "^7.1.2",
"hardhat": "2.25.0",
"hardhat": "2.26.2",
"hardhat-contract-sizer": "^2.10.0",
"hardhat-deploy": "^1.0.4",
"hardhat-deploy-ethers": "^0.4.2",
Expand All @@ -154,10 +154,17 @@
},
"dependencies": {
"@chainlink/contracts": "^1.4.0",
"@kleros/vea-contracts": "^0.6.0",
"@kleros/vea-contracts": "^0.7.0",
"@openzeppelin/contracts": "^5.4.0",
"@shutter-network/shutter-sdk": "0.0.2",
"isomorphic-fetch": "^3.0.0",
"isomorphic-fetch": "^3.0.0"
},
"peerDependencies": {
"viem": "^2.24.1"
},
"peerDependenciesMeta": {
"viem": {
"optional": false
}
}
Comment on lines +162 to 169
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Peer dependency viem ^2.24.1 conflicts with root resolution (^2.23.2).

This will produce peer warnings/errors and potentially divergent behavior across workspaces.

Either relax the peer to match the resolution, or better, update the root resolution to satisfy the peer (recommended):

Preferred (root package.json):

-    "viem@npm:2.x": "npm:^2.23.2"
+    "viem@npm:2.x": "npm:^2.24.1"

If you must stay on 2.23.x, change this package’s peer to:

-    "viem": "^2.24.1"
+    "viem": "^2.23.0"

…but this may block newer features you rely on.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"peerDependencies": {
"viem": "^2.24.1"
},
"peerDependenciesMeta": {
"viem": {
"optional": false
}
}
"peerDependencies": {
- "viem": "^2.24.1"
+ "viem": "^2.23.0"
},
"peerDependenciesMeta": {
"viem": {
"optional": false
}
}
🤖 Prompt for AI Agents
In contracts/package.json around lines 162 to 169, the peer dependency version
for "viem" (^2.24.1) conflicts with the root workspace resolution (^2.23.2),
causing warnings and potential inconsistent behavior. To fix this, update the
root package.json to use "viem" version ^2.24.1 to match the peer dependency, or
alternatively, relax the peer dependency in this package.json to ^2.23.2 if you
must stay on that version, understanding this may limit access to newer
features.

}
33 changes: 33 additions & 0 deletions contracts/scripts/getDisputeKits.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { getDisputeKits } from "../deployments/disputeKitsViem";
import { createPublicClient, http } from "viem";
import { arbitrumSepolia } from "viem/chains";

const rpc = process.env.ARBITRUM_SEPOLIA_RPC;
if (!rpc) {
throw new Error("ARBITRUM_SEPOLIA_RPC is not set");
}

const client = createPublicClient({
chain: arbitrumSepolia,
transport: http(rpc),
});

async function main() {
try {
console.log("Fetching DisputeKitCreated events...");
const disputeKitResult = await getDisputeKits(client, "devnet");
console.log(disputeKitResult);
} catch (error) {
console.error("Error fetching events:", error);
throw error;
}
}

if (require.main === module) {
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"elliptic@npm:6.5.4": "npm:6.6.1",
"word-wrap@npm:~1.2.3": "npm:1.2.5",
"@codemirror/state": "npm:6.5.2",
"undici@npm:7.3.0": "npm:7.5.0"
"undici@npm:7.3.0": "npm:7.5.0",
"viem@npm:2.x": "npm:^2.23.2"
Comment on lines +80 to +81
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Align viem resolution with contracts’ peer dependency to avoid peer conflicts.

Root resolution pins viem 2.x to ^2.23.2, while contracts require viem ^2.24.1 as a peer. This will trigger peer resolution warnings/errors in Yarn 4 and could break consumers.

Update the resolution to satisfy the peer:

   "resolutions": {
     ...
-    "viem@npm:2.x": "npm:^2.23.2"
+    "viem@npm:2.x": "npm:^2.24.1"
   },

To check for other mismatches:


🏁 Script executed:

#!/bin/bash
rg -n --json '"viem"\s*:\s*"' | jq -r '.data.path.text + ":" + .data.line_number|tostring + " " + .data.lines.text'

Length of output: 1417


🏁 Script executed:

#!/bin/bash
# Search for all references to “viem” in any JSON file to spot mismatched pins
rg -n '"viem"' -g '*.json'

Length of output: 440


Update viem resolution to match peerDependency (^2.24.1)

All of your sub-packages (contracts, web, kleros-sdk, web-devtools, kleros-app) declare viem at ^2.24.1, but the root resolutions entry still pins viem@npm:2.x to ^2.23.2. This mismatch will trigger peer warnings/errors in Yarn 4 and may break consumers.

• File: package.json (root)
• Change the resolutions.viem@npm:2.x entry

  "resolutions": {
    …
-   "viem@npm:2.x": "npm:^2.23.2"
+   "viem@npm:2.x": "npm:^2.24.1"
  },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"undici@npm:7.3.0": "npm:7.5.0",
"viem@npm:2.x": "npm:^2.23.2"
"resolutions": {
"undici@npm:7.3.0": "npm:7.5.0",
"viem@npm:2.x": "npm:^2.24.1"
},
🤖 Prompt for AI Agents
In package.json around lines 80 to 81, the resolutions entry for viem is set to
^2.23.2, which conflicts with the peerDependency version ^2.24.1 declared in
sub-packages. Update the resolutions.viem@npm:2.x entry to ^2.24.1 to align with
the peerDependency version and prevent peer warnings or errors in Yarn 4.

},
"scripts": {
"check-prerequisites": "scripts/check-prerequisites.sh",
Expand Down
5 changes: 5 additions & 0 deletions web/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ YARN_ENABLE_GLOBAL_CACHE = "true"

[functions]
directory = "web/netlify/functions/"

[[headers]]
for = "/*"
[headers.values]
X-Robots-Tag = "llms-txt"
Comment on lines +13 to +16
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Header value likely incorrect; consider advertising llms.txt via Link header instead of X-Robots-Tag.

X-Robots-Tag expects crawler directives (e.g., noindex, noai). Using "llms-txt" here is non-standard and probably ignored. To advertise a policy file, prefer a Link header (and ensure the file is served at the expected path).

Apply one of these:

Option A — advertise a policy file:

 [[headers]]
   for = "/*"
   [headers.values]
-    X-Robots-Tag = "llms-txt"
+    Link = "</llms.txt>; rel=\"ai-policy\""

Option B — if you meant to control AI crawlers:

 [[headers]]
   for = "/*"
   [headers.values]
-    X-Robots-Tag = "llms-txt"
+    X-Robots-Tag = "noai, noimageai"

Also verify the file is published at the root (e.g., web/public/llms.txt → https://site/llms.txt), not under src.

Run to locate the file and confirm its publish path:


🏁 Script executed:

#!/bin/bash
fd -HI --glob "llms.txt"

Length of output: 48


Misuse of X-Robots-Tag; advertise AI policy via Link header

  • The current X-Robots-Tag = "llms-txt" is non-standard and will be ignored by crawlers.
  • To expose llms.txt as your AI policy, use a Link header with rel="ai-policy".
  • If you actually intend to block AI crawlers or image-AI, use valid X-Robots-Tag directives (e.g., noai, noimageai).
  • We located your policy file at web/src/public/llms.txt. Make sure it’s published at the site root (https:///llms.txt)—either move it to web/public/llms.txt or adjust your Netlify publish directory.

Option A — advertise your policy file via Link header:

 [[headers]]
   for = "/*"
   [headers.values]
-    X-Robots-Tag = "llms-txt"
+    Link = "</llms.txt>; rel=\"ai-policy\""

Option B — apply valid X-Robots-Tag directives:

 [[headers]]
   for = "/*"
   [headers.values]
-    X-Robots-Tag = "llms-txt"
+    X-Robots-Tag = "noai, noimageai"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[[headers]]
for = "/*"
[headers.values]
X-Robots-Tag = "llms-txt"
[[headers]]
for = "/*"
[headers.values]
Link = "</llms.txt>; rel=\"ai-policy\""
🤖 Prompt for AI Agents
In web/netlify.toml around lines 13 to 16, the X-Robots-Tag header is set to a
non-standard value "llms-txt" which will be ignored by crawlers. Replace this
header with a Link header that advertises your AI policy file using
rel="ai-policy" pointing to /llms.txt, or alternatively, use valid X-Robots-Tag
directives like "noai, noimageai" if you want to block AI crawlers. Also ensure
the llms.txt file is published at the site root by moving it to the web/public
directory or adjusting the Netlify publish directory accordingly.

9 changes: 9 additions & 0 deletions web/src/public/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# v2.kleros.builders llms.txt

> Facilitates decentralized arbitration by allowing users to create, manage, and resolve dispute cases through crowdsourced juror consensus, rewarding jurors with cryptocurrency for coherent votes on disputes on the blockchain-based Kleros platform.

- [Kleros Dispute Dashboard](https://v2.kleros.builders): Dashboard for managing and viewing decentralized dispute cases, jurors, and court statistics on Kleros platform.
- [Kleros Dispute Cases](https://v2.kleros.builders/#/cases/display/1/desc/all): Provide a platform for viewing and managing decentralized dispute resolution cases.
- [Kleros Decentralized Courts](https://v2.kleros.builders/#/courts): Facilitate decentralized dispute resolution by allowing users to stake tokens, participate as jurors, and view court cases.
- [Kleros Jurors Leaderboard](https://v2.kleros.builders/#/jurors/1/desc/all): Display ranking and statistics of jurors based on coherent voting and rewards in the Kleros decentralized arbitration system.
- [Get PNK Token](https://v2.kleros.builders/#/get-pnk): Facilitates cross-chain swaps of PNK tokens typically between the Ethereum and Arbitrum networks.
Loading
Loading