I want to deploy a v2 of a super simple smart contract where I add an additional state variable.
From my understanding, the way to do this is to create a new variable
uint myNewVar;
Then create a function like
function setMyNewVar(uint newVar) public {
myNewVar = newVar;
}
Then I'd do something like:
const myNewVar = 5;
await upgradeProxy(contractA.address,
ContractB, {
deployer, call: { fn: 'setMyNewVar', args: [myNewVar] },
});
The Problem:
I want to use OpenZeppelin's app within Gnosis safe to trigger my contract's upgrade. Is there any way to run setMyNewVar
right after v2 gets deployed?
If not, how can I set new variables when doing upgrades through the Gnosis UI?
Or, am I missing something?
I'd prefer to make the owner of the contract a gnosis safe and not a single person (single point of failure).