Hello,
I have questions about how to manually execute the upgrade
action on the ProxyAdmin contract that gets deployed when I call upgrades.deployProxy
via the buidler library.
I read through and followed the steps laid out in OpenZeppelin Buidler Upgrades: Step by Step Tutorial and was able to do it all successfully.
Below is the abbreviated sequence of events that I hope to achieve in a test:
Box = await ethers.getContractFactory("Box");
box = await upgrades.deployProxy(Box, [42], {initializer: 'store'});
bobAddress = await bob.getAddress()
await upgrades.admin.transferProxyAdminOwnership(bobAddress);
const BoxV2 = await ethers.getContractFactory("BoxV2");
const boxV2Address = await upgrades.prepareUpgrade(box.address, BoxV2);
await box.connect(bob).upgrade(box.address, boxV2Address
I already tried the last line and it failed as it said the upgrade
method did not exist on the box contract. The challenge Im facing is finding the address of the ProxyAdmin contract so that, as bob, i can manually upgrade the box proxy to point to thew new V2 box implementation.
I dug into the open zeppelin node_modules and saw that when upgrades.upgradeProxy(box.address, BoxV2)
is called the box.address
is loaded into a ProxyAdmin contract and then upgrade
is ran on it.
From my understanding, box.address
, is the proxy address and its confusing why i cant use it to execute upgrade
manually.
Thank you for any help.
Regards,
Jon-Eric Cook