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

chore(protocol): manage deps with node_modules instead of submodules #15759

Merged
merged 5 commits into from
Feb 14, 2024

Conversation

dionysuzx
Copy link
Collaborator

@dionysuzx dionysuzx commented Feb 13, 2024

what do you think of this change @adaki2004 @dantaik ? i am inspired from:

i always have issues with git submodules and dont really like them.

how to update

after merging run these commands locally (make sure your index is clean):

git submodule deinit -f --all 
git clean -fd

Summary by CodeRabbit

  • Refactor
    • Updated import paths for OpenZeppelin contracts and other external libraries across various contracts to use the @openzeppelin/contracts-upgradeable namespace or correct project structure paths.
    • Adjusted import paths in scripts and tests to reflect reorganization of project structure or dependencies.

@dionysuzx dionysuzx changed the title chore(solidity): foundry deps idea chore(protocol): manage deps with node_modules instead of submodules Feb 13, 2024
@adaki2004
Copy link
Contributor

This looks good to me. So pnpm install , and works out of the blue, right ?

@dionysuzx
Copy link
Collaborator Author

This looks good to me. So pnpm install , and works out of the blue, right ?

yes, that is all. and the dependencies are frozen by tag, just as before.

@adaki2004
Copy link
Contributor

This looks good to me. So pnpm install , and works out of the blue, right ?

yes, that is all. and the dependencies are frozen by tag, just as before.

say no more. ✅

Copy link

coderabbitai bot commented Feb 14, 2024

Important

Auto Review Skipped

Review was skipped due to path filters

Files ignored due to path filters (2)
  • packages/protocol/package.json is excluded by: !**/*.json
  • pnpm-lock.yaml is excluded by: !**/*.yaml

Walkthrough

The recent updates across the protocol's contracts primarily focus on standardizing the import paths for OpenZeppelin contracts and other external libraries. By shifting to the @openzeppelin/contracts-upgradeable namespace and correcting paths to align with project reorganization, these changes enhance code maintainability and dependency management efficiency. This adjustment ensures a smoother integration with external libraries, fostering a more robust and upgradable contract ecosystem.

Changes

Files Change Summary
.../TaikoToken.sol, .../TaikoL2.sol Updated OpenZeppelin import paths to @openzeppelin/contracts or @openzeppelin/contracts-upgradeable namespace.
.../TaikoGovernor.sol, .../TaikoTimelockController.sol, .../AssignmentHook.sol Updated import paths for OpenZeppelin contracts; added new imports where necessary.
.../LibProposing.sol, .../LibProving.sol, .../LibVerifying.sol, .../CrossChainOwned.sol Changed IERC20.sol import from local to @openzeppelin package.
.../AutomataDcapV3Attestation.sol, .../PEMCertChainLib.sol Updated import paths for internal libraries and console.sol to reflect new locations.
.../OwnerUUPSUpgradable.sol, .../LibAddress.sol, .../LibDeploy.sol, .../SignalService.sol, .../TimelockTokenPool.sol, .../ERC20Airdrop.sol, .../ERC20Airdrop2.sol, .../ERC721Airdrop.sol, .../MerkleClaimable.sol, .../BaseVault.sol, .../BridgedERC1155.sol, .../BridgedERC20.sol, .../BridgedERC20Base.sol, .../BridgedERC721.sol, .../ERC1155Vault.sol, .../ERC20Vault.sol, .../ERC721Vault.sol, .../LibBridgedToken.sol, .../SgxVerifier.sol Switched import paths to @openzeppelin/contracts or @openzeppelin/contracts-upgradeable and corrected paths for project structure.
.../GenerateGenesis.g.sol, .../remappings.txt, .../DeployOnL1.s.sol, .../SetAddress.s.sol, .../SetDcapParams.s.sol, .../UpgradeAddressManager.s.sol, .../UpgradeAssignmentHook.s.sol, .../UpgradeBridge.s.sol, .../UpgradeERC1155Vault.s.sol, .../UpgradeERC20Vault.s.sol, .../UpgradeERC721Vault.s.sol, .../UpgradeGuardianProver.s.sol, .../UpgradeScript.s.sol, .../UpgradeSignalService.s.sol, .../UpgradeTaikoGovernor.s.sol, .../UpgradeTaikoL1.s.sol, .../UpgradeTimelockController.s.sol Updated import paths for external libraries and scripts to reflect project reorganization.
.../DeployCapability.sol, .../TaikoGovernor.t.sol, .../TaikoTest.sol, .../AutomataDcapV3AttestationTest.t.sol, .../AttestationBase.t.sol, .../DcapTestUtils.t.sol, .../V3QuoteParseUtils.t.sol, .../FreeMintERC20.sol, .../MayFailFreeMintERC20.sol, .../RegularERC20.sol, .../ERC1155Vault.t.sol, .../ERC721Vault.t.sol, .../PseZkVerifier.t.sol Updated import paths for external contracts and libraries to correct paths or namespaces.

"In the realm of code, where solidity reigns,
A rabbit hopped through contracts' lanes.
🐇 With a flick and a hop, it refined the path,
OpenZeppelin imports, now on a new bath.
🌟 Upgradable, solid, the code does gleam,
A testament to the rabbit's dream."

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@adaki2004 adaki2004 marked this pull request as ready for review February 14, 2024 04:34
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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 6c7e4de and 12312f9.
Files ignored due to path filters (2)
  • packages/protocol/package.json is excluded by: !**/*.json
  • pnpm-lock.yaml is excluded by: !**/*.yaml
Files selected for processing (60)
  • packages/protocol/contracts/L1/TaikoToken.sol (1 hunks)
  • packages/protocol/contracts/L1/gov/TaikoGovernor.sol (1 hunks)
  • packages/protocol/contracts/L1/gov/TaikoTimelockController.sol (1 hunks)
  • packages/protocol/contracts/L1/hooks/AssignmentHook.sol (1 hunks)
  • packages/protocol/contracts/L1/libs/LibProposing.sol (1 hunks)
  • packages/protocol/contracts/L1/libs/LibProving.sol (1 hunks)
  • packages/protocol/contracts/L1/libs/LibVerifying.sol (1 hunks)
  • packages/protocol/contracts/L2/CrossChainOwned.sol (1 hunks)
  • packages/protocol/contracts/L2/TaikoL2.sol (1 hunks)
  • packages/protocol/contracts/automata-attestation/AutomataDcapV3Attestation.sol (1 hunks)
  • packages/protocol/contracts/automata-attestation/lib/PEMCertChainLib.sol (1 hunks)
  • packages/protocol/contracts/common/OwnerUUPSUpgradable.sol (1 hunks)
  • packages/protocol/contracts/libs/LibAddress.sol (1 hunks)
  • packages/protocol/contracts/libs/LibDeploy.sol (1 hunks)
  • packages/protocol/contracts/signal/SignalService.sol (1 hunks)
  • packages/protocol/contracts/team/TimelockTokenPool.sol (1 hunks)
  • packages/protocol/contracts/team/airdrop/ERC20Airdrop.sol (1 hunks)
  • packages/protocol/contracts/team/airdrop/ERC20Airdrop2.sol (1 hunks)
  • packages/protocol/contracts/team/airdrop/ERC721Airdrop.sol (1 hunks)
  • packages/protocol/contracts/team/airdrop/MerkleClaimable.sol (1 hunks)
  • packages/protocol/contracts/tokenvault/BaseVault.sol (1 hunks)
  • packages/protocol/contracts/tokenvault/BridgedERC1155.sol (1 hunks)
  • packages/protocol/contracts/tokenvault/BridgedERC20.sol (1 hunks)
  • packages/protocol/contracts/tokenvault/BridgedERC20Base.sol (1 hunks)
  • packages/protocol/contracts/tokenvault/BridgedERC721.sol (1 hunks)
  • packages/protocol/contracts/tokenvault/ERC1155Vault.sol (1 hunks)
  • packages/protocol/contracts/tokenvault/ERC20Vault.sol (1 hunks)
  • packages/protocol/contracts/tokenvault/ERC721Vault.sol (1 hunks)
  • packages/protocol/contracts/tokenvault/LibBridgedToken.sol (1 hunks)
  • packages/protocol/contracts/verifiers/SgxVerifier.sol (1 hunks)
  • packages/protocol/genesis/GenerateGenesis.g.sol (1 hunks)
  • packages/protocol/remappings.txt (1 hunks)
  • packages/protocol/script/DeployOnL1.s.sol (2 hunks)
  • packages/protocol/script/SetAddress.s.sol (1 hunks)
  • packages/protocol/script/SetDcapParams.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeAddressManager.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeAssignmentHook.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeBridge.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeERC1155Vault.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeERC20Vault.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeERC721Vault.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeGuardianProver.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeScript.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeSignalService.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeTaikoGovernor.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeTaikoL1.s.sol (1 hunks)
  • packages/protocol/script/upgrade/UpgradeTimelockController.s.sol (1 hunks)
  • packages/protocol/test/DeployCapability.sol (1 hunks)
  • packages/protocol/test/L1/gov/TaikoGovernor.t.sol (1 hunks)
  • packages/protocol/test/TaikoTest.sol (1 hunks)
  • packages/protocol/test/automata-attestation/AutomataDcapV3AttestationTest.t.sol (1 hunks)
  • packages/protocol/test/automata-attestation/common/AttestationBase.t.sol (1 hunks)
  • packages/protocol/test/automata-attestation/utils/DcapTestUtils.t.sol (1 hunks)
  • packages/protocol/test/automata-attestation/utils/V3QuoteParseUtils.t.sol (1 hunks)
  • packages/protocol/test/common/erc20/FreeMintERC20.sol (1 hunks)
  • packages/protocol/test/common/erc20/MayFailFreeMintERC20.sol (1 hunks)
  • packages/protocol/test/common/erc20/RegularERC20.sol (1 hunks)
  • packages/protocol/test/tokenvault/ERC1155Vault.t.sol (1 hunks)
  • packages/protocol/test/tokenvault/ERC721Vault.t.sol (1 hunks)
  • packages/protocol/test/verifiers/PseZkVerifier.t.sol (1 hunks)
Files skipped from review due to trivial changes (5)
  • packages/protocol/contracts/team/TimelockTokenPool.sol
  • packages/protocol/remappings.txt
  • packages/protocol/script/upgrade/UpgradeERC20Vault.s.sol
  • packages/protocol/script/upgrade/UpgradeERC721Vault.s.sol
  • packages/protocol/test/automata-attestation/AutomataDcapV3AttestationTest.t.sol
Additional comments: 55
packages/protocol/test/common/erc20/RegularERC20.sol (1)
  • 5-5: The import statement for the ERC20 contract from OpenZeppelin has been updated correctly to use the node_modules path.
packages/protocol/script/upgrade/UpgradeBridge.s.sol (1)
  • 17-18: The import paths for Script.sol and console2.sol have been correctly updated to reflect their new locations within the forge-std/src directory.
packages/protocol/script/upgrade/UpgradeTaikoL1.s.sol (1)
  • 17-18: The import paths for Script.sol and console2.sol have been correctly updated to reflect their new locations within the forge-std/src directory.
packages/protocol/script/upgrade/UpgradeERC1155Vault.s.sol (1)
  • 17-18: The import paths for Script.sol and console2.sol have been correctly updated to reflect their new locations within the forge-std/src directory.
packages/protocol/script/upgrade/UpgradeSignalService.s.sol (1)
  • 17-18: The import paths for Script.sol and console2.sol have been correctly updated to reflect their new locations within the forge-std/src directory.
packages/protocol/contracts/L1/gov/TaikoTimelockController.sol (1)
  • 17-17: The import statement for TimelockControllerUpgradeable.sol from OpenZeppelin has been updated correctly to use the node_modules path.
packages/protocol/contracts/libs/LibDeploy.sol (1)
  • 17-18: The import statements for ERC1967Proxy.sol and OwnableUpgradeable.sol from OpenZeppelin have been correctly updated to use the node_modules path.
packages/protocol/test/common/erc20/MayFailFreeMintERC20.sol (1)
  • 4-4: The import statement for the ERC20 contract from OpenZeppelin has been updated correctly to use the node_modules path.
packages/protocol/script/SetAddress.s.sol (1)
  • 17-18: The import paths for Script.sol and console2.sol have been correctly updated to reflect their new locations within the forge-std/src directory.
packages/protocol/script/upgrade/UpgradeScript.s.sol (2)
  • 18-18: The import statement for UUPSUpgradeable.sol from OpenZeppelin has been correctly updated to use the node_modules path.
  • 20-21: The import paths for console2.sol and Script.sol have been correctly updated to reflect their new locations within the forge-std/src directory.
packages/protocol/contracts/tokenvault/LibBridgedToken.sol (1)
  • 17-17: The import statement for the Strings.sol library from OpenZeppelin Contracts has been updated correctly to use the node_modules path.
packages/protocol/script/SetDcapParams.s.sol (1)
  • 17-18: The import paths for Script.sol and console2.sol have been correctly updated to reflect their new locations within the forge-std/src directory.
packages/protocol/contracts/team/airdrop/ERC20Airdrop.sol (1)
  • 17-18: The import statements for IERC20.sol and IVotes.sol from OpenZeppelin have been correctly updated to use the node_modules path.
packages/protocol/contracts/tokenvault/BaseVault.sol (1)
  • 17-17: The import statement for IERC165Upgradeable.sol from OpenZeppelin Contracts Upgradeable library has been updated correctly to use the node_modules path.
packages/protocol/contracts/L2/CrossChainOwned.sol (1)
  • 17-17: The import statement for IERC20.sol from OpenZeppelin has been updated correctly to use the node_modules path.
packages/protocol/test/DeployCapability.sol (2)
  • 5-6: The import paths for OpenZeppelin contracts have been correctly updated to use the @openzeppelin/ namespace, aligning with the PR's objective of managing dependencies through node_modules.
  • 8-9: The use of forge-std for testing and scripting purposes is noted and appropriate for the context of deployment scripts.
packages/protocol/contracts/team/airdrop/MerkleClaimable.sol (1)
  • 17-17: The import path for MerkleProof.sol has been correctly updated to use the @openzeppelin/contracts namespace, aligning with the PR's objective of managing dependencies through node_modules.
packages/protocol/contracts/libs/LibAddress.sol (1)
  • 17-20: The import paths for OpenZeppelin contracts have been correctly updated to use the @openzeppelin/contracts namespace, aligning with the PR's objective of managing dependencies through node_modules.
packages/protocol/test/TaikoTest.sol (1)
  • 4-7: The import paths for forge-std and OpenZeppelin contracts have been correctly updated, aligning with the PR's objective of managing dependencies through node_modules.
packages/protocol/contracts/common/OwnerUUPSUpgradable.sol (1)
  • 17-18: The import paths for OpenZeppelin contracts have been correctly updated to use the @openzeppelin/contracts-upgradeable namespace, aligning with the PR's objective of managing dependencies through node_modules.
packages/protocol/contracts/tokenvault/BridgedERC20Base.sol (1)
  • 17-17: The import path for ERC20Upgradeable.sol has been correctly updated to use the @openzeppelin/contracts-upgradeable namespace, aligning with the PR's objective of managing dependencies through node_modules.
packages/protocol/contracts/team/airdrop/ERC20Airdrop2.sol (1)
  • 17-17: The import path for IERC20.sol has been correctly updated to use the @openzeppelin/contracts namespace, aligning with the PR's objective of managing dependencies through node_modules.
packages/protocol/contracts/tokenvault/BridgedERC721.sol (1)
  • 17-18: The import paths for OpenZeppelin contracts have been correctly updated to use the @openzeppelin/contracts-upgradeable namespace for ERC721 functionality and the @openzeppelin/contracts namespace for utility functions, aligning with the PR's objective of managing dependencies through node_modules.
packages/protocol/contracts/L1/TaikoToken.sol (1)
  • 17-19: The import paths for OpenZeppelin contracts have been correctly updated to use the @openzeppelin/contracts-upgradeable namespace, aligning with the PR's objective of managing dependencies through node_modules.
packages/protocol/contracts/tokenvault/BridgedERC1155.sol (1)
  • 17-21: The import paths for OpenZeppelin contracts and interfaces have been correctly updated to use the @openzeppelin/contracts-upgradeable namespace for ERC1155 functionality and the @openzeppelin/contracts namespace for utility functions, aligning with the PR's objective of managing dependencies through node_modules.
packages/protocol/contracts/L1/gov/TaikoGovernor.sol (1)
  • 17-24: The import paths for OpenZeppelin governance contracts have been correctly updated to use the @openzeppelin/contracts-upgradeable namespace, and the addition of GovernorVotesQuorumFractionUpgradeable is appropriate for extending governance functionalities. This aligns with the PR's objective of managing dependencies through node_modules.
packages/protocol/contracts/tokenvault/BridgedERC20.sol (1)
  • 17-20: Changes in import paths from local to @openzeppelin namespace are correct and align with best practices for dependency management.
packages/protocol/contracts/L1/hooks/AssignmentHook.sol (1)
  • 17-18: Changes in import paths to use the @openzeppelin namespace are correct and align with best practices for dependency management.
packages/protocol/test/L1/gov/TaikoGovernor.t.sol (1)
  • 7-8: Changes in import paths to use the @openzeppelin namespace are correct and align with best practices for dependency management.
packages/protocol/contracts/verifiers/SgxVerifier.sol (1)
  • 17-17: Change in the import path for ECDSA.sol to use the @openzeppelin namespace is correct and aligns with best practices for dependency management.
packages/protocol/contracts/tokenvault/ERC721Vault.sol (1)
  • 17-18: Changes in import paths for ERC721 interfaces to use the @openzeppelin namespace are correct and align with best practices for dependency management.
packages/protocol/test/automata-attestation/utils/DcapTestUtils.t.sol (1)
  • 7-8: Changes to import paths for JSONParserLib and LibString using absolute paths are correct and align with best practices for dependency management.
packages/protocol/contracts/L1/libs/LibProposing.sol (1)
  • 17-17: Updating the import statement for IERC20.sol to use the @openzeppelin package is correct and enhances dependency management and security.
packages/protocol/genesis/GenerateGenesis.g.sol (1)
  • 4-6: Updating the import paths to point to the src directory within the forge-std package is correct and improves clarity and maintainability of the code.
packages/protocol/contracts/tokenvault/ERC20Vault.sol (1)
  • 17-18: Updating the import paths for ERC20 and SafeERC20 libraries to use the @openzeppelin package is correct and aligns with best practices for secure and reliable code.
packages/protocol/contracts/automata-attestation/lib/PEMCertChainLib.sol (1)
  • 4-4: The import path for LibString has been updated correctly to reflect the new location within the solady library. This change aligns with the PR's objective to streamline dependency management.
packages/protocol/test/automata-attestation/common/AttestationBase.t.sol (3)
  • 4-6: The import paths for forge-std modules have been updated correctly to point to the src directory. This change aligns with the PR's objective to streamline dependency management.
  • 10-10: The import path for P256Verifier has been updated correctly to reflect its location within the p256-verifier module. This change is consistent with the PR's objective.
  • 15-15: The import path for Base64 from the solady library has been updated correctly to point to the src/utils directory. This change aligns with the PR's objective to streamline dependency management.
packages/protocol/test/verifiers/PseZkVerifier.t.sol (1)
  • 5-5: Change in import path for Strings.sol aligns with the PR's objective and follows best practices for dependency management.
packages/protocol/contracts/L1/libs/LibProving.sol (1)
  • 17-17: Change in import path for IERC20.sol aligns with the PR's objective and follows best practices for dependency management.
packages/protocol/script/DeployOnL1.s.sol (1)
  • 17-17: The import path for Strings.sol from OpenZeppelin has been updated to use @openzeppelin/contracts namespace, aligning with the PR's objective to standardize dependency management.
packages/protocol/contracts/automata-attestation/AutomataDcapV3Attestation.sol (2)
  • 13-14: The import paths for Base64 and LibString have been updated to reflect their new locations within the solady library. This change aligns with the PR's objective to optimize and standardize import paths.
  • 21-21: The import statement for console.sol has been commented out. While this is a non-functional change, it suggests a cleanup of debugging code, which is a good practice for maintaining clean and production-ready code.
packages/protocol/test/tokenvault/ERC721Vault.t.sol (1)
  • 4-4: The import statement for the ERC721 contract has been updated to use the @openzeppelin package. Ensure that @openzeppelin/contracts is included in the project's package.json dependencies to avoid runtime errors.
packages/protocol/test/tokenvault/ERC1155Vault.t.sol (8)
  • 4-4: The import statement for the ERC1155 contract has been updated to use the OpenZeppelin Contracts library. This change aligns with the PR's objective to manage dependencies using node_modules instead of submodules, improving maintainability and ease of dependency management.
  • 6-7: Ensure that the TaikoTest.sol import and its usage throughout the test suite are consistent and correctly implemented. This base test setup is crucial for the integrity of the test environment.
  • 1-7: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [9-11]

The constructor of TestTokenERC1155 correctly initializes the ERC1155 token with a base URI. This setup is essential for testing token minting and interactions within the ERC1155Vault tests.

  • 1-7: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [13-15]

The PrankDestBridge contract is a mock to simulate cross-chain interactions without deploying real bridge code. This approach is effective for isolating the ERC1155Vault functionality in tests but ensure that the mock behavior closely mirrors the expected real-world bridge interactions.

  • 1-7: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [17-19]

The UpdatedBridgedERC1155 contract introduces a new method helloWorld. Verify that this addition is solely for testing purposes and assess its relevance to the overall test objectives.

  • 1-7: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [21-23]

The ERC1155VaultTest setup method is comprehensive, covering various aspects necessary for the tests. Ensure that the setup accurately reflects the test environment requirements, including mock contracts and initial token minting.

  • 1-7: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [25-27]

The test cases, such as test_1155Vault_sendToken_1155, are well-structured and cover significant functionalities of the ERC1155Vault. Ensure that each test case has clear objectives and adequately tests the contract's behavior under various conditions.

  • 1-7: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [29-31]

The final test case, test_1155Vault_upgrade_bridged_tokens_1155, demonstrates upgrading the implementation of a bridged contract. This test is crucial for ensuring that the upgrade mechanism works as expected. Verify that the upgrade process and the assertion checks are correctly implemented.

packages/protocol/script/DeployOnL1.s.sol Show resolved Hide resolved
@dantaik
Copy link
Contributor

dantaik commented Feb 14, 2024

I like the idea, but it seems there are test errors.

@dantaik
Copy link
Contributor

dantaik commented Feb 14, 2024

I like this idea, but please make sure all tests pass - there is at least a failure

@adaki2004
Copy link
Contributor

I like this idea, but please make sure all tests pass - there is at least a failure

@d1onys1us i think the failure is coming from an import (and wrong remappings). That one is removed on branch #15781, and once incorporated into main, the base of this PR can be updated.

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.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 12312f9 and 173d548.
Files selected for processing (2)
  • packages/protocol/script/DeployERC20Airdrop.s.sol (1 hunks)
  • packages/protocol/test/team/airdrop/ERC20Airdrop.t.sol (1 hunks)
Additional comments: 4
packages/protocol/script/DeployERC20Airdrop.s.sol (2)
  • 18-18: The import path for console2.sol has been updated correctly to reflect the new file structure. This change aligns with the PR's objective of improving project structure and dependency management.
  • 15-21: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [27-45]

The use of vm.startBroadcast and vm.stopBroadcast from Foundry's scripting environment is correctly implemented for transaction broadcasting. This approach is appropriate for deployment scripts in a development or testing context.

packages/protocol/test/team/airdrop/ERC20Airdrop.t.sol (2)
  • 6-6: The import statement for OwnableUpgradeable has been updated to use the @openzeppelin package. This change aligns with the PR's objective of standardizing and optimizing import paths for dependencies, improving maintainability and developer experience.
  • 3-9: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [7-122]

The mock contracts, such as MockAddressManager and SimpleERC20Vault, are implemented to facilitate testing without deploying external dependencies. This approach is effective for isolating the contract under test and focusing on its behavior. However, ensure that the behavior of these mock contracts closely mimics that of their real counterparts to ensure test accuracy.

@dantaik
Copy link
Contributor

dantaik commented Feb 14, 2024

@davidtaikocha I think you may need to review this PR. If I remembered correctly, you also need the codebase to work with Hardfork.

.gitmodules Show resolved Hide resolved
@davidtaikocha
Copy link
Member

@davidtaikocha I think you may need to review this PR. If I remembered correctly, you also need the codebase to work with Hardfork.

I think the codebase is still in node_modules right? so if the pnpm test:genesis test can be passed, i'm ok with that.

@dantaik dantaik enabled auto-merge (squash) February 14, 2024 11:18
@dantaik dantaik removed the request for review from davidtaikocha February 14, 2024 11:18
@dantaik dantaik merged commit cd35d69 into main Feb 14, 2024
14 checks passed
@dantaik dantaik deleted the cleanup-foundry branch February 14, 2024 11:18
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.

4 participants