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

Update Solc version from 0.8.18 to 0.8.24 #1567

Merged

Conversation

Anmol-Dhiman
Copy link
Contributor

@Anmol-Dhiman Anmol-Dhiman commented Apr 22, 2024

Need to change the sol version in node_modules -

  • @kleros/vea-contracts/src/interface/gateways/ISenderGateway.sol
  • @kleros/vea-contracts/src/interface/gateways/IReceiverGateway.sol
  • @kleros/vea-contracts/src/interface/inboxes/IVeaInbox.sol
  • @kleros/vea-contracts/src/interface/types/VeaClaim.sol

Test Result -
Screenshot 2024-04-22 at 5 05 59 PM

Issue #1510


PR-Codex overview

This PR updates the Solidity version to 0.8.24 and adjusts import paths for OpenZeppelin contracts and Kleros VeA contracts.

Detailed summary

  • Updated Solidity version to 0.8.24 in multiple files
  • Adjusted import paths for OpenZeppelin contracts
  • Updated import paths for Kleros VeA contracts

The following files were skipped due to too many changes: contracts/src/libraries/SortitionSumTreeFactory.sol, contracts/src/rng/BlockhashRNG.sol, contracts/src/arbitration/university/SortitionModuleUniversity.sol, contracts/src/rng/RandomizerRNG.sol, contracts/src/arbitration/KlerosCoreBase.sol, contracts/src/arbitration/university/KlerosCoreUniversity.sol, contracts/src/token/TestERC721.sol, contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol, contracts/src/arbitration/KlerosGovernor.sol, contracts/src/arbitration/CentralizedArbitrator.sol, contracts/src/gateway/ForeignGateway.sol, contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol, contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol, contracts/src/arbitration/SortitionModuleBase.sol, contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol, contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol, yarn.lock

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

Summary by CodeRabbit

  • New Features

    • Upgraded Solidity version to 0.8.24 across all contracts for enhanced security and new features.
    • Updated @openzeppelin/contracts to version ^5.0.2.
    • Updated @kleros/vea-contracts to version ^0.4.0.
  • Improvements

    • Improved import paths for clarity and organization.
  • Compatibility

    • Ensured all contracts are compatible with the latest Solidity version 0.8.24.

These changes enhance the overall security, readability, and maintainability of the codebase, ensuring compatibility with the latest Solidity features and improvements.

Copy link

netlify bot commented Apr 22, 2024

Deploy Preview for kleros-v2 ready!

Name Link
🔨 Latest commit 07a593b
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2/deploys/6660cb9dc8557600082b1d9a
😎 Deploy Preview https://deploy-preview-1567--kleros-v2.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 Apr 22, 2024

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 07a593b
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-neo/deploys/6660cb9d6db04d00083ad990
😎 Deploy Preview https://deploy-preview-1567--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

netlify bot commented Apr 22, 2024

Deploy Preview for kleros-v2-university ready!

Name Link
🔨 Latest commit 07a593b
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-university/deploys/6660cb9d6ab6c20008d4e2e4
😎 Deploy Preview https://deploy-preview-1567--kleros-v2-university.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.

@Anmol-Dhiman Anmol-Dhiman marked this pull request as ready for review April 22, 2024 11:55
Copy link
Contributor

coderabbitai bot commented May 17, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The updates primarily involve upgrading the Solidity version from 0.8.18 to 0.8.24 across various contracts, interfaces, and configuration files, ensuring compatibility with the latest Solidity features and improvements. Additionally, the package.json file has been modified to reflect newer versions of dependencies, specifically @openzeppelin/contracts and @kleros/vea-contracts.

Changes

Files/Paths Change Summary
contracts/package.json Upgraded @openzeppelin/contracts from ^4.9.5 to ^5.0.2 and @kleros/vea-contracts from ^0.3.2 to ^0.4.0.
contracts/src/gateway/interfaces/IForeignGateway.sol Updated Solidity version from 0.8.18 to 0.8.24 and modified import path for IReceiverGateway.
contracts/src/gateway/interfaces/IHomeGateway.sol Updated Solidity version from 0.8.18 to 0.8.24 and modified import path for ISenderGateway.
contracts/src/gateway/mock/VeaMock.sol Updated Solidity version from 0.8.18 to 0.8.24 and modified import paths for IVeaInbox and IVeaOutboxOnL1.

Possibly related issues

Possibly related PRs

  • Fix/stake simulator #1744: This PR is related as it updates the package.json file for the @kleros/kleros-v2-web project, which includes the integration of the @kleros/kleros-v2-contracts package, similar to the main PR's updates to the @kleros/kleros-v2-contracts dependencies.
  • chore: update-ui-components-lib #1802: This PR is related because it also involves updates to the package.json file, specifically for the @kleros/ui-components-library, which is relevant to the overall dependency management in the Kleros project.

Suggested labels

Type: Bug :bug:, Package: Web

Suggested reviewers

  • alcercu

"In the realm of code so bright,
Solidity marched to a higher height.
From 0.8.18 to .24,
Mappings clearer than before.
Contracts and interfaces, all aligned,
CodeRabbit's joy, truly defined!"


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d153ace and 07a593b.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • contracts/package.json (2 hunks)
  • contracts/src/gateway/interfaces/IForeignGateway.sol (1 hunks)
  • contracts/src/gateway/interfaces/IHomeGateway.sol (1 hunks)
  • contracts/src/gateway/mock/VeaMock.sol (1 hunks)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

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

Documentation and Community

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

@jaybuidl jaybuidl self-requested a review May 17, 2024 12:12
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Out of diff range and nitpick comments (3)
contracts/src/rng/BlockhashRNG.sol (1)

[!TIP]
Codebase Verification

The receiveRandomness function in BlockhashRNG.sol uses the blockhash function to retrieve the block hash for a given block number. If the block hash is not available (i.e., the block is older than 256 blocks), it falls back to using the previous block's hash. This fallback mechanism can introduce predictability issues if not handled correctly.

The search for known vulnerabilities related to blockhash usage did not yield any results, which means there are no documented vulnerabilities in the provided markdown files. However, the use of blockhash for randomness is generally discouraged due to its predictability and potential for manipulation by miners.

Recommendations:

  1. Avoid Using blockhash for Randomness: Consider using a more secure source of randomness, such as Chainlink VRF, which provides verifiable randomness.
  2. Fallback Mechanism: Ensure that the fallback mechanism does not introduce predictability. Using the previous block's hash can be predictable and should be avoided if possible.

Code Locations:

  • contracts/src/rng/BlockhashRNG.sol
    • function receiveRandomness(uint256 _block) external override returns (uint256 randomNumber)

Please review the implementation and consider using a more secure method for generating random numbers.

Analysis chain

Line range hint 15-33: Ensure the fallback mechanism in receiveRandomness does not introduce security vulnerabilities.


The search results indicate that the blockhash function is used in the BlockhashRNG.sol file, specifically within the receiveRandomness function. The fallback mechanism uses the previous blockhash if the current blockhash is not available. This approach can introduce predictability issues if not handled correctly.

To ensure the fallback mechanism does not introduce security vulnerabilities, we need to verify the implementation details and check for any known vulnerabilities related to blockhash usage in Solidity.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for any known vulnerabilities or issues related to blockhash usage as a fallback in Solidity 0.8.24.

# Test: Search for known vulnerabilities related to blockhash usage.
rg --type markdown 'blockhash usage vulnerabilities' ./security-reports/

Length of output: 134



Script:

#!/bin/bash
# Description: Search for the usage of `blockhash` in the codebase and check for any related vulnerabilities.

# Find all occurrences of `blockhash` in the codebase.
rg 'blockhash' .

# Check for known vulnerabilities related to `blockhash` usage in Solidity.
rg --type markdown 'blockhash vulnerabilities' .

Length of output: 110631



Script:

#!/bin/bash
# Description: Analyze the `receiveRandomness` function in `BlockhashRNG.sol` for security vulnerabilities related to `blockhash` usage.

# Extract the `receiveRandomness` function implementation.
ast-grep --lang solidity --pattern $'function receiveRandomness(uint256 _block) external override returns (uint256 randomNumber) {
  $$$
}' .

# Check for known vulnerabilities related to `blockhash` usage in Solidity.
rg --type markdown 'blockhash vulnerabilities' .

Length of output: 310



Script:

#!/bin/bash
# Description: Analyze the `receiveRandomness` function in `BlockhashRNG.sol` for security vulnerabilities related to `blockhash` usage.

# Extract the `receiveRandomness` function implementation using `rg`.
rg -A 20 'function receiveRandomness' ./contracts/src/rng/BlockhashRNG.sol

# Check for known vulnerabilities related to `blockhash` usage in Solidity.
rg --type markdown 'blockhash vulnerabilities' .

Length of output: 850

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

[!TIP]
Codebase Verification

Compatibility Verification with Foreign Gateway Implementations

The methods in IHomeGateway and IForeignGateway do not match, which could lead to compatibility issues for cross-chain functionality. Specifically, the following discrepancies were found:

  • IHomeGateway has methods relayCreateDispute, relayCreateDispute (overloaded), disputeHashToHomeID, foreignChainID, foreignGateway, and feeToken.
  • IForeignGateway has methods relayRule, withdrawFees, disputeHashToForeignID, homeChainID, and homeGateway.

These differences indicate that the interfaces are not aligned, which may affect the intended cross-chain operations.

Locations in the Codebase:

  • contracts/src/gateway/interfaces/IHomeGateway.sol
  • contracts/src/gateway/interfaces/IForeignGateway.sol

Please review and ensure that the methods in both interfaces are compatible to maintain cross-chain functionality.

Analysis chain

Line range hint 9-67: Ensure compatibility with corresponding foreign gateway implementations to maintain cross-chain functionality.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify compatibility with foreign gateway implementations.

# Test: Check for corresponding foreign gateway interface and ensure methods match.
rg --type solidity 'interface IForeignGateway' ./contracts/src/gateway/interfaces/

Length of output: 117



Script:

#!/bin/bash
# Description: Verify compatibility with foreign gateway implementations.

# Test: Check for corresponding foreign gateway interface and ensure methods match.
rg --type solidity 'interface IForeignGateway' ./contracts/src/gateway/interfaces/

Length of output: 117



Script:

#!/bin/bash
# Description: Verify compatibility with foreign gateway implementations.

# Test: Check for corresponding foreign gateway interface and ensure methods match.
rg --type 'sol' 'interface IForeignGateway' ./contracts/src/gateway/interfaces/

Length of output: 107



Script:

#!/bin/bash
# Description: Verify compatibility with foreign gateway implementations.

# Test: Check for corresponding foreign gateway interface and ensure methods match.
rg 'interface IForeignGateway' ./contracts/src/gateway/interfaces/

Length of output: 186



Script:

#!/bin/bash
# Description: Extract methods from IForeignGateway and compare with IHomeGateway.

# Extract methods from IForeignGateway
echo "Methods in IForeignGateway:"
rg --pcre2 --only-matching --no-filename 'function\s+\w+\s*\([^)]*\)' ./contracts/src/gateway/interfaces/IForeignGateway.sol

# Extract methods from IHomeGateway
echo "Methods in IHomeGateway:"
rg --pcre2 --only-matching --no-filename 'function\s+\w+\s*\([^)]*\)' ./contracts/src/gateway/interfaces/IHomeGateway.sol

Length of output: 901

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

[!TIP]
Codebase Verification

Ensure all implementations of the IDisputeKit interface are updated to match the new interface methods.

  • The DisputeKitSybilResistant and DisputeKitClassic contracts are missing the following methods from the IDisputeKit interface:
    • createDispute
    • draw
    • currentRuling

Please update these implementations to include the required methods.

Analysis chain

Line range hint 9-67: Ensure that all implementations of the IDisputeKit interface are updated to match the new interface methods.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all implementations of the `IDisputeKit` interface are updated.

# Test: Search for implementations of the `IDisputeKit` interface and check for method compatibility.
rg --type solidity 'implements IDisputeKit' ./contracts/src/arbitration/

Length of output: 107



Script:

#!/bin/bash
# Description: Verify that all implementations of the `IDisputeKit` interface are updated.

# Test: Search for implementations of the `IDisputeKit` interface and check for method compatibility.
rg --type sol 'implements IDisputeKit' ./contracts/src/arbitration/

Length of output: 97



Script:

#!/bin/bash
# Description: Verify that all implementations of the `IDisputeKit` interface are updated.

# Test: Search for implementations of the `IDisputeKit` interface and check for method compatibility.
rg 'implements IDisputeKit' --glob '*.sol'

Length of output: 44



Script:

#!/bin/bash
# Description: Verify that all implementations of the `IDisputeKit` interface are updated.

# Test: Search for any references to the `IDisputeKit` interface in the codebase.
rg 'IDisputeKit' --glob '*.sol'

Length of output: 3680



Script:

#!/bin/bash
# Description: Verify that all implementations of the `IDisputeKit` interface are updated.

# Extract method signatures from DisputeKitSybilResistant
echo "Methods in DisputeKitSybilResistant:"
rg --pcre2 --only-matching 'function\s+\w+\s*\([^)]*\)' contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol

# Extract method signatures from DisputeKitClassic
echo "Methods in DisputeKitClassic:"
rg --pcre2 --only-matching 'function\s+\w+\s*\([^)]*\)' contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol

Length of output: 1593

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5f0d234 and d153ace.
Files selected for processing (56)
  • contracts/hardhat.config.ts (1 hunks)
  • contracts/package.json (1 hunks)
  • contracts/src/arbitration/CentralizedArbitrator.sol (2 hunks)
  • contracts/src/arbitration/DisputeTemplateRegistry.sol (1 hunks)
  • contracts/src/arbitration/KlerosCore.sol (1 hunks)
  • contracts/src/arbitration/KlerosCoreBase.sol (2 hunks)
  • contracts/src/arbitration/KlerosCoreNeo.sol (1 hunks)
  • contracts/src/arbitration/KlerosGovernor.sol (2 hunks)
  • contracts/src/arbitration/PolicyRegistry.sol (1 hunks)
  • contracts/src/arbitration/SortitionModule.sol (1 hunks)
  • contracts/src/arbitration/SortitionModuleBase.sol (2 hunks)
  • contracts/src/arbitration/SortitionModuleNeo.sol (1 hunks)
  • contracts/src/arbitration/arbitrables/ArbitrableExample.sol (1 hunks)
  • contracts/src/arbitration/arbitrables/DisputeResolver.sol (1 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol (2 hunks)
  • contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol (2 hunks)
  • contracts/src/arbitration/evidence/EvidenceModule.sol (1 hunks)
  • contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol (3 hunks)
  • contracts/src/arbitration/interfaces/IArbitrableV2.sol (1 hunks)
  • contracts/src/arbitration/interfaces/IArbitratorV2.sol (1 hunks)
  • contracts/src/arbitration/interfaces/IDisputeKit.sol (1 hunks)
  • contracts/src/arbitration/interfaces/IDisputeTemplateRegistry.sol (1 hunks)
  • contracts/src/arbitration/interfaces/IEvidence.sol (1 hunks)
  • contracts/src/arbitration/interfaces/ISortitionModule.sol (1 hunks)
  • contracts/src/arbitration/university/ISortitionModuleUniversity.sol (1 hunks)
  • contracts/src/arbitration/university/KlerosCoreUniversity.sol (2 hunks)
  • contracts/src/arbitration/university/SortitionModuleUniversity.sol (2 hunks)
  • contracts/src/gateway/ForeignGateway.sol (2 hunks)
  • contracts/src/gateway/HomeGateway.sol (1 hunks)
  • contracts/src/gateway/interfaces/IForeignGateway.sol (1 hunks)
  • contracts/src/gateway/interfaces/IHomeGateway.sol (1 hunks)
  • contracts/src/gateway/mock/VeaMock.sol (1 hunks)
  • contracts/src/kleros-v1/interfaces/IArbitrableV1.sol (1 hunks)
  • contracts/src/kleros-v1/interfaces/IArbitratorV1.sol (1 hunks)
  • contracts/src/kleros-v1/interfaces/IEvidenceV1.sol (1 hunks)
  • contracts/src/kleros-v1/interfaces/IKlerosLiquid.sol (1 hunks)
  • contracts/src/kleros-v1/interfaces/ITokenController.sol (1 hunks)
  • contracts/src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol (1 hunks)
  • contracts/src/kleros-v1/kleros-liquid-xdai/interfaces/IERC677.sol (1 hunks)
  • contracts/src/kleros-v1/kleros-liquid-xdai/interfaces/IRandomAuRa.sol (1 hunks)
  • contracts/src/kleros-v1/kleros-liquid-xdai/interfaces/ITokenBridge.sol (1 hunks)
  • contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol (2 hunks)
  • contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol (2 hunks)
  • contracts/src/libraries/CappedMath.sol (1 hunks)
  • contracts/src/libraries/Constants.sol (1 hunks)
  • contracts/src/libraries/SafeERC20.sol (1 hunks)
  • contracts/src/libraries/SortitionSumTreeFactory.sol (2 hunks)
  • contracts/src/proxy/Initializable.sol (1 hunks)
  • contracts/src/proxy/UUPSProxiable.sol (1 hunks)
  • contracts/src/proxy/UUPSProxy.sol (1 hunks)
  • contracts/src/proxy/mock/UUPSUpgradeableMocks.sol (1 hunks)
  • contracts/src/proxy/mock/by-inheritance/UpgradedByInheritance.sol (1 hunks)
  • contracts/src/proxy/mock/by-rewrite/UpgradedByRewrite.sol (1 hunks)
  • contracts/src/proxy/mock/by-rewrite/UpgradedByRewriteV2.sol (1 hunks)
  • contracts/src/rng/BlockhashRNG.sol (2 hunks)
  • contracts/src/rng/IRandomizer.sol (1 hunks)
Files not processed due to max files limit (10)
  • contracts/src/rng/IncrementalNG.sol
  • contracts/src/rng/RNG.sol
  • contracts/src/rng/RandomizerRNG.sol
  • contracts/src/rng/mock/RandomizerMock.sol
  • contracts/src/token/Faucet.sol
  • contracts/src/token/PNK.sol
  • contracts/src/token/PinakionV2.sol
  • contracts/src/token/TestERC20.sol
  • contracts/src/token/TestERC721.sol
  • contracts/src/token/WrappedPinakionV2.sol
Files skipped from review due to trivial changes (38)
  • contracts/hardhat.config.ts
  • contracts/src/arbitration/DisputeTemplateRegistry.sol
  • contracts/src/arbitration/KlerosCoreNeo.sol
  • contracts/src/arbitration/KlerosGovernor.sol
  • contracts/src/arbitration/PolicyRegistry.sol
  • contracts/src/arbitration/SortitionModule.sol
  • contracts/src/arbitration/SortitionModuleNeo.sol
  • contracts/src/arbitration/arbitrables/ArbitrableExample.sol
  • contracts/src/arbitration/arbitrables/DisputeResolver.sol
  • contracts/src/arbitration/evidence/EvidenceModule.sol
  • contracts/src/arbitration/interfaces/IArbitrableV2.sol
  • contracts/src/arbitration/interfaces/IArbitratorV2.sol
  • contracts/src/arbitration/interfaces/IDisputeTemplateRegistry.sol
  • contracts/src/arbitration/interfaces/IEvidence.sol
  • contracts/src/arbitration/interfaces/ISortitionModule.sol
  • contracts/src/arbitration/university/ISortitionModuleUniversity.sol
  • contracts/src/gateway/interfaces/IForeignGateway.sol
  • contracts/src/gateway/mock/VeaMock.sol
  • contracts/src/kleros-v1/interfaces/IArbitrableV1.sol
  • contracts/src/kleros-v1/interfaces/IArbitratorV1.sol
  • contracts/src/kleros-v1/interfaces/IEvidenceV1.sol
  • contracts/src/kleros-v1/interfaces/IKlerosLiquid.sol
  • contracts/src/kleros-v1/interfaces/ITokenController.sol
  • contracts/src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol
  • contracts/src/kleros-v1/kleros-liquid-xdai/interfaces/IERC677.sol
  • contracts/src/kleros-v1/kleros-liquid-xdai/interfaces/IRandomAuRa.sol
  • contracts/src/kleros-v1/kleros-liquid-xdai/interfaces/ITokenBridge.sol
  • contracts/src/libraries/CappedMath.sol
  • contracts/src/libraries/Constants.sol
  • contracts/src/libraries/SafeERC20.sol
  • contracts/src/proxy/Initializable.sol
  • contracts/src/proxy/UUPSProxiable.sol
  • contracts/src/proxy/UUPSProxy.sol
  • contracts/src/proxy/mock/UUPSUpgradeableMocks.sol
  • contracts/src/proxy/mock/by-inheritance/UpgradedByInheritance.sol
  • contracts/src/proxy/mock/by-rewrite/UpgradedByRewrite.sol
  • contracts/src/proxy/mock/by-rewrite/UpgradedByRewriteV2.sol
  • contracts/src/rng/IRandomizer.sol
Additional comments not posted (40)
contracts/src/rng/BlockhashRNG.sol (1)

3-3: Updated Solidity version to 0.8.24 aligns with the PR's objectives.

contracts/src/arbitration/KlerosCore.sol (2)

9-9: Updated Solidity version to 0.8.24 aligns with the PR's objectives.


Line range hint 9-47: Ensure that governance controls are thoroughly tested, especially around the upgrade authorization logic.

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

9-9: Updated Solidity version to 0.8.24 aligns with the PR's objectives.

contracts/package.json (2)

67-67: Updated OpenZeppelin contracts to version ^5.0.2 to ensure compatibility with Solidity 0.8.24.


67-67: Check for breaking changes or major modifications in the OpenZeppelin contracts update from ^4.9.5 to ^5.0.2.

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

9-9: Updated Solidity version to 0.8.24 aligns with the PR's objectives.

contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol (2)

3-3: Updated Solidity version to 0.8.24 aligns with the PR's objectives.


Line range hint 3-67: Ensure thorough testing of the dispute relaying functionality between Kleros Liquid (v1) and Kleros v2.

contracts/src/gateway/HomeGateway.sol (2)

9-9: Updated Solidity version to 0.8.24 aligns with the PR's objectives.


Line range hint 9-67: Ensure compatibility with the corresponding foreign gateway to maintain cross-chain functionality.

contracts/src/libraries/SortitionSumTreeFactory.sol (2)

9-9: Updated Solidity version to 0.8.24 aligns with the PR's objectives.


Line range hint 9-67: Ensure thorough testing of the sortition process using the SortitionSumTreeFactory library.

contracts/src/gateway/ForeignGateway.sol (3)

9-9: Solidity version updated to 0.8.24.

This update is in line with the PR's objective to leverage enhancements and fixes in the newer Solidity version.


42-42: Mapping key type specified for feeForJuror.

This change improves code clarity by making the mapping key more descriptive (courtId instead of a generic uint96).


49-49: Mapping key type specified for disputeHashtoDisputeData.

This change enhances readability and maintainability by using disputeHash as a key, making it clear what the mapping represents.

contracts/src/arbitration/university/SortitionModuleUniversity.sol (2)

11-11: Solidity version updated to 0.8.24.

This update aligns with the PR's objective to use the latest Solidity version for security and performance improvements.


41-41: Mapping key type specified for jurors.

Specifying account as the key type for the jurors mapping enhances code clarity and makes the mapping's purpose more understandable.

contracts/src/arbitration/CentralizedArbitrator.sol (2)

3-3: Solidity version updated to 0.8.24.

Updating to the latest Solidity version is crucial for taking advantage of the latest language features and security fixes.


32-32: Mapping key types specified for paidFees, hasPaid, and contributions.

These changes improve the readability and maintainability of the contract by making the keys in these mappings more descriptive (choiceId and account).

Also applies to: 33-33, 34-34

contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol (2)

10-10: Updated Solidity version to 0.8.24 looks good.


42-42: Refactoring of mapping to use choiceId enhances clarity and descriptiveness.

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

9-9: Updated Solidity version to 0.8.24 looks good.


42-42: Refactoring of mapping to use choiceId for tracking fees paid enhances clarity.


43-44: Refactoring of mappings to use choiceId for payment status and contributions enhances clarity.

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

9-9: Updated Solidity version to 0.8.24.

This update aligns with the PR's objective to leverage enhancements and fixes in the newer Solidity version.


49-51: Refined mapping keys for clarity.

The changes to the mapping keys enhance code readability and maintainability by using descriptive identifiers like choiceId and account.

mapping(uint256 choiceId => uint256) paidFees;
mapping(uint256 choiceId => bool) hasPaid;
mapping(address account => mapping(uint256 choiceId => uint256)) contributions;

55-55: Introduced alreadyDrawn mapping to prevent duplicate juror drawing.

This is a crucial addition for ensuring that each juror is only drawn once per round, enhancing the fairness of the dispute resolution process.

mapping(address drawnAddress => bool) alreadyDrawn;
contracts/src/arbitration/SortitionModuleBase.sol (4)

11-11: Updated Solidity version to 0.8.24.

This change aligns with the PR's objective to update the Solidity version across various contracts to leverage enhancements and fixes in the newer version.


73-73: Updated mapping key for sortitionSumTrees to use treeHash for better clarity.

This change enhances readability and maintainability by using a more descriptive key, making the codebase easier to understand and manage.


74-74: Updated mapping key for jurors to use account for better clarity.

This change improves the readability of the code by replacing a generic type with a more descriptive key, which helps in understanding the purpose of the mapping more clearly.


76-76: Updated mapping key for latestDelayedStakeIndex to use jurorAccount and courtId, enhancing clarity and readability.

The use of more descriptive keys in this mapping makes the codebase more intuitive and easier to navigate, aligning with best practices for code clarity.

contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol (4)

3-3: Solidity version updated to 0.8.24.

This update is in line with the PR's objective to leverage enhancements and fixes in the newer Solidity version.


171-171: Mapping for disputes introduced.

This mapping is crucial for managing disputes efficiently, allowing direct access to dispute data using a dispute ID.


175-175: Mapping for jurors introduced.

This mapping facilitates efficient management and retrieval of juror data, enhancing the contract's performance when accessing juror-specific information.


179-179: Mapping for dispute rulings introduced.

This mapping stores the rulings for disputes, which is essential for tracking the outcomes of arbitration processes.

contracts/src/arbitration/KlerosCoreBase.sol (2)

9-9: Solidity version updated to 0.8.24.

This update is consistent with the PR's objective to leverage enhancements and fixes in the newer Solidity version.


44-44: Mapping key improved for clarity.

The change from mapping(uint256 => bool) to mapping(uint256 disputeKitId => bool) enhances readability by explicitly indicating that the keys represent dispute kit IDs.

contracts/src/arbitration/university/KlerosCoreUniversity.sol (2)

3-3: Solidity version updated to 0.8.24.

This update aligns with the PR's objective to leverage enhancements and fixes in the newer Solidity version.


39-39: Mapping key improved for clarity in supportedDisputeKits.

The change from uint256 to uint256 disputeKitId enhances the readability and self-explanatory nature of the code.

coderabbitai[bot]
coderabbitai bot previously approved these changes May 17, 2024
@jaybuidl jaybuidl linked an issue Jun 5, 2024 that may be closed by this pull request
@jaybuidl jaybuidl changed the title Chore(contracts)/sol version update Update Solc version from 0.8.18 to 0.8.24 Jun 5, 2024
Copy link

codeclimate bot commented Jun 5, 2024

Code Climate has analyzed commit 07a593b and detected 0 issues on this pull request.

View more on Code Climate.

@jaybuidl jaybuidl merged commit 9f27b76 into kleros:dev Jun 5, 2024
18 of 22 checks passed
@jaybuidl jaybuidl added the Type: Toolchain ⚒️ Build tools configuration, CI/CD label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: Contracts Court smart contracts Type: Maintenance 🚧 Type: Toolchain ⚒️ Build tools configuration, CI/CD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Solc version from 0.8.18 to 0.8.24
2 participants