Skip to content

Conversation

@tinom9
Copy link
Contributor

@tinom9 tinom9 commented Dec 23, 2025

Description

  • Add virtual keyword to every function of @layerzerolabs/oft-evm-upgradeable contracts susceptible of being overriden. Excludes init and storage getter functions.

@cursor
Copy link

cursor bot commented Dec 23, 2025

PR Summary

Makes overridable functions explicitly virtual across OFT upgradeable contracts for extensibility; no logic changes.

  • Fee config: setDefaultFeeBps, setFeeBps, and _getFeeBps in FeeUpgradeable.sol are now virtual
  • Token accessors: token() in OFTUpgradeable, OFTAdapterUpgradeable, and NativeOFTAdapterUpgradeable set to virtual
  • Fees APIs: feeBalance() and withdrawFees() in OFTFeeUpgradeable.sol and OFTAdapterFeeUpgradeable.sol set to virtual
  • Core: msgInspector() in OFTCoreUpgradeable.sol set to virtual; _payNative() in NativeOFTAdapterUpgradeable.sol now virtual override

Written by Cursor Bugbot for commit 7d222fd. This will update automatically on new commits. Configure here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the virtual keyword to functions in upgradeable OFT contracts that are intended to be overridable by derived contracts, improving extensibility while excluding initialization and storage getter functions.

  • Added virtual keyword to public view/pure functions that return contract-specific values
  • Added virtual keyword to external functions with access control modifiers
  • Added virtual keyword to internal functions that implement overridable behavior

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
OFTUpgradeable.sol Made token() function virtual to allow customization of token address retrieval
OFTFeeUpgradeable.sol Made feeBalance() and withdrawFees() virtual to enable custom fee management logic
OFTCoreUpgradeable.sol Made msgInspector() virtual to allow custom message inspection behavior
OFTAdapterUpgradeable.sol Made token() function virtual to enable custom token address implementation
OFTAdapterFeeUpgradeable.sol Made feeBalance() and withdrawFees() virtual to support custom fee handling
NativeOFTAdapterUpgradeable.sol Made token() and _payNative() virtual to allow customization of native token operations
FeeUpgradeable.sol Made fee configuration and calculation functions virtual to enable custom fee logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

TRileySchwarz
TRileySchwarz previously approved these changes Dec 23, 2025
@github-actions
Copy link
Contributor

🚨 E2E Tests Failed

The E2E tests failed during CI. These tests validate real blockchain interactions and may fail due to:

This is non-blocking and does not prevent merging. Check the action logs above for detailed failure information.

@tinom9 tinom9 enabled auto-merge December 23, 2025 02:46
@tinom9 tinom9 added this pull request to the merge queue Dec 23, 2025
Merged via the queue into main with commit 3de3f5b Dec 23, 2025
18 checks passed
@tinom9 tinom9 deleted the tino/oft-evm-up-virtual branch December 23, 2025 03:45
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.

3 participants