openzeppelin-upgrades icon indicating copy to clipboard operation
openzeppelin-upgrades copied to clipboard

CLI: UpgradeableBeacon incorrectly detected as upgradeable implementation

Open ericglau opened this issue 2 years ago • 1 comments

UpgradeableBeacon is incorrectly detected as an upgradable implementation because it has a function with signature upgradeTo(address), which causes it to "look" like a UUPS implementation, even though this function is for the beacon itself and not related to UUPS.

Steps to reproduce:

  1. Install https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/ using Foundry
  2. Run upgrades core CLI
  3. The following error occurs:
lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol:UpgradeableBeacon

      lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol:31: Contract `UpgradeableBeacon` has a constructor
          Define an initializer instead
          https://zpl.in/upgrades/error-001
      
      lib/openzeppelin-contracts/contracts/access/Ownable.sol:38: Contract `Ownable` has a constructor
          Define an initializer instead
          https://zpl.in/upgrades/error-001

ericglau avatar Jul 24 '23 15:07 ericglau

+1 to this, I need to call npx @openzeppelin/upgrades-core@^1.32.3 validate from a GHA and this happens.

Ramarti avatar Mar 22 '24 23:03 Ramarti