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

add licensing info #103

Merged
merged 1 commit into from
May 7, 2024
Merged

add licensing info #103

merged 1 commit into from
May 7, 2024

Conversation

RnkSngh
Copy link
Collaborator

@RnkSngh RnkSngh commented May 7, 2024

PR to add licencing info to add an Apache 2.0 licence to this repo.

  • all contracts in the contracts/ directory have the apache 2.0 licence
  • all contract in the tests/ directory is unlicenced

Summary by CodeRabbit

  • Documentation

    • Updated the software licensing to Apache License Version 2.0 across various files to ensure compliance and clarity in terms and conditions for use.
  • Refactor

    • Standardized SPDX license identifiers to "Apache-2.0" in multiple contracts and interfaces, aligning with updated licensing terms.
  • New Features

    • Enhanced licensing information, including detailed terms and conditions under the Apache License Version 2.0, added across multiple files for better transparency and user understanding.

@RnkSngh RnkSngh requested a review from dshiell May 7, 2024 00:25
Copy link

coderabbitai bot commented May 7, 2024

Warning

Rate Limit Exceeded

@RnkSngh has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 46 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between da685f1 and 3b901ab.

Walkthrough

The update involves transitioning various files to the Apache-2.0 license. This revision includes updating SPDX identifiers, incorporating copyright details for Polymer Labs, and outlining licensing terms. No functional changes to exported entities were observed, emphasizing compliance with licensing requirements.

Changes

File Path Change Summary
LICENSE, GeneralMiddleware.sol, Dispatcher.sol, OptimisticLightClient.sol, OptimisticProofVerifier.sol, UniversalChannelHandler.sol, Earth.sol, Mars.sol, IDispatcher.sol, ILightClient.sol, IProofVerifier.sol, IUniversalChannelHandler.sol, IbcDispatcher.sol, IbcMiddleware.sol, IbcReceiver.sol, IbcReceiverUpgradeable.sol, Ibc.sol, IbcErrors.sol, IbcUtils.sol, DummyLightClient.sol, DummyProofVerifier.sol, GasAudit.sol, DispatcherV2.sol, DispatcherV2Initializable.sol, TestUtils.t.sol Updated SPDX license identifier to Apache-2.0, added Polymer Labs copyright, and detailed licensing terms.

Poem

🐰✨
In the fields of code, where the green bits grow,
A rabbit hopped, with changes in tow.
From UNLICENSED to Apache they leap,
Over lines of code, the updates seep.
"Hop, hop, hop!" they cheer, quite spry,
Under the vast, digital sky.
🌟🐇💻


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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

@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 (4)
contracts/base/GeneralMiddleware.sol (4)

Line range hint 21-21: Remove unused import to clean up the code.

- import {Ibc, UniversalPacket, AckPacket} from "../libs/Ibc.sol";
+ import {UniversalPacket, AckPacket} from "../libs/Ibc.sol";

Line range hint 48-48: Variable names should follow mixedCase naming convention.

- uint256 public MW_ID;
+ uint256 public mwId;

Line range hint 66-66: Consider adding named parameters to improve code readability and maintainability.

Also applies to: 77-77, 96-96, 125-125, 142-142, 155-155


Line range hint 175-175: Avoid leaving empty function bodies as they can lead to maintenance issues. Consider implementing the function or explicitly noting it's intentionally left empty.

- function onTimeoutUniversalPacket(bytes32 channelId, UniversalPacket calldata packet) external override onlyIbcMw {}
+ function onTimeoutUniversalPacket(bytes32 channelId, UniversalPacket calldata packet) external override onlyIbcMw {
+    // TODO: Implement or explicitly note why this is left empty
+ }
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 25e9a3d and fb22dc6.
Files selected for processing (25)
  • LICENSE (1 hunks)
  • contracts/base/GeneralMiddleware.sol (1 hunks)
  • contracts/core/Dispatcher.sol (1 hunks)
  • contracts/core/OptimisticLightClient.sol (1 hunks)
  • contracts/core/OptimisticProofVerifier.sol (1 hunks)
  • contracts/core/UniversalChannelHandler.sol (1 hunks)
  • contracts/examples/Earth.sol (1 hunks)
  • contracts/examples/Mars.sol (1 hunks)
  • contracts/interfaces/IDispatcher.sol (1 hunks)
  • contracts/interfaces/ILightClient.sol (1 hunks)
  • contracts/interfaces/IProofVerifier.sol (1 hunks)
  • contracts/interfaces/IUniversalChannelHandler.sol (1 hunks)
  • contracts/interfaces/IbcDispatcher.sol (1 hunks)
  • contracts/interfaces/IbcMiddleware.sol (1 hunks)
  • contracts/interfaces/IbcReceiver.sol (1 hunks)
  • contracts/interfaces/IbcReceiverUpgradeable.sol (1 hunks)
  • contracts/libs/Ibc.sol (1 hunks)
  • contracts/libs/IbcErrors.sol (1 hunks)
  • contracts/libs/IbcUtils.sol (1 hunks)
  • contracts/utils/DummyLightClient.sol (1 hunks)
  • contracts/utils/DummyProofVerifier.sol (1 hunks)
  • contracts/utils/GasAudit.sol (1 hunks)
  • test/upgradeableProxy/upgrades/DispatcherV2.sol (1 hunks)
  • test/upgradeableProxy/upgrades/DispatcherV2Initializable.sol (1 hunks)
  • test/utils/TestUtils.t.sol (1 hunks)
Files skipped from review due to trivial changes (21)
  • LICENSE
  • contracts/core/Dispatcher.sol
  • contracts/core/OptimisticLightClient.sol
  • contracts/core/UniversalChannelHandler.sol
  • contracts/examples/Earth.sol
  • contracts/interfaces/IDispatcher.sol
  • contracts/interfaces/ILightClient.sol
  • contracts/interfaces/IProofVerifier.sol
  • contracts/interfaces/IUniversalChannelHandler.sol
  • contracts/interfaces/IbcDispatcher.sol
  • contracts/interfaces/IbcMiddleware.sol
  • contracts/interfaces/IbcReceiver.sol
  • contracts/interfaces/IbcReceiverUpgradeable.sol
  • contracts/libs/Ibc.sol
  • contracts/libs/IbcUtils.sol
  • contracts/utils/DummyLightClient.sol
  • contracts/utils/DummyProofVerifier.sol
  • contracts/utils/GasAudit.sol
  • test/upgradeableProxy/upgrades/DispatcherV2.sol
  • test/upgradeableProxy/upgrades/DispatcherV2Initializable.sol
  • test/utils/TestUtils.t.sol
Additional Context Used
GitHub Check Runs (1)
lint failure (12)

contracts/base/GeneralMiddleware.sol: [warning] 21-21:
imported name Ibc is not used


contracts/base/GeneralMiddleware.sol: [warning] 48-48:
Variable name must be in mixedCase


contracts/base/GeneralMiddleware.sol: [warning] 66-66:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 77-77:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 80-80:
All public or external methods in a contract must override a definition from an interface


contracts/base/GeneralMiddleware.sol: [warning] 96-96:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 125-125:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 142-142:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 155-155:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 175-175:
Code contains empty blocks

Additional comments not posted (5)
contracts/libs/IbcErrors.sol (1)

1-1: SPDX license identifier updated to Apache-2.0.

contracts/base/GeneralMiddleware.sol (2)

1-1: SPDX license identifier updated to Apache-2.0.


Line range hint 80-80: Ensure that all public or external methods override a definition from an interface to adhere to Solidity best practices.

Verification successful

The script was successfully executed with the correct settings to handle the regex capabilities needed for the task. The absence of output from the script indicates that there are no public or external methods in the GeneralMiddleware.sol file that fail to include the override keyword where expected. This suggests that all such methods in this file properly override interface definitions, adhering to Solidity best practices.

All public or external methods in GeneralMiddleware.sol correctly override interface definitions as per Solidity best practices.

  • No issues were found in the methods' declarations regarding the use of the override keyword.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all public or external methods in `GeneralMiddleware.sol` properly override interface definitions.

# Test: Search for public or external methods that do not override interface definitions. Expect: No occurrences.
rg --type solidity --multiline $'function (.+?)\\(\\) (public|external)' contracts/base/GeneralMiddleware.sol

Length of output: 141



Script:

#!/bin/bash
# Description: Verify that all public or external methods in `GeneralMiddleware.sol` properly override interface definitions.

# Test: Search for public or external methods that do not override interface definitions. Expect: No occurrences.
rg --multiline $'function (.+?)\\((.*?)\\) (public|external)(?!.*override)' contracts/base/GeneralMiddleware.sol

Length of output: 411



Script:

#!/bin/bash
# Description: Verify that all public or external methods in `GeneralMiddleware.sol` properly override interface definitions.

# Test: Search for public or external methods that do not override interface definitions. Expect: No occurrences.
rg --pcre2 --multiline $'function (.+?)\\((.*?)\\) (public|external)(?!.*override)' contracts/base/GeneralMiddleware.sol

Length of output: 119

contracts/core/OptimisticProofVerifier.sol (1)

1-1: SPDX license identifier updated to Apache-2.0.

contracts/examples/Mars.sol (1)

1-1: SPDX license identifier updated to Apache-2.0.

@RnkSngh RnkSngh force-pushed the raunak/spdx-licence branch 2 times, most recently from 8a98ab9 to 5edb1ab Compare May 7, 2024 02:04
Copy link

@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 (4)
contracts/base/GeneralMiddleware.sol (4)

Line range hint 22-22: Remove the unused import to clean up the code.

- import {Ibc, UniversalPacket, AckPacket} from "../libs/Ibc.sol";
+ import {UniversalPacket, AckPacket} from "../libs/Ibc.sol";

Line range hint 49-49: Rename the variable to follow Solidity naming conventions.

- uint256 public MW_ID;
+ uint256 public mwId;

Line range hint 67-67: Consider adding named parameters to improve code readability.

- function sendUniversalPacket(
+ function sendUniversalPacket(
+     bytes32 channelId,
+     bytes32 destPortAddr,
+     bytes calldata appData,
+     uint64 timeoutTimestamp
+ ) external override {

Line range hint 176-176: Consider adding a comment to explain why this method body is empty, or implement the intended functionality.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 25e9a3d and 8a98ab9.
Files selected for processing (25)
  • LICENSE (1 hunks)
  • contracts/base/GeneralMiddleware.sol (1 hunks)
  • contracts/core/Dispatcher.sol (1 hunks)
  • contracts/core/OptimisticLightClient.sol (1 hunks)
  • contracts/core/OptimisticProofVerifier.sol (1 hunks)
  • contracts/core/UniversalChannelHandler.sol (1 hunks)
  • contracts/examples/Earth.sol (1 hunks)
  • contracts/examples/Mars.sol (1 hunks)
  • contracts/interfaces/IDispatcher.sol (1 hunks)
  • contracts/interfaces/ILightClient.sol (1 hunks)
  • contracts/interfaces/IProofVerifier.sol (1 hunks)
  • contracts/interfaces/IUniversalChannelHandler.sol (1 hunks)
  • contracts/interfaces/IbcDispatcher.sol (1 hunks)
  • contracts/interfaces/IbcMiddleware.sol (1 hunks)
  • contracts/interfaces/IbcReceiver.sol (1 hunks)
  • contracts/interfaces/IbcReceiverUpgradeable.sol (1 hunks)
  • contracts/libs/Ibc.sol (1 hunks)
  • contracts/libs/IbcErrors.sol (1 hunks)
  • contracts/libs/IbcUtils.sol (1 hunks)
  • contracts/utils/DummyLightClient.sol (1 hunks)
  • contracts/utils/DummyProofVerifier.sol (1 hunks)
  • contracts/utils/GasAudit.sol (1 hunks)
  • test/upgradeableProxy/upgrades/DispatcherV2.sol (1 hunks)
  • test/upgradeableProxy/upgrades/DispatcherV2Initializable.sol (1 hunks)
  • test/utils/TestUtils.t.sol (1 hunks)
Files skipped from review as they are similar to previous changes (24)
  • LICENSE
  • contracts/core/Dispatcher.sol
  • contracts/core/OptimisticLightClient.sol
  • contracts/core/OptimisticProofVerifier.sol
  • contracts/core/UniversalChannelHandler.sol
  • contracts/examples/Earth.sol
  • contracts/examples/Mars.sol
  • contracts/interfaces/IDispatcher.sol
  • contracts/interfaces/ILightClient.sol
  • contracts/interfaces/IProofVerifier.sol
  • contracts/interfaces/IUniversalChannelHandler.sol
  • contracts/interfaces/IbcDispatcher.sol
  • contracts/interfaces/IbcMiddleware.sol
  • contracts/interfaces/IbcReceiver.sol
  • contracts/interfaces/IbcReceiverUpgradeable.sol
  • contracts/libs/Ibc.sol
  • contracts/libs/IbcErrors.sol
  • contracts/libs/IbcUtils.sol
  • contracts/utils/DummyLightClient.sol
  • contracts/utils/DummyProofVerifier.sol
  • contracts/utils/GasAudit.sol
  • test/upgradeableProxy/upgrades/DispatcherV2.sol
  • test/upgradeableProxy/upgrades/DispatcherV2Initializable.sol
  • test/utils/TestUtils.t.sol
Additional Context Used
GitHub Check Runs (1)
lint failure (12)

contracts/base/GeneralMiddleware.sol: [warning] 22-22:
imported name Ibc is not used


contracts/base/GeneralMiddleware.sol: [warning] 49-49:
Variable name must be in mixedCase


contracts/base/GeneralMiddleware.sol: [warning] 67-67:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 78-78:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 81-81:
All public or external methods in a contract must override a definition from an interface


contracts/base/GeneralMiddleware.sol: [warning] 97-97:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 126-126:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 143-143:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 156-156:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 176-176:
Code contains empty blocks

Additional comments not posted (2)
contracts/base/GeneralMiddleware.sol (2)

1-18: The licensing information has been updated correctly to Apache-2.0.


Line range hint 81-81: Verify that this method overrides an interface definition or consider removing it if it's not used.

@RnkSngh RnkSngh changed the title add licencing info add licensing info May 7, 2024
Copy link

@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 (9)
contracts/base/GeneralMiddleware.sol (9)

Line range hint 22-22: The import Ibc is not used in the file.

- import {Ibc, UniversalPacket, AckPacket} from "../libs/Ibc.sol";
+ import {UniversalPacket, AckPacket} from "../libs/Ibc.sol";

Line range hint 49-49: Variable MW_ID should follow mixedCase naming convention.

- uint256 public MW_ID;
+ uint256 public mwId;

Line range hint 67-67: Consider using named parameters for clarity in method calls.


Line range hint 78-78: Consider using named parameters for clarity in method calls.


Line range hint 97-97: Consider using named parameters for clarity in method calls.


Line range hint 126-126: Consider using named parameters for clarity in method calls.


Line range hint 143-143: Consider using named parameters for clarity in method calls.


Line range hint 156-156: Consider using named parameters for clarity in method calls.


Line range hint 176-176: Empty method implementations should be documented to explain why they are empty.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 25e9a3d and 5edb1ab.
Files selected for processing (25)
  • LICENSE (1 hunks)
  • contracts/base/GeneralMiddleware.sol (1 hunks)
  • contracts/core/Dispatcher.sol (1 hunks)
  • contracts/core/OptimisticLightClient.sol (1 hunks)
  • contracts/core/OptimisticProofVerifier.sol (1 hunks)
  • contracts/core/UniversalChannelHandler.sol (1 hunks)
  • contracts/examples/Earth.sol (1 hunks)
  • contracts/examples/Mars.sol (1 hunks)
  • contracts/interfaces/IDispatcher.sol (1 hunks)
  • contracts/interfaces/ILightClient.sol (1 hunks)
  • contracts/interfaces/IProofVerifier.sol (1 hunks)
  • contracts/interfaces/IUniversalChannelHandler.sol (1 hunks)
  • contracts/interfaces/IbcDispatcher.sol (1 hunks)
  • contracts/interfaces/IbcMiddleware.sol (1 hunks)
  • contracts/interfaces/IbcReceiver.sol (1 hunks)
  • contracts/interfaces/IbcReceiverUpgradeable.sol (1 hunks)
  • contracts/libs/Ibc.sol (1 hunks)
  • contracts/libs/IbcErrors.sol (1 hunks)
  • contracts/libs/IbcUtils.sol (1 hunks)
  • contracts/utils/DummyLightClient.sol (1 hunks)
  • contracts/utils/DummyProofVerifier.sol (1 hunks)
  • contracts/utils/GasAudit.sol (1 hunks)
  • test/upgradeableProxy/upgrades/DispatcherV2.sol (1 hunks)
  • test/upgradeableProxy/upgrades/DispatcherV2Initializable.sol (1 hunks)
  • test/utils/TestUtils.t.sol (1 hunks)
Files skipped from review as they are similar to previous changes (24)
  • LICENSE
  • contracts/core/Dispatcher.sol
  • contracts/core/OptimisticLightClient.sol
  • contracts/core/OptimisticProofVerifier.sol
  • contracts/core/UniversalChannelHandler.sol
  • contracts/examples/Earth.sol
  • contracts/examples/Mars.sol
  • contracts/interfaces/IDispatcher.sol
  • contracts/interfaces/ILightClient.sol
  • contracts/interfaces/IProofVerifier.sol
  • contracts/interfaces/IUniversalChannelHandler.sol
  • contracts/interfaces/IbcDispatcher.sol
  • contracts/interfaces/IbcMiddleware.sol
  • contracts/interfaces/IbcReceiver.sol
  • contracts/interfaces/IbcReceiverUpgradeable.sol
  • contracts/libs/Ibc.sol
  • contracts/libs/IbcErrors.sol
  • contracts/libs/IbcUtils.sol
  • contracts/utils/DummyLightClient.sol
  • contracts/utils/DummyProofVerifier.sol
  • contracts/utils/GasAudit.sol
  • test/upgradeableProxy/upgrades/DispatcherV2.sol
  • test/upgradeableProxy/upgrades/DispatcherV2Initializable.sol
  • test/utils/TestUtils.t.sol
Additional Context Used
GitHub Check Runs (1)
lint success (11)

contracts/base/GeneralMiddleware.sol: [warning] 22-22:
imported name Ibc is not used


contracts/base/GeneralMiddleware.sol: [warning] 49-49:
Variable name must be in mixedCase


contracts/base/GeneralMiddleware.sol: [warning] 67-67:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 78-78:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 81-81:
All public or external methods in a contract must override a definition from an interface


contracts/base/GeneralMiddleware.sol: [warning] 97-97:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 126-126:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 143-143:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 156-156:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 176-176:
Code contains empty blocks

Additional comments not posted (3)
contracts/base/GeneralMiddleware.sol (3)

1-1: Updated SPDX license identifier to Apache-2.0.


3-17: Copyright and licensing information added.


Line range hint 81-81: Ensure that all public or external methods override a definition from an interface.

Copy link
Collaborator

@dshiell dshiell left a comment

Choose a reason for hiding this comment

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

Lets use only Polymer Labs in the copyright language per slack discussion otherwise, lgtm!

@RnkSngh RnkSngh force-pushed the raunak/spdx-licence branch 2 times, most recently from 1ab69ea to 4c25c9e Compare May 7, 2024 18:47
@RnkSngh RnkSngh force-pushed the raunak/spdx-licence branch from 4c25c9e to 3b901ab Compare May 7, 2024 18:49
Copy link

@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 (4)
contracts/base/GeneralMiddleware.sol (4)

Line range hint 21-21: Remove the unused import to clean up the code.

- import {Ibc, UniversalPacket, AckPacket} from "../libs/Ibc.sol";
+ import {UniversalPacket, AckPacket} from "../libs/Ibc.sol";

Line range hint 48-48: Consider renaming MW_ID to mwId to adhere to Solidity naming conventions.

- uint256 public MW_ID;
+ uint256 public mwId;

Line range hint 66-66: Consider using named parameters for clarity and maintainability.

- function onRecvMWPacket(
+ function onRecvMWPacket(
+     bytes32 channelId,
+     UniversalPacket calldata ucPacket,
+     uint256 mwIndex,
+     address[] calldata mwAddrs
+ ) external onlyIbcMw returns (AckPacket memory ackPacket) {

Line range hint 175-175: Avoid leaving function bodies empty. Implement or explicitly comment on why they are empty.

- function onRecvUniversalPacket(bytes32 channelId, UniversalPacket calldata ucPacket)
+ function onRecvUniversalPacket(bytes32 channelId, UniversalPacket calldata ucPacket) {
+     // TODO: Implement or provide rationale for empty function
+ }
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between da685f1 and 1ab69ea.
Files selected for processing (25)
  • LICENSE (1 hunks)
  • contracts/base/GeneralMiddleware.sol (1 hunks)
  • contracts/core/Dispatcher.sol (1 hunks)
  • contracts/core/OptimisticLightClient.sol (1 hunks)
  • contracts/core/OptimisticProofVerifier.sol (1 hunks)
  • contracts/core/UniversalChannelHandler.sol (1 hunks)
  • contracts/examples/Earth.sol (1 hunks)
  • contracts/examples/Mars.sol (1 hunks)
  • contracts/interfaces/IDispatcher.sol (1 hunks)
  • contracts/interfaces/ILightClient.sol (1 hunks)
  • contracts/interfaces/IProofVerifier.sol (1 hunks)
  • contracts/interfaces/IUniversalChannelHandler.sol (1 hunks)
  • contracts/interfaces/IbcDispatcher.sol (1 hunks)
  • contracts/interfaces/IbcMiddleware.sol (1 hunks)
  • contracts/interfaces/IbcReceiver.sol (1 hunks)
  • contracts/interfaces/IbcReceiverUpgradeable.sol (1 hunks)
  • contracts/libs/Ibc.sol (1 hunks)
  • contracts/libs/IbcErrors.sol (1 hunks)
  • contracts/libs/IbcUtils.sol (1 hunks)
  • contracts/utils/DummyLightClient.sol (1 hunks)
  • contracts/utils/DummyProofVerifier.sol (1 hunks)
  • contracts/utils/GasAudit.sol (1 hunks)
  • test/upgradeableProxy/upgrades/DispatcherV2.sol (1 hunks)
  • test/upgradeableProxy/upgrades/DispatcherV2Initializable.sol (1 hunks)
  • test/utils/TestUtils.t.sol (1 hunks)
Files skipped from review as they are similar to previous changes (24)
  • LICENSE
  • contracts/core/Dispatcher.sol
  • contracts/core/OptimisticLightClient.sol
  • contracts/core/OptimisticProofVerifier.sol
  • contracts/core/UniversalChannelHandler.sol
  • contracts/examples/Earth.sol
  • contracts/examples/Mars.sol
  • contracts/interfaces/IDispatcher.sol
  • contracts/interfaces/ILightClient.sol
  • contracts/interfaces/IProofVerifier.sol
  • contracts/interfaces/IUniversalChannelHandler.sol
  • contracts/interfaces/IbcDispatcher.sol
  • contracts/interfaces/IbcMiddleware.sol
  • contracts/interfaces/IbcReceiver.sol
  • contracts/interfaces/IbcReceiverUpgradeable.sol
  • contracts/libs/Ibc.sol
  • contracts/libs/IbcErrors.sol
  • contracts/libs/IbcUtils.sol
  • contracts/utils/DummyLightClient.sol
  • contracts/utils/DummyProofVerifier.sol
  • contracts/utils/GasAudit.sol
  • test/upgradeableProxy/upgrades/DispatcherV2.sol
  • test/upgradeableProxy/upgrades/DispatcherV2Initializable.sol
  • test/utils/TestUtils.t.sol
Additional Context Used
GitHub Check Runs (1)
lint success (11)

contracts/base/GeneralMiddleware.sol: [warning] 21-21:
imported name Ibc is not used


contracts/base/GeneralMiddleware.sol: [warning] 48-48:
Variable name must be in mixedCase


contracts/base/GeneralMiddleware.sol: [warning] 66-66:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 77-77:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 80-80:
All public or external methods in a contract must override a definition from an interface


contracts/base/GeneralMiddleware.sol: [warning] 96-96:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 125-125:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 142-142:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 155-155:
Named parameters missing. MIN unnamed argumenst is 4


contracts/base/GeneralMiddleware.sol: [warning] 175-175:
Code contains empty blocks

Additional comments not posted (2)
contracts/base/GeneralMiddleware.sol (2)

1-1: Updated SPDX license identifier to Apache-2.0.


3-17: Copyright and licensing information is correctly updated and well-documented.

@RnkSngh RnkSngh merged commit e3baba6 into main May 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants