Hi team, I was trying to deploy upgradable contracts to moonbeam network, a parachain on polkadot, but getting this error.
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?
Code to reproduce
Can you show the full stack trace? And the script you're running.
this is the basic deploy script from the tutorial, the basic setup is also producing the same error
Ok I see. Can you please run
env DEBUG='@openzeppelin:*' hardhat run --network moonbase scripts/deploy.js
Sorry about the slow progress. We're getting there.
hi @frangio, here's the output of that command
sorry if the light blue color is little unreadable
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?
I got the same issue when using package @openzeppelin/hardhat-upgrades version 1.11.0. Upgrade to 1.13.0 to fix it.
Delete .openzeppelin/unknown-YOUR-NetworkId.json !!!
This happens especially at deploying upgradeable contracts into Parachain EVM.
@RussoCrowe Can you elaborate on what you mean?
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?