Hey
I’m playing with upgradable contracts.
I’ve must have messed up something in one of the upgrades and every call to the contract results in Error: VM execution error
i’ve tried upgrading again and added the most basic functions just a a view returning address(this) and they all fail.
is there a way to somehow reset that state of the contract? to get it at least in a working state? for example to be able to recover any tokens/eth in the contract?
Maybe you do not call functions in the proxy contract, here is a document about proxy:
And a simple tutorial:
OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat
it worked perfectly fine in the begining and for other contracts
so i’m not sure what you mean by “you do not call functions in the proxy contract”
i’ve used the same address from the begining
Cause you said
added the most basic functions just a a view returning address(this) and they all fail.
so I guess you call these functions by a wrong contract address.
I am not sure this, just know, only use admin
account to update implementation, and non-admin
account to call logical functions.
is there a way to somehow reset that state of the contract? to get it at least in a working state?
Maybe destroy the contracts and re-deploy contracts at the same address if possible.
for example to be able to recover any tokens/eth in the contract?
Update the logical contract of the proxy to add this function.
Hi @sirpy,
Are you still having this issue? What network are you using?
Are you able to share your contract?
thanks for asking
lol after breaking my head over this, i found out I wasnt using the original admin account to try and upgrade the contract.
though maybe this is a bug, because oz-cli never said anything about it, just showed up as upgrade success.
Hi @sirpy,
Please note: we’ve decided it’s best to focus our upgradeability efforts on the Upgrades Plugins exclusively, and have halted development on the OpenZeppelin CLI. For details see:
Building for interoperability: why we’re focusing on Upgrades Plugins
I suggest looking at the following guides/tutorials to use Upgrades Plugins:
- Learn guides on Upgrading Smart Contracts: https://docs.openzeppelin.com/learn/upgrading-smart-contracts
- OpenZeppelin Upgrades: Step by Step Tutorial for Truffle
- OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat