Hello,
In v5 the upgradable contracts are using the namespace storage pattern as defined in ERC7201. Do the contracts which import these upgradable contracts need to use this pattern or can the state variables be defined as usual?
Thank you
Code to reproduce
For example in this child contract MyContract we are importing v5 contracts but defining the state variables like exampleNumber, exampleMapping, exampleString in a normal way.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
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 {
uint256 exampleNumber;
mapping (uint256 key => uint256 value) exampleMapping;
string exampleString;
/// @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
Remix, Any