Open mistersingh179 opened 1 year ago
Did you ever figure this one out? I'm having similar issues.
you can set upgradeIndex (as parameter in the deploy function) to ensure each call is executed only once. forgot if this start at 1 or 0
Thank you for this! I did end up figuring it out as you describe. It starts at 0 I believe.
hardhat deploy
runs all the deployment files every time it is run. When I run it the second time it runs a previously randeploy
command which tried to upgrade the proxy to a previous deployed implementation and thus fails as it has already been initialized to a higher version.Take this code in 00_deploy_box.js
First time when this file is ran it deploys Implementation1, Proxy, Implementation2 & then executes
upgradeTo
.Second time when this file runs it re-runs all the commands and will fail deploying Implementation1 as its
initializer
modifier protects it from being run again.If it didnt have the initialize protection, it would have re-deployed Imlementation1,
upgradeTo
, and then Implementation2 andupgradeTo
.My Implentation Code is: