Open spalladino opened 6 years ago
@spalladino This would be really cool! Would it be possible to have this same functionality added to the TestHelper
? (It's possible that this is already do-able when testing zos deployments/upgrades, so you can ignore this if already implemented.)
https://openzeppelin.slack.com/archives/C6DT68JPJ/p1544647937063900
Would it be possible to have this same functionality added to the TestHelper?
You should be able to call setImplementation
in the result of the TestHelper, and change the contract that the name refers to. Something along the lines of the following should do the trick!
const project = await TestHelper(...);
const ContractV2 = Contracts.getFromLocal('ContractV2'); // or artifacts.require('ContractV2') if on truffle
project.setImplementation(ContractV2, 'Contract')
That said, I understand that the actual use case you have is more related to https://github.com/zeppelinos/zos/issues/86, is that right?
Thanks @spalladino. Yes, my issue is more related to #86, but your example with setimplementation
is helpful.
Given a proxy created for a package/contract, such as
openzeppelin/ERC20
, we should allow the user to upgrade the proxy to a different contract or even a different package. For instance, the user may want to upgrade toopenzeppelin/ERC20Pausable
to add a new feature to an existing proxy, or to upgrade toopenzeppelin-forked/ERC20
in case they want to start following an fork of the package.We'd need to come up with a new syntax for
zos update
for this operation. Also, make sure to run storage compatibility checks before performing the upgrade.