On not being able to figure out the reason. I jumped back to the basic tutorial and still got the error while deploying the Box contract.
I found that when I deploy to a network like rinkeby, it works normally but not working on moonbeam. Do networks or blockchains play a role in upgradable contracts then?
Ok so what I believe is happening here is that the plugin sees that the transaction was confirmed but when it then fetches the code from the contract address it receives an empty result. This is interpreted to mean that the transaction failed and the contract was not deployed, which is why it considers it an "invalid deployment" and erases it from the network manifest.
The reason why it's getting empty bytecode may be that the RPC endpoint is load balanced and hitting a different node than the one that saw the transaction mined. Generally load balanced endpoints use session stickiness which is why we don't see this problem on other networks.
Right now I can't do anything about this. I'll have to get back to you next week.
alright, thanks for the info. so in all, for now atleast, it means deploying upgradable contracts to moonbase won't work yet. I'll also ask inquire about this in the moonbase community so progress can be made. thanks!
I had a similar issue on a deployment where I went ahead and performed the upgrade on-chain, and this now seems to have led to a situation where I can't upgrade anymore. I've created a topic here. @frangio, please could you assist?
Generally you should NOT delete the network json file if using a mainnet or testnet if you want to be able to upgrade your contracts. You should commit them to version control.
Yes, ... but during development, people need to deploy smart contracts over and over again. if I keep those json files, I will get this "no contract at address..." error.
The plugin should detect if you are using a development network (e.g. a local Hardhat or Ganache dev network) and avoid giving the "no contract at address" error. Which network are you using that encounters this error?