I am trying to upgrade a contract instance on kovan. I added a single function and then used the cli tool to upgrade the contracts. This is the steps that I took
oz compile
*selected kovan network
*selected contract instance
*picked the instance to upgrade
Then I get this error message:
No AST nodes of type ContractDefinition with id 419 found.
Environment
running on mac, these are my deps from package.json:
“@openzeppelin/contracts-ethereum-package”: “2.5.0”,
“@openzeppelin/upgrades”: “^2.6.0”,
“@openzeppelin/cli”: “2.8.2”,
“openzeppelin-solidity”: “^3.0.1”,
Compiling gives me some warnings but it shows a checkmark and says contracts have been compiled successfully.
Thanks for letting me know that you can’t share your contract.
I am not sure what is causing the error.
You have “@openzeppelin/contracts-ethereum-package”: “2.5.0” which is the upgradeable version of OpenZeppelin Contracts using Solidity 0.5
You also have “openzeppelin-solidity”: “^3.0.1” which is OpenZeppelin Contracts using Solidity 0.6.
I assume that you are using Solidity 0.5, so you don’t need to have openzeppelin-solidity (the old name for @openzeppelin/contracts) as a dependency.
Are you able to share the imports of your contract so that I can try to reproduce? If not, I suggest creating a new project with a simple contract with your imports to see if that is causing the issue.
I removed “openzeppelin-solidity”: “^3.0.1” and now none of the dependency solidity files are being properly imported. I deleted package-lock.json, removed build folder, removed node_modules, did a fresh npm install and it is saying other openzeppelin dependencies (ownable) cannot be found.