Skip to content

setDelegate in OAppCoreUpgradeable should be marked virtual to allow custom access control overrides #1649

@RideSolo

Description

@RideSolo

Describe the bug
The setDelegate function in OAppCoreUpgradeable is not marked as virtual, which prevents developers from overriding it to implement custom access control logic. This limits flexibility for integrators who want to apply role-based permissions or other mechanisms instead of onlyOwner.

To Reproduce
Steps to reproduce the behavior:

  1. Attempt to override setDelegate in a contract that inherits from OAppCoreUpgradeable
  2. Compile the contract
  3. See error: TypeError: Trying to override non-virtual function. Did you forget to add "virtual"?

Expected behavior
The setDelegate function should be marked as virtual, similar to setPeer, so that developers can override it as needed.

Screenshots
N/A

Environment (please complete the following information):
N/A

Additional context
This is particularly important when using AccessControl-based permissioning instead of Ownable. Without virtual, the only workaround is to wrap setDelegate in a separate method or fork the base contract, which is not ideal and breaks the default tooling

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions