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

refactor: disable ZETA related functions and remove call functions not using callOptions #393

Merged
merged 12 commits into from
Oct 16, 2024

Conversation

lumtis
Copy link
Member

@lumtis lumtis commented Oct 15, 2024

  • Comment out ZETA function
  • Remove old methods not using callOptions

Not running generate now to simplify review.

Opening for review now, there is a test error happening in these lines:
https://github.com/zeta-chain/protocol-contracts/pull/393/files#diff-2605cea5bc2def7c46e3d80e4eaef42116a8c377202c5645d231f1bd7daf4726R178
https://github.com/zeta-chain/protocol-contracts/pull/393/files#diff-2605cea5bc2def7c46e3d80e4eaef42116a8c377202c5645d231f1bd7daf4726R255
-> replacing the gasLimit with callOptions for withdraw tests. Gonna investigate further later, maybe you have an idea @skosito or are these tests still needed at all?

Summary by CodeRabbit

  • New Features

    • Introduced a new interface for handling unsupported methods, enhancing error management.
    • Updated contracts to implement the new interface, improving clarity on unsupported functionalities.
  • Bug Fixes

    • Modified deposit and withdrawal functions to revert on unsupported ZETA operations, ensuring proper error handling.
  • Documentation

    • Updated comments across contracts to reflect changes in functionality and error handling.
  • Tests

    • Added new test cases for error handling and updated existing tests to accommodate new function signatures and error types.

@lumtis lumtis marked this pull request as ready for review October 15, 2024 13:54
Copy link
Contributor

coderabbitai bot commented Oct 15, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

A new interface INotSupportedMethods has been introduced to define an error type ZETANotSupported, which is implemented in the GatewayEVM and GatewayZEVM contracts. These contracts have been modified to handle unsupported method calls by reverting with the new error. Additionally, several functions have been updated to utilize a CallOptions structure instead of individual parameters for gas limits. Test contracts have been adjusted to incorporate these changes, ensuring proper error handling and functionality.

Changes

File Change Summary
v2/contracts/Errors.sol Added interface INotSupportedMethods and error ZETANotSupported().
v2/contracts/evm/GatewayEVM.sol Implemented INotSupportedMethods; modified _transferFromToAssetHandler to revert on ZETA deposits.
v2/contracts/zevm/GatewayZEVM.sol Inherited INotSupportedMethods; updated withdraw, withdrawAndCall, and call functions to revert on unsupported operations and changed parameters to use CallOptions.
v2/contracts/zevm/interfaces/IGatewayZEVM.sol Updated withdrawAndCall and call functions to use CallOptions.
v2/test/GatewayEVM.t.sol Added error ZETANotSupported(); updated tests for handling deposits and custody balance checks.
v2/test/GatewayEVMZEVM.t.sol Integrated CallOptions into test functions; added a new state variable.
v2/test/GatewayZEVM.t.sol Added error ZETANotSupported(); updated event parameter sender to sfender and modified function calls to use CallOptions.
v2/test/utils/SenderZEVM.sol Updated callReceiver and withdrawAndCallReceiver to include CallOptions.

Possibly related issues

  • Disable ZETA gateway functions #390: The changes in this PR address the objective of disabling ZETA gateway functions as indicated by the introduction of the ZETANotSupported error.

Possibly related PRs

Suggested reviewers

  • fadeev
  • CharlieMc0
  • andresaiello
  • brewmaster012

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 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 anywhere in the PR title to generate the title automatically.

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

🧹 Outside diff range and nitpick comments (11)
v2/contracts/Errors.sol (3)

4-6: Approve interface declaration with minor documentation fix.

The interface declaration and its purpose are clear. However, there's a small typo in the documentation.

Please update the documentation comment as follows:

- /// @notice Interface for contracts that with non supported methods.
+ /// @notice Interface for contracts with non-supported methods.

7-7: Approve error declaration with suggestion for consideration.

The ZETANotSupported error declaration is clear and aligns with the PR objective of disabling ZETA-related functions.

Consider adding an optional message parameter to the error for more informative error reporting:

error ZETANotSupported(string message);

This would allow for more context when the error is thrown, potentially easing debugging and improving user experience.


1-9: Summary: New interface aligns with PR objectives.

The introduction of the INotSupportedMethods interface with the ZETANotSupported error aligns well with the PR objective of disabling ZETA-related functions. This provides a standardized way to handle unsupported methods across the codebase, which should improve consistency and maintainability.

As you implement this interface in other contracts, ensure consistent usage of the ZETANotSupported error for all ZETA-related functions that are being disabled. This will provide a uniform error handling mechanism throughout the codebase.

v2/test/GatewayEVMZEVM.t.sol (2)

127-131: LGTM. Consider adjusting the gasLimit value.

The initialization of callOptions is consistent with its addition as a state variable. However, the gasLimit value of 1 seems unusually low. Consider setting a more realistic gas limit for testing purposes, as this low value might not accurately represent real-world scenarios.


159-159: LGTM. Consider extracting CallOptions for improved readability.

The update to use CallOptions in the gatewayZEVM.call function is consistent with the PR objectives. However, creating the CallOptions inline might reduce readability. Consider extracting this to a separate variable or using the state variable callOptions if appropriate.

v2/test/GatewayEVM.t.sol (2)

506-510: Reminder to address the TODO comment for future implementation

The TODO comment indicates that this test should be updated once ZETA support is re-enabled (see issue #394). Consider tracking this with a GitHub issue to ensure it is revisited.

Would you like me to open a new GitHub issue to track this TODO?


514-515: Consider removing commented out code for clarity

The lines checking the owner's ZETA balance after deposit are commented out. Since the deposit of ZETA is currently not supported and the test expects a revert, consider removing these lines to keep the codebase clean.

v2/test/GatewayZEVM.t.sol (4)

309-313: Reminder to update tests when ZETA support is restored

The test currently expects a revert with ZETANotSupported and includes a TODO to replace the error check once ZETA support returns. Ensure that these tests are revisited and updated accordingly when ZETA functionality is reintroduced.

Would you like me to open a GitHub issue to track this task?


329-333: Reminder to update tests for ZETA withdrawal failures

Similar to earlier, this test is adjusted to expect ZETANotSupported due to the temporary disabling of ZETA. Please remember to update these tests when re-enabling ZETA support.

Would you like assistance in updating these tests once ZETA is supported again?


Line range hint 378-395: Commented out assertions may hide potential issues

In the testWithdrawZETA function, several assertions are commented out. This may prevent detection of issues in future changes.

Consider uncommenting the assertions or updating the test to reflect the current state.


467-467: Ensure test reflects current ZETA support status

The test expects a revert with ZETANotSupported. Verify that this is the correct behavior and update the test as necessary when ZETA support is reinstated.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f7f6d9f and 11a1f78.

⛔ Files ignored due to path filters (1)
  • v2/soldeer.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • v2/contracts/Errors.sol (1 hunks)
  • v2/contracts/evm/GatewayEVM.sol (3 hunks)
  • v2/contracts/zevm/GatewayZEVM.sol (3 hunks)
  • v2/contracts/zevm/interfaces/IGatewayZEVM.sol (0 hunks)
  • v2/test/GatewayEVM.t.sol (2 hunks)
  • v2/test/GatewayEVMZEVM.t.sol (5 hunks)
  • v2/test/GatewayZEVM.t.sol (10 hunks)
  • v2/test/utils/SenderZEVM.sol (3 hunks)
💤 Files with no reviewable changes (1)
  • v2/contracts/zevm/interfaces/IGatewayZEVM.sol
🧰 Additional context used
🔇 Additional comments (18)
v2/contracts/Errors.sol (1)

1-2: LGTM: Appropriate license and Solidity version.

The MIT license is suitable for open-source projects, and using a specific, recent Solidity version (0.8.26) is good for consistency and security.

v2/test/utils/SenderZEVM.sol (4)

5-5: LGTM: Import statement for CallOptions and RevertOptions added.

The new import statement is necessary and consistent with the changes made in the functions below. It correctly imports the required structures from the IGatewayZEVM interface.


5-5: Summary: Consistent implementation of CallOptions with a concern.

The changes in this file consistently implement the use of CallOptions in both callReceiver and withdrawAndCallReceiver functions. The new import statement and the updates to the function calls are correct and align with the PR objectives.

However, there's a consistent use of a very low gasLimit (1) in both functions. While this consistency suggests it might be intentional, it's important to verify if this value is appropriate for the intended use case. Such a low gas limit could potentially cause issues in execution.

Please confirm if the gasLimit of 1 is intentional and suitable for these test functions. If not, consider adjusting it to a more practical value.

Also applies to: 42-46, 50-50, 85-89, 91-91


85-89: Consistent use of CallOptions, but verify gas limit.

The changes to use CallOptions in withdrawAndCallReceiver are correct and consistent with the callReceiver function. However, the gasLimit of 1 is still present and might be too low for practical use. Please verify if this is intentional or if it should be adjusted.

#!/bin/bash
# Description: Check for other occurrences of CallOptions in the codebase to compare gas limit values

echo "Searching for CallOptions usage in the codebase:"
rg --type solidity 'CallOptions\s*\{[^}]*gasLimit:' .

Also applies to: 91-91


42-46: Verify the gas limit in CallOptions.

The changes to use CallOptions are correct and align with the updated interface. However, the gasLimit of 1 seems unusually low and might cause issues in execution. Please verify if this is intentional or if it should be set to a more reasonable value.

Also applies to: 50-50

✅ Verification successful

Gas Limit Configuration Verified

The usage of CallOptions with gasLimit: 1 is consistent across multiple test files in the codebase. This indicates that the low gas limit is intentional and standard for testing purposes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other occurrences of gasLimit in test files to compare values

echo "Searching for gasLimit usage in test files:"
rg --type solidity 'gasLimit:' test/

Length of output: 195


Script:

#!/bin/bash
# Description: Check for other occurrences of gasLimit in Solidity test files

echo "Searching for gasLimit usage in Solidity test files:"
rg -g "*.sol" 'gasLimit:' test/

Length of output: 192


Script:

#!/bin/bash
# Description: Check for other occurrences of gasLimit in all Solidity files

echo "Searching for gasLimit usage in all Solidity files:"
rg -g "*.sol" 'gasLimit:' .

Length of output: 3561

v2/test/GatewayEVMZEVM.t.sol (4)

62-63: LGTM. Please clarify the purpose of RevertOptions.

The addition of the callOptions variable aligns with the PR objectives. However, the RevertOptions variable wasn't mentioned in the summary. Could you please provide more context on its purpose and how it relates to the overall changes?


178-182: LGTM. Consistent use of CallOptions.

The update to the function signature in the encoded data correctly incorporates the CallOptions structure, aligning with the PR objectives. The use of the callOptions variable (presumably the state variable) maintains consistency and improves the test's alignment with the updated function signature.


255-260: LGTM. Consistent implementation of CallOptions.

The update to the function signature in the encoded data correctly incorporates the CallOptions structure, aligning with the PR objectives. This change is consistent with the similar modification made in the testCallReceiverEVMFromSenderZEVM function, maintaining a uniform approach throughout the test file.


Line range hint 1-283: Overall LGTM. Successfully incorporated CallOptions.

The changes in this file successfully incorporate the CallOptions structure as intended, aligning well with the PR objectives. The implementation is consistent across different test functions, improving the contract's functionality and testability. While there are a few minor suggestions for improvement (such as clarifying the purpose of RevertOptions and considering a more realistic gasLimit), the overall changes are well-implemented and maintain the existing test coverage.

v2/contracts/zevm/GatewayZEVM.sol (2)

6-6: Importing INotSupportedMethods Interface

The import statement correctly includes the INotSupportedMethods interface, allowing the contract to implement necessary error handling for unsupported methods.


27-28: Adding PausableUpgradeable and INotSupportedMethods to Inheritance

The contract now inherits from PausableUpgradeable and INotSupportedMethods, providing pausing functionality and implementing the interface for unsupported methods. This enhances the contract's capabilities and aligns with best practices.

v2/contracts/evm/GatewayEVM.sol (2)

4-4: Importing INotSupportedMethods Interface

The addition of the INotSupportedMethods import allows the contract to implement standardized error handling for unsupported methods.


27-28: Updated Inheritance with PausableUpgradeable and INotSupportedMethods

The contract now inherits from PausableUpgradeable and INotSupportedMethods. Ensure that the pause functionality is correctly initialized and that all required functions from the interface are properly implemented.

v2/test/GatewayEVM.t.sol (2)

415-415: Definition of ZETANotSupported error is appropriate

The error declaration correctly defines ZETANotSupported, which is used to handle unsupported ZETA operations.


506-510: Update to test reflects current unsupported ZETA operations

The test now correctly expects a revert with ZETANotSupported when attempting to deposit ZETA, which aligns with the current functionality.

v2/test/GatewayZEVM.t.sol (3)

35-35: Appropriate addition of ZETANotSupported error

The addition of the ZETANotSupported error correctly captures unsupported ZETA operations and aligns with the changes in handling unsupported methods.


340-343: Ensure consistent error handling for ZETA operations

The expected revert is changed to ZETANotSupported, replacing InsufficientZetaAmount. Confirm that this aligns with the intended behavior for unsupported ZETA operations.


Line range hint 173-206: Ensure updated function signatures are used correctly

The function gateway.withdrawAndCall is updated to accept a CallOptions struct. Please verify that all calls to this function correctly utilize the new CallOptions parameter and that test cases reflect the updated functionality.

Run the following script to check for correct usage:

✅ Verification successful

All withdrawAndCall function calls correctly utilize the updated CallOptions parameter.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check all calls to `withdrawAndCall` to ensure they use the updated `CallOptions` struct.

# Test: Search for `withdrawAndCall` function calls.
# Expect: All calls should include `CallOptions` parameter.

rg --type solidity -A2 'gateway\.withdrawAndCall\('

Length of output: 86


Script:

#!/bin/bash
# Description: Check all calls to `withdrawAndCall` in Solidity files to ensure they use the updated `CallOptions` struct.

# Find all .sol files and search for `withdrawAndCall` function calls.
fd --extension sol --type file | xargs rg 'gateway\.withdrawAndCall\(' -A2

Length of output: 4253

v2/contracts/zevm/GatewayZEVM.sol Outdated Show resolved Hide resolved
v2/contracts/zevm/GatewayZEVM.sol Outdated Show resolved Hide resolved
v2/contracts/evm/GatewayEVM.sol Outdated Show resolved Hide resolved
v2/test/GatewayZEVM.t.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@skosito skosito left a comment

Choose a reason for hiding this comment

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

looks good, regarding your comment in description, i also did a bit of cleaning up those duplicate methods here couple days ago, i think i removed correct tests and tests were passing, maybe it can help: 752dde4#diff-6b934f508cf9d7ef1dbd0d3a31087c6a8dc330fa646dbb07d7477fcb024cc253

v2/contracts/Errors.sol Show resolved Hide resolved
v2/soldeer.lock Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (5)
v2/contracts/zevm/GatewayZEVM.sol (5)

6-6: LGTM: Addition of INotSupportedMethods interface

The addition of the INotSupportedMethods interface and its implementation in the GatewayZEVM contract aligns with the PR objective of disabling ZETA-related functions. This change provides a standardized way to handle unsupported methods.

Consider updating the contract's documentation to reflect this change and explain which methods are no longer supported and why.

Also applies to: 28-28


205-239: LGTM: Disabling ZETA withdrawal functionality

The changes to the withdraw function effectively disable ZETA withdrawals, which aligns with the PR objectives. The addition of the ZETANotSupported error provides a clear indication to users that this functionality is currently unavailable.

Consider removing the commented-out code to improve code readability. The original implementation can be retrieved from version control if needed in the future. If you prefer to keep it for now, add a comment explaining why it's being retained and when it might be removed or re-enabled.


243-274: LGTM: Disabling ZETA withdrawAndCall functionality

The changes to the withdrawAndCall function effectively disable ZETA withdrawals and subsequent contract calls, which aligns with the PR objectives. The addition of the ZETANotSupported error provides a clear indication to users that this functionality is currently unavailable.

As with the withdraw function, consider removing the commented-out code to improve code readability. The original implementation can be retrieved from version control if needed in the future. If you prefer to keep it for now, add a comment explaining why it's being retained and when it might be removed or re-enabled.


Line range hint 282-293: LGTM: Updated call function to use CallOptions

The modification of the call function to use CallOptions instead of a separate gasLimit parameter is a good improvement. This change simplifies the function signature and provides more flexibility for future extensions of call options.

Consider updating the function's documentation to reflect the new CallOptions parameter and explain what options are available within this structure.


Line range hint 1-465: Summary: Disabling ZETA functions and updating call options

The changes in this file successfully achieve the PR objectives:

  1. ZETA-related withdrawal functions (withdraw and withdrawAndCall) have been disabled and now revert with a ZETANotSupported error.
  2. The call function has been updated to use CallOptions, improving flexibility and consistency.

These modifications enhance the contract's alignment with current requirements while maintaining a clear path for future updates through TODO comments and linked issues.

Consider the following suggestions for future improvements:

  1. Once the ZETA functionality is ready to be re-enabled, ensure that all disabled functions are thoroughly tested and updated.
  2. If the commented-out code for ZETA functions is kept long-term, consider moving it to a separate file or document to maintain cleaner code in the main contract.
  3. Update the contract's documentation to clearly indicate which functions are currently disabled and provide information on alternative methods users should use in the meantime.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 11a1f78 and 40c5aaa.

⛔ Files ignored due to path filters (144)
  • v2/docs/src/SUMMARY.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/Errors.sol/interface.INotSupportedMethods.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/README.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/Revert.sol/interface.Revertable.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/Revert.sol/struct.RevertContext.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/Revert.sol/struct.RevertOptions.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/ERC20Custody.sol/contract.ERC20Custody.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/GatewayEVM.sol/contract.GatewayEVM.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/ZetaConnectorBase.sol/abstract.ZetaConnectorBase.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/ZetaConnectorNative.sol/contract.ZetaConnectorNative.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/ZetaConnectorNonNative.sol/contract.ZetaConnectorNonNative.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20Custody.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20CustodyErrors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20CustodyEvents.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/interface.Callable.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVM.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVMErrors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVMEvents.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/struct.MessageContext.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IZetaConnector.sol/interface.IZetaConnectorEvents.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IZetaNonEthNew.sol/interface.IZetaNonEthNew.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/GatewayZEVM.sol/contract.GatewayZEVM.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/SystemContract.sol/contract.SystemContract.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/SystemContract.sol/interface.SystemContractErrors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/ZRC20.sol/contract.ZRC20.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/ZRC20.sol/interface.ZRC20Errors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVM.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVMErrors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVMEvents.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IGatewayZEVM.sol/struct.CallOptions.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/ISystem.sol/interface.ISystem.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IWZETA.sol/interface.IWETH9.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IZRC20.sol/enum.CoinType.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IZRC20.sol/interface.IZRC20.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IZRC20.sol/interface.IZRC20Metadata.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IZRC20.sol/interface.ZRC20Events.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/UniversalContract.sol/interface.UniversalContract.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/UniversalContract.sol/interface.zContract.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/UniversalContract.sol/struct.zContext.md is excluded by !v2/docs/**
  • v2/docs/src/index.md is excluded by !v2/docs/**
  • v2/pkg/address.sol/address.go is excluded by !v2/pkg/**
  • v2/pkg/beaconproxy.sol/beaconproxy.go is excluded by !v2/pkg/**
  • v2/pkg/console.sol/console.go is excluded by !v2/pkg/**
  • v2/pkg/core.sol/core.go is excluded by !v2/pkg/**
  • v2/pkg/defender.sol/defender.go is excluded by !v2/pkg/**
  • v2/pkg/defenderdeploy.sol/defenderdeploy.go is excluded by !v2/pkg/**
  • v2/pkg/erc1967proxy.sol/erc1967proxy.go is excluded by !v2/pkg/**
  • v2/pkg/erc1967utils.sol/erc1967utils.go is excluded by !v2/pkg/**
  • v2/pkg/erc20custody.sol/erc20custody.go is excluded by !v2/pkg/**
  • v2/pkg/erc20custody.t.sol/erc20custodytest.go is excluded by !v2/pkg/**
  • v2/pkg/erc20custodyupgradetest.sol/erc20custodyupgradetest.go is excluded by !v2/pkg/**
  • v2/pkg/errors.sol/inotsupportedmethods.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayevm.sol/gatewayevm.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayevm.t.sol/gatewayevminboundtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayevm.t.sol/gatewayevmtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayevmupgradetest.sol/gatewayevmupgradetest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayevmzevm.t.sol/gatewayevmzevmtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayzevm.sol/gatewayzevm.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayzevm.t.sol/gatewayzevminboundtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayzevm.t.sol/gatewayzevmoutboundtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayzevmupgradetest.sol/gatewayzevmupgradetest.go is excluded by !v2/pkg/**
  • v2/pkg/igatewayzevm.sol/igatewayzevm.go is excluded by !v2/pkg/**
  • v2/pkg/math.sol/math.go is excluded by !v2/pkg/**
  • v2/pkg/mockerc20.sol/mockerc20.go is excluded by !v2/pkg/**
  • v2/pkg/mockerc721.sol/mockerc721.go is excluded by !v2/pkg/**
  • v2/pkg/proxyadmin.sol/proxyadmin.go is excluded by !v2/pkg/**
  • v2/pkg/receiverevm.sol/receiverevm.go is excluded by !v2/pkg/**
  • v2/pkg/safeconsole.sol/safeconsole.go is excluded by !v2/pkg/**
  • v2/pkg/safeerc20.sol/safeerc20.go is excluded by !v2/pkg/**
  • v2/pkg/senderzevm.sol/senderzevm.go is excluded by !v2/pkg/**
  • v2/pkg/signedmath.sol/signedmath.go is excluded by !v2/pkg/**
  • v2/pkg/src/strings.sol/strings.go is excluded by !v2/pkg/**
  • v2/pkg/stderror.sol/stderror.go is excluded by !v2/pkg/**
  • v2/pkg/stdjson.sol/stdjson.go is excluded by !v2/pkg/**
  • v2/pkg/stdmath.sol/stdmath.go is excluded by !v2/pkg/**
  • v2/pkg/stdstorage.sol/stdstorage.go is excluded by !v2/pkg/**
  • v2/pkg/stdstorage.sol/stdstoragesafe.go is excluded by !v2/pkg/**
  • v2/pkg/stdstyle.sol/stdstyle.go is excluded by !v2/pkg/**
  • v2/pkg/stdtoml.sol/stdtoml.go is excluded by !v2/pkg/**
  • v2/pkg/storageslot.sol/storageslot.go is excluded by !v2/pkg/**
  • v2/pkg/strings.sol/strings.go is excluded by !v2/pkg/**
  • v2/pkg/systemcontract.sol/systemcontract.go is excluded by !v2/pkg/**
  • v2/pkg/systemcontractmock.sol/systemcontractmock.go is excluded by !v2/pkg/**
  • v2/pkg/testerc20.sol/testerc20.go is excluded by !v2/pkg/**
  • v2/pkg/testuniversalcontract.sol/testuniversalcontract.go is excluded by !v2/pkg/**
  • v2/pkg/transparentupgradeableproxy.sol/transparentupgradeableproxy.go is excluded by !v2/pkg/**
  • v2/pkg/upgradeablebeacon.sol/upgradeablebeacon.go is excluded by !v2/pkg/**
  • v2/pkg/upgrades.sol/unsafeupgrades.go is excluded by !v2/pkg/**
  • v2/pkg/upgrades.sol/upgrades.go is excluded by !v2/pkg/**
  • v2/pkg/utils.sol/utils.go is excluded by !v2/pkg/**
  • v2/pkg/versions.sol/versions.go is excluded by !v2/pkg/**
  • v2/pkg/wzeta.sol/weth9.go is excluded by !v2/pkg/**
  • v2/pkg/zeta.non-eth.sol/zetanoneth.go is excluded by !v2/pkg/**
  • v2/pkg/zetaconnectornative.sol/zetaconnectornative.go is excluded by !v2/pkg/**
  • v2/pkg/zetaconnectornative.t.sol/zetaconnectornativetest.go is excluded by !v2/pkg/**
  • v2/pkg/zetaconnectornativeupgradetest.sol/zetaconnectornativeupgradetest.go is excluded by !v2/pkg/**
  • v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go is excluded by !v2/pkg/**
  • v2/pkg/zetaconnectornonnative.t.sol/zetaconnectornonnativetest.go is excluded by !v2/pkg/**
  • v2/pkg/zetaconnectornonnativeupgradetest.sol/zetaconnectornonnativeupgradetest.go is excluded by !v2/pkg/**
  • v2/pkg/zrc20.sol/zrc20.go is excluded by !v2/pkg/**
  • v2/pkg/zrc20.t.sol/zrc20test.go is excluded by !v2/pkg/**
  • v2/soldeer.lock is excluded by !**/*.lock
  • v2/types/Errors.sol/INotSupportedMethods.ts is excluded by !v2/types/**
  • v2/types/Errors.sol/index.ts is excluded by !v2/types/**
  • v2/types/GatewayZEVM.ts is excluded by !v2/types/**
  • v2/types/IGatewayZEVM.sol/IGatewayZEVM.ts is excluded by !v2/types/**
  • v2/types/factories/Address__factory.ts is excluded by !v2/types/**
  • v2/types/factories/BeaconProxy__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ERC1967Proxy__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ERC1967Utils__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ERC20CustodyUpgradeTest__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ERC20Custody__factory.ts is excluded by !v2/types/**
  • v2/types/factories/Errors.sol/INotSupportedMethods__factory.ts is excluded by !v2/types/**
  • v2/types/factories/Errors.sol/index.ts is excluded by !v2/types/**
  • v2/types/factories/GatewayEVMUpgradeTest__factory.ts is excluded by !v2/types/**
  • v2/types/factories/GatewayEVM__factory.ts is excluded by !v2/types/**
  • v2/types/factories/GatewayZEVMUpgradeTest__factory.ts is excluded by !v2/types/**
  • v2/types/factories/GatewayZEVM__factory.ts is excluded by !v2/types/**
  • v2/types/factories/IGatewayZEVM.sol/IGatewayZEVM__factory.ts is excluded by !v2/types/**
  • v2/types/factories/Math__factory.ts is excluded by !v2/types/**
  • v2/types/factories/MockERC20__factory.ts is excluded by !v2/types/**
  • v2/types/factories/MockERC721__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ProxyAdmin__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ReceiverEVM__factory.ts is excluded by !v2/types/**
  • v2/types/factories/SafeERC20__factory.ts is excluded by !v2/types/**
  • v2/types/factories/SenderZEVM__factory.ts is excluded by !v2/types/**
  • v2/types/factories/StdError.sol/StdError__factory.ts is excluded by !v2/types/**
  • v2/types/factories/StdStorage.sol/StdStorageSafe__factory.ts is excluded by !v2/types/**
  • v2/types/factories/Strings__factory.ts is excluded by !v2/types/**
  • v2/types/factories/SystemContract.sol/SystemContract__factory.ts is excluded by !v2/types/**
  • v2/types/factories/SystemContractMock.sol/SystemContractMock__factory.ts is excluded by !v2/types/**
  • v2/types/factories/TestERC20__factory.ts is excluded by !v2/types/**
  • v2/types/factories/TestUniversalContract__factory.ts is excluded by !v2/types/**
  • v2/types/factories/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.ts is excluded by !v2/types/**
  • v2/types/factories/UpgradeableBeacon__factory.ts is excluded by !v2/types/**
  • v2/types/factories/WZETA.sol/WETH9__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ZRC20.sol/ZRC20__factory.ts is excluded by !v2/types/**
  • v2/types/factories/Zeta.non-eth.sol/ZetaNonEth__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ZetaConnectorNativeUpgradeTest__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ZetaConnectorNative__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ZetaConnectorNonNativeUpgradeTest__factory.ts is excluded by !v2/types/**
  • v2/types/factories/ZetaConnectorNonNative__factory.ts is excluded by !v2/types/**
  • v2/types/factories/index.ts is excluded by !v2/types/**
  • v2/types/index.ts is excluded by !v2/types/**
📒 Files selected for processing (6)
  • v2/contracts/Errors.sol (1 hunks)
  • v2/contracts/evm/GatewayEVM.sol (3 hunks)
  • v2/contracts/zevm/GatewayZEVM.sol (3 hunks)
  • v2/test/GatewayEVMZEVM.t.sol (5 hunks)
  • v2/test/GatewayZEVM.t.sol (10 hunks)
  • v2/test/utils/SenderZEVM.sol (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • v2/contracts/Errors.sol
  • v2/contracts/evm/GatewayEVM.sol
  • v2/test/GatewayZEVM.t.sol
  • v2/test/utils/SenderZEVM.sol
🧰 Additional context used
🔇 Additional comments (4)
v2/test/GatewayEVMZEVM.t.sol (4)

62-63: LGTM

The declaration of callOptions and revertOptions is appropriate and aligns with the integration of the CallOptions structure into the tests.


156-162: Verify sufficient gasLimit for gatewayZEVM.call

The CallOptions used here sets gasLimit to 1. Similar to earlier, this value may not provide enough gas for the call to complete, especially with isArbitraryCall set to true. Please ensure that the gasLimit is adequate for the complexity of the transaction.


181-185: Ensure gasLimit in callOptions is adequate

The callOptions passed in this function invocation have a gasLimit of 1. As previously mentioned, this may not be sufficient for the transaction to execute without issues. Verify that the gasLimit is set appropriately for the function being called.


258-263: Confirm gasLimit sufficiency in withdrawAndCall

The callOptions for withdrawAndCall also use a gasLimit of 1. Consistent with earlier comments, please verify that this gasLimit is sufficient for the function to execute as expected.

v2/test/GatewayEVMZEVM.t.sol Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.23%. Comparing base (a675f8a) to head (cf2ea8c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #393      +/-   ##
==========================================
- Coverage   84.95%   84.23%   -0.72%     
==========================================
  Files           8        8              
  Lines         412      387      -25     
  Branches      138      121      -17     
==========================================
- Hits          350      326      -24     
+ Misses         62       61       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (4)
v2/contracts/zevm/GatewayZEVM.sol (2)

205-239: Approved: ZETA withdrawal disabled as per PR objectives

The changes to the withdraw function for ZETA tokens effectively disable this functionality, which aligns with the PR objectives. The addition of the ZETANotSupported error provides clear feedback to callers.

However, consider cleaning up the commented-out code in a future PR to improve code maintainability. The TODO comment and issue link provide sufficient context for future reference.

In a future PR, consider removing the commented-out code to keep the codebase clean. The version control system can be used to retrieve the previous implementation if needed.


Line range hint 1-461: Summary: Changes align well with PR objectives

The modifications to the GatewayZEVM contract successfully achieve the PR objectives:

  1. ZETA-related functions (withdraw and withdrawAndCall) have been disabled and now revert with a clear error message.
  2. The introduction of the INotSupportedMethods interface provides a structured way to handle unsupported operations.
  3. The call function has been updated to use CallOptions, improving consistency across the contract.

These changes effectively streamline the codebase by disabling certain functions and removing outdated methods.

Consider creating a follow-up task to clean up the commented-out code in the withdraw and withdrawAndCall functions. While this code provides useful context for the recent changes, it may impact code readability and maintainability in the long term. The version control system can be used to retrieve previous implementations if needed in the future.

v2/test/GatewayZEVM.t.sol (2)

358-362: LGTM: Updated error handling for ZETA withdrawal.

The error expectation has been changed from InsufficientZetaAmount to ZETANotSupported, aligning with the PR objective of disabling ZETA-related functions. The TODO comment provides good context for this change.

Would you like me to create a GitHub issue to track the TODO for replacing this error check once ZETA support is restored?


Line range hint 427-454: LGTM: Disabled ZETA withdrawal test.

The ZETA withdrawal test has been significantly modified, with most of the logic commented out and a new expectation for the ZETANotSupported error added. This aligns with the PR objective of disabling ZETA-related functions.

Would you like me to create a GitHub issue to track the TODO for restoring this test once ZETA support is back?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 40c5aaa and 3d536cb.

⛔ Files ignored due to path filters (67)
  • v2/docs/src/SUMMARY.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/Errors.sol/interface.INotSupportedMethods.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/Revert.sol/interface.Revertable.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/Revert.sol/struct.RevertContext.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/Revert.sol/struct.RevertOptions.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/ERC20Custody.sol/contract.ERC20Custody.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/GatewayEVM.sol/contract.GatewayEVM.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/ZetaConnectorBase.sol/abstract.ZetaConnectorBase.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/ZetaConnectorNative.sol/contract.ZetaConnectorNative.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/ZetaConnectorNonNative.sol/contract.ZetaConnectorNonNative.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20Custody.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20CustodyErrors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20CustodyEvents.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/interface.Callable.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVM.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVMErrors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVMEvents.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IGatewayEVM.sol/struct.MessageContext.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IZetaConnector.sol/interface.IZetaConnectorEvents.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/evm/interfaces/IZetaNonEthNew.sol/interface.IZetaNonEthNew.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/GatewayZEVM.sol/contract.GatewayZEVM.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/SystemContract.sol/contract.SystemContract.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/SystemContract.sol/interface.SystemContractErrors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/ZRC20.sol/contract.ZRC20.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/ZRC20.sol/interface.ZRC20Errors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVM.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVMErrors.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVMEvents.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IGatewayZEVM.sol/struct.CallOptions.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/ISystem.sol/interface.ISystem.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IWZETA.sol/interface.IWETH9.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IZRC20.sol/enum.CoinType.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IZRC20.sol/interface.IZRC20.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IZRC20.sol/interface.IZRC20Metadata.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/IZRC20.sol/interface.ZRC20Events.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/UniversalContract.sol/interface.UniversalContract.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/UniversalContract.sol/interface.zContract.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/UniversalContract.sol/struct.MessageContext.md is excluded by !v2/docs/**
  • v2/docs/src/contracts/zevm/interfaces/UniversalContract.sol/struct.zContext.md is excluded by !v2/docs/**
  • v2/docs/src/index.md is excluded by !v2/docs/**
  • v2/pkg/erc20custody.t.sol/erc20custodytest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayevm.sol/gatewayevm.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayevm.t.sol/gatewayevminboundtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayevm.t.sol/gatewayevmtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayevmzevm.t.sol/gatewayevmzevmtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayzevm.sol/gatewayzevm.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayzevm.t.sol/gatewayzevminboundtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayzevm.t.sol/gatewayzevmoutboundtest.go is excluded by !v2/pkg/**
  • v2/pkg/gatewayzevmupgradetest.sol/gatewayzevmupgradetest.go is excluded by !v2/pkg/**
  • v2/pkg/igatewayzevm.sol/igatewayzevm.go is excluded by !v2/pkg/**
  • v2/pkg/senderzevm.sol/senderzevm.go is excluded by !v2/pkg/**
  • v2/pkg/systemcontract.sol/systemcontract.go is excluded by !v2/pkg/**
  • v2/pkg/systemcontractmock.sol/systemcontractmock.go is excluded by !v2/pkg/**
  • v2/pkg/testuniversalcontract.sol/testuniversalcontract.go is excluded by !v2/pkg/**
  • v2/pkg/zetaconnectornative.t.sol/zetaconnectornativetest.go is excluded by !v2/pkg/**
  • v2/pkg/zetaconnectornonnative.t.sol/zetaconnectornonnativetest.go is excluded by !v2/pkg/**
  • v2/pkg/zrc20.t.sol/zrc20test.go is excluded by !v2/pkg/**
  • v2/types/GatewayZEVM.ts is excluded by !v2/types/**
  • v2/types/IGatewayZEVM.sol/IGatewayZEVM.ts is excluded by !v2/types/**
  • v2/types/factories/GatewayEVM__factory.ts is excluded by !v2/types/**
  • v2/types/factories/GatewayZEVMUpgradeTest__factory.ts is excluded by !v2/types/**
  • v2/types/factories/GatewayZEVM__factory.ts is excluded by !v2/types/**
  • v2/types/factories/IGatewayZEVM.sol/IGatewayZEVM__factory.ts is excluded by !v2/types/**
  • v2/types/factories/SenderZEVM__factory.ts is excluded by !v2/types/**
  • v2/types/factories/SystemContract.sol/SystemContract__factory.ts is excluded by !v2/types/**
  • v2/types/factories/SystemContractMock.sol/SystemContractMock__factory.ts is excluded by !v2/types/**
  • v2/types/factories/TestUniversalContract__factory.ts is excluded by !v2/types/**
📒 Files selected for processing (3)
  • v2/contracts/zevm/GatewayZEVM.sol (3 hunks)
  • v2/contracts/zevm/interfaces/IGatewayZEVM.sol (0 hunks)
  • v2/test/GatewayZEVM.t.sol (10 hunks)
💤 Files with no reviewable changes (1)
  • v2/contracts/zevm/interfaces/IGatewayZEVM.sol
🧰 Additional context used
🔇 Additional comments (12)
v2/contracts/zevm/GatewayZEVM.sol (3)

6-6: LGTM: New interface implementation aligns with PR objectives

The addition of the INotSupportedMethods interface and its implementation in the GatewayZEVM contract is in line with the PR's goal of disabling ZETA-related functions. This change provides a structured way to handle unsupported methods.

Also applies to: 28-28


243-274: Approved: ZETA withdrawAndCall disabled as per PR objectives

The changes to the withdrawAndCall function for ZETA tokens mirror those made to the withdraw function, effectively disabling this functionality as intended. This aligns with the PR objectives.

As with the withdraw function, consider cleaning up the commented-out code in a future PR to improve code maintainability. The TODO comment and issue link provide sufficient context for future reference.

The suggestion to clean up commented-out code in a future PR applies here as well, for the same reasons mentioned in the previous comment.


Line range hint 284-289: LGTM: Improved consistency with CallOptions

The update to the call function signature, replacing the separate gasLimit parameter with the CallOptions structure, improves consistency across the contract. This change aligns well with the use of CallOptions in other parts of the contract and simplifies the function interface.

v2/test/GatewayZEVM.t.sol (9)

35-35: LGTM: New error for ZETA functionality.

The addition of the ZETANotSupported error aligns with the PR objective of disabling ZETA-related functions.


173-180: LGTM: Updated function call using CallOptions struct.

The withdrawAndCall function now uses a CallOptions struct, which aligns with the PR objective of updating function calls to use callOptions. This change improves code structure and readability.


188-195: LGTM: Consistent use of CallOptions struct.

This withdrawAndCall function call has been updated to use the CallOptions struct, maintaining consistency with the previous change and aligning with the PR objectives.


201-208: LGTM: Consistent update to use CallOptions struct.

This withdrawAndCall function call has been updated to use the CallOptions struct, maintaining consistency with the previous changes and aligning with the PR objectives.


214-221: LGTM: Consistent use of CallOptions struct.

This withdrawAndCall function call has been updated to use the CallOptions struct, maintaining consistency with the previous changes and aligning with the PR objectives.


234-241: LGTM: Consistent update to use CallOptions struct.

This withdrawAndCall function call has been updated to use the CallOptions struct, maintaining consistency with the previous changes and aligning with the PR objectives.


268-275: LGTM: Consistent use of CallOptions struct.

This withdrawAndCall function call has been updated to use the CallOptions struct, maintaining consistency with the previous changes and aligning with the PR objectives.


368-373: LGTM: Consistent update to error handling for ZETA withdrawal.

The error expectation has been changed from MessageSizeExceeded to ZETANotSupported, maintaining consistency with the previous change and aligning with the PR objective of disabling ZETA-related functions. The TODO comment provides good context for this change.


378-382: LGTM: Consistent update to error handling for ZETA withdrawal.

The error expectation has been changed from ZeroAddress to ZETANotSupported, maintaining consistency with the previous changes and aligning with the PR objective of disabling ZETA-related functions. The TODO comment provides good context for this change.

@lumtis lumtis merged commit db2f95f into main Oct 16, 2024
11 checks passed
@lumtis lumtis deleted the refactor-disable-zeta branch October 16, 2024 12:32
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.

Remove GatewayZEVM call methods with no callOptions Disable ZETA gateway functions
4 participants