PREFACE: Hello to Damien and the OpenZeppelin team. I haven’t seen you since we met at the Smackathon contest in Miami back in 2019. I hope you are doing well!
I’ve been away from Eth coding for a while. I’m starting up again. My old environment consisted of using Truffle for development along with the zos-cli environment and Basil. I see know that OpenZeppelin is at version 3.4.0. I did a fresh npm install of the OpenZeppelin library on my Ubntu 14.04 box using the command shown in the current docs:
npm install --global @openzeppelin/cli
But when I type *openzeppelin --version" at the command line I still see version 2.8.2:
$ openzeppelin --version
2.8.2
Is this a repository issue or npm issue? How do I get the latest 3.4.0 version of OpenZeppelin running on my PC?
Also, I see that the new vehicle for using OpenZeppelin is Truffle plugins. Can anyone tell me the quick-start steps to migrate from the old way of using OpenZeppelin (zos-cli) to the new method of using plugins? Are there any clean-up or uninstall operations I should do first to avoid conflicts? I am worried that I will end up using the old ZOS contract library by accident, and I see that there have been several important fixes, including the now fixed problem of ZOS returning a zero address when an error occurred:
My main question is what doc should I now follow to use the new toolkit to compile and deploy Solidity contracts using Truffle with the new ZOS plugins?
You may want to uninstall the global version of OpenZeppelin CLI. When you are doing openzeppelin --version you are getting the version of the OpenZeppelin CLI and not the version of OpenZeppelin Contracts that you have installed.
Though depending on what version of OpenZeppelin Contracts you had previously used, you may not be able to upgrade versions due to changes with state variables.
If you are starting from scratch, then you can choose to use either Truffle or Hardhat and create a new project.
Thanks abcoathup. What document will help me best determine if my contracts are using state variables in a way that is incompatible with the newest versions? Are the compatibility issues related to changes in the way delegateCall is utilizing the smart contract memory locations when passing the state variables from the proxy to the proxied target?
You can migrate to OpenZeppelin Upgrades Plugins to deploy and upgrade your upgradeable contracts.
For the avoidance of doubt, this is separate from the version of OpenZeppelin Contracts that you use in your implementation contract.
What version of OpenZeppelin Contracts (upgradeable) were you using previously?
If it was OpenZeppelin Contracts Ethereum Package 2.x then you won’t be able to upgrade your contract to use OpenZeppelin Contracts Upgradeable 3.x due to state layout changes.