Hello. I'm having some trouble deploying an UUPS upgradable smartcontract after the v5 release in the paris evm version. My smartcontract is the simplest one that can be auto generated by simply checking the UUPS upgradeability feature in the contract wizard, but I changed ^0.8.20 to ^0.8.19.
The deployment is a two step process. The first smart contract is deployed with success, but the second one (which should be the proxy, as far as I know) fails with this message:
Error occured: invalid opcode.
invalid opcode
The execution might have thrown.
And the transaction status ends up being:
status false Transaction mined but execution failed
What is the correct way to deploy this smart contract? Do I need to still use a v4 release? Which one should I use and how do I select it using remix?
Thanks in advance!
Code to reproduce
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
contract MyContract is Initializable, OwnableUpgradeable, UUPSUpgradeable {
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(address initialOwner) initializer public {
__Ownable_init(initialOwner);
__UUPSUpgradeable_init();
}
function _authorizeUpgrade(address newImplementation)
internal
onlyOwner
override
{}
}
Environment
I'm using remix. In advanced configurations, I chose evm version: paris. The compiler is 0.8.21, and the environment is Remix VM (Merge).