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 23 commits into
base: master
Choose a base branch
from
Draft

Release #2076

wants to merge 23 commits into from

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Aug 8, 2025

PR-Codex overview

This PR updates the Solidity version constraints across various contracts, adds new functionality for dispute kits, and updates dependencies. It also improves the voting context handling in the frontend and modifies the changelog for versioning clarity.

Detailed summary

  • Updated Solidity version from ^0.8.24 to >=0.8.0 <0.9.0 in multiple contracts.
  • Added helper function getDisputeKitsViem to retrieve dispute kit information.
  • Enhanced voting context to handle multiple dispute kits.
  • Updated hardhat to version 2.26.2.
  • Updated @kleros/vea-contracts to version 0.7.0.
  • Modified changelog for version 0.13.0 and 0.12.0 with detailed changes.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Discover and work with multiple dispute kits; new script to fetch dispute-kit creation events.
    • Public llms.txt added with platform info and resource links.
  • Improvements

    • Voting flow/UI supports additional dispute kit types and more flexible rendering.
    • Commit flow validates required shutter API config to prevent faulty submissions.
    • Changelog updated with 0.12.0 and 0.13.0 entries.
  • Dependency & Tooling

    • Solidity toolchain, Hardhat/Foundry and packages bumped; viem declared as a peer dependency.
    • Build/coverage configs adjusted for IR and compiler settings.
  • Configuration

    • Netlify configured to add X-Robots-Tag header for all routes.

Copy link

netlify bot commented Aug 8, 2025

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit 41e8998
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet/deploys/689a94250a85e10008fa3b0d
😎 Deploy Preview https://deploy-preview-2076--kleros-v2-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

Walkthrough

Adds a Viem-based helper and CLI script to discover dispute kit contracts; updates contracts toolchain and dependencies (solc 0.8.30, viaIR, Hardhat bump, viem as peerDependency); relaxes many Solidity pragmas; adjusts coverage/IR configs; extends frontend voting logic for multiple dispute kits; adds web llms.txt and Netlify header; updates changelog.

Changes

Cohort / File(s) Change Summary
Dispute Kits helper & exports
contracts/deployments/disputeKitsViem.ts, contracts/deployments/index.ts, contracts/scripts/getDisputeKits.ts
New Viem-based module and CLI script to query DisputeKitCreated events, map IDs→addresses, return typed dispute-kit info; exports added.
Contracts package metadata & root resolutions
contracts/package.json, package.json
Bumped contracts package version; upgraded hardhat and @kleros/vea-contracts; added viem as a peerDependency and pinned a root viem resolution.
Solidity toolchain & compiler settings
contracts/hardhat.config.ts, contracts/foundry.toml
Set solc to 0.8.30, enabled viaIR (env-driven), increased optimizer settings, added Foundry test profile and per-file via_ir exceptions; removed older compiler block.
Coverage / IR flags
contracts/.solcover.js, contracts/scripts/coverage.sh
Added irMinimum: true to solcover config and export VIA_IR=false in coverage script to disable IR for coverage runs.
Solidity pragma relaxations
contracts/src/.../interfaces/*.sol, contracts/src/rng/*, contracts/src/gateway/*
Relaxed many pragmas from ^0.8.24 to >=0.8.0 <0.9.0 to broaden 0.8.x compatibility; no API changes.
Web docs & hosting header
web/src/public/llms.txt, web/netlify.toml
Added llms.txt public doc and Netlify header X-Robots-Tag: llms-txt applied to all routes.
Web UI voting & shutter flow
web/src/hooks/useVotingContext.tsx, web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx, web/src/pages/Cases/CaseDetails/Voting/Shutter/Commit.tsx
Voting context extended to support multiple dispute kits; Shutter component refactored to render commit/reveal independently; commit handler now guards for REACT_APP_SHUTTER_API.
Changelog
contracts/CHANGELOG.md
Added entries for v0.12.0 and v0.13.0, adjusted entry ordering and release anchors.

Sequence Diagram(s)

sequenceDiagram
    participant Script as getDisputeKits.ts
    participant ViemClient as Viem PublicClient
    participant Helper as disputeKitsViem.getDisputeKits
    participant Chain as KlerosCore (on-chain)

    Script->>ViemClient: init with RPC
    Script->>Helper: getDisputeKits(client, deployment)
    Helper->>Chain: query DisputeKitCreated logs
    Helper->>Helper: decode logs, map IDs -> addresses
    Helper->>Helper: correlate addresses with local contract instances
    Helper-->>Script: return DisputeKitByIds (address, contract?, flags)
    Script->>Script: log/display results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Package: Contracts, Type: Enhancement :sparkles:, Type: Toolchain ⚒️

Suggested reviewers

  • alcercu
  • tractorss
  • unknownunknown1

Poem

"I dug a tunnel through the build tonight,
fetched kits with Viem by lantern light.
Solidity hopped a version high,
docs and headers waved goodbye.
A rabbit cheers — tiny hops, big flight 🐇"


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d10251b and 41e8998.

📒 Files selected for processing (1)
  • contracts/CHANGELOG.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • contracts/CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: contracts-testing
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: contracts-testing
  • GitHub Check: SonarCloud
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Aug 8, 2025

Deploy Preview for kleros-v2-university failed. Why did it fail? →

Name Link
🔨 Latest commit 41e8998
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-university/deploys/689a94255adb4f0008f0c6f4

Copy link

netlify bot commented Aug 8, 2025

Deploy Preview for kleros-v2-neo-devtools ready!

Name Link
🔨 Latest commit 41e8998
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo-devtools/deploys/689a94258f816c00096c6cd9
😎 Deploy Preview https://deploy-preview-2076--kleros-v2-neo-devtools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Aug 8, 2025

Deploy Preview for kleros-v2-testnet-devtools ready!

Name Link
🔨 Latest commit 41e8998
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet-devtools/deploys/689a94258cadd30009e4d251
😎 Deploy Preview https://deploy-preview-2076--kleros-v2-testnet-devtools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (4)
contracts/hardhat.config.ts (1)

29-35: Verify compile time and bytecode size with viaIR and 10000 runs

The size‐contracts check failed (missing node_modules), and the compile step reported only 1.26 s (likely no real work). Please run the following under contracts/ and share the results to ensure there are no regressions:

  • Install dependencies:
    yarn install
  • Measure bytecode sizes without recompiling:
    yarn hardhat size-contracts --no-compile
  • Clean compile and time it:
    rm -rf cache artifacts
    TIMEFORMAT='compile took %R sec' time yarn hardhat compile

If you observe significant increases in compile times or bytecode sizes (EIP-170 limit concerns), consider lowering optimizer runs (e.g., 200–2000).

contracts/package.json (1)

160-161: Question: is isomorphic-fetch needed on Node 20?

Node 20 has stable global fetch. Adding isomorphic-fetch may be redundant and can introduce polyfill conflicts in some runtimes.

If not strictly needed for browser bundles, consider removing:

   "dependencies": {
     "@chainlink/contracts": "^1.4.0",
     "@kleros/vea-contracts": "^0.7.0",
     "@openzeppelin/contracts": "^5.4.0",
     "@shutter-network/shutter-sdk": "0.0.2",
-    "isomorphic-fetch": "^3.0.0"
   },

If needed in specific scripts, prefer local import over global polyfill.

contracts/CHANGELOG.md (1)

7-15: Mark unreleased changes as “Unreleased” to avoid confusion with published versions.

Labeling 0.13.0 as “Not published yet” while giving it a version can confuse consumers and tools.

Consider:

-## [0.13.0] - 2025-08-07 (Not published yet)
+## [Unreleased]

Move these entries under Unreleased until the tag is published and the package version is bumped.

web/src/public/llms.txt (1)

6-8: Improve sentence structure to avoid repetitive beginnings.

The descriptions are informative, but three consecutive sentences start with "Kleros" which affects readability.

Consider rewording for better flow:

- [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.
+ [Kleros Dispute Cases](https://v2.kleros.builders/#/cases/display/1/desc/all): Comprehensive platform for viewing and managing decentralized dispute resolution cases.
+ [Decentralized Courts](https://v2.kleros.builders/#/courts): Enable decentralized dispute resolution by allowing users to stake tokens, participate as jurors, and view court cases.
+ [Jurors Leaderboard](https://v2.kleros.builders/#/jurors/1/desc/all): Rankings and statistics of jurors based on coherent voting and rewards in the decentralized arbitration system.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f979978 and 9140890.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • contracts/CHANGELOG.md (2 hunks)
  • contracts/deployments/disputeKitsViem.ts (1 hunks)
  • contracts/deployments/index.ts (1 hunks)
  • contracts/foundry.toml (1 hunks)
  • contracts/hardhat.config.ts (1 hunks)
  • contracts/package.json (4 hunks)
  • contracts/scripts/getDisputeKits.ts (1 hunks)
  • package.json (1 hunks)
  • web/netlify.toml (1 hunks)
  • web/src/public/llms.txt (1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📚 Learning: 2025-05-23T17:47:39.947Z
Learnt from: kemuru
PR: kleros/kleros-v2#1994
File: web/vite.config.js:26-33
Timestamp: 2025-05-23T17:47:39.947Z
Learning: In Yarn workspace setups, dependencies defined in individual workspace package.json files (like web/package.json) are typically hoisted to the root node_modules directory. This means vite config paths should point to "../node_modules" from workspace directories to access hoisted dependencies, not to local workspace node_modules.

Applied to files:

  • package.json
📚 Learning: 2024-11-21T23:16:14.816Z
Learnt from: jaybuidl
PR: kleros/kleros-v2#1757
File: prettier-config/package.json:7-7
Timestamp: 2024-11-21T23:16:14.816Z
Learning: As of November 2024, ESLint v9.15.0 has been released and is acceptable to use in the project.

Applied to files:

  • contracts/hardhat.config.ts
📚 Learning: 2024-11-21T23:20:28.163Z
Learnt from: jaybuidl
PR: kleros/kleros-v2#1757
File: web-devtools/package.json:36-40
Timestamp: 2024-11-21T23:20:28.163Z
Learning: TypeScript-ESLint v8.15.0 is compatible with both ESLint v8 and v9.

Applied to files:

  • contracts/hardhat.config.ts
📚 Learning: 2024-10-14T13:58:25.708Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: web/src/hooks/queries/usePopulatedDisputeData.ts:58-61
Timestamp: 2024-10-14T13:58:25.708Z
Learning: In `web/src/hooks/queries/usePopulatedDisputeData.ts`, the query and subsequent logic only execute when `disputeData.dispute?.arbitrableChainId` and `disputeData.dispute?.externalDisputeId` are defined, so `initialContext` properties based on these values are safe to use without additional null checks.

Applied to files:

  • contracts/scripts/getDisputeKits.ts
  • contracts/deployments/disputeKitsViem.ts
📚 Learning: 2024-11-19T05:31:48.701Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1744
File: web/src/hooks/useGenesisBlock.ts:9-31
Timestamp: 2024-11-19T05:31:48.701Z
Learning: In `useGenesisBlock.ts`, within the `useEffect` hook, the conditions (`isKlerosUniversity`, `isKlerosNeo`, `isTestnetDeployment`) are mutually exclusive, so multiple imports won't execute simultaneously, and race conditions are not a concern.

Applied to files:

  • contracts/scripts/getDisputeKits.ts
📚 Learning: 2024-10-24T08:16:02.749Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: kleros-sdk/src/requests/gqlClient.ts:18-18
Timestamp: 2024-10-24T08:16:02.749Z
Learning: In this TypeScript project, when a file (such as `kleros-sdk/src/requests/gqlClient.ts`) exports only a single entity, it's acceptable to use default exports instead of named exports.

Applied to files:

  • contracts/scripts/getDisputeKits.ts
  • contracts/deployments/index.ts
  • contracts/deployments/disputeKitsViem.ts
📚 Learning: 2024-10-22T09:38:20.093Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: kleros-sdk/src/dataMappings/utils/actionTypes.ts:1-1
Timestamp: 2024-10-22T09:38:20.093Z
Learning: In the TypeScript file `kleros-sdk/src/dataMappings/utils/actionTypes.ts`, the `Abi` type is parsed later in the action functions, so importing `Abi` from `viem` in this file is unnecessary.

Applied to files:

  • contracts/deployments/index.ts
  • contracts/deployments/disputeKitsViem.ts
📚 Learning: 2024-10-28T05:55:12.728Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1716
File: web-devtools/src/app/(main)/dispute-template/CustomContextInputs.tsx:29-42
Timestamp: 2024-10-28T05:55:12.728Z
Learning: In the `CustomContextInputs` component located at `web-devtools/src/app/(main)/dispute-template/CustomContextInputs.tsx`, the `DisputeRequestParams` array is used to exclude certain variables from the custom input since they are already provided in a preceding component. Therefore, converting it to a type is unnecessary.

Applied to files:

  • contracts/deployments/index.ts
  • contracts/deployments/disputeKitsViem.ts
📚 Learning: 2025-01-23T08:14:47.397Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1846
File: prettier-config/index.js:26-26
Timestamp: 2025-01-23T08:14:47.397Z
Learning: The prettier-plugin-solidity plugin is installed in the kleros-v2 repository, even though it's not visible in the sandbox environment's node_modules (which is expected as node_modules is not committed to the repository).

Applied to files:

  • contracts/package.json
📚 Learning: 2025-05-15T06:50:45.650Z
Learnt from: tractorss
PR: kleros/kleros-v2#1982
File: web/src/pages/Resolver/Landing/index.tsx:0-0
Timestamp: 2025-05-15T06:50:45.650Z
Learning: In the Kleros V2 codebase, it's acceptable to use ESLint disable comments for dependency arrays in useEffect hooks when including certain dependencies (like state that is being updated within the effect) would cause infinite loops.

Applied to files:

  • contracts/package.json
📚 Learning: 2025-05-23T17:47:39.947Z
Learnt from: kemuru
PR: kleros/kleros-v2#1994
File: web/vite.config.js:26-33
Timestamp: 2025-05-23T17:47:39.947Z
Learning: The viteStaticCopy plugin configuration in web/vite.config.js correctly copies Shutter SDK files from the installed node_modules location. The path resolve(__dirname, "../node_modules/shutter-network/shutter-sdk/dist/*") works when dependencies are properly installed, despite initial analysis suggesting otherwise due to sandbox environment limitations.

Applied to files:

  • contracts/package.json
📚 Learning: 2024-10-22T10:23:15.789Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: kleros-sdk/src/sdk.ts:1-3
Timestamp: 2024-10-22T10:23:15.789Z
Learning: In `kleros-sdk/src/sdk.ts`, the `PublicClient` type is used and should not be flagged as unused.

Applied to files:

  • contracts/deployments/disputeKitsViem.ts
🪛 LanguageTool
web/src/public/llms.txt

[style] ~7-~7: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...entralized dispute resolution cases. - [Kleros Decentralized Courts](https://v2.kleros...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~8-~8: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ate as jurors, and view court cases. - [Kleros Jurors Leaderboard](https://v2.kleros.b...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: contracts-testing
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
🔇 Additional comments (11)
contracts/package.json (3)

3-3: Version bump looks good.

0.12.0 aligns with the new peer requirement and helper additions.


157-157: OK to bump @kleros/vea-contracts to ^0.7.0.

Matches the Hardhat/Foundry upgrades and related changes.


124-124: Verify Hardhat Plugin Compatibility with v2.26.2
Ensure all Hardhat plugins in contracts/package.json (lines 135–142) are compatible with Hardhat v2.26.2:

  • hardhat-contract-sizer (l.135)
  • hardhat-deploy (l.136)
  • hardhat-deploy-ethers (l.137)
  • hardhat-deploy-tenderly (l.138)
  • hardhat-docgen (l.139)
  • hardhat-gas-reporter (l.140)
  • hardhat-tracer (l.141)
  • hardhat-watcher (l.142)

If your CI build has passed, you can safely ignore this check.

contracts/foundry.toml (2)

3-7: LGTM! Solidity 0.8.30 upgrade with IR pipeline is well-configured.

The compiler upgrade to 0.8.30 with IR compilation enabled aligns with the coordinated changes across build tools. The optimizer settings with 500 runs and Yul stack allocation are appropriate for production builds.


8-13: Good approach to handle IR compilation compatibility issues.

The test profile and compilation restrictions provide flexibility for files that may have issues with IR compilation. This is a pragmatic solution for the transition period.

contracts/deployments/index.ts (1)

21-22: LGTM! Clean integration of dispute kits functionality.

The export structure follows established patterns and provides a clear API for the new Viem-based dispute kits functionality. The type exports and function aliasing are consistent with the module's existing approach.

contracts/scripts/getDisputeKits.ts (3)

5-13: LGTM! Good environment variable validation and client setup.

The environment variable check and Viem client configuration are properly implemented with appropriate error handling.


26-33: LGTM! Clean script execution pattern.

The main function execution pattern with proper process exit handling follows Node.js best practices.


15-24: No action needed: “devnet” deployment exists for Arbitrum Sepolia
Verified that contracts/deployments/arbitrumSepoliaDevnet.ts defines the “devnet” deployment on Arbitrum Sepolia, matching the RPC endpoint used in getDisputeKits(client, "devnet").

contracts/deployments/disputeKitsViem.ts (2)

5-18: LGTM! Well-structured type definitions.

The type definitions properly model dispute kit contracts and their metadata. The union type for DisputeKit correctly handles the nullable case, and the exported types provide a clean API surface.


66-85: LGTM! Robust contract matching logic.

The address comparison with case normalization and the use of satisfies for type checking demonstrate good defensive programming practices. The logic correctly identifies gated and shutter variants.

Comment on lines +129 to +130
[0.13.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%2Fkleros-v2-contracts@0.13.0
[0.12.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%2Fkleros-v2-contracts@0.12.0
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%2Fkleros-v2-contracts@0.13.0
+<!-- [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%2Fkleros-v2-contracts@0.13.0"

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%2Fkleros-v2-contracts@0.13.0
+<!-- [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%2Fkleros-v2-contracts@0.13.0
[0.12.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%2Fkleros-v2-contracts@0.12.0
<!-- [0.13.0]: (add after publishing) -->
[0.12.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%2Fkleros-v2-contracts@0.12.0
🤖 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.

Comment on lines +20 to +30
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",
});
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.

Comment on lines +21 to +24
const DisputeKitCreated = getAbiItem({
abi: klerosCoreAbi,
name: "DisputeKitCreated",
}) as AbiEvent;
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.

Comment on lines +31 to +49
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}`])
);
};
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.

Comment on lines +162 to 169
"peerDependencies": {
"viem": "^2.24.1"
},
"peerDependenciesMeta": {
"viem": {
"optional": false
}
}
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.

Comment on lines +80 to +81
"undici@npm:7.3.0": "npm:7.5.0",
"viem@npm:2.x": "npm:^2.23.2"
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.

Comment on lines +13 to +16
[[headers]]
for = "/*"
[headers.values]
X-Robots-Tag = "llms-txt"
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.

Copy link

netlify bot commented Aug 8, 2025

Deploy Preview for kleros-v2-neo failed. Why did it fail? →

Name Link
🔨 Latest commit 9140890
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo/deploys/6895580d150f77000893db61

Copy link

netlify bot commented Aug 8, 2025

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 41e8998
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo/deploys/689a94254f34370008c51ad0
😎 Deploy Preview https://deploy-preview-2076--kleros-v2-neo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
web/src/hooks/useVotingContext.tsx (3)

45-47: Guard usage of disputeKitAddress in address-to-name resolution

If disputeKitAddress is temporarily undefined while disputeData loads, ensure useDisputeKitAddresses tolerates undefined. If not, gate the hook param.

Possible defensive tweak:

- const { disputeKitName } = useDisputeKitAddresses({ disputeKitAddress });
+ const { disputeKitName } = useDisputeKitAddresses({ disputeKitAddress: disputeKitAddress as `0x${string}` | undefined });

Or add an internal guard in the hook to early-return when the address is undefined.


51-83: Pattern is sound; keep hooks stable and gate via enabled

Calling all four hooks with enabled flags preserves hook order and avoids conditional-hook pitfalls. Refetch cadence is centralized via REFETCH_INTERVAL. LGTM.

If you want to remove repetition, you can extract the common query options:

+  const baseQuery = { refetchInterval: REFETCH_INTERVAL as const };
   const classicVoteResult = useReadDisputeKitClassicIsVoteActive({
-    query: {
-      enabled: isEnabled && disputeKitName === DisputeKits.Classic,
-      refetchInterval: REFETCH_INTERVAL,
-    },
+    query: { ...baseQuery, enabled: isEnabled && disputeKitName === DisputeKits.Classic },
     args: hookArgs,
   });

84-105: Memo switch is correct; consider exposing a loading flag for the active kit

The selector is correct and dependencies are complete. Optional: expose voteStatusLoading from the active hook to improve UX around the hasVoted read.

Example:

const activeVoteStatusLoading = useMemo(() => {
  switch (disputeKitName) {
    case DisputeKits.Classic: return classicVoteResult.isLoading;
    case DisputeKits.Shutter: return shutterVoteResult.isLoading;
    case DisputeKits.Gated: return gatedVoteResult.isLoading;
    case DisputeKits.GatedShutter: return gatedShutterVoteResult.isLoading;
    default: return false;
  }
}, [disputeKitName, classicVoteResult.isLoading, shutterVoteResult.isLoading, gatedVoteResult.isLoading, gatedShutterVoteResult.isLoading]);

// Optionally export it in the context value
web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx (1)

32-39: Behavioral change: commit and reveal can render together—confirm this is intentional

The fragment now allows both <ShutterCommit /> and <Reveal /> to render if both flags are true. If the domain guarantees commit and vote periods are mutually exclusive (as expected), this is fine and equivalent in practice. If not guaranteed, consider restoring exclusivity or adding a runtime assertion.

Option to restore exclusivity:

-  return (
-    <>
-      {shouldShowCommit && (
-        <ShutterCommit {...{ arbitrable, setIsOpen, voteIDs, refetch, dispute, currentPeriodIndex, isGated }} />
-      )}
-      {shouldShowReveal && <Reveal {...{ setIsOpen, voteIDs, isGated }} />}
-    </>
-  );
+  return shouldShowCommit ? (
+    <ShutterCommit {...{ arbitrable, setIsOpen, voteIDs, refetch, dispute, currentPeriodIndex, isGated }} />
+  ) : shouldShowReveal ? (
+    <Reveal {...{ setIsOpen, voteIDs, isGated }} />
+  ) : null;

Additionally, ensure voteIDs can’t be undefined while the component renders. Consider defaulting to an empty array (outside this hunk):

// Above: current line 27
const voteIDs = useMemo(() => drawData?.draws?.map((d) => d.voteIDNum) ?? [], [drawData]);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9140890 and 3080c8f.

📒 Files selected for processing (2)
  • web/src/hooks/useVotingContext.tsx (2 hunks)
  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (16)
📚 Learning: 2024-10-14T13:58:25.708Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: web/src/hooks/queries/usePopulatedDisputeData.ts:58-61
Timestamp: 2024-10-14T13:58:25.708Z
Learning: In `web/src/hooks/queries/usePopulatedDisputeData.ts`, the query and subsequent logic only execute when `disputeData.dispute?.arbitrableChainId` and `disputeData.dispute?.externalDisputeId` are defined, so `initialContext` properties based on these values are safe to use without additional null checks.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
📚 Learning: 2024-10-28T05:55:12.728Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1716
File: web-devtools/src/app/(main)/dispute-template/CustomContextInputs.tsx:29-42
Timestamp: 2024-10-28T05:55:12.728Z
Learning: In the `CustomContextInputs` component located at `web-devtools/src/app/(main)/dispute-template/CustomContextInputs.tsx`, the `DisputeRequestParams` array is used to exclude certain variables from the custom input since they are already provided in a preceding component. Therefore, converting it to a type is unnecessary.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
📚 Learning: 2025-05-15T06:50:40.859Z
Learnt from: tractorss
PR: kleros/kleros-v2#1982
File: web/src/pages/Resolver/Landing/index.tsx:62-62
Timestamp: 2025-05-15T06:50:40.859Z
Learning: In the Landing component, it's safe to pass `dispute?.dispute?.arbitrated.id as 0x${string}` to `usePopulatedDisputeData` without additional null checks because the hook internally handles undefined parameters through its `isEnabled` flag and won't execute the query unless all required data is available.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
📚 Learning: 2024-12-09T12:36:59.441Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1775
File: web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx:0-0
Timestamp: 2024-12-09T12:36:59.441Z
Learning: In the `StakeWithdrawButton` component, the transaction flow logic is tightly linked to component updates, so extracting it into a custom hook does not provide significant benefits.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
📚 Learning: 2024-10-09T10:22:41.474Z
Learnt from: jaybuidl
PR: kleros/kleros-v2#1582
File: web-devtools/src/app/(main)/ruler/SelectArbitrable.tsx:88-90
Timestamp: 2024-10-09T10:22:41.474Z
Learning: Next.js recommends using the `useEffect` hook to set `isClient` and using `suppressHydrationWarning` as a workaround for handling hydration inconsistencies, especially when dealing with data like `knownArbitrables` that may differ between server-side and client-side rendering. This approach is acceptable in TypeScript/React applications, such as in `web-devtools/src/app/(main)/ruler/SelectArbitrable.tsx`.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
📚 Learning: 2025-05-09T13:39:15.086Z
Learnt from: tractorss
PR: kleros/kleros-v2#1982
File: web/src/pages/Resolver/Parameters/NotablePersons/PersonFields.tsx:64-0
Timestamp: 2025-05-09T13:39:15.086Z
Learning: In PersonFields.tsx, the useEffect hook for address validation intentionally uses an empty dependency array to run only once on component mount. This is specifically designed for the dispute duplication flow when aliasesArray is already populated with addresses that need initial validation.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
📚 Learning: 2024-06-27T10:11:54.861Z
Learnt from: nikhilverma360
PR: kleros/kleros-v2#1632
File: web/src/components/DisputeView/DisputeInfo/DisputeInfoList.tsx:37-42
Timestamp: 2024-06-27T10:11:54.861Z
Learning: `useMemo` is used in `DisputeInfoList` to optimize the rendering of `FieldItems` based on changes in `fieldItems`, ensuring that the mapping and truncation operation are only performed when necessary.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
📚 Learning: 2024-12-16T17:17:32.359Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1794
File: web/src/hooks/useStarredCases.tsx:13-18
Timestamp: 2024-12-16T17:17:32.359Z
Learning: In `useStarredCases.tsx`, when handling the `starredCases` Map from local storage, direct mutation is acceptable to prevent the overhead of copying, provided it doesn't adversely affect React's render cycle.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
📚 Learning: 2024-11-19T05:31:48.701Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1744
File: web/src/hooks/useGenesisBlock.ts:9-31
Timestamp: 2024-11-19T05:31:48.701Z
Learning: In `useGenesisBlock.ts`, within the `useEffect` hook, the conditions (`isKlerosUniversity`, `isKlerosNeo`, `isTestnetDeployment`) are mutually exclusive, so multiple imports won't execute simultaneously, and race conditions are not a concern.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
📚 Learning: 2024-12-06T13:04:50.495Z
Learnt from: kemuru
PR: kleros/kleros-v2#1774
File: web/src/components/CasesDisplay/index.tsx:61-61
Timestamp: 2024-12-06T13:04:50.495Z
Learning: In `web/src/components/CasesDisplay/index.tsx`, the variables `numberDisputes` and `numberClosedDisputes` can sometimes be `NaN`, and should default to `0` using logical OR (`||`) to prevent display issues in the `StatsAndFilters` component.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
📚 Learning: 2024-11-07T10:48:16.774Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1739
File: web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx:22-26
Timestamp: 2024-11-07T10:48:16.774Z
Learning: In the `Coherency` component (`web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx`), `totalResolvedVotes` is always greater than or equal to `totalCoherentVotes`. When both are zero, `0/0` results in `NaN`, which is acceptable in this context.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
📚 Learning: 2024-11-19T05:29:56.238Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1744
File: web/src/hooks/queries/useHomePageBlockQuery.ts:71-71
Timestamp: 2024-11-19T05:29:56.238Z
Learning: In `web/src/hooks/queries/useHomePageBlockQuery.ts`, the non-null assertions on `blockNumber!` and `genesisBlock!` within `queryFn` are safe because `isEnabled` ensures that `queryFn` only runs when either `blockNumber` or `genesisBlock` is defined.

Applied to files:

  • web/src/hooks/useVotingContext.tsx
📚 Learning: 2024-10-29T10:13:04.524Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1729
File: web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx:69-69
Timestamp: 2024-10-29T10:13:04.524Z
Learning: In `web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx`, when the button is disabled, the associated logic won't be reached, and certain code paths may exist for TypeScript purposes.

Applied to files:

  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
📚 Learning: 2024-10-29T10:14:52.512Z
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1729
File: web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx:125-127
Timestamp: 2024-10-29T10:14:52.512Z
Learning: In `web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx`, when `isEmailUpdateable` is false, `user?.emailUpdateableAt` is always defined. Therefore, using the non-null assertion `!` with `user?.emailUpdateableAt!` is acceptable because TypeScript may not infer its definiteness.

Applied to files:

  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
📚 Learning: 2024-10-09T10:23:39.325Z
Learnt from: jaybuidl
PR: kleros/kleros-v2#1582
File: web-devtools/src/app/(main)/ruler/SelectArbitrable.tsx:98-103
Timestamp: 2024-10-09T10:23:39.325Z
Learning: In `SelectArbitrable.tsx` of the web-devtools project (React/TypeScript), direct DOM manipulation using `child.click()` is acceptable when considered reasonably safe.

Applied to files:

  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
📚 Learning: 2024-10-09T10:17:37.935Z
Learnt from: jaybuidl
PR: kleros/kleros-v2#1582
File: web-devtools/src/app/(main)/dispute-template/page.tsx:324-360
Timestamp: 2024-10-09T10:17:37.935Z
Learning: In this codebase, prefer using the `??` (nullish coalescing operator) over `||` when handling default values for optional properties in React components.

Applied to files:

  • web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: contracts-testing
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
🔇 Additional comments (2)
web/src/hooks/useVotingContext.tsx (2)

107-107: Good defaulting for hidden votes

Defaulting isHiddenVotes with ?? false avoids transient undefineds from GraphQL. Matches the codebase’s preference for nullish coalescing over ||.


48-50: Normalize all DisputeKit call arguments to bigint and include id in the enabled guard

Viem/Wagmi read hooks for IsVoteActive expect a tuple of uint256 values as bigint, but here id, roundId, and voteId may be string | number. Also, the current isEnabled guard skips checking id, so the hook could fire with [0n, …].

Proposed diff:

-  const hookArgs = [BigInt(id ?? 0), roundId, voteId] as const;
-  const isEnabled = !isUndefined(roundId) && !isUndefined(voteId);
+  // Helper to coerce string|number to bigint
+  const toBigInt = (v: string | number | bigint) =>
+    typeof v === "bigint" ? v : BigInt(v);
+
+  // Only enable when all three IDs are defined
+  const disputeId  = id      !== undefined ? toBigInt(id)      : undefined;
+  const roundIdBn  = roundId !== undefined ? toBigInt(roundId) : undefined;
+  const voteIdBn   = voteId  !== undefined ? toBigInt(voteId)  : undefined;
+  const isEnabled  =
+    disputeId !== undefined &&
+    roundIdBn !== undefined &&
+    voteIdBn !== undefined;
+
+  // Pass the normalized bigint tuple
+  const hookArgs = [disputeId!, roundIdBn!, voteIdBn!] as const;

Please verify that the generated useReadDisputeKit…IsVoteActive hook signatures indeed expect [bigint, bigint, bigint] and adjust accordingly.

Comment on lines +29 to +31
const shouldShowCommit = id && isCommitPeriod && !commited;
const shouldShowReveal = id && isVotingPeriod;

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

Coerce id to boolean to avoid string leakage into predicates

id && isCommitPeriod && !commited and id && isVotingPeriod may infer string | boolean. Use Boolean(id) (or !!id) to keep these strictly boolean.

Apply:

-  const shouldShowCommit = id && isCommitPeriod && !commited;
-  const shouldShowReveal = id && isVotingPeriod;
+  const hasId = Boolean(id);
+  const shouldShowCommit = hasId && isCommitPeriod && !commited;
+  const shouldShowReveal = hasId && isVotingPeriod;
📝 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 shouldShowCommit = id && isCommitPeriod && !commited;
const shouldShowReveal = id && isVotingPeriod;
const hasId = Boolean(id);
const shouldShowCommit = hasId && isCommitPeriod && !commited;
const shouldShowReveal = hasId && isVotingPeriod;
🤖 Prompt for AI Agents
In web/src/pages/Cases/CaseDetails/Voting/Shutter/index.tsx around lines 29 to
31, the variables shouldShowCommit and shouldShowReveal use `id` directly in
logical expressions, which can cause the result to be a string or boolean. To
fix this, explicitly coerce `id` to a boolean by replacing `id` with
`Boolean(id)` or `!!id` in these expressions to ensure the predicates are
strictly boolean values.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
web/src/pages/Cases/CaseDetails/Voting/Shutter/Commit.tsx (1)

88-91: Tiny readability tweak: trim once

Avoid calling trim on the env value more than necessary.

-      if (!import.meta.env.REACT_APP_SHUTTER_API || import.meta.env.REACT_APP_SHUTTER_API.trim() === "") {
+      const shutterApi = import.meta.env.REACT_APP_SHUTTER_API?.trim();
+      if (!shutterApi) {
         console.error("REACT_APP_SHUTTER_API environment variable is not set or is empty");
-        throw new Error("Cannot commit vote: REACT_APP_SHUTTER_API environment variable is required but not set");
+        // see earlier comment re: return vs throw
+        return;
       }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3080c8f and a130a6a.

📒 Files selected for processing (1)
  • web/src/pages/Cases/CaseDetails/Voting/Shutter/Commit.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: contracts-testing
  • GitHub Check: SonarCloud
  • GitHub Check: Analyze (javascript)
  • GitHub Check: SonarCloud
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
web/src/pages/Cases/CaseDetails/Voting/Shutter/Commit.tsx (1)

88-91: Env prefix correctly configured in vite.config.js

The project’s Vite configuration (web/vite.config.js at line 24) already includes "REACT_APP" in its envPrefix, so import.meta.env.REACT_APP_SHUTTER_API will be loaded as intended. No changes are required.

Comment on lines +88 to +91
if (!import.meta.env.REACT_APP_SHUTTER_API || import.meta.env.REACT_APP_SHUTTER_API.trim() === "") {
console.error("REACT_APP_SHUTTER_API environment variable is not set or is empty");
throw new Error("Cannot commit vote: REACT_APP_SHUTTER_API environment variable is required but not set");
}
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

⚠️ Potential issue

Guard is good, but avoid throwing inside the async handler; surface a user-facing error and return early

Throwing here can lead to an unhandled rejection unless the caller traps it. Prefer a toast/notification (or disable the commit UI upfront) and return early.

Apply minimal safe change (replace throw with a graceful return); wire to your toast system if available:

-      if (!import.meta.env.REACT_APP_SHUTTER_API || import.meta.env.REACT_APP_SHUTTER_API.trim() === "") {
-        console.error("REACT_APP_SHUTTER_API environment variable is not set or is empty");
-        throw new Error("Cannot commit vote: REACT_APP_SHUTTER_API environment variable is required but not set");
-      }
+      if (!import.meta.env.REACT_APP_SHUTTER_API || import.meta.env.REACT_APP_SHUTTER_API.trim() === "") {
+        console.error("REACT_APP_SHUTTER_API environment variable is not set or is empty");
+        // TODO: replace with your app's toast/notification system
+        // e.g., toast.error("Shutter API is not configured. Please contact support.");
+        return;
+      }

Optional but recommended: also disable the commit action in the UI when the API is missing, so users never reach this branch. I can propose a patch for OptionsContainer usage if you want.

📝 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
if (!import.meta.env.REACT_APP_SHUTTER_API || import.meta.env.REACT_APP_SHUTTER_API.trim() === "") {
console.error("REACT_APP_SHUTTER_API environment variable is not set or is empty");
throw new Error("Cannot commit vote: REACT_APP_SHUTTER_API environment variable is required but not set");
}
if (!import.meta.env.REACT_APP_SHUTTER_API || import.meta.env.REACT_APP_SHUTTER_API.trim() === "") {
console.error("REACT_APP_SHUTTER_API environment variable is not set or is empty");
// TODO: replace with your app's toast/notification system
// e.g., toast.error("Shutter API is not configured. Please contact support.");
return;
}
🤖 Prompt for AI Agents
In web/src/pages/Cases/CaseDetails/Voting/Shutter/Commit.tsx around lines 88 to
91, do not throw inside the async handler when REACT_APP_SHUTTER_API is missing;
instead log the error, show a user-facing notification (call the app's
toast/notification helper if available) and return early from the handler to
avoid an unhandled rejection. Replace the throw with a graceful return after
emitting the notification (or set an error state used by the UI), and
additionally ensure the commit action/button is disabled when the API env var is
not set so users cannot reach this branch.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
contracts/scripts/coverage.sh (1)

24-24: Scope VIA_IR to specific commands to avoid environment leakage

Export works, but scoping the variable per-invocation makes the script more robust if additional steps are added.

Minimal change within this context:

-export VIA_IR=false

Then run the commands with scoped env:

VIA_IR=false yarn build
VIA_IR=false yarn hardhat coverage --solcoverjs ./.solcover.js --temp artifacts --show-stack-traces --testfiles "test/**/*.ts"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a130a6a and b8628bb.

📒 Files selected for processing (3)
  • contracts/.solcover.js (1 hunks)
  • contracts/hardhat.config.ts (1 hunks)
  • contracts/scripts/coverage.sh (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: contracts-testing
  • GitHub Check: SonarCloud
  • GitHub Check: Analyze (javascript)
  • GitHub Check: SonarCloud
  • GitHub Check: Analyze (javascript)
  • GitHub Check: contracts-testing
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-testnet-devtools
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet-devtools
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet-devtools
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Analyze (javascript)
  • GitHub Check: contracts-testing

@@ -7,6 +7,7 @@ const shell = require("shelljs");
module.exports = {
istanbulReporter: ["lcov"],
configureYulOptimizer: true,
irMinimum: true,
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

Unrecognized solcover option "irMinimum" — likely a no-op; remove to avoid confusion

I don’t see "irMinimum" in solidity-coverage’s documented options. With coverage.sh already forcing VIA_IR=false for Hardhat, this flag is unnecessary and potentially misleading.

Apply this diff to remove it:

-  irMinimum: true,

If you want an inline hint about IR for coverage runs, consider a comment:

   configureYulOptimizer: true,
+  // IR is disabled for coverage via scripts/coverage.sh (VIA_IR=false)

Optionally verify support via docs:


🌐 Web query:

Is there a documented `irMinimum` option supported by solidity-coverage's .solcover.js config?

💡 Result:

Yes. The .solcover.js config includes a documented irMinimum option: a boolean (default false) that “speeds up test execution times when solc is run in viaIR mode,” and it may not work for all projects.[1]

Details:

  • Location: Listed under Config Options in the solidity-coverage package docs.[1]
  • Purpose: Enable a faster path when compiling with Solidity’s viaIR; useful if your project compiles successfully under coverage with it enabled.[1]
  • Type/Default: Boolean, default false.[1]

You can set it in .solcover.js like:
module.exports = {
irMinimum: true
}

Mirrors of the same table appear in downstream copies of the docs as well.[2]

Citations:


Documented option “irMinimum” is redundant under VIA_IR=false

solidity-coverage does support irMinimum (boolean, default false) to speed up test runs when compiling via IR, but your coverage.sh script forces VIA_IR=false, so this setting has no effect and may confuse future maintainers.

• Location: contracts/.solcover.js (line 10)
• Suggested change:

-  irMinimum: true,
+  // IR is disabled for coverage via scripts/coverage.sh (VIA_IR=false), so `irMinimum` is redundant
🤖 Prompt for AI Agents
In contracts/.solcover.js around line 10, the irMinimum: true option is
redundant because coverage.sh forces VIA_IR=false; remove the irMinimum property
or conditionally set it only when IR is enabled (e.g., check process.env.VIA_IR
=== 'true' and only include irMinimum when true) so the config reflects the
actual compilation mode and avoids confusing future maintainers.

Comment on lines +29 to 35
version: "0.8.30",
settings: {
// viaIR: true,
viaIR: process.env.VIA_IR !== "false", // Defaults to true
optimizer: {
enabled: true,
runs: 100,
},
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
},
},
{
// For Vea
version: "0.8.24",
settings: {
// viaIR: true,
optimizer: {
enabled: true,
runs: 100,
runs: 10000,
},
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

viaIR default and optimizer runs: confirm cross-tool parity; consider env-parameterizing runs

  • viaIR: Defaulting to true and overriding with VIA_IR=false for coverage is sensible and aligns with coverage.sh.
  • Optimizer runs: Hardhat is now 10000; Foundry (per PR context) uses 500. This divergence will change bytecode and gas characteristics across toolchains. If intentional, fine; otherwise, parameterize via env to keep them in sync.

Suggested change to parameterize runs:

           optimizer: {
             enabled: true,
-            runs: 10000,
+            runs: Number(process.env.SOLC_OPTIMIZER_RUNS ?? 10000),
           },

You can then align Foundry and Hardhat by setting SOLC_OPTIMIZER_RUNS in CI/local as needed.

To quickly audit current settings across the repo:


🏁 Script executed:

#!/bin/bash
# Inspect optimizer/viaIR settings in Foundry and Hardhat
set -e
echo "== Hardhat optimizer runs =="
rg -n 'runs:\s*\d+' contracts/hardhat.config.ts -A 2
echo
echo "== Foundry config =="
fd -a "foundry.toml" | while read -r f; do
  echo ">>> $f"
  rg -n -A 2 -B 2 'via_ir|optimizer|runs' "$f" || true
done

Length of output: 858


Align Hardhat and Foundry optimizer runs via an env var

Foundry’s default profile uses optimizer_runs = 500, while Hardhat is fixed at runs: 10000. This mismatch will produce different bytecode/gas characteristics across your pipelines.

• File/contracts/hardhat.config.ts (lines 31–35):

  • Change
             optimizer: {
               enabled: true,
    -          runs: 10000,
    +          runs: Number(process.env.SOLC_OPTIMIZER_RUNS ?? 10000),
             },
  • In CI/local, set SOLC_OPTIMIZER_RUNS=500 (or bump Foundry to 10000) to keep both toolchains in sync.

• The existing viaIR logic (process.env.VIA_IR !== "false") already matches Foundry’s default via_ir = true and its tests profile uses via_ir = false for coverage.

📝 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
version: "0.8.30",
settings: {
// viaIR: true,
viaIR: process.env.VIA_IR !== "false", // Defaults to true
optimizer: {
enabled: true,
runs: 100,
},
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
},
},
{
// For Vea
version: "0.8.24",
settings: {
// viaIR: true,
optimizer: {
enabled: true,
runs: 100,
runs: 10000,
},
version: "0.8.30",
settings: {
viaIR: process.env.VIA_IR !== "false", // Defaults to true
optimizer: {
enabled: true,
runs: Number(process.env.SOLC_OPTIMIZER_RUNS ?? 10000),
},
🤖 Prompt for AI Agents
In contracts/hardhat.config.ts around lines 29–35, the Hardhat solc optimizer
runs are hardcoded to 10000 which mismatches Foundry’s default 500; change the
config to read runs from an environment variable (SOLC_OPTIMIZER_RUNS) and
coerce to a number with a sensible fallback (e.g., keep current 10000 as
fallback), and update CI/local to set SOLC_OPTIMIZER_RUNS=500 (or alternatively
bump Foundry to 10000) so both toolchains use the same optimizer runs.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
contracts/src/gateway/interfaces/IHomeGateway.sol (1)

5-9: Missing import for IArbitratorV2 breaks compilation

This interface references IArbitratorV2 in the CrossChainDisputeIncoming event (Line 21) but does not import it. Indirect imports via IArbitrableV2 do not bring IArbitratorV2 into scope. This will fail to compile.

Apply this diff to add the missing import:

 import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
 import "@kleros/vea-contracts/src/interfaces/gateways/ISenderGateway.sol";
 import "../../arbitration/interfaces/IArbitrableV2.sol";
+import "../../arbitration/interfaces/IArbitratorV2.sol";

Also applies to: 20-21

🧹 Nitpick comments (2)
contracts/src/gateway/interfaces/IHomeGateway.sol (1)

66-66: NatSpec tag typo

Use @return for NatSpec consistency.

-    /// return The fee token.
+    /// @return The fee token.
contracts/src/arbitration/interfaces/IEvidence.sol (1)

8-10: Fix typos in NatSpec for clarity

Minor spelling corrections improve readability in docs.

-    /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.
-    /// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.
+    /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter's responsibility to submit the right external dispute ID.
+    /// @param _party The address of the party submitting the evidence. Note that 0x0 refers to evidence not submitted by any party.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8628bb and d10251b.

📒 Files selected for processing (10)
  • contracts/src/arbitration/interfaces/IArbitrableV2.sol (1 hunks)
  • contracts/src/arbitration/interfaces/IArbitratorV2.sol (1 hunks)
  • contracts/src/arbitration/interfaces/IDisputeKit.sol (1 hunks)
  • contracts/src/arbitration/interfaces/IDisputeTemplateRegistry.sol (1 hunks)
  • contracts/src/arbitration/interfaces/IEvidence.sol (1 hunks)
  • contracts/src/arbitration/interfaces/ISortitionModule.sol (1 hunks)
  • contracts/src/gateway/interfaces/IForeignGateway.sol (1 hunks)
  • contracts/src/gateway/interfaces/IHomeGateway.sol (1 hunks)
  • contracts/src/rng/IRandomizer.sol (1 hunks)
  • contracts/src/rng/RNG.sol (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • contracts/src/rng/RNG.sol
  • contracts/src/arbitration/interfaces/ISortitionModule.sol
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: contracts-testing
  • GitHub Check: SonarCloud
  • GitHub Check: Analyze (javascript)
  • GitHub Check: SonarCloud
  • GitHub Check: contracts-testing
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
🔇 Additional comments (8)
contracts/src/rng/IRandomizer.sol (1)

3-3: Pragma range broadened — LGTM

Broadening to >=0.8.0 <0.9.0 is fine for an interface and aligns with the repo-wide compiler upgrades. No API changes.

contracts/src/arbitration/interfaces/IArbitratorV2.sol (1)

3-3: Pragma range broadened — LGTM

Compatible with the toolchain update to 0.8.30; no interface changes.

contracts/src/gateway/interfaces/IHomeGateway.sol (1)

3-3: Pragma range broadened — LGTM

Consistent with the rest of the interfaces and the toolchain update.

contracts/src/arbitration/interfaces/IDisputeKit.sol (1)

3-3: Pragma range broadened — LGTM

Interface remains unchanged; the wider pragma is appropriate for external consumers.

contracts/src/arbitration/interfaces/IDisputeTemplateRegistry.sol (1)

3-3: Pragma range broadened — LGTM

No API changes; aligns with the repo-wide pragma update.

contracts/src/arbitration/interfaces/IArbitrableV2.sol (1)

3-3: Pragma range broadened — LGTM

Consistent with other interfaces; no surface changes.

contracts/src/arbitration/interfaces/IEvidence.sol (1)

3-3: Pragma range broadened — LGTM

Interface unchanged; safe pragma widening.

contracts/src/gateway/interfaces/IForeignGateway.sol (1)

3-3: Pragma range broadened — LGTM

Matches the ecosystem-wide update; no interface changes.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants