Not sure if I should open a new thread for this but I'm running into a similar issue when trying to Deploy and Upgrade a TransparentProxy using Foundry and OpenZeppelin 5.0.
Deployment Script:
I am using as the owner the Proxy: 0x50Ef443c406b05025C3faBA716bAFCe345b1b7CB
TransparentProxy Deployment tx: https://arbiscan.io/tx/0x551e0f10e40163d04ba6dcec898222e494d8dffd8ff50a5c92b26aa303e0d1e5#eventlog
Looking into the AdminChanged event I can see:
newAdmin : 0x50Ef443c406b05025C3faBA716bAFCe345b1b7CB
That it's the same address as the owner that I use in the deployProxy function.
That's why I believe that when I run the following command:
address autolayerReferalsProxyAddress = 0x69ad4c9E77110D98A284664db2FE4c970CBbEc28;
Options memory opts;
opts.referenceContract = "AutoLayerReferals.sol";
Upgrades.upgradeProxy(
autolayerReferalsProxyAddress,
"AutoLayerReferals.sol",
"",
opts
);
Runs into the following error:
Because either the ProxyAdmin wasn't deployed correctly or the admin wasn't set correctly.
Hi @ericglau,
- I have reinstaled the OpenZeppelin Contracts to be sure that I'm on v5 (I believe that I was already) and I have updated my remappings.txt (which was missing that changes that you pointed out).
- Although the variable name is
proxyAdminAddress
, as you can see it's the address 0x50Ef443c406b05025C3faBA716bAFCe345b1b7CB that it's an EOA. The name is proxyAdminAddress because before writing this post the only way that I found to make it work is pre-deploying a ProxyAdmin address and using it's address as the second parameter of the deployTransparentProxy function, but I wanted to avoid this use)
- Nice!
It works perfectly now! It seems that one of my remappings was messing everything up and although I have v5 of OpenZeppelin contracts, other instaled libraries were using the v4.
Just another question, when using Proxies with Foundry, is there any folder where I can find the deployment addresses? (I have searched for the .openzeppelin one but it doesn't seem to be there)
Thank you so much!
1 Like
To be clear, when using OpenZeppelin Contracts v5, the second parameter for deployTransparentProxy
should indeed be an EOA, not a pre-deployed proxy admin address.
Just another question, when using Proxies with Foundry, is there any folder where I can find the deployment addresses? (I have searched for the .openzeppelin one but it doesn't seem to be there)
The Foundry Upgrades plugin does not keep track of deployment addresses. You would need to track these manually. You might be able to find them under the broadcast
directory, which is created by Foundry as it broadcasts your deployments/transactions.