4 votes

OpenZippelin upgradeability pattern | How can both implementation and proxy contracts share the same storage tho they were implemented independently?

good question, yes you are right the proxy contract and the implementation are deployed independently and have different storage layouts. The magic here is, that when calling the Proxy contract, ...
donoso.eth's user avatar
  • 1,473
3 votes
Accepted

OZ transparent upgradeable proxy admin reverts when trying upgrade an implementation

OpenZeppelin v5 TransparentUpgradeableProxy creates(deploys) its own ProxyAdmin contract. Now, in the proxy constructor you should provide not the ProxyAdmin contract address, but let's say the Admin'...
tenbits's user avatar
  • 2,313
2 votes

onlyInitializing vs initializer in OpenZeppelin Upgradeable Contracts

All of your points are correct. The main problem stems from the fact that constructors can't be used. That's upgradeable contracts have to use regular functions to initialize them. But this should ...
Lauri Peltonen's user avatar
2 votes

Is it possible to change a constant variable value when using upgradeable pattern and deploying a new version?

Yes, you can override the constant, as the value doesn't occupy any storage slot, but exists in the runtime bytecode, which is deployed in the new contract.
tenbits's user avatar
  • 2,313
1 vote
Accepted

How to implement Chainlink VRFv2 with Upgradeable Transparent Proxy smart contract?

You don't need to import the Initializable.sol and inherit the Initializable contract in your VRFTest contract (as it's already being imported and inherited in VRFConsumerBaseV2Upgradeable contract ...
SYED ASAD KAZMI's user avatar
1 vote
Accepted

Upgrading Smart Contracts with New Fields: How to Safely Modify Storage Layout

In your example, it is safe to add the new field as: GovernorCountingSimpleStorage struct doesn't collide with other storage as has a custom offset the new variables in GovernorCountingSimpleStorage ...
tenbits's user avatar
  • 2,313
1 vote
Accepted

Will upgrading a smart contract to inherit from a new base class cause potential storage conflicts with UUPS proxy pattern?

Yes, the state variables of the myToken contract will occupy new slot positions, following those from ERC20Votes. Here are two solutions: Use @openzeppelin\contracts-upgradeable\token\ERC20\...
tenbits's user avatar
  • 2,313
1 vote

OpenZippelin upgradeability pattern | How can both implementation and proxy contracts share the same storage tho they were implemented independently?

It's a good question and it's important knowledge if one is to work safely with upgradeable contracts using the Proxy pattern. This summary is meant to be cognitively light-weight so you get the idea. ...
Rob Hitchens's user avatar
  • 55.2k
1 vote

Deploy upgradable contracts using Remix

I do not know how to do it. You might be better off using Truffle and this tutorial: https://forum.openzeppelin.com/t/openzeppelin-upgrades-step-by-step-tutorial-for-truffle/3579 And then connecting ...
Mars Robertson's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible