The title is pretty self explanatory.
Let's say I have a contract where I defined a constant variable and this contract is using some upgradeable pattern. When I deploy a new version of the contract, theoretically I can overwrite the constant's value, since that is baked into the bytecode.
Example:
- First version of the contract:
contract MyUpgradeableContract {
uint256 public constant ZERO_TO_BE_ONE = 0;
}
- Contract after upgrade:
contract MyUpgradeableContract {
uint256 public constant ZERO_TO_BE_ONE = 1;
}
Is this allowed in solidity with upgradeable pattern?