Skip to content

Shutterized Dispute Kit #1965

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

Shutterized Dispute Kit #1965

wants to merge 34 commits into from

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Apr 30, 2025

Devnet contract deployed

DisputeKitShutter

Critical changes needed:

See #1314


PR-Codex overview

This PR introduces the DisputeKitShutter to the Kleros v2 ecosystem, enhancing dispute resolution capabilities. It also updates various components, including version upgrades and improved event handling for disputes.

Detailed summary

  • Added DisputeKitShutter contract with specific voting and encryption features.
  • Updated subgraph.yaml files with descriptions and repository links.
  • Enhanced ClassicDispute and ClassicRound entities to include dispute kit IDs.
  • Improved event handlers for dispute creation and voting.
  • Updated version numbers in package.json files.
  • Added utility functions for extracting dispute kit IDs.
  • Revised comments for clarity regarding entity compatibility.
  • Modified deployment scripts to accommodate new functionality.

The following files were skipped due to too many changes: contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter_Proxy.json, contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter.json, contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter_Implementation.json

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

Summary by CodeRabbit

  • New Features

    • Introduced the DisputeKitShutter contract, enabling encrypted voting and integration with the Shutter Network for enhanced privacy in dispute resolution.
    • Added new deployment artifacts, proxy contracts, and deployment scripts for DisputeKitShutter on Arbitrum Sepolia Devnet.
    • Updated subgraph manifests and configurations to index events and entities from DisputeKitShutter, supporting multiple dispute kits dynamically.
  • Bug Fixes

    • Improved subgraph entity handling to dynamically support multiple dispute kits, removing reliance on hardcoded IDs.
  • Documentation

    • Updated README with deployed addresses for DisputeKitShutter and subgraph configuration comments.
  • Chores

    • Updated package versions and removed unused dependencies.
    • Enhanced deployment and subgraph update scripts for better contract management and configuration consistency.
  • Tests

    • Extended test coverage to include DisputeKitShutter and updated error messages for vote commitment validation.

@jaybuidl jaybuidl self-assigned this Apr 30, 2025
Copy link
Contributor

coderabbitai bot commented Apr 30, 2025

Walkthrough

This update introduces the DisputeKitShutter contract and its supporting infrastructure, including deployment scripts, proxy contracts, event handling, and subgraph indexing. It refactors core and subgraph logic to dynamically handle multiple dispute kits, adds new subgraph manifest templates, and enhances CLI and SDK integration for Shutter-based encryption and decryption operations.

Changes

File(s) / Group Summary
contracts/package.json Removed node-fetch from devDependencies; added @shutter-network/shutter-sdk and isomorphic-fetch to dependencies.
contracts/scripts/shutter.ts New script for Shutter encryption/decryption, API interactions, CLI, and SDK integration.
contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol Refactored commit/vote logic into internal functions; introduced hashVote for customizable vote hashing.
contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol New contract extending ClassicBase with Shutter-specific commit/vote logic, event emission, and hashing.
contracts/README.md Added DisputeKitShutter contract addresses for Arbitrum Sepolia Devnet.
contracts/deploy/00-home-chain-arbitration.ts Deployment script updated to deploy and register DisputeKitShutter and enable it on the General Court.
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter*.json Added deployment artifacts for DisputeKitShutterProxy (UUPS proxy) on Arbitrum Sepolia Devnet.
contracts/src/proxy/KlerosProxies.sol Added DisputeKitShutterProxy contract, inheriting from UUPSProxy.
contracts/test/arbitration/index.ts Extended tests to include DisputeKitShutter deployment and event verification.
contracts/test/foundry/KlerosCore.t.sol Updated expected revert messages in tests to match new error string.
subgraph/core-neo/subgraph.template.yaml New subgraph manifest template for Core Neo, supporting multiple dispute kits and event handlers.
subgraph/core-university/subgraph.template.yaml New subgraph manifest template for Core University, supporting multiple data sources and entities.
subgraph/core/src/DisputeKitClassic.ts Refactored to extract dispute kit IDs dynamically and add null checks; updated event/entity handling.
subgraph/core/src/KlerosCore.ts Updated comment to clarify applicability to both Classic and Shutter dispute kits.
subgraph/core/src/entities/ClassicContribution.ts Dynamically determines dispute kit ID for contributions; removed hardcoded ID.
subgraph/core/src/entities/ClassicDispute.ts Updated function to accept dynamic dispute kit ID and round index for entity creation.
subgraph/core/src/entities/ClassicRound.ts Updated to handle dynamic dispute kit IDs for round creation and funding updates.
subgraph/core/src/utils.ts Added utility to extract dispute kit ID from extraData bytes.
subgraph/core/subgraph.template.yaml New subgraph manifest template for Core, supporting multiple dispute kits and event handlers.
subgraph/core/subgraph.yaml Added DisputeKitShutter as a new data source; updated metadata and comments.
subgraph/dispute-template-registry/subgraph.template.yaml New subgraph manifest template for Dispute Template Registry.
subgraph/dispute-template-registry/subgraph.yaml Added autogenerated comment and metadata fields.
subgraph/core-neo/subgraph.yaml, subgraph/core-university/subgraph.yaml Updated contract addresses, start blocks, and added autogenerated comments.
subgraph/package.json Updated version and drtVersion fields.
subgraph/scripts/update.sh Refactored to filter undeployed contracts from subgraph configs before updating.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ShutterScript (CLI)
    participant Shutter API
    participant Shutter SDK

    User->>ShutterScript: encrypt <message>
    ShutterScript->>Shutter API: fetchShutterData(decryptionTimestamp)
    Shutter API-->>ShutterScript: {pubkey, params, identity}
    ShutterScript->>Shutter SDK: encryptData(message, pubkey, params, sigma)
    Shutter SDK-->>ShutterScript: encryptedCommitment
    ShutterScript-->>User: {encryptedCommitment, identity}

    User->>ShutterScript: decrypt <encryptedMessage> <identity>
    ShutterScript->>Shutter API: fetchDecryptionKey(identity)
    Shutter API-->>ShutterScript: decryptionKey
    ShutterScript->>Shutter SDK: decrypt(encryptedMessage, decryptionKey)
    Shutter SDK-->>ShutterScript: decryptedMessage
    ShutterScript-->>User: decryptedMessage
Loading
sequenceDiagram
    participant Core
    participant DisputeKitClassic
    participant DisputeKitShutter
    participant Subgraph

    Core->>DisputeKitClassic: createDispute(...)
    Core->>DisputeKitShutter: createDispute(...)
    DisputeKitClassic-->>Core: DisputeKitCreated(id=1)
    DisputeKitShutter-->>Core: DisputeKitCreated(id=2)
    Core-->>Subgraph: DisputeKitCreated events
    Subgraph->>DisputeKitClassic: handle events (dynamic kit ID)
    Subgraph->>DisputeKitShutter: handle events (dynamic kit ID)
Loading

Possibly related PRs

Suggested reviewers

  • jaybuidl
  • alcercu

Poem

🐇
In the warren of contracts, a Shutter appears,
Encrypting our votes, dispelling old fears.
Proxies and scripts now hop into view,
Subgraphs and IDs—dynamic and new!
With every commit and a cryptic event,
The rabbit rejoices—on progress, we're bent!

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 5989928 and df98319.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • contracts/README.md (1 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol (4 hunks)
  • subgraph/core-neo/subgraph.yaml (1 hunks)
  • subgraph/dispute-template-registry/subgraph.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • contracts/README.md
  • subgraph/dispute-template-registry/subgraph.yaml
  • subgraph/core-neo/subgraph.yaml
  • contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Redirect rules - kleros-v2-neo
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: contracts-testing

🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@jaybuidl jaybuidl added Type: Feature🗿 Package: Web Court web frontend Package: Contracts Court smart contracts Package: Bots Court bots Package: Subgraph Court subgraph labels Apr 30, 2025
Copy link

netlify bot commented Apr 30, 2025

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

Name Link
🔨 Latest commit df98319
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-university/deploys/682c87f1d604940008f30748

Copy link

netlify bot commented Apr 30, 2025

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit df98319
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet/deploys/682c87f10feee1000813b123
😎 Deploy Preview https://deploy-preview-1965--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

netlify bot commented Apr 30, 2025

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit df98319
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo/deploys/682c87f12411d000081eaf42
😎 Deploy Preview https://deploy-preview-1965--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

netlify bot commented Apr 30, 2025

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

Name Link
🔨 Latest commit df98319
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet-devtools/deploys/682c87f1d143e9000935bf3a
😎 Deploy Preview https://deploy-preview-1965--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: 3

🧹 Nitpick comments (5)
contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol (1)

439-453: Added virtual hashVote function for extensible vote hashing

This new hashVote function is a key architectural change that enables the Shutter integration:

  1. It's declared as virtual so derived contracts can override it
  2. The base implementation hashes only _choice and _salt (backward compatible)
  3. It accepts but doesn't use the _justification parameter in the base implementation
  4. The comment explicitly indicates that derived contracts may use the unused parameters

This design enables the specialized Shutter implementation to include the justification in the hash calculation.

This is a well-designed extension point that maintains backward compatibility while enabling new functionality in derived contracts. The virtual function pattern allows for specialized implementations like DisputeKitShutter to include the justification in the hash while keeping the base functionality unchanged.

contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol (2)

30-33: Unnecessary external self-call incurs gas & re-entrancy risk

this.castCommit(...) performs an external call to the same contract, paying
extra gas for ABI encoding/decoding and exposing the function to re-entrancy
checks (albeit low-risk here).

Since castCommit is declared external, you can call it internally without
this by using the fully-qualified function name:

-        this.castCommit(_coreDisputeID, _voteIDs, _commit);
+        castCommit(_coreDisputeID, _voteIDs, _commit);

This is cheaper and avoids the external-call context switch.


85-92: Natspec parameter order does not match function signature

The docstring lists the parameters as (_choice, _justification, _salt)
while the signature is (_choice, _salt, _justification).
This can confuse automated doc generators.

- * @param _justification The justification for the vote
- * @param _salt A random salt for commitment
+ * @param _salt A random salt for commitment
+ * @param _justification The justification for the vote
contracts/scripts/shutter.ts (2)

33-82: Missing retry / back-off on Shutter API call

fetchShutterData fails the whole encryption flow on the first transient HTTP
error. Consider adding a simple exponential back-off or at least one retry to
improve UX when the Shutter API momentarily flakes.

Not blocking, but worth considering.


160-186: Leaking raw Shutter keys in logs

encrypt() logs the eon key, identity and sigma to stdout. These are
cryptographically sensitive materials and should not be printed in production
mode.

Recommend gating the console.log statements behind an environment variable
(e.g. DEBUG) or removing them entirely.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 01edde5 and 8e46e05.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • contracts/package.json (1 hunks)
  • contracts/scripts/shutter.ts (1 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol (1 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol (3 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitGated.sol (1 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol (1 hunks)
  • contracts/test/foundry/KlerosCore.t.sol (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • 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
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: SonarCloud
  • GitHub Check: Analyze (javascript)
  • GitHub Check: contracts-testing
🔇 Additional comments (8)
contracts/src/arbitration/dispute-kits/DisputeKitGated.sol (1)

30-30: Version update from 0.8.0 to 0.9.0

The version constant has been updated as part of the broader Shutter integration changes across dispute kit contracts.

contracts/package.json (1)

159-160:

❓ Verification inconclusive

Added Shutter SDK and related dependencies

These new dependencies are required to support the Shutter Network integration for encrypted commitments:

  1. @shutter-network/shutter-sdk - Core SDK for Shutter Network functionality
  2. isomorphic-fetch - Cross-environment fetch implementation

Note that the Shutter SDK is at version 0.0.1, which suggests it's in early development.


🏁 Script executed:

#!/bin/bash
# Check for newer versions of the Shutter SDK and potential issues

echo "Checking for latest version of @shutter-network/shutter-sdk"
npm view @shutter-network/shutter-sdk versions

echo "Checking for any reported issues or vulnerabilities"
npm audit --json | grep -i shutter

Length of output: 682


🏁 Script executed:

#!/bin/bash
# Generate a lockfile to enable auditing
npm install --package-lock-only

echo "Re-checking for any reported issues or vulnerabilities after lockfile creation"
npm audit --json | grep -i shutter

Length of output: 796


Verify Shutter SDK and Fetch Dependency
The PR adds:

  • @shutter-network/shutter-sdk @ 0.0.1
  • isomorphic-fetch @ ^3.0.0

Because this project uses workspace-protocols, running npm audit in CI failed—please manually:
• Confirm there are no known vulnerabilities in these packages (e.g. via a local npm audit or yarn audit).
• Verify that 0.0.1 of the Shutter SDK is the intended stable release (bump when a newer stable version is available).

contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol (3)

241-241: Improved parameter documentation

The _commit parameter documentation is updated to more clearly indicate it's a "commitment hash" rather than a general commit.


286-286: Added vote hash calculation for verification

The code now uses the new hashVote function to generate a vote hash, which enables customized hashing strategies in derived contracts.


292-293: Updated vote hash verification logic and error message

The verification logic now compares against the computed voteHash instead of directly hashing the choice and salt. The error message has been updated accordingly.

contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol (1)

14-14: Version update from 0.8.0 to 0.9.0

The version constant has been updated as part of the broader Shutter integration changes across dispute kit contracts.

contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol (1)

56-72: Event is emitted even when castCommit reverts

Because castCommitShutter emits CommitCastShutter after the external call,
a failure inside castCommit will revert the whole transaction and the event
will not be emitted.
If your intention was to guarantee the event only when the commit succeeds,
this is fine. If you need to record the attempt, move the emit in a
try/catch block.

contracts/scripts/shutter.ts (1)

88-127: Error parsing assumes specific JSON structure

fetchDecryptionKey throws if jsonResponse.message is undefined, but the
Shutter API returns the payload at jsonResponse root according to the spec
used earlier. Align the two helpers or add a type-guard to avoid false
positives.

Comment on lines +148 to +153
function generateRandomBytes32(): `0x${string}` {
return ("0x" +
crypto
.getRandomValues(new Uint8Array(32))
.reduce((acc, byte) => acc + byte.toString(16).padStart(2, "0"), "")) as Hex;
}
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

crypto.getRandomValues is not available in Node.js

getRandomValues is a Web-Crypto API. In a Node environment use
crypto.randomBytes.

-  return ("0x" +
-    crypto
-      .getRandomValues(new Uint8Array(32))
-      .reduce((acc, byte) => acc + byte.toString(16).padStart(2, "0"), "")) as Hex;
+  return ("0x" + crypto.randomBytes(32).toString("hex")) as Hex;

This prevents runtime crashes when the script is executed with ts-node.

📝 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
function generateRandomBytes32(): `0x${string}` {
return ("0x" +
crypto
.getRandomValues(new Uint8Array(32))
.reduce((acc, byte) => acc + byte.toString(16).padStart(2, "0"), "")) as Hex;
}
function generateRandomBytes32(): `0x${string}` {
return ("0x" + crypto.randomBytes(32).toString("hex")) as Hex;
}

@jaybuidl jaybuidl linked an issue Apr 30, 2025 that may be closed by this pull request
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

🧹 Nitpick comments (2)
contracts/test/arbitration/index.ts (2)

65-65: Test function updated but consider expanding test coverage

The deployContracts function is properly updated to include DisputeKitShutter. However, while the deployment and registration of DisputeKitShutter are verified, there are no specific tests for its unique functionality related to Shutter integration.

Consider adding specific test cases for the DisputeKitShutter's encryption/decryption capabilities and its integration with the Shutter API to ensure complete coverage.

Also applies to: 71-71, 73-73


6-6: Update test description to reflect expanded scope

The describe block is still labeled "DisputeKitClassic" even though the tests now cover both classic and shutter dispute kits. Consider renaming this to "DisputeKits" or "Arbitration System" to more accurately reflect the expanded test scope.

-describe("DisputeKitClassic", async () => {
+describe("DisputeKits", async () => {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 8e46e05 and 98ec3ba.

📒 Files selected for processing (6)
  • contracts/README.md (1 hunks)
  • contracts/deploy/00-home-chain-arbitration.ts (1 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter.json (1 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter_Proxy.json (1 hunks)
  • contracts/src/proxy/KlerosProxies.sol (1 hunks)
  • contracts/test/arbitration/index.ts (2 hunks)
✅ Files skipped from review due to trivial changes (4)
  • contracts/README.md
  • contracts/src/proxy/KlerosProxies.sol
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter_Proxy.json
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter.json
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: Redirect rules - kleros-v2-neo
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-testnet-devtools
  • GitHub Check: Header rules - kleros-v2-testnet-devtools
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet-devtools
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: SonarCloud
  • GitHub Check: contracts-testing
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
contracts/deploy/00-home-chain-arbitration.ts (1)

99-106: Good integration of DisputeKitShutter

The implementation properly deploys the new DisputeKitShutter contract as upgradeable and registers it with the core contract. This aligns with the PR objective of introducing Shutter API integration for message encryption in the dispute kit system.

Consider adding a brief comment explaining what DisputeKitShutter is for and how it differs from DisputeKitClassic, which would improve code documentation.

contracts/test/arbitration/index.ts (4)

3-3: LGTM!

Correctly imports the new DisputeKitShutter type.


9-9: LGTM!

Properly declares the disputeKitShutter variable for use in tests.


13-13: LGTM!

Updated to destructure the disputeKitShutter from the return value of deployContracts().


18-18: LGTM!

Test correctly verifies both dispute kits are created with the expected IDs and addresses.

Also applies to: 21-22

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

♻️ Duplicate comments (1)
contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol (1)

15-15: ⚠️ Potential issue

override on a constant still breaks compilation

constant variables cannot be declared virtual, hence they cannot be overridden.
Unless DisputeKitClassicBase now declares

string public virtual version;

this line will fail to compile exactly as reported in the previous review.

-    string public constant override version = "0.9.1";
+    /// @inheritdoc DisputeKitClassicBase
+    string public constant version = "0.9.1";
🧹 Nitpick comments (1)
contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol (1)

85-96: Natspec parameter order/documentation drift

The comment lists _justification before _salt, but the signature places _salt first.
This will confuse integrators and automated doc generators.

- * @param _justification The justification for the vote
- * @param _salt A random salt for commitment
+ * @param _salt A random salt for commitment
+ * @param _justification The justification for the vote
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 98ec3ba and 74d1506.

📒 Files selected for processing (3)
  • contracts/README.md (3 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter.json (1 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • contracts/README.md
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: Redirect rules - kleros-v2-testnet-devtools
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-testnet-devtools
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-testnet-devtools
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Analyze (javascript)
  • GitHub Check: SonarCloud
  • GitHub Check: contracts-testing
🔇 Additional comments (1)
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter.json (1)

1-1145: Artifact looks fine – no action required
Deployment metadata/ABI are auto-generated; nothing to review manually here.

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

♻️ Duplicate comments (1)
contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol (1)

14-15: ⚠️ Potential issue

Fix the override modifier on constant variable.

The override modifier on a constant variable will cause compilation errors because constant variables cannot be virtual in the base contract. Unless DisputeKitClassicBase defines version as a non-constant variable with the virtual modifier, this will fail to compile.

-    string public constant override version = "0.9.2";
+    /// @inheritdoc DisputeKitClassicBase
+    string public constant version = "0.9.2";
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between b40abc2 and cb7997f.

📒 Files selected for processing (9)
  • contracts/README.md (3 hunks)
  • contracts/deploy/upgrade-dispute-kit-v0.9.2.ts (1 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json (3 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter.json (1 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol (2 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol (4 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitGated.sol (1 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol (1 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • contracts/src/arbitration/dispute-kits/DisputeKitGated.sol
  • contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol
🚧 Files skipped from review as they are similar to previous changes (4)
  • contracts/README.md
  • contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol
  • contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter.json
⏰ Context from checks skipped due to timeout of 90000ms (16)
  • GitHub Check: Redirect rules - kleros-v2-neo
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: contracts-testing
  • GitHub Check: SonarCloud
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Mend Security Check
🔇 Additional comments (6)
contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol (2)

76-78: Ensure proper usage of internal call to maintain msg.sender context.

Your implementation correctly uses the internal _castCommit method, which preserves the original msg.sender context. This avoids the issue that would occur with an external self-call (this.castCommit(...)), which would change msg.sender to the contract address.


92-99:

✅ Verification successful

Verify justification hashing security.

The hash function properly incorporates the justification by first hashing it separately and then including that hash in the final encoded hash. This approach is secure and correctly extends the base implementation to add Shutter-specific functionality.


🏁 Script executed:

#!/bin/bash
# Verify if the base implementation of hashVote exists and how it's defined
ast-grep --pattern $'function hashVote($_, $_, $_) $$$'

Length of output: 56


🏁 Script executed:

#!/bin/bash
# Search for all occurrences of hashVote to locate its definition or overrides
rg -n "function hashVote" .

# Display the imports and inheritance at the top of DisputeKitShutter.sol
sed -n '1,50p' contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol

Length of output: 65641


🏁 Script executed:

#!/bin/bash
# Show contract declaration and imports for DisputeKitShutter.sol
sed -n '1,50p' contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol

# Inspect IDisputeKit for hashVote (if declared)
rg -n "interface IDisputeKit" -A10 contracts/src/arbitration/interfaces/IDisputeKit.sol

# Specifically search for hashVote in all dispute-kit interfaces
rg -n "hashVote" contracts/src/arbitration/interfaces

Length of output: 2640


#!/bin/bash
# Search for the base implementation of hashVote in the DisputeKitClassicBase contract
rg -n "function hashVote" contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol -A3

🏁 Script executed:

#!/bin/bash
# Locate the base implementation of hashVote in DisputeKitClassicBase.sol
rg -n "function hashVote" contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol -A5

Length of output: 334


hashVote override securely incorporates the justification

The override in DisputeKitShutter.sol (lines 92–99) properly hashes the _justification string and includes its bytes32 hash in an abi.encode call with _choice and _salt. This securely extends the base implementation—which only packed choice and salt—by incorporating juror justifications without introducing collision risks.

• contracts/src/arbitration/dispute-kits/DisputeKitShutter.sol:92–99 – hashVote override as shown above

No further action required.

contracts/deploy/upgrade-dispute-kit-v0.9.2.ts (1)

36-36: Update initializer function name correctly aligned with contract changes.

The initializer function name change from (presumably) "initialize2" to "initialize4" correctly aligns with the changes in DisputeKitClassic and DisputeKitShutter contracts where the upgrade initializer was renamed to initialize4 with a reinitializer(4) modifier.

contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json (3)

820-848: New hashVote function added to support justification hashing.

The added hashVote function in the ABI matches the implementation in DisputeKitShutter and supports the new requirement of providing justification at commit time rather than at voting time as mentioned in the PR objectives.


869-869: Renamed initializer function for upgrades.

Correctly updated the initializer function name from initialize2 to initialize4 to match the changes in the contract implementation.


874-892: Added isAppealFunded view function.

This new function provides a way to check if an appeal is funded for a dispute, which improves the contract's functionality for the dispute resolution flow.

Comment on lines 1063 to 1073
"numDeployments": 3,
"solcInputHash": "96b8e3f55478438b6784f67c1730309e",
"metadata": "{\"compiler\":{\"version\":\"0.8.24+commit.e11b9ed9\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/KlerosProxies.sol\":\"DisputeKitClassicProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/KlerosProxies.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\nimport \\\"./UUPSProxy.sol\\\";\\n\\n/// Workaround to get meaningful names for the proxy contracts\\n/// Otherwise all the contracts are called `UUPSProxy` on the chain explorers\\n\\ncontract DisputeKitClassicNeoProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitClassicUniversityProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitClassicProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitGatedProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitShutterProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitSybilResistantProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeTemplateRegistryProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract EvidenceModuleProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract ForeignGatewayOnEthereumProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract HomeGatewayToEthereumProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreNeoProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreRulerProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreUniversityProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract PolicyRegistryProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract RandomizerRNGProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract SortitionModuleNeoProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract SortitionModuleUniversityProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract SortitionModuleProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\",\"keccak256\":\"0x209228b56d42a8444ca70919e1ded5711fba434a746f26d426e230f57526fc6c\",\"license\":\"MIT\"},\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\n/// @title UUPS Proxy\\n/// @author Simon Malatrait <[email protected]>\\n/// @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n/// @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n/// @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n/// @dev Adapted from <https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.0/contracts/proxy/ERC1967/ERC1967Proxy.sol>\\ncontract UUPSProxy {\\n /// @dev Storage slot with the address of the current implementation.\\n /// This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n /// validated in the constructor.\\n /// NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n /// If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n /// function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Delegates the current call to `implementation`.\\n /// NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /// @dev Fallback function that delegates calls to the address returned by `_implementation()`.\\n /// @dev Will run if no other function in the contract matches the call data.\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xc3e0b18f846a62cc6c274680fc10014d1267885f8eefc6767292d3e174a081c0\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b5060405161030238038061030283398101604081905261002f91610151565b8181817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010e576000826001600160a01b031682604051610077919061021f565b600060405180830381855af49150503d80600081146100b2576040519150601f19603f3d011682016040523d82523d6000602084013e6100b7565b606091505b505090508061010c5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050505061023b565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610148578181015183820152602001610130565b50506000910152565b6000806040838503121561016457600080fd5b82516001600160a01b038116811461017b57600080fd5b60208401519092506001600160401b038082111561019857600080fd5b818501915085601f8301126101ac57600080fd5b8151818111156101be576101be610117565b604051601f8201601f19908116603f011681019083821181831017156101e6576101e6610117565b816040528281528860208487010111156101ff57600080fd5b61021083602083016020880161012d565b80955050505050509250929050565b6000825161023181846020870161012d565b9190910192915050565b60b9806102496000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea264697066735822122031995e44df4f8c0f7e14fc8c92fe3e63c4fcc994a0505b92eecf1c3a7b742d8964736f6c63430008180033",
"deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea264697066735822122031995e44df4f8c0f7e14fc8c92fe3e63c4fcc994a0505b92eecf1c3a7b742d8964736f6c63430008180033",
"execute": {
"methodName": "initialize",
"args": [
"0xf1C7c037891525E360C59f708739Ac09A7670c59",
"0x0000000000000000000000000000000000000000"
]
"methodName": "initialize4",
"args": []
},
"implementation": "0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24",
"implementation": "0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a",
"devdoc": {
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

Updated deployment metadata and implementation address.

The deployment metadata has been updated to reflect the new implementation address, execution method, and bytecode. The change from initialize with arguments to initialize4 with no arguments is consistent with the upgrade approach in the contract.


🏁 Script executed:

#!/bin/bash
# Verify if there are any references to the old implementation address that might need updating
rg -A 3 "0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24" --type-not json

Length of output: 1688


Fix outdated implementation address references in deployment scripts

The new implementation address (0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a) needs to replace all occurrences of the old one (0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24) in your TypeScript deployment files:

• contracts/deployments/arbitrumSepoliaDevnet.ts

-  address: "0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24",
+  address: "0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a",

• contracts/deployments/devnet.viem.ts

- * [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24)
+ * [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a)

- export const disputeKitClassicImplementationAddress = {
-   421614: "0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24",
+ export const disputeKitClassicImplementationAddress = {
+   421614: "0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a",

Please update these references to keep your frontend and scripts in sync with the on‐chain deployment.

📝 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
"numDeployments": 3,
"solcInputHash": "96b8e3f55478438b6784f67c1730309e",
"metadata": "{\"compiler\":{\"version\":\"0.8.24+commit.e11b9ed9\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/KlerosProxies.sol\":\"DisputeKitClassicProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/KlerosProxies.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\nimport \\\"./UUPSProxy.sol\\\";\\n\\n/// Workaround to get meaningful names for the proxy contracts\\n/// Otherwise all the contracts are called `UUPSProxy` on the chain explorers\\n\\ncontract DisputeKitClassicNeoProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitClassicUniversityProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitClassicProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitGatedProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitShutterProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitSybilResistantProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeTemplateRegistryProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract EvidenceModuleProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract ForeignGatewayOnEthereumProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract HomeGatewayToEthereumProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreNeoProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreRulerProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreUniversityProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract PolicyRegistryProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract RandomizerRNGProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract SortitionModuleNeoProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract SortitionModuleUniversityProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract SortitionModuleProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\",\"keccak256\":\"0x209228b56d42a8444ca70919e1ded5711fba434a746f26d426e230f57526fc6c\",\"license\":\"MIT\"},\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\n/// @title UUPS Proxy\\n/// @author Simon Malatrait <[email protected]>\\n/// @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n/// @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n/// @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n/// @dev Adapted from <https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.0/contracts/proxy/ERC1967/ERC1967Proxy.sol>\\ncontract UUPSProxy {\\n /// @dev Storage slot with the address of the current implementation.\\n /// This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n /// validated in the constructor.\\n /// NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n /// If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n /// function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Delegates the current call to `implementation`.\\n /// NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /// @dev Fallback function that delegates calls to the address returned by `_implementation()`.\\n /// @dev Will run if no other function in the contract matches the call data.\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xc3e0b18f846a62cc6c274680fc10014d1267885f8eefc6767292d3e174a081c0\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b5060405161030238038061030283398101604081905261002f91610151565b8181817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010e576000826001600160a01b031682604051610077919061021f565b600060405180830381855af49150503d80600081146100b2576040519150601f19603f3d011682016040523d82523d6000602084013e6100b7565b606091505b505090508061010c5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050505061023b565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610148578181015183820152602001610130565b50506000910152565b6000806040838503121561016457600080fd5b82516001600160a01b038116811461017b57600080fd5b60208401519092506001600160401b038082111561019857600080fd5b818501915085601f8301126101ac57600080fd5b8151818111156101be576101be610117565b604051601f8201601f19908116603f011681019083821181831017156101e6576101e6610117565b816040528281528860208487010111156101ff57600080fd5b61021083602083016020880161012d565b80955050505050509250929050565b6000825161023181846020870161012d565b9190910192915050565b60b9806102496000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea264697066735822122031995e44df4f8c0f7e14fc8c92fe3e63c4fcc994a0505b92eecf1c3a7b742d8964736f6c63430008180033",
"deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea264697066735822122031995e44df4f8c0f7e14fc8c92fe3e63c4fcc994a0505b92eecf1c3a7b742d8964736f6c63430008180033",
"execute": {
"methodName": "initialize",
"args": [
"0xf1C7c037891525E360C59f708739Ac09A7670c59",
"0x0000000000000000000000000000000000000000"
]
"methodName": "initialize4",
"args": []
},
"implementation": "0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24",
"implementation": "0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a",
"devdoc": {
// File: contracts/deployments/arbitrumSepoliaDevnet.ts
export const disputeKitClassicDeployment = {
// … other fields …
address: "0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a",
// … other fields …
};
Suggested change
"numDeployments": 3,
"solcInputHash": "96b8e3f55478438b6784f67c1730309e",
"metadata": "{\"compiler\":{\"version\":\"0.8.24+commit.e11b9ed9\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/KlerosProxies.sol\":\"DisputeKitClassicProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/KlerosProxies.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\nimport \\\"./UUPSProxy.sol\\\";\\n\\n/// Workaround to get meaningful names for the proxy contracts\\n/// Otherwise all the contracts are called `UUPSProxy` on the chain explorers\\n\\ncontract DisputeKitClassicNeoProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitClassicUniversityProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitClassicProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitGatedProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitShutterProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeKitSybilResistantProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract DisputeTemplateRegistryProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract EvidenceModuleProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract ForeignGatewayOnEthereumProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract HomeGatewayToEthereumProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreNeoProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreRulerProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreUniversityProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract KlerosCoreProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract PolicyRegistryProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract RandomizerRNGProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract SortitionModuleNeoProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract SortitionModuleUniversityProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\\ncontract SortitionModuleProxy is UUPSProxy {\\n constructor(address _implementation, bytes memory _data) UUPSProxy(_implementation, _data) {}\\n}\\n\",\"keccak256\":\"0x209228b56d42a8444ca70919e1ded5711fba434a746f26d426e230f57526fc6c\",\"license\":\"MIT\"},\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\n/// @title UUPS Proxy\\n/// @author Simon Malatrait <[email protected]>\\n/// @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n/// @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n/// @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n/// @dev Adapted from <https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.0/contracts/proxy/ERC1967/ERC1967Proxy.sol>\\ncontract UUPSProxy {\\n /// @dev Storage slot with the address of the current implementation.\\n /// This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n /// validated in the constructor.\\n /// NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n /// If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n /// function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Delegates the current call to `implementation`.\\n /// NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /// @dev Fallback function that delegates calls to the address returned by `_implementation()`.\\n /// @dev Will run if no other function in the contract matches the call data.\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xc3e0b18f846a62cc6c274680fc10014d1267885f8eefc6767292d3e174a081c0\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b5060405161030238038061030283398101604081905261002f91610151565b8181817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010e576000826001600160a01b031682604051610077919061021f565b600060405180830381855af49150503d80600081146100b2576040519150601f19603f3d011682016040523d82523d6000602084013e6100b7565b606091505b505090508061010c5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050505061023b565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610148578181015183820152602001610130565b50506000910152565b6000806040838503121561016457600080fd5b82516001600160a01b038116811461017b57600080fd5b60208401519092506001600160401b038082111561019857600080fd5b818501915085601f8301126101ac57600080fd5b8151818111156101be576101be610117565b604051601f8201601f19908116603f011681019083821181831017156101e6576101e6610117565b816040528281528860208487010111156101ff57600080fd5b61021083602083016020880161012d565b80955050505050509250929050565b6000825161023181846020870161012d565b9190910192915050565b60b9806102496000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea264697066735822122031995e44df4f8c0f7e14fc8c92fe3e63c4fcc994a0505b92eecf1c3a7b742d8964736f6c63430008180033",
"deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea264697066735822122031995e44df4f8c0f7e14fc8c92fe3e63c4fcc994a0505b92eecf1c3a7b742d8964736f6c63430008180033",
"execute": {
"methodName": "initialize",
"args": [
"0xf1C7c037891525E360C59f708739Ac09A7670c59",
"0x0000000000000000000000000000000000000000"
]
"methodName": "initialize4",
"args": []
},
"implementation": "0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24",
"implementation": "0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a",
"devdoc": {
// File: contracts/deployments/devnet.viem.ts
/**
* __View Contract on Arbitrum Sepolia Arbiscan__
* https://sepolia.arbiscan.io/address/0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a
*/
export const disputeKitClassicImplementationAddress = {
421614: "0x0B3E35C1b5E1C33b3A8722F3B697dF8ff8c1068a",
};

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: 3

♻️ Duplicate comments (2)
subgraph/core-neo/subgraph.template.yaml (2)

46-49: Same “duplicate event name” issue as in the core manifest
See previous comment in subgraph/core/subgraph.template.yaml.
The advice applies identically here.


119-153: Repeated Classic/Shutter mapping duplication
Same DRY concern and template suggestion as raised for the core
manifest.

🧹 Nitpick comments (8)
subgraph/core/src/entities/ClassicContribution.ts (1)

1-1: Added necessary entity imports

The import statement now includes additional entities needed for the dynamic dispute kit ID resolution.

Note: The DisputeKit entity is imported but not used in the function. Consider removing this unused import.

-import { ClassicContribution, Dispute, DisputeKit, Round } from "../../generated/schema";
+import { ClassicContribution, Dispute, Round } from "../../generated/schema";
subgraph/scripts/update.sh (2)

13-13: Fix potential shell script issues.

There are some bash scripting practices that could be improved.

-    local contractName=$(basename $(yq '.dataSources['$dataSourceIndex'].mapping.abis[] | select(.name == "'$dataSourceName'") | .file' "$subgraphConfig") .json)
+    local contractName
+    contractName=$(basename "$(yq '.dataSources['$dataSourceIndex'].mapping.abis[] | select(.name == "'$dataSourceName'") | .file' "$subgraphConfig")" .json)

This change:

  1. Separates declaration and assignment to prevent masking return values
  2. Adds proper quotes to prevent word splitting
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 13-13: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 13-13: Quote this to prevent word splitting.

(SC2046)


79-79: Fix array assignment in bash.

The current array assignment could lead to word splitting issues.

-        notDeployedSourceIndices+=($i)
+        notDeployedSourceIndices+=("$i")

This change adds quotes to prevent word splitting and ensure reliable array handling.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 79-79: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)

subgraph/core/subgraph.template.yaml (1)

123-160: Large copy-paste blocks hint that a data-source template could DRY this file

DisputeKitClassic and DisputeKitShutter share the exact mapping
definition apart from the ABI name. Consider replacing both with a
single datasource template and spawning instances programmatically
during handleDisputeKitCreated.
Benefits: one source of truth, easier maintenance when events change.

subgraph/core/src/DisputeKitClassic.ts (2)

29-33: Potential off-by-one when computing newRoundIndex

getNumberOfRounds returns 1 immediately after dispute creation in
Kleros Core, but if that ever changes (e.g. returns 0) subtracting ONE
will yield a negative BigInt and crash the handler.

Safeguard the subtraction:

let totalRounds = klerosCore.getNumberOfRounds(event.params._coreDisputeID);
if (totalRounds.equals(BigInt.zero())) {
  totalRounds = ONE; // fallback for safety
}
const newRoundIndex = totalRounds.minus(ONE);

42-48: String interpolation might leak formatting issues

Building IDs with template literals assumes disputeKitID is printable
without loss. For stricter typing (and less accidental whitespace) do:

const classicDisputeID = disputeKitID.toString().concat("-").concat(coreDisputeID);

Minor, but helps avoid hard-to-spot string-conversion bugs.

subgraph/core-university/subgraph.template.yaml (2)

4-5: Double-check fullTextSearch feature usage
Verify that schema.graphql defines the fields intended for full-text indexing, and confirm your Graph Node version supports the fullTextSearch feature.


9-13: Use consistent placeholder formatting
The network, address, and startBlock placeholders mix unquoted (_PLACEHOLDER_) and quoted ("_PLACEHOLDER_") styles. Standardizing to a templating convention (e.g., {{ NETWORK }}) will simplify automated replacements and reduce errors.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between ca14ada and 74625e1.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (17)
  • subgraph/core-neo/subgraph.template.yaml (1 hunks)
  • subgraph/core-neo/subgraph.yaml (1 hunks)
  • subgraph/core-university/subgraph.template.yaml (1 hunks)
  • subgraph/core-university/subgraph.yaml (3 hunks)
  • subgraph/core/src/DisputeKitClassic.ts (8 hunks)
  • subgraph/core/src/KlerosCore.ts (1 hunks)
  • subgraph/core/src/entities/ClassicContribution.ts (1 hunks)
  • subgraph/core/src/entities/ClassicDispute.ts (1 hunks)
  • subgraph/core/src/entities/ClassicRound.ts (2 hunks)
  • subgraph/core/src/utils.ts (1 hunks)
  • subgraph/core/subgraph.template.yaml (1 hunks)
  • subgraph/core/subgraph.yaml (2 hunks)
  • subgraph/dispute-template-registry/subgraph.template.yaml (1 hunks)
  • subgraph/dispute-template-registry/subgraph.yaml (1 hunks)
  • subgraph/package.json (1 hunks)
  • subgraph/scripts/all.sh (1 hunks)
  • subgraph/scripts/update.sh (3 hunks)
✅ Files skipped from review due to trivial changes (5)
  • subgraph/core/src/KlerosCore.ts
  • subgraph/core-neo/subgraph.yaml
  • subgraph/dispute-template-registry/subgraph.yaml
  • subgraph/package.json
  • subgraph/dispute-template-registry/subgraph.template.yaml
🧰 Additional context used
🪛 Biome (1.9.4)
subgraph/core/src/utils.ts

[error] 1-1: Do not shadow the global "BigInt" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

subgraph/core/src/entities/ClassicDispute.ts

[error] 1-1: Do not shadow the global "BigInt" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

🪛 Shellcheck (0.10.0)
subgraph/scripts/update.sh

[warning] 13-13: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 13-13: Quote this to prevent word splitting.

(SC2046)


[warning] 79-79: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Redirect rules - kleros-v2-testnet-devtools
  • GitHub Check: Header rules - kleros-v2-testnet-devtools
  • GitHub Check: Pages changed - kleros-v2-testnet-devtools
  • 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: Header rules - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
🔇 Additional comments (27)
subgraph/scripts/all.sh (1)

13-13: Expanded subgraph scope to include new subgraphs

The script now processes two additional subgraphs: core-neo and core-university. This change aligns with the introduction of the DisputeKitShutter contract and ensures that all necessary subgraphs are updated when running batch operations.

subgraph/core/src/utils.ts (2)

1-1: Added Bytes import to support new utility function

The import statement now includes Bytes alongside BigInt, which is required for the new utility function that processes byte data.

🧰 Tools
🪛 Biome (1.9.4)

[error] 1-1: Do not shadow the global "BigInt" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)


6-10: Well-implemented utility for extracting dispute kit IDs

This new utility function correctly extracts the dispute kit ID from extraData by:

  1. Getting the last 32 bytes
  2. Reversing them to convert from big-endian to little-endian
  3. Converting to a BigInt and returning the string representation

This function is essential for supporting multiple dispute kits dynamically, including the new DisputeKitShutter.

Regarding the static analysis warning about shadowing BigInt: This is a common pattern when working with TheGraph's library and doesn't cause issues in this context.

subgraph/core/src/entities/ClassicDispute.ts (3)

1-1: Updated import to directly use BigInt

The import now directly uses BigInt instead of the previously imported ZERO constant, which aligns with the function's updated parameters.

🧰 Tools
🪛 Biome (1.9.4)

[error] 1-1: Do not shadow the global "BigInt" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)


5-5: Enhanced function signature with dispute kit parameters

The function now accepts two additional parameters: disputeKitID (string) and roundIndex (BigInt). This makes the function more flexible and supports the multi-dispute-kit architecture.


7-9: Dynamic ID construction and round index initialization

The entity ID now uses the passed disputeKitID parameter for construction instead of a hardcoded value, and the currentLocalRoundIndex is set from the passed roundIndex parameter. These changes allow the function to work correctly with multiple dispute kits.

subgraph/core/src/entities/ClassicContribution.ts (2)

9-18: Added dynamic dispute kit ID resolution

This code correctly resolves the dispute kit ID by:

  1. Loading the core dispute entity
  2. Loading the corresponding round entity
  3. Extracting the dispute kit ID from the round

The function properly handles null cases by returning early if either entity is not found.


19-19: Updated round ID construction with dynamic dispute kit ID

The round ID is now constructed using the dynamically resolved dispute kit ID instead of a hardcoded value, enabling the function to work correctly with multiple dispute kits including the new DisputeKitShutter.

subgraph/core-university/subgraph.yaml (2)

68-70: Address and start block updated for PolicyRegistry.

The contract address was updated to 0x31d067405184d7FaA64b0834511cBcFAF32CdC4b and the start block to 141215158 for the PolicyRegistry data source, reflecting the new deployment referenced in the PR objectives for the Sepolia Arbitrum Devnet.


123-125: Address and start block updated for EvidenceModule.

The contract address was updated to 0x990f44d19a5F46889801B31bf58e0536fBECf27C and the start block to 141215177 for the EvidenceModule data source, ensuring the subgraph indexes events from the correct deployment on the Sepolia Arbitrum Devnet.

subgraph/core/subgraph.yaml (2)

124-161: Added DisputeKitShutter data source to the subgraph.

The new data source properly configures the subgraph to index events from the DisputeKitShutter contract, reusing the same event handlers, entities, and mappings as DisputeKitClassic. This ensures that the subgraph can properly track disputes using this new Shutter-based dispute kit.

The implementation follows best practices by:

  1. Maintaining consistency with existing data sources
  2. Using the same event handlers for similar events
  3. Setting the correct start block to avoid missing historical events

143-144: Check if the comment "Testing for Alchemy" should remain in production code.

The comment suggests this might be temporary for testing purposes.

Is this comment intended to remain in the production version of the subgraph manifest?

subgraph/core/src/entities/ClassicRound.ts (2)

6-12: Added support for dynamic dispute kit IDs.

The function signature was improved to accept a dispute kit ID parameter, making the code more flexible to accommodate multiple dispute kit types, including the new DisputeKitShutter.


74-85: Refactored to dynamically determine dispute kit ID.

Good enhancement that replaces hardcoded dispute kit IDs with dynamic lookups from the core entities. The code now properly:

  1. Fetches the core dispute and round entities
  2. Extracts the dispute kit ID from the round entity
  3. Uses proper early returns when entities aren't found

This change ensures the subgraph can correctly handle multiple dispute kit types, including the new DisputeKitShutter.

subgraph/scripts/update.sh (3)

5-21: Added function to check if a contract is deployed.

The new isContractDeployed function provides better error handling for the update process by verifying contract deployment before updating the subgraph configuration.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 13-13: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 13-13: Quote this to prevent word splitting.

(SC2046)


68-72: Improved initialization using template file.

The script now properly initializes from a template file, ensuring a clean starting point and preventing configuration drift between updates.


73-89: Added handling for undeployed contracts.

The script now identifies and removes data sources for contracts that aren't deployed, preventing subgraph errors and making the update process more robust.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 79-79: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)

subgraph/core/subgraph.template.yaml (1)

135-146: DisputeKitShutter data‐source still references Classic ABI

Your Shutter data-source lists both DisputeKitShutter and
DisputeKitClassic ABIs, the latter “required on Alchemy”.
If only the Shutter ABI is needed, drop the Classic reference; if both
are truly required document why, otherwise future maintainers may delete
it as “dead weight”.

subgraph/core-university/subgraph.template.yaml (9)

1-6: Confirm Graph manifest version and placeholder defaults
You've specified specVersion: 0.0.5 with placeholders for the schema and features. Ensure this aligns with your core and core-neo manifests, and that your deployment tooling correctly replaces these values.


14-17: Mapping header configuration
kind: ethereum/events, apiVersion: 0.0.7, and language: wasm/assemblyscript look correct and consistent with your other subgraphs.


18-29: Entities declaration in KlerosCore mapping
The entities (User, Arbitrable, TokenAndETHShift, JurorTokensPerCourt, Court, Dispute, Round, Draw, DisputeKit, Counter) align with the schema. No changes needed here.


63-82: PolicyRegistry mapping review
The PolicyRegistry dataSource is configured correctly with its ABI and handlePolicyUpdate handler.


118-138: EvidenceModule mapping review
The configuration for EvidenceModule is sound and matches your ABI and handler setup.


139-160: SortitionModule mapping review
The SortitionModule block is correctly defined with its entities and event handlers.


83-117: 🛠️ Refactor suggestion

Inconsistent with PR objectives: missing DisputeKitShutter mapping
The PR introduces DisputeKitShutter, but this manifest only defines DisputeKitClassic. To index Shutter-specific events, add a new dataSources block for DisputeKitShutter (with ABI JSON, entities, and eventHandlers) mirroring the DisputeKitClassic section.

Likely an incorrect or invalid review comment.


36-62:

✅ Verification successful

Ensure all KlerosCore event handlers are implemented
This block lists handlers such as handleAppealDecision, handleCourtJump, and handleDisputeKitEnabled. Confirm each is exported in src/KlerosCore.ts.


🏁 Script executed:

rg -n "export function handle" subgraph/core-university/src/KlerosCore.ts

Length of output: 903


All KlerosCore event handlers are implemented
Verified that each handler listed in subgraph/core-university/subgraph.template.yaml has a corresponding export function handle… in src/KlerosCore.ts (e.g., handleAppealDecision, handleDisputeCreation, handleDraw, etc.). No missing handlers found.


30-35:

❓ Verification inconclusive

Verify ABI JSON file paths
Ensure these ABI files exist under contracts/deployments/<NETWORK>/ and include the latest Shutter changes (if applicable):

  • SortitionModuleUniversity.json
  • DisputeKitClassicUniversity.json
  • KlerosCoreUniversity.json

🏁 Script executed:

#!/bin/bash
# Verify presence of deployment ABI files
for f in KlerosCoreUniversity.json DisputeKitClassicUniversity.json SortitionModuleUniversity.json PolicyRegistry.json EvidenceModule.json; do
  if [[ -z "$(fd -e json "$f" contracts/deployments)" ]]; then
    echo "::error file=subgraph/core-university/subgraph.template.yaml::$f not found"
  fi
done

Length of output: 1691


ABI JSON file presence confirmed
All required ABI files are present under contracts/deployments/arbitrumSepoliaDevnet/:

  • SortitionModuleUniversity.json
  • DisputeKitClassicUniversity.json
  • KlerosCoreUniversity.json

Please manually verify these ABIs include the latest Shutter changes and ensure they’re added under any other target network folders if needed.

Comment on lines +47 to +51
- event: CourtCreated(indexed uint96,indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256[])
handler: handleCourtCreated
# FIX: This is support for old signature
- event: CourtCreated(indexed uint256,indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256[])
handler: handleCourtCreated
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

Duplicate CourtCreated signatures may break code-generation

The same event name is declared twice with different parameter lists.
graph-cli treats the name as the unique identifier, so the second
occurrence silently overwrites the first when the manifest is compiled,
causing one of the handlers never to be executed.

47   - event: CourtCreated(indexed uint96,indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256[])
50   - event: CourtCreated(indexed uint256,indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256[])

If you need to index both historic and new signatures, create two
separate ABIs (or one ABI with both events but different names) and
map them to distinct handlers.

Comment on lines +34 to +37
- name: KlerosCore
# FIX: temporarily point to the abi with event addition.
file: ./abi-migrations/KlerosCore.json
eventHandlers:
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

Temporary “abi-migrations” paths risk deployment rot

Pointing to ./abi-migrations/* is useful during migration, but leaving
these references in the template means the generated manifest will point
to files that do not exist in the production build context, breaking
graph deploy.

Suggestion:

-        - name: KlerosCore
-          # FIX: temporarily point to the abi with event addition.
-          file: ./abi-migrations/KlerosCore.json
+        - name: KlerosCore
+          file: ../../contracts/deployments/_PLACEHOLDER_/KlerosCore.json

or keep the “migration” file but add a TODO to remove it after the
upgrade has fully propagated.

📝 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
- name: KlerosCore
# FIX: temporarily point to the abi with event addition.
file: ./abi-migrations/KlerosCore.json
eventHandlers:
- name: KlerosCore
file: ../../contracts/deployments/_PLACEHOLDER_/KlerosCore.json
eventHandlers:

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

♻️ Duplicate comments (1)
subgraph/core/subgraph.template.yaml (1)

49-53: Duplicate CourtCreated event definitions may cause silent handler overwrites.

The same event name CourtCreated is declared twice with different parameter lists, and graph-cli de-duplicates based on the event name. This causes one of the signatures to silently overwrite the other, so handlers for the old signature will never run.

Consider renaming one of the events (e.g., CourtCreatedV1) or splitting into two ABIs with distinct event names to ensure both signatures are indexed.

🧹 Nitpick comments (2)
subgraph/core/subgraph.template.yaml (1)

36-38: Temporary ABI migration path is non-production.

Pointing to ./abi-migrations/KlerosCore.json is intended only during migration. Leaving it in the template will break graph deploy once those files are removed.

Refactor to reference the placeholder deployment path directly:

- file: ./abi-migrations/KlerosCore.json
+ file: ../../contracts/deployments/_PLACEHOLDER_/KlerosCore.json
subgraph/core-neo/subgraph.template.yaml (1)

138-142: Temporary ABI migration reference may not match Neo deployment.

This block points to ./abi-migrations/KlerosCore.json. For Neo-specific migrations, consider renaming:

- file: ./abi-migrations/KlerosCore.json
+ file: ./abi-migrations/KlerosCoreNeo.json
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 142273c and 5989928.

📒 Files selected for processing (7)
  • subgraph/core-neo/subgraph.template.yaml (1 hunks)
  • subgraph/core-university/subgraph.template.yaml (1 hunks)
  • subgraph/core/subgraph.template.yaml (1 hunks)
  • subgraph/core/subgraph.yaml (2 hunks)
  • subgraph/dispute-template-registry/subgraph.template.yaml (1 hunks)
  • subgraph/dispute-template-registry/subgraph.yaml (1 hunks)
  • subgraph/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • subgraph/package.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • subgraph/dispute-template-registry/subgraph.yaml
  • subgraph/dispute-template-registry/subgraph.template.yaml
  • subgraph/core/subgraph.yaml
  • subgraph/core-university/subgraph.template.yaml
🔇 Additional comments (1)
subgraph/core-neo/subgraph.template.yaml (1)

48-50: Verify support for historic CourtCreated signatures.

Unlike the core template, this Neo manifest only indexes the new CourtCreated signature. If you must capture older events, add the legacy signature as well:

- event: CourtCreated(indexed uint96,indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256[])
  handler: handleCourtCreated

Comment on lines +137 to +162
- ClassicDispute
- ClassicRound
- ClassicVote
- ClassicContribution
abis:
- name: DisputeKitShutter
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitShutter.json
- name: DisputeKitClassic # Required on Alchemy
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitClassic.json
- name: KlerosCore
# FIX: temporarily point to abi with event addition
file: ./abi-migrations/KlerosCore.json
eventHandlers:
- event: DisputeCreation(indexed uint256,uint256,bytes)
handler: handleDisputeCreation
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleContributionEvent
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleWithdrawal
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
handler: handleChoiceFunded
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
handler: handleVoteCast
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
handler: handleCommitCast
file: ./src/DisputeKitClassic.ts
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

Incorrect mapping file for DisputeKitShutter data source.

The Shutter data source is still pointing at the Classic mapping implementation:

file: ./src/DisputeKitClassic.ts

This will apply the wrong handlers to Shutter events. You need a dedicated Shutter handler file.

Update the mapping path accordingly:

- file: ./src/DisputeKitClassic.ts
+ file: ./src/DisputeKitShutter.ts
🤖 Prompt for AI Agents
In subgraph/core/subgraph.template.yaml between lines 137 and 162, the
DisputeKitShutter data source incorrectly uses the Classic mapping file
(./src/DisputeKitClassic.ts), causing wrong event handlers to be applied. To fix
this, create or specify a dedicated mapping file for DisputeKitShutter (e.g.,
./src/DisputeKitShutter.ts) and update the file path under the DisputeKitShutter
data source accordingly.

Comment on lines +121 to +154
name: DisputeKitShutter
network: _PLACEHOLDER_
source:
address: "_PLACEHOLDER_"
abi: DisputeKitShutter
startBlock: _PLACEHOLDER_
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- ClassicDispute
- ClassicRound
- ClassicVote
- ClassicContribution
abis:
- name: DisputeKitShutter
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitShutter.json
- name: KlerosCore
# FIX: temporarily point to abi with event addition
file: ./abi-migrations/KlerosCore.json
eventHandlers:
- event: DisputeCreation(indexed uint256,uint256,bytes)
handler: handleDisputeCreation
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleContributionEvent
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleWithdrawal
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
handler: handleChoiceFunded
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
handler: handleVoteCast
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
handler: handleCommitCast
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

Incorrect mapping file for DisputeKitShutter in Neo template.

The Neo Shutter data source also reuses the Classic mapping:

file: ./src/DisputeKitClassic.ts

It should point to the Shutter handler:

- file: ./src/DisputeKitClassic.ts
+ file: ./src/DisputeKitShutter.ts
🤖 Prompt for AI Agents
In subgraph/core-neo/subgraph.template.yaml between lines 121 and 154, the
mapping for the DisputeKitShutter data source incorrectly uses the Classic
mapping file. Update the mapping file reference to point to the Shutter handler
by changing the file path to ./src/DisputeKitShutter.ts instead of the Classic
mapping file.

Copy link

codeclimate bot commented May 20, 2025

Code Climate has analyzed commit df98319 and detected 13 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2
Style 11

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: Bots Court bots Package: Contracts Court smart contracts Package: Subgraph Court subgraph Package: Web Court web frontend Type: Feature🗿
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-Reveal via Shutter Network
2 participants