Open abcoathup opened 3 years ago
Any update? I also face this issue
We need someone to help us understand what the dry run does exactly and what is going wrong that it breaks the Upgrades Plugin.
In the meantime, please use --skip-dry-run
.
This has just cost me a considerable amount of time to figure out where the problem was (see here). When will this be fixed?
We need someone to help us understand what the dry run does exactly and what is going wrong that it breaks the Upgrades Plugin.
In the meantime, please use
--skip-dry-run
.
What to do if the chain.js file in the .openzeppelin directory has been deleted??? Using hardhat.
Error: Proxy admin is not the one registered in the network manifest
@NeoXtreem @0xByteLeon
I have same issues, but I solved the issue.
At your project root directory, you can find .openzeppelin
directory.
There should be the files that contains proxy addresses for the smart contracts you deployed.
In case that file is old (not latest) or missed, then you will get that error message.
In my case, that file is old one which is overwritten by git pull.
So I restored the latest unknown-43113.json
file at .openzeppelin
. (I deployed to fuji Avalanche testnet).
It solved the problem.
@frangio I burned some time on this issue as well. You asked for someone to help you "understand what the dry run does exactly and what is going wrong that it breaks the Upgrades Plugin".
Here's what appears to be going on to me:
Let's say I want to deploy to mainnet. when I run truffle migrate
, it forks mainnet and creates a .openzeppelin/unknown_1337.json
. It then saves the dry-run information (impls, admin, etc.) in there.
Then, once the dry-run is finished, it creates the .openzeppelin/mainnet.json
, and the same values get placed in there after the mainnet migration is complete.
So the issue becomes that general instructions are to commit the mainnet.json
(and testnet) network files, but to NOT commit the unknown_*.json
files.
The issue comes later, the next time someone wants to do a mainnet deploy. Say someone clones the git repository - they now have the mainnet.json
, but NOT the unknown_*.json
file. Thus when the fork is made for the dry-run, the network file used before for the dry run during the initial deployment (with the admin and impls) is not there, so the upgrades plugin is throwing the "Error: Proxy admin is not the one registered in the network manifest at upgradeProxy" error.
After figuring this out, I was able to just copy my mainnet.json
to unknown_1337.json
and rerun the dry-run and everything worked.
It might be cleaner to implement the dry-run plugin to use a temporary network file (like mainnet_dry-run.json
) instead, and if it doesn't exist to just copy the mainnet.json
if it exists into that file before the dry-run.
Hope this helps. Seems plenty of people have burned considerable time on this issue due to lack of clarity about what's going on under the covers. In my case, I didn't feel comfortable pushing out to mainnet until the dry-run had completed successfully, so took the time to figure out.
Shout out to @webgurucan, whose comment above led me down this path.
*Note for anyone looking for a workaround for this:
unknown_{networkId}
. In my case it was unknown_1337.json
, since the default ganache network id is 1337. Possible there's a different network id for your file depending on what you're doing.Just had the same issue, i was working on rinkeby testnet then i did a test using ganache and from there it was impossible to deploy any more migrations on rinkeby.
I was always getting "previous deployment is not registered", I indeed had a new unknown-1337.json file near my rinkeby.json one. Deleting it didn't help so i added it back and added the content of my rinkeby.json (after seeing your message @treygrainger) into the unknown-1337.json and it work again now.
This definitely had me lost lot of time, might worth a fix.
Truffle has a dry run option on migration that forks the network to check the migration.
When deploying a contract with dry run skipped, and then attempting to do an upgrade with dry run, the upgrade fails with:
Using Box.sol and BoxV2.sol from https://forum.openzeppelin.com/t/openzeppelin-upgrades-step-by-step-tutorial-for-truffle/3579 and the deploy and upgrade migrations below:
2_deploy_box.js
3_upgrade_box.js