Skip to content
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

Renamed DisputeRequest._arbitrableDisputeID into _arbitratorDisputeID #1711

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Oct 14, 2024

The DisputeResolvers have been redeployed.

The subgraphs are not impacted because the DisputeRequest event is not indexed, the frontends are querying it directly from the logs.

Summary by CodeRabbit

  • New Features

    • Updated deployment addresses for key smart contracts across various networks, enhancing clarity and accessibility for users.
  • Bug Fixes

    • Renamed parameters in events and functions to improve consistency and understanding, particularly changing _arbitrableDisputeID to _arbitratorDisputeID.
  • Documentation

    • Updated README files and metadata sections to reflect new contract addresses and changes in the Solidity compiler version.
  • Chores

    • Incremented deployment counts and updated implementation addresses in the DisputeTemplateRegistry.

PR-Codex overview

This PR focuses on renaming variables and updating related references for clarity in the context of dispute handling within the arbitration system.

Detailed summary

  • Renamed _arbitrableDisputeID to _arbitratorDisputeID in multiple files.
  • Updated function parameters and event arguments accordingly.
  • Changed UI references in page.tsx for consistency.
  • Modified Solidity event documentation to reflect new naming.
  • Updated deployment JSON files for new implementation addresses.

The following files were skipped due to too many changes: contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json, contracts/deployments/arbitrum/DisputeResolverNeo.json, contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverNeo.json, contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json, contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json, contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverRuler.json, contracts/deployments/arbitrumSepoliaDevnet/ArbitrableExample.json

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

Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

Walkthrough

The pull request includes significant updates across several smart contract files and related documentation. Key changes involve updating contract addresses for various dispute-related contracts, renaming parameters from _arbitrableDisputeID to _arbitratorDisputeID, and modifying transaction details such as hashes and block numbers. Additionally, the Solidity compiler version has been upgraded across multiple files, reflecting changes in metadata and ABI structures. These updates enhance clarity and ensure alignment with the latest deployment configurations.

Changes

File Path Change Summary
contracts/README.md Updated deployment addresses for DisputeResolverNeo, DisputeResolver, DisputeTemplateRegistry, and ArbitrableExample.
contracts/deployments/arbitrum/DisputeResolverNeo.json Updated contract address, transaction hash, block number, and ABI parameter name from _arbitrableDisputeID to _arbitratorDisputeID. Updated compiler version from 0.8.18 to 0.8.24.
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json Updated contract address, transaction hash, and renamed parameters in ABI from _arbitrableDisputeID to _arbitratorDisputeID. Updated compiler version from 0.8.18 to 0.8.24.
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverNeo.json Updated contract address, transaction hash, and renamed parameters in ABI from _arbitrableDisputeID to _arbitratorDisputeID. Updated compiler version from 0.8.18 to 0.8.24.
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverRuler.json Updated contract address, transaction hash, and renamed parameters in ABI from _arbitrableDisputeID to _arbitratorDisputeID. Updated gas usage metrics and compiler version from 0.8.18 to 0.8.24.
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json Updated contract address, transaction hash, and renamed parameters in ABI from _arbitrableDisputeID to _arbitratorDisputeID. Updated compiler version from 0.8.18 to 0.8.24.
contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json Updated implementation address and incremented numDeployments from 1 to 2.
contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json Updated contract address, transaction hash, incremented numDeployments from 1 to 2, and updated compiler version from 0.8.18 to 0.8.24.
contracts/src/arbitration/interfaces/IArbitrableV2.sol Renamed parameters in DisputeRequest and Ruling events from _arbitrableDisputeID to _arbitratorDisputeID.
contracts/test/evidence/index.ts Renamed variable in the Moderation section from arbitrableDisputeID to arbitratorDisputeID.
web-devtools/src/app/(main)/dispute-template/page.tsx Renamed parameter in params state object from _arbitrableDisputeID to _arbitratorDisputeID.
web/src/hooks/queries/useEvidenceGroup.ts Renamed parameter in createEventFilter method from _arbitrableDisputeID to _arbitratorDisputeID.
web/src/hooks/queries/usePopulatedDisputeData.ts Renamed parameter in getTemplateId function from _arbitrableDisputeID to _arbitratorDisputeID.

Suggested labels

Type: Maintenance :construction:, Package: Web

Suggested reviewers

  • alcercu
  • kemuru
  • Harman-singh-waraich

Poem

🐰 In the land of code where disputes arise,
New names for IDs, oh what a surprise!
From arbitrable to arbitrator, we cheer,
Clearer paths for contracts, let’s give a big cheer!
With addresses updated, our work is well done,
In the world of blockchain, we’ve just begun! 🌟


🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

Copy link

netlify bot commented Oct 14, 2024

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

Name Link
🔨 Latest commit 20e0d67
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-testnet-devtools/deploys/670e9974f3276c0008218fa0
😎 Deploy Preview https://deploy-preview-1711--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 site configuration.

Copy link

netlify bot commented Oct 14, 2024

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

Name Link
🔨 Latest commit 20e0d67
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-university/deploys/670e9974e4c50800085f1ae4

Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit 20e0d67
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-testnet/deploys/670e9974c349390008cb72a4
😎 Deploy Preview https://deploy-preview-1711--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 site configuration.

Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 20e0d67
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-neo/deploys/670e9974a05673000885fcff
😎 Deploy Preview https://deploy-preview-1711--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 site 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

🧹 Outside diff range and nitpick comments (7)
web-devtools/src/app/(main)/dispute-template/page.tsx (1)

244-248: LGTM: Form input updated correctly

The form input for the dispute ID has been correctly updated to use "arbitratorDisputeID" instead of "arbitrableDisputeID". This change is consistent with the PR objective and the previous modifications.

For consistency, consider updating the placeholder text to reflect the new parameter name:

  <Field
    type="text"
    name="_arbitratorDisputeID"
    value={params._arbitratorDisputeID?.toString()}
    onChange={handleFormUpdate}
-   placeholder="0"
+   placeholder="Arbitrator Dispute ID"
  />
contracts/test/evidence/index.ts (1)

262-267: LGTM! Consider updating the comment for clarity.

The change from _arbitrableDisputeID to _arbitratorDisputeID is correct and aligns with the PR objective. The test logic remains intact, and the expectation check is still valid.

Consider updating the comment on line 267 to reflect the new variable name:

-      expect(_arbitratorDisputeID).to.equal(0, "Wrong dispute ID.");
+      expect(_arbitratorDisputeID).to.equal(0, "Wrong arbitrator dispute ID.");

This change would make the comment more specific and consistent with the new variable name.

contracts/deployments/arbitrum/DisputeResolverNeo.json (3)

2-2: Contract redeployed with significant changes

The contract has been redeployed with the following key changes:

  1. New contract address: 0xE4066AE16685F66e30fb22e932B67E49220095c0
  2. New transaction hash: 0xfd8525e390d4cc185b331f3f9e9cdd98a5a9e89870452416d553106a4f496537
  3. New block number: 263830661
  4. Significantly reduced gas usage: from 16675612 to 2719796

These changes indicate a new deployment of the contract, possibly with optimizations or changes in the Arbitrum network's gas pricing. The substantial reduction in gas usage (about 83%) is particularly noteworthy and may result in lower transaction costs for users interacting with this contract.

Consider documenting the reasons for redeployment and the optimizations made to achieve such a significant gas reduction. This information could be valuable for future maintenance and upgrades.

Also applies to: 295-307


32-32: Improved naming in DisputeRequest event

The parameter name in the DisputeRequest event has been updated:

  • Old: _arbitrableDisputeID
  • New: _arbitratorDisputeID

This change provides a more accurate description of the dispute ID, clarifying that it's associated with the arbitrator rather than the arbitrable contract. This improvement in naming convention enhances the clarity and maintainability of the code.

Ensure that all related documentation and any external systems interacting with this event are updated to reflect this change in parameter name.


Line range hint 397-518: Storage layout updated with improved type definitions

The storage layout has been updated with the following key changes:

  1. New astId values for all storage variables.
  2. More specific type definitions for arbitrator and templateRegistry:
    • arbitrator: Now uses t_contract(IArbitratorV2)20599 instead of a generic address type.
    • templateRegistry: Now uses t_contract(IDisputeTemplateRegistry)20770 instead of a generic address type.

These changes reflect updates in the contract's structure and type definitions. The use of more specific contract interfaces for arbitrator and templateRegistry suggests improved type safety and potentially better integration with these external contracts.

The use of specific interface types for external contracts is a good practice. It provides better type checking at compile-time and makes the contract's dependencies more explicit. Consider applying this pattern consistently across all external contract interactions in the project.

contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json (1)

295-295: Transaction details updated

The contract redeployment has resulted in new transaction details:

  • New transaction hash: 0x89b84676899eef39b48e254c58b79c65ac4f7e32b81f92e1a86bc4dcabf488b6
  • New contract address: 0xAE92948F5534A6ABCC7ea16a5Cd1984cD305Aa6E
  • Updated gas used: 892639
  • New block hash and number

Ensure that any project documentation or logs referencing the old transaction details are updated.

Also applies to: 299-299, 301-301, 303-304, 306-307

contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json (1)

Line range hint 1-513: Overall assessment: Positive improvements with verification needed

The changes to the DisputeResolverUniversity contract deployment are generally positive:

  1. Improved gas efficiency (69% reduction in gas usage).
  2. Enhanced clarity through parameter renaming.
  3. Updated to the latest Solidity compiler version (0.8.24).

These improvements should lead to better performance and maintainability. However, due to the nature of these changes, it's crucial to:

  1. Update any external integrations that may be affected by the parameter renaming.
  2. Conduct thorough testing to ensure the new compiler version doesn't introduce unexpected behavior.
  3. Verify that the storage layout changes don't impact any planned upgrades or external interactions.

Consider implementing a comprehensive test suite that covers all contract functionalities, especially focusing on the renamed parameters and any new features introduced by the compiler update. This will help ensure the contract's reliability and catch any potential issues early.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between bf3c630 and 26eb85a.

📒 Files selected for processing (15)
  • contracts/README.md (2 hunks)
  • contracts/deployments/arbitrum/DisputeResolverNeo.json (8 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json (10 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverNeo.json (8 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverRuler.json (7 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json (10 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json (2 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json (4 hunks)
  • contracts/src/arbitration/interfaces/IArbitrableV2.sol (1 hunks)
  • contracts/test/evidence/index.ts (1 hunks)
  • subgraph/package.json (4 hunks)
  • web-devtools/src/app/(main)/dispute-template/page.tsx (2 hunks)
  • web/src/hooks/queries/useEvidenceGroup.ts (1 hunks)
  • web/src/hooks/queries/usePopulatedDisputeData.ts (1 hunks)
  • web/src/pages/DisputeTemplateView/index.tsx (2 hunks)
🧰 Additional context used
📓 Learnings (1)
web/src/hooks/queries/usePopulatedDisputeData.ts (1)
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: web/src/hooks/queries/usePopulatedDisputeData.ts:58-61
Timestamp: 2024-10-14T13:58:25.708Z
Learning: In `web/src/hooks/queries/usePopulatedDisputeData.ts`, the query and subsequent logic only execute when `disputeData.dispute?.arbitrableChainId` and `disputeData.dispute?.externalDisputeId` are defined, so `initialContext` properties based on these values are safe to use without additional null checks.
🔇 Additional comments (37)
contracts/src/arbitration/interfaces/IArbitrableV2.sol (2)

15-15: Approved: Improved clarity in DisputeRequest event documentation

The change from '_arbitrableDisputeID' to '_arbitratorDisputeID' in the event documentation is correct and aligns with the PR objective. This modification enhances clarity by specifying that the identifier pertains to the dispute in the Arbitrator contract, not the Arbitrable contract.


Line range hint 29-41: Verify: Clarifications in Ruling event and rule function

The AI summary mentions that the context has been clarified for both the Ruling event and the rule function, specifically regarding the _disputeID parameter. However, these changes are not visible in the provided code snippet. Please confirm if these clarifications have been made, possibly in comments or documentation not shown in this diff.

To check for these changes, please run the following script:

#!/bin/bash
# Description: Check for changes in Ruling event and rule function documentation

# Test: Look for changes in the Ruling event documentation
rg --type solidity -C 3 "event Ruling" contracts/src/arbitration/interfaces/IArbitrableV2.sol

# Test: Look for changes in the rule function documentation
rg --type solidity -C 3 "function rule" contracts/src/arbitration/interfaces/IArbitrableV2.sol
web/src/hooks/queries/usePopulatedDisputeData.ts (1)

104-104: LGTM! Consider checking for consistency across the codebase.

The change from _arbitrableDisputeID to _arbitratorDisputeID improves naming accuracy and aligns with the PR objectives. This modification clarifies that the dispute ID is assigned by the arbitrator rather than the arbitrable contract.

To ensure consistency, please verify if similar changes are needed elsewhere in the codebase. Run the following script to check for other occurrences of arbitrableDisputeID:

If you find any other occurrences, consider updating them for consistency across the project.

subgraph/package.json (1)

13-13: Consider the implications of changing command separators from && to ;

The changes in the clean scripts for various components (core, core-neo, core-university, and drt) involve replacing && with ; as the command separator. This modification alters the execution behavior:

  • With &&, the rm command would only run if the graph clean command succeeded.
  • With ;, the rm command will run regardless of whether the graph clean command succeeds or fails.

While this change ensures that the cleanup (rm) always occurs, it may lead to unexpected behavior if the graph clean command fails critically. Consider the following:

  1. Is this change intentional to ensure cleanup in all scenarios?
  2. Are there any potential risks in running the rm command if graph clean fails?
  3. Should error handling be added to check the status of graph clean before proceeding?

To ensure consistency, let's check if this change has been applied uniformly across all relevant scripts:

Please review the implications of this change and confirm if it aligns with the intended behavior for these cleanup scripts.

Also applies to: 26-26, 37-37, 49-49

web/src/pages/DisputeTemplateView/index.tsx (3)

171-171: LGTM: Correct renaming of dispute ID parameter

The change from _arbitrableDisputeID to _arbitratorDisputeID in the initialContext object is consistent with the PR objective and ensures that the correct dispute ID is used when fetching data.


230-234: LGTM: Consistent update of dispute ID input field

The changes to the input field for the dispute ID are consistent with the PR objective:

  1. The label has been updated from "arbitrableDisputeID" to "arbitratorDisputeID", improving clarity for users.
  2. The name and value attributes of the Field component have been correctly updated to use the new _arbitratorDisputeID parameter.

These changes ensure that the correct state variable is updated when the user interacts with this input field.


Line range hint 1-379: Summary: Consistent implementation of dispute ID renaming

After reviewing the entire file, I can confirm that the renaming from _arbitrableDisputeID to _arbitratorDisputeID has been applied consistently throughout the DisputeTemplateView component. The changes affect:

  1. The initialContext object in the scheduleFetchData function.
  2. The input field for the dispute ID, including its label, name, and value attributes.

These changes align with the PR objective and maintain the overall functionality of the component. No other parts of the code appear to be affected by this renaming.

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

184-184: LGTM: Consistent renaming of dispute ID parameter

The change from arbitrableDisputeID to arbitratorDisputeID in the initialContext object is correct and aligns with the PR objective. This ensures consistency throughout the codebase.


Line range hint 1-368: Summary: Consistent renaming of dispute ID parameter

The changes in this file correctly implement the renaming of _arbitrableDisputeID to _arbitratorDisputeID. The modifications are consistent and limited to the necessary areas:

  1. The initialContext object in the scheduleFetchData function.
  2. The form input label and field for the dispute ID.

These changes align with the PR objective and maintain the overall functionality of the component. No other parts of the code were affected, and the renaming has been applied consistently.

To ensure we haven't missed any instances, let's run a quick check:

If this search returns no results, we can be confident that the renaming has been completed thoroughly.

contracts/README.md (2)

14-14: LGTM. Verify the new DisputeResolverNeo address.

The update to the DisputeResolverNeo address is consistent with the expected changes. Please ensure that this new address has been properly deployed and is functioning as expected on the Arbitrum One network.

To verify the contract deployment, run the following script:


69-69: LGTM. Verify the new contract addresses for Devnet.

The updates to the ArbitrableExample address and the addition of new DisputeResolver variants are consistent with the expected changes. Please ensure that all these new addresses have been properly deployed and are functioning as expected on the Arbitrum Sepolia network.

To verify the contract deployments, run the following script:

Also applies to: 76-79

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

273-273: Deployment count incremented

The numDeployments field has been incremented from 1 to 2, indicating a new deployment of the contract. This is consistent with the update process.


Line range hint 273-284: Verify consistency with PR objectives

The PR title mentions renaming DisputeRequest._arbitrableDisputeID to _arbitratorDisputeID, but the changes in this file are related to contract deployment (new implementation address and increased deployment count). While these changes don't directly reflect the renaming, they could be a result of deploying a new version of the contract that includes the renamed parameter.

To ensure the renaming is reflected in the contract implementation, please run the following script:

#!/bin/bash
# Description: Verify the renaming of _arbitrableDisputeID to _arbitratorDisputeID

# Search for occurrences of both old and new parameter names
echo "Occurrences of _arbitrableDisputeID:"
rg --type solidity "_arbitrableDisputeID"

echo "Occurrences of _arbitratorDisputeID:"
rg --type solidity "_arbitratorDisputeID"

284-284: Implementation address updated

The implementation address has been changed from 0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6 to 0xE00A43d3c3321A0e210F2F8bE2F3F75eC8a4951E. This update is typical in a UUPS upgrade process and reflects the new contract implementation.

To ensure this change is consistent across the codebase, please run the following script:

✅ Verification successful

Implementation address updated consistently across the codebase

  • The new implementation address 0xE00A43d3c3321A0e210F2F8bE2F3F75eC8a4951E has been correctly updated in DisputeTemplateRegistry.json and related implementation files.
  • The old implementation address 0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6 appears only in expected proxy configuration files.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new implementation address is used consistently

# Search for the old and new implementation addresses
echo "Occurrences of old implementation address:"
rg --type json "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6"

echo "Occurrences of new implementation address:"
rg --type json "0xE00A43d3c3321A0e210F2F8bE2F3F75eC8a4951E"

Length of output: 410


Script:

#!/bin/bash
# Description: Verify the new implementation address is used consistently across JSON files

# Define the old and new implementation addresses
OLD_IMPLEMENTATION="0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6"
NEW_IMPLEMENTATION="0xE00A43d3c3321A0e210F2F8bE2F3F75eC8a4951E"

# Search for the old implementation address in JSON files
echo "Occurrences of old implementation address ($OLD_IMPLEMENTATION):"
rg --type json "$OLD_IMPLEMENTATION"

# Search for the new implementation address in JSON files
echo "Occurrences of new implementation address ($NEW_IMPLEMENTATION):"
rg --type json "$NEW_IMPLEMENTATION"

Length of output: 1465

contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json (5)

2-2: New contract deployment detected.

The contract address and transaction hash have been updated, indicating a new deployment of the DisputeTemplateRegistry contract. This is consistent with the implementation upgrade process.

Also applies to: 221-221


227-230: Updated deployment details.

The deployment details have been updated:

  • numDeployments increased to 2, indicating this is the second deployment.
  • gasUsed, blockHash, and blockNumber have been updated to reflect the new deployment transaction.

These changes are consistent with the new contract deployment observed earlier.

Also applies to: 245-246, 251-251


Line range hint 3-220: ABI updated with new functions.

The ABI has been updated to include new functions related to governance and template management, such as changeGovernor and templates. These changes are consistent with the new state variables.

Please ensure that these new functions are properly implemented with appropriate access control. Run the following script to check their implementation:

#!/bin/bash
# Description: Verify the implementation of new functions

# Test: Check for changeGovernor function implementation
echo "Checking changeGovernor implementation:"
ast-grep --lang solidity --pattern $'function changeGovernor($_) {
  $$$
}' src/arbitration/DisputeTemplateRegistry.sol

# Test: Check for templates function implementation
echo "Checking templates function implementation:"
ast-grep --lang solidity --pattern $'function templates() $$ {
  $$$
}' src/arbitration/DisputeTemplateRegistry.sol

253-253: Compiler version updated to 0.8.24.

The Solidity compiler version has been updated from 0.8.18 to 0.8.24. This update may include optimizations and bug fixes.

Please ensure that the contract behavior remains unchanged after the compiler update. Run the following script to check for any compiler warnings or errors:


Line range hint 371-387: New state variables added: governor and templates.

Two new state variables have been introduced:

  1. governor: Likely used for access control.
  2. templates: Probably used to keep track of the number of templates.

These additions suggest enhanced governance and template management functionality.

Please ensure that these new state variables are properly initialized and used throughout the contract. Run the following script to check their usage:

✅ Verification successful

Verification Successful

The governor and templates state variables are properly initialized and utilized within the DisputeTemplateRegistry.sol contract.

  • governor: Used for access control, ensuring only the governor can perform specific actions.
  • templates: Manages the count of dispute templates effectively.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of new state variables

# Test: Check for governor variable usage
echo "Checking governor usage:"
rg --type solidity "governor" src/arbitration/DisputeTemplateRegistry.sol

# Test: Check for templates variable usage
echo "Checking templates usage:"
rg --type solidity "templates" src/arbitration/DisputeTemplateRegistry.sol

Length of output: 657


Script:

#!/bin/bash
# Description: Verify the usage of new state variables without specifying file type

# Test: Check for governor variable usage
echo "Checking governor usage:"
rg "governor" src/arbitration/DisputeTemplateRegistry.sol

# Test: Check for templates variable usage
echo "Checking templates usage:"
rg "templates" src/arbitration/DisputeTemplateRegistry.sol

Length of output: 404


Script:

#!/bin/bash
# Description: Locate the DisputeTemplateRegistry.sol file in the codebase

fd "DisputeTemplateRegistry.sol"

Length of output: 152


Script:

#!/bin/bash
# Description: Verify the usage of new state variables in the correct file path

# Test: Check for governor variable usage
echo "Checking governor usage in DisputeTemplateRegistry.sol:"
rg "governor" contracts/src/arbitration/DisputeTemplateRegistry.sol

# Test: Check for templates variable usage
echo "Checking templates usage in DisputeTemplateRegistry.sol:"
rg "templates" contracts/src/arbitration/DisputeTemplateRegistry.sol

Length of output: 1097

contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverNeo.json (5)

2-2: Contract redeployed with new address and transaction details.

The contract has been redeployed with a new address (0x42776e45977C6C4e172e564102Ab01540555b368) and updated transaction details. This change is expected and reflects the latest deployment of the DisputeResolverNeo contract.

Also applies to: 295-307


32-32: Approved: Event parameter renamed for clarity.

The event parameter in the DisputeRequest event has been renamed from "_arbitrableDisputeID" to "_arbitratorDisputeID". This change improves clarity and accurately reflects the parameter's purpose.


318-319: Bytecode updated to reflect contract changes.

The bytecode and deployedBytecode have been updated, which is consistent with the modifications made to the contract. These changes are expected and reflect the new implementation.


Line range hint 397-513: Storage layout updated correctly.

The storage layout has been updated with new astId values while maintaining the overall structure. This change correctly reflects the updates made to the contract without introducing any breaking changes to the existing data structure.


317-317: Compiler version updated: Verify compatibility.

The Solidity compiler version has been updated from 0.8.18 to 0.8.24. While this update is generally positive, it's important to ensure that the new version doesn't introduce any breaking changes or unexpected behavior.

To verify the compatibility of the new compiler version, please run the following script:

contracts/deployments/arbitrum/DisputeResolverNeo.json (1)

317-317: Solidity compiler version updated

The Solidity compiler version has been updated:

  • Old version: 0.8.18+commit.87f61d96
  • New version: 0.8.24+commit.e11b9ed9

This update to a newer compiler version may introduce improvements in terms of bug fixes, optimizations, and new language features. However, it's crucial to ensure that the contract code is compatible with the new version and that any breaking changes have been addressed.

To ensure compatibility and identify any potential issues, run the following verification script:

✅ Verification successful

Adjusting Verification Script for Solidity Files

The previous verification script did not recognize the solidity file type. To accurately search Solidity files, we can target files with the .sol extension directly. Please run the following updated verification script to check for new Solidity 0.8.24 features and potential breaking changes:


Solidity Compiler Update Verified

The Solidity compiler has been successfully updated to version 0.8.24+commit.e11b9ed9.

  • New Features Used:
    • abi.encodeCall is utilized in the following files:
      • contracts/src/libraries/SafeERC20.sol
      • contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol

No potential breaking changes were detected in the codebase related to the compiler upgrade.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for breaking changes and new features between Solidity 0.8.18 and 0.8.24

# Test: Search for usage of new Solidity 0.8.24 features or syntax
echo "Checking for usage of new Solidity 0.8.24 features:"
rg --type solidity -e 'function\s+\w+\s*\(\s*\)\s*pure\s+virtual\s+override\s+returns' \
                   -e 'bytes.concat' \
                   -e 'abi.encodeCall'

# Test: Check for usage of features that might have changed behavior
echo "Checking for potential breaking changes:"
rg --type solidity -e 'selfdestruct' \
                   -e 'block\.difficulty' \
                   -e 'tx\.origin' \
                   -e 'msg\.sig'

echo "Review the output above for any potential issues related to the compiler upgrade."

Length of output: 655


Script:

#!/bin/bash
# Description: Check for breaking changes and new features between Solidity 0.8.18 and 0.8.24

# Find all Solidity files
SOL_FILES=$(fd --type f --extension sol)

# Test: Search for usage of new Solidity 0.8.24 features or syntax
echo "Checking for usage of new Solidity 0.8.24 features:"
echo "$SOL_FILES" | xargs rg -e 'function\s+\w+\s*\(\s*\)\s*pure\s+virtual\s+override\s+returns' \
                         -e 'bytes\.concat' \
                         -e 'abi\.encodeCall'

# Test: Check for usage of features that might have changed behavior
echo "Checking for potential breaking changes:"
echo "$SOL_FILES" | xargs rg -e 'selfdestruct' \
                         -e 'block\.difficulty' \
                         -e 'tx\.origin' \
                         -e 'msg\.sig'

echo "Review the output above for any potential issues related to the compiler upgrade."

Length of output: 11049

contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json (4)

397-397: ⚠️ Potential issue

Storage layout changes detected

Several changes have been made to the storage layout:

  1. astId values have been updated for multiple storage elements.
  2. The type for 'arbitrator' has changed to "t_contract(IArbitratorV2)20599".
  3. The type for 'templateRegistry' has changed to "t_contract(IDisputeTemplateRegistry)20770".

While astId changes are likely due to the compiler update, the contract type changes suggest possible updates in the IArbitratorV2 and IDisputeTemplateRegistry interfaces. Ensure that:

  1. The contract remains compatible with the updated interfaces.
  2. Any dependent contracts or scripts interacting with these storage variables are updated if necessary.
  3. The changes don't introduce any unexpected behavior in storage access or management.

Run the following script to check for any changes in the related interface contracts:

#!/bin/bash
# Check for changes in the IArbitratorV2 and IDisputeTemplateRegistry interfaces
rg --type-not json "interface IArbitratorV2|interface IDisputeTemplateRegistry" src/

Also applies to: 405-410, 413-418, 421-426, 429-433, 443-444, 459-462, 464-467, 476-477, 481-485, 489-493, 497-501, 505-509


316-317: ⚠️ Potential issue

Compiler version upgraded

The Solidity compiler version has been upgraded from 0.8.18 to 0.8.24. This update may include important bug fixes and optimizations. However, ensure that:

  1. The new compiler version doesn't introduce any breaking changes.
  2. The contract's behavior remains consistent after recompilation.
  3. All dependencies are compatible with the new compiler version.

The solc input hash has also been updated, which is expected with the compiler change.

Run the following script to check for any compiler warnings or errors:

#!/bin/bash
# Compile the contract with the new compiler version and check for warnings/errors
solc --version
solc src/arbitration/arbitrables/DisputeResolver.sol --allow-paths . --combined-json abi,bin

2-2: ⚠️ Potential issue

Contract address has changed

The DisputeResolver contract has been redeployed with a new address. Ensure that all references to the old address (0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6) are updated to the new address (0xAE92948F5534A6ABCC7ea16a5Cd1984cD305Aa6E) throughout the project.

Run the following script to check for any remaining references to the old address:

#!/bin/bash
# Search for the old contract address in the project files
rg --type-not json "0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6"

32-32: ⚠️ Potential issue

ABI changes: Parameter names updated

Two parameter names have been changed in the ABI:

  1. In the DisputeRequest event: _arbitrableDisputeID_arbitratorDisputeID
  2. In the rule function: _externalDisputeID_arbitratorDisputeID

These changes improve clarity but may break existing integrations. Ensure all contract interactions are updated accordingly.

Run the following script to check for usage of the old parameter names in the project:

Also applies to: 267-267

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

2-2: New contract deployment with improved gas efficiency

The contract has been redeployed with a new address: 0x9e8F92708705D3571F29589E441bF52c9e5f8811. Notable improvements include:

  1. Significant reduction in gas usage from 2,912,079 to 892,661, indicating potential code optimizations or changes in the Arbitrum Sepolia network.
  2. Updated transaction details (hash, block number, and block hash) reflecting the new deployment.

Also applies to: 295-307


Line range hint 397-513: Updated storage layout

The storage layout has been updated with new AST IDs. While the structure remains largely the same, these changes could potentially impact contract upgrades or external interactions.

To ensure the storage layout changes don't introduce any issues, please run the following verification:

#!/bin/bash
# Compare the old and new storage layouts
echo "Comparing storage layouts..."
rg --type json '"storageLayout"' -A 100 | diff - <(rg --type json '"storageLayout"' -A 100 contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json)

# Check for any storage-related warnings
echo "Checking for storage-related warnings..."
rg --type solidity 'storage|slot' -C 5 | rg 'warning|caution|note'

316-317: Solidity compiler version update

The Solidity compiler has been updated from version 0.8.18 to 0.8.24. This update may include important bug fixes, optimizations, and new features.

To ensure the update doesn't introduce any breaking changes, please run the following verification steps:

#!/bin/bash
# Check for any compiler warnings or errors
echo "Checking for compiler warnings or errors..."
rg --type solidity 'pragma solidity 0\.8\.24;' -C 10 | rg 'warning|error'

# Verify test coverage
echo "Verifying test coverage..."
rg --type solidity 'contract DisputeResolver' -A 5 | rg 'test|spec'
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverRuler.json (5)

295-295: Transaction details updated with potential gas optimization.

The contract redeployment shows the following changes:

  1. New transaction hash: 0x8ecdcbf2dd492716a233e2e71e9842bf62c8962b340d52dc4d0ad35fd1b9bb6c
  2. Decreased gas usage: from 1052517 to 894147
  3. New block number: 88690828

The reduction in gas usage could indicate optimizations in the contract code or changes in the network conditions.

Also applies to: 301-301, 306-307


32-32: ABI updated: DisputeRequest event parameter renamed.

The DisputeRequest event parameter has been renamed from _arbitrableDisputeID to _arbitratorDisputeID.

Please ensure that all contract interactions and event listeners using the DisputeRequest event are updated accordingly. Run the following script to check for any remaining references to the old parameter name:

#!/bin/bash
# Search for references to the old parameter name in the project
rg -i "_arbitrableDisputeID"

315-316: Metadata changes detected.

  1. numDeployments has changed from 2 to 1.
  2. solcInputHash has been updated to e0f719371c25ee6b430d9b7926bcf1db.

Please verify the following:

  1. The reason for resetting the deployment count.
  2. Any changes in the contract source code or compiler settings that led to the new solcInputHash.

Run the following script to check for recent changes in the contract source code:

#!/bin/bash
# Check for recent changes in the DisputeResolverRuler contract
git log -p -- src/arbitration/devtools/DisputeResolverRuler.sol

317-317: Solidity compiler version updated.

The Solidity compiler version has been updated from 0.8.18 to 0.8.24.

While updating the compiler version is generally good practice, please ensure:

  1. The contract code is compatible with the new version.
  2. No breaking changes affect the contract's behavior.
  3. Thorough testing has been performed with the new compiler version.

Run the following script to check for any compiler warnings or errors:

#!/bin/bash
# Compile the contract with the new compiler version and check for warnings/errors
solc --version
solc src/arbitration/devtools/DisputeResolverRuler.sol --allow-paths . --optimize --optimize-runs 200

2-2: Contract address has been updated.

The DisputeResolverRuler contract has been redeployed to a new address: 0x2F34E49853EaDB3253C9453aBeE37d3fbA395F6B.

Please ensure that all references to the old address (0xF1544a7B9DC6aBFAbBD58A2feF8Ee8fEDdBA5DBd) are updated throughout the project. Run the following script to check for any remaining references:

✅ Verification successful

Contract address update verified.

No references to the old address (0xF1544a7B9DC6aBFAbBD58A2feF8Ee8fEDdBA5DBd) were found in the project. All references have been successfully updated to the new address: 0x2F34E49853EaDB3253C9453aBeE37d3fbA395F6B.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the old contract address in the project
rg -i "0xF1544a7B9DC6aBFAbBD58A2feF8Ee8fEDdBA5DBd"

Length of output: 264


Script:

#!/bin/bash
# Search for the old contract address in the project
rg -i "0xF1544a7B9DC6aBFAbBD58A2feF8Ee8fEDdBA5DBd"

Length of output: 50

Copy link
Contributor

@Harman-singh-waraich Harman-singh-waraich left a comment

Choose a reason for hiding this comment

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

lgtm

kemuru
kemuru previously approved these changes Oct 15, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 15, 2024
@jaybuidl jaybuidl added this pull request to the merge queue Oct 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 15, 2024
alcercu
alcercu previously approved these changes Oct 15, 2024
Copy link
Contributor

@alcercu alcercu left a comment

Choose a reason for hiding this comment

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

lgtm

@jaybuidl jaybuidl force-pushed the fix/arbitrable-disputerequest-interface branch from 26eb85a to 20e0d67 Compare October 15, 2024 16:33
Copy link

codeclimate bot commented Oct 15, 2024

Code Climate has analyzed commit 20e0d67 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 3

View more on Code Climate.

Copy link

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

🧹 Outside diff range and nitpick comments (1)
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json (1)

2-2: New deployment with improved gas efficiency

The contract has been redeployed with a new address: 0x9e8F92708705D3571F29589E441bF52c9e5f8811. Notably, the gas usage for deployment has significantly decreased from 2,912,079 to 892,661, which is a substantial improvement in efficiency.

Consider documenting the reasons for this gas optimization in the project's changelog or documentation to help track improvements over time.

Also applies to: 295-307

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 26eb85a and 20e0d67.

📒 Files selected for processing (14)
  • contracts/README.md (2 hunks)
  • contracts/deployments/arbitrum/DisputeResolverNeo.json (8 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json (10 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverNeo.json (8 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverRuler.json (7 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json (10 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json (2 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json (4 hunks)
  • contracts/src/arbitration/interfaces/IArbitrableV2.sol (1 hunks)
  • contracts/test/evidence/index.ts (1 hunks)
  • subgraph/package.json (4 hunks)
  • web-devtools/src/app/(main)/dispute-template/page.tsx (2 hunks)
  • web/src/hooks/queries/useEvidenceGroup.ts (1 hunks)
  • web/src/hooks/queries/usePopulatedDisputeData.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json
  • contracts/src/arbitration/interfaces/IArbitrableV2.sol
  • contracts/test/evidence/index.ts
  • subgraph/package.json
  • web-devtools/src/app/(main)/dispute-template/page.tsx
  • web/src/hooks/queries/useEvidenceGroup.ts
  • web/src/hooks/queries/usePopulatedDisputeData.ts
🧰 Additional context used
🔇 Additional comments (24)
contracts/README.md (3)

14-14: Address update for DisputeResolverNeo on Arbitrum One looks good.

The address has been correctly updated from 0x95eCE455bD817D6adB92F2383617d36eBE10D6EB to 0xE4066AE16685F66e30fb22e932B67E49220095c0. This change is in line with the PR objectives.


69-69: Address updates and additions for Arbitrum Sepolia Devnet are correct.

The following changes have been made:

  1. ArbitrableExample address updated to 0x3Eae72F076c68F5c354C73abC33EAA291ef1b2Fa.
  2. New addresses added for:
    • DisputeResolver: 0xAE92948F5534A6ABCC7ea16a5Cd1984cD305Aa6E
    • DisputeResolverNeo: 0x42776e45977C6C4e172e564102Ab01540555b368
    • DisputeResolverRuler: 0x2F34E49853EaDB3253C9453aBeE37d3fbA395F6B
    • DisputeResolverUniversity: 0x9e8F92708705D3571F29589E441bF52c9e5f8811
  3. DisputeTemplateRegistry address updated to 0x596D3B09E684D62217682216e9b7a0De75933391.

These changes align with the PR objectives and reflect the latest deployment configurations.

Also applies to: 76-80


Line range hint 1-24: README updates accurately reflect the latest deployment configurations.

The changes in this file are limited to address updates and additions for various contracts across different networks, primarily in the Arbitrum One and Arbitrum Sepolia Devnet sections. These updates are consistent with the PR objectives and reflect the latest deployment configurations.

Key points:

  1. The DisputeResolverNeo address has been updated on Arbitrum One.
  2. Several addresses have been updated or added in the Arbitrum Sepolia Devnet section, including new addresses for different DisputeResolver variants.
  3. No changes were made to the deployment instructions or other parts of the README.

These updates ensure that developers and users have the most up-to-date contract addresses for interacting with the system.

Also applies to: 69-80

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

221-221: Deployment details updated

Several deployment details have been updated, including:

  • Transaction hash
  • Contract address
  • Gas used
  • Logs bloom
  • Block hash and number
  • Number of deployments incremented to 2

These changes are consistent with a new deployment of the contract.

Also applies to: 225-225, 227-230, 234-236, 242-242, 245-246, 251-252


371-379: Storage layout modified

The storage layout for the contract has been updated:

  • The governor variable's astId has changed from 2856 to 4384.
  • The templates variable's astId has changed from 2858 to 4387.
  • Both variables are now explicitly labeled with their types (t_address and t_uint256 respectively).

These changes are likely due to the compiler version update and possibly some modifications in the contract structure.

To verify that these storage layout changes don't introduce any compatibility issues with existing data, run the following script:

#!/bin/bash
# Search for storage layout dependencies in the codebase
echo "Searching for storage layout dependencies:"
rg --type solidity "governor" -C 2
rg --type solidity "templates" -C 2

Also applies to: 379-387


253-253: Compiler version updated

The Solidity compiler version has been updated from 0.8.18 to 0.8.24.

To ensure that this compiler version update is consistent across the project, run the following script:

#!/bin/bash
# Check for Solidity version specifications in the project
echo "Searching for Solidity version specifications:"
rg --type solidity "pragma solidity"
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverNeo.json (3)

2-2: Contract redeployment confirmed.

The contract has been successfully redeployed with a new address and updated transaction details. This aligns with the PR objectives of redeploying the DisputeResolvers.

Also applies to: 295-307


318-319: Bytecode updated due to contract changes and compiler update.

The bytecode and deployedBytecode have been modified, which is consistent with the changes made to the contract and the update in the compiler version.


397-397: Storage layout updated to reflect code changes.

The storage layout has been updated with new astId values and interface names. These changes are consistent with the compiler update and modifications to the contract interfaces.

Verify that the storage layout changes don't introduce any unexpected side effects:

Also applies to: 405-405, 413-413, 421-421, 429-429, 443-444, 459-459, 464-464, 476-476, 481-481, 489-489, 497-497, 505-505

✅ Verification successful

Storage layout changes verified and consistent.
The storage layouts across all DisputeResolver*.json files are consistent, with only astId values updated due to compiler or interface modifications. No unexpected side effects detected.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Compare storage layouts across different contract versions
echo "Comparing storage layouts:"
for file in $(find . -name "*DisputeResolver*.json"); do
  echo "File: $file"
  jq '.storageLayout.storage[] | {label: .label, type: .type}' "$file"
  echo "---"
done

Length of output: 6043

contracts/deployments/arbitrum/DisputeResolverNeo.json (4)

Line range hint 1-519: Summary of changes in DisputeResolverNeo.json

This review covered the following key changes:

  1. Updated contract address
  2. Renamed event parameter from _arbitrableDisputeID to _arbitratorDisputeID
  3. Updated transaction details with significantly reduced gas usage
  4. Updated Solidity compiler version

These changes are consistent with the PR objectives and indicate a successful redeployment of the DisputeResolverNeo contract with potential optimizations. Please ensure that all affected parts of the codebase have been updated to reflect these changes, especially the new contract address and event parameter name.


317-317: Compiler version updated

The Solidity compiler version has been updated from 0.8.18+commit.87f61d96 to 0.8.24+commit.e11b9ed9. This update may include bug fixes, optimizations, and new features.

To ensure the contract's compatibility with the new compiler version, run the following script:

#!/bin/bash
# Description: Check for potential compatibility issues with the new compiler version

# Test: Search for deprecated features or syntax that might be affected by the compiler update
echo "Searching for potential compatibility issues:"
rg -t sol "pragma solidity 0\.8\.(1[89]|2[0-3])" # Find files using older compiler versions
rg -t sol "(selfdestruct|block\.blockhash|tx\.origin)" # Search for deprecated or changed features

Additionally, please ensure that:

  1. The contract has been thoroughly tested with the new compiler version.
  2. Any new compiler warnings or errors have been addressed.
  3. The contract's behavior remains unchanged after the update.

32-32: Approved: Event parameter renamed in ABI

The parameter name in the DisputeRequest event has been changed from _arbitrableDisputeID to _arbitratorDisputeID. This change aligns with the PR objectives and improves the semantic clarity of the event.

To ensure this change is consistently applied throughout the codebase, run the following script:

#!/bin/bash
# Description: Verify the consistent use of the new parameter name

# Test: Search for occurrences of both old and new parameter names
echo "Searching for old parameter name (_arbitrableDisputeID):"
rg "_arbitrableDisputeID"
echo "Searching for new parameter name (_arbitratorDisputeID):"
rg "_arbitratorDisputeID"

295-295: Significant changes in deployment transaction details

The deployment transaction details have been updated:

  1. New transaction hash: 0xfd8525e390d4cc185b331f3f9e9cdd98a5a9e89870452416d553106a4f496537
  2. New block number: 263830661
  3. Gas used reduced from 16675612 to 2719796 (about 83.7% reduction)

The substantial decrease in gas usage suggests significant optimizations or changes in the contract's initialization process. This could lead to lower deployment costs and potentially indicate improved contract efficiency.

To verify the transaction details and gas usage, run the following script:

#!/bin/bash
# Description: Verify the new transaction details

# Test: Use Etherscan API to fetch transaction details
echo "Fetching transaction details from Etherscan API:"
curl -s "https://api.arbiscan.io/api?module=proxy&action=eth_getTransactionByHash&txhash=0xfd8525e390d4cc185b331f3f9e9cdd98a5a9e89870452416d553106a4f496537&apikey=YourApiKeyToken"

Also applies to: 300-301, 306-306

contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json (4)

295-295: Updated bytecode and deployment transaction

The contract's bytecode has been modified, reflecting the changes in its implementation. This has resulted in a new deployment transaction with the hash 0x89b84676899eef39b48e254c58b79c65ac4f7e32b81f92e1a86bc4dcabf488b6. Ensure that any systems relying on the contract's bytecode for verification purposes are updated accordingly.

Also applies to: 304-304


316-317: Compiler version updated to 0.8.24

The Solidity compiler version has been upgraded from 0.8.18 to 0.8.24. This update may introduce new features, optimizations, or bug fixes. Ensure that:

  1. All contracts in the project use a compatible compiler version.
  2. The changes introduced in the new compiler version do not negatively impact the contract's behavior.
  3. Any compiler-specific optimizations or features are reviewed for correctness.

The solcInputHash has also been updated to e0f719371c25ee6b430d9b7926bcf1db, which is expected due to the compiler change and contract modifications.

Run the following script to check for any inconsistencies in compiler versions across the project:

#!/bin/bash
# Check for different compiler versions in Solidity files
rg --type solidity "pragma solidity" | sort | uniq -c

397-397: Storage layout changes and type updates

Several changes have been made to the contract's storage layout:

  1. The astId values for storage elements have been updated, which is expected due to contract modifications and the compiler version update.
  2. The types for IArbitratorV2 and IDisputeTemplateRegistry have been updated, potentially indicating changes in these interfaces.

These changes may affect:

  • Contract upgrades if using upgradeable proxy patterns.
  • External contracts that directly access storage slots.
  • Tools that analyze or interact with the contract's storage layout.

Ensure that:

  1. If using upgradeable patterns, the storage layout changes are compatible and won't cause data corruption.
  2. Any external contracts or tools that depend on the storage layout are updated accordingly.
  3. The changes in interface types (IArbitratorV2 and IDisputeTemplateRegistry) are intentional and consistent with the rest of the system.

Run the following script to check for any references to the old interface versions:

#!/bin/bash
# Search for old interface names in project files
rg --type solidity "IArbitratorV1|IDisputeTemplateRegistry(?!V2)"

Also applies to: 405-410, 413-418, 421-426, 429-433, 443-444, 459-462, 464-467, 476-481, 489-493, 497-501, 505-509


32-32: ABI changes: Parameter renaming

Two important changes have been made to the contract's ABI:

  1. In the DisputeRequest event, _arbitrableDisputeID has been renamed to _arbitratorDisputeID.
  2. In the rule function, _externalDisputeID has been renamed to _arbitratorDisputeID.

These changes improve clarity and consistency but may require updates in any external contracts or scripts that interact with the DisputeResolver contract.

Run the following script to find potential places where the old parameter names are still used:

Also applies to: 267-267

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

318-319: Bytecode updated: Verify contract functionality

The contract's bytecode and deployedBytecode have been updated, which is expected due to the parameter renaming and potential optimizations.

To ensure that the new bytecode behaves as expected:

  1. Verify that all tests pass with the new deployment.
  2. Consider performing a dry-run of key contract interactions on a testnet to confirm functionality.

316-317: Compiler version updated: Verify compatibility

The Solidity compiler version has been updated from 0.8.18 to 0.8.24, which is a positive change for potential security improvements and new language features.

To ensure compatibility with the new compiler version:

  1. Review the changelog between versions 0.8.18 and 0.8.24 for any breaking changes or new features that might affect the contract's behavior.
  2. Run the contract through a static analysis tool like Slither with the new compiler version to catch any potential issues.

397-397: Storage layout updated: Verify tooling compatibility

The storage layout has been updated with new AST IDs, which is expected due to code changes and the compiler update. While this doesn't affect the contract's runtime behavior, it's important for tools interacting with the contract's storage.

To ensure compatibility with tools that rely on the storage layout:

  1. If using any storage layout dependent tools or scripts, test them against the new contract deployment.
  2. Verify that any off-chain services or frontends interacting with the contract's storage are updated if necessary.

Also applies to: 405-405, 413-413, 421-421, 429-429, 443-444, 459-459, 464-464, 476-476, 481-481, 489-489, 497-497, 505-505

contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverRuler.json (4)

295-295: Transaction details updated with new deployment.

The following changes have been made to the transaction details:

  1. New transaction hash: 0x8ecdcbf2dd492716a233e2e71e9842bf62c8962b340d52dc4d0ad35fd1b9bb6c
  2. Gas used decreased from 1052517 to 894147
  3. Block number updated to 88690828
  4. Cumulative gas used updated to 894147

The decrease in gas usage could indicate optimizations in the contract code. This is a positive change as it reduces transaction costs.

Also applies to: 301-301, 306-307


32-32: ABI updated: DisputeRequest event parameter renamed.

The DisputeRequest event parameter has been renamed from _arbitrableDisputeID to _arbitratorDisputeID. This change aligns with the PR objectives.

Please ensure that all code interacting with this event is updated accordingly. Run the following script to check for any remaining occurrences of the old parameter name:

#!/bin/bash
# Search for the old parameter name in the project files
rg -i "_arbitrableDisputeID"

315-317: Metadata updated with new deployment information.

The following changes have been made to the metadata:

  1. Number of deployments reset to 1
  2. Solc input hash updated to e0f719371c25ee6b430d9b7926bcf1db
  3. Compiler version explicitly set to 0.8.24+commit.e11b9ed9

These changes indicate a fresh deployment with possibly updated contract source or compiler settings. The explicit compiler version improves reproducibility.

To ensure consistency, please verify that the compiler version matches the one specified in your development environment:

#!/bin/bash
# Check the Solidity compiler version in the project
rg -i "pragma solidity" --type solidity

2-2: Contract address has been updated.

The DisputeResolverRuler contract has been redeployed to a new address: 0x2F34E49853EaDB3253C9453aBeE37d3fbA395F6B.

Please ensure that all references to the old address (0xF1544a7B9DC6aBFAbBD58A2feF8Ee8fEDdBA5DBd) are updated throughout the project. Run the following script to check for any remaining occurrences of the old address:

@@ -1,5 +1,5 @@
{
"address": "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6",
"address": "0xE00A43d3c3321A0e210F2F8bE2F3F75eC8a4951E",
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Old Contract Address Still Referenced in Multiple Files

The old contract address 0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6 is still referenced in several parts of the codebase:

  • contracts/deployments/devnet.viem.ts
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Proxy.json
  • contracts/deployments/arbitrumSepoliaDevnet.ts

Please update or remove these references to ensure consistency across the codebase.

🔗 Analysis chain

Contract address updated

The contract address has been changed from the previous deployment.

To verify that this new address is correctly referenced in other parts of the codebase, run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for references to the old and new contract addresses
echo "Searching for old address references:"
rg --type-not json "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6"
echo "Searching for new address references:"
rg --type-not json "0xE00A43d3c3321A0e210F2F8bE2F3F75eC8a4951E"

Length of output: 325


Script:

#!/bin/bash
# Search for references to the old and new contract addresses without type restrictions
echo "Searching for old address references:"
rg "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6"
echo "Searching for new address references:"
rg "0xE00A43d3c3321A0e210F2F8bE2F3F75eC8a4951E"

Length of output: 2054

@@ -29,7 +29,7 @@
{
"indexed": true,
"internalType": "uint256",
"name": "_arbitrableDisputeID",
"name": "_arbitratorDisputeID",
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

Breaking change in DisputeRequest event parameter.

The parameter _arbitrableDisputeID has been renamed to _arbitratorDisputeID in the DisputeRequest event. This change aligns with the PR objectives but may impact frontends or other contracts interacting with this event.

Ensure that all dependent systems (frontends, subgraphs, etc.) are updated to use the new parameter name _arbitratorDisputeID.

"bytecode": "0x608060405234801561001057600080fd5b50604051610ed5380380610ed583398101604081905261002f91610083565b600080546001600160a01b03199081163317909155600180546001600160a01b03948516908316179055600280549290931691161790556100bd565b6001600160a01b038116811461008057600080fd5b50565b6000806040838503121561009657600080fd5b82516100a18161006b565b60208401519092506100b28161006b565b809150509250929050565b610e09806100cc6000396000f3fe60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea2646970667358221220a06c81e91424fe76df69c3e72cd9c749e5c9c24c2bef1c69e870ee7aa89d346f64736f6c63430008120033",
"deployedBytecode": "0x60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea2646970667358221220a06c81e91424fe76df69c3e72cd9c749e5c9c24c2bef1c69e870ee7aa89d346f64736f6c63430008120033",
"solcInputHash": "e0f719371c25ee6b430d9b7926bcf1db",
"metadata": "{\"compiler\":{\"version\":\"0.8.24+commit.e11b9ed9\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitratorDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplate\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateDataMappings\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateUri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplateUri\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_arbitratorDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrator\":\"The arbitrator of the contract.\",\"_arbitratorDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDisputeForTemplate(bytes,string,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplate\":\"Dispute template.\",\"_disputeTemplateDataMappings\":\"The data mappings.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"createDisputeForTemplateUri(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_arbitratorDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\npragma solidity 0.8.24;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor.\\n IArbitratorV2 public arbitrator; // The arbitrator.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps arbitrator-side dispute IDs to local dispute IDs.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitratorV2 _arbitrator, IDisputeTemplateRegistry _templateRegistry) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplate Dispute template.\\n /// @param _disputeTemplateDataMappings The data mappings.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplate(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return\\n _createDispute(\\n _arbitratorExtraData,\\n _disputeTemplate,\\n _disputeTemplateDataMappings,\\n \\\"\\\",\\n _numberOfRulingOptions\\n );\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplateUri(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, \\\"\\\", \\\"\\\", _disputeTemplateUri, _numberOfRulingOptions);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _arbitratorDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _arbitratorDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = arbitratorDisputeIDToLocalID[_arbitratorDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _arbitratorDisputeID, dispute.ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n bytes calldata _arbitratorExtraData,\\n string memory _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n string memory _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) internal virtual returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n arbitratorDisputeIDToLocalID[disputeID] = localDisputeID;\\n uint256 templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _disputeTemplate, _disputeTemplateDataMappings);\\n emit DisputeRequest(arbitrator, localDisputeID, localDisputeID, templateId, _disputeTemplateUri);\\n }\\n}\\n\",\"keccak256\":\"0x48f3aa7fad24ef68821c57c5741189eb5c73bc9a915ee8df2073b1aa844423f2\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// @dev When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitratorDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitratorDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0xe841a4fe8ec109ce17dde4457bf1583c8b499109b05887c53a49a3207fc6e80b\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0xa4dc6b958197adead238de4246cd04e7389c3dc1b9f968acd10985f8fc5b74cf\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0xb46ff71c32a524a865fe8ca99d94c9daeb690bc9d7d49d963a45b06f60af19f3\",\"license\":\"MIT\"}},\"version\":1}",
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistent storage layouts detected across DisputeResolver deployments.

Different deployments show varying type identifiers for the arbitrator and disputes fields, which may lead to deployment issues or upgrade conflicts.

🔗 Analysis chain

Compiler version updated and documentation revised.

The Solidity compiler has been upgraded to version 0.8.24, and the documentation has been updated to reflect the parameter name change from _arbitrableDisputeID to _arbitratorDisputeID.

Verify that the compiler settings are consistent across all contracts in the project:

Also applies to: 326-326

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for consistent compiler version across all Solidity files
echo "Checking Solidity compiler versions:"
grep -r "pragma solidity" . --include="*.sol"

Length of output: 6043

@@ -1,5 +1,5 @@
{
"address": "0x95eCE455bD817D6adB92F2383617d36eBE10D6EB",
"address": "0xE4066AE16685F66e30fb22e932B67E49220095c0",
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Multiple References to Old Contract Address Detected

Several files still reference the old DisputeResolverNeo contract address 0x95eCE455bD817D6adB92F2383617d36eBE10D6EB. Please update these references to the new address 0xE4066AE16685F66e30fb22e932B67E49220095c0 to ensure consistency across the codebase:

  • contracts/deployments/mainnet.viem.ts
  • contracts/deployments/arbitrum.ts
🔗 Analysis chain

Contract address updated

The DisputeResolverNeo contract has been redeployed to a new address: 0xE4066AE16685F66e30fb22e932B67E49220095c0. This change is consistent with the PR objectives mentioning the redeployment of DisputeResolvers.

To verify the new contract address, run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new contract address across the codebase

# Test: Search for references to the old and new contract addresses
echo "Searching for old contract address:"
rg "0x95eCE455bD817D6adB92F2383617d36eBE10D6EB"
echo "Searching for new contract address:"
rg "0xE4066AE16685F66e30fb22e932B67E49220095c0"

Length of output: 264


Script:

#!/bin/bash
# Description: Verify the new contract address across the codebase without specifying file types

# Test: Search for references to the old and new contract addresses
echo "Searching for old contract address:"
rg "0x95eCE455bD817D6adB92F2383617d36eBE10D6EB"
echo "Searching for new contract address:"
rg "0xE4066AE16685F66e30fb22e932B67E49220095c0"

Length of output: 3660

@@ -1,5 +1,5 @@
{
"address": "0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6",
"address": "0xAE92948F5534A6ABCC7ea16a5Cd1984cD305Aa6E",
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Old contract address still referenced in project files

The old DisputeResolver contract address (0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6) is still referenced in the following files. Please update all occurrences to the new address (0xAE92948F5534A6ABCC7ea16a5Cd1984cD305Aa6E):

  • contracts/deployments/arbitrumSepoliaDevnet.ts
  • contracts/deployments/devnet.viem.ts
🔗 Analysis chain

Contract address has been updated

The DisputeResolver contract has been redeployed with a new address. Ensure that all references to the old address (0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6) are updated to the new address (0xAE92948F5534A6ABCC7ea16a5Cd1984cD305Aa6E) throughout the project.

Run the following script to check for any remaining references to the old address:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the old contract address in the project files
rg --type-not json "0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6"

Length of output: 777

@@ -29,7 +29,7 @@
{
"indexed": true,
"internalType": "uint256",
"name": "_arbitrableDisputeID",
"name": "_arbitratorDisputeID",
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Incomplete Parameter Renaming Detected

Several instances of the old parameter names _arbitrableDisputeID and _externalDisputeID are still present in the codebase. Please ensure that all occurrences are updated to _arbitratorDisputeID for consistency.

🔗 Analysis chain

Approved: Parameter renaming in ABI

The parameter renaming from _arbitrableDisputeID to _arbitratorDisputeID in the DisputeRequest event and from _externalDisputeID to _arbitratorDisputeID in the rule function aligns with the PR objectives and improves consistency.

To ensure these changes are consistently applied throughout the codebase, run the following script:

Also applies to: 267-267

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
echo "Searching for any remaining instances of old parameter names..."
rg -g "*.sol" '_arbitrableDisputeID|_externalDisputeID'

echo "Verifying new parameter names..."
rg -g "*.sol" '_arbitratorDisputeID'

Length of output: 3839

@jaybuidl jaybuidl merged commit 3a6d207 into dev Oct 15, 2024
22 of 28 checks passed
@jaybuidl jaybuidl deleted the fix/arbitrable-disputerequest-interface branch October 15, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants