i have an upgradable smart contract with 3 mappings, i set only the first two in the initialize function .
pragma solidity ^0.8.0;
contract ContractA {
mapping(uint256 => address) public mappingA;
mapping(uint256 => address) public mappingB;
mapping(address => bool) public mappingC;
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
bool public initialized;
function initialize(bytes calldata params) public {
if (initialized) revert();
initialized = true;
(address _addressA, address _addressB) = abi.decode(params, (address, address));
mappingA[0] = _addressA;
mappingB[0] = _addressB;
}
function setMappingC(address _addressC) public {
mappingC[_addressC] = true;
}
function upgrade(
address newImplementation,
address _addressA,
address _addressB
) public {
bytes memory params = abi.encode(_addressA, _addressB);
(bool success, ) = newImplementation.delegatecall(abi.encodeWithSelector(this.initialize.selector, params));
if (!success) revert();
assembly {
sstore(_IMPLEMENTATION_SLOT, newImplementation)
}
}
}
is there any potential problems ( E.g. with storage ) regarding the third one mappingC when calling setMappingC through the proxy, or in a future upgrade ? since the Proxy does not have the MappingC context .