Recommended versions of OpenZeppelin Contracts and Solidity for a new project

Hi Everyone,

I have a question. What combination of versions would you recommend for a new project that we want to have upgradability as well? Is solc 8.x ok to use even though only unreleased OpenZeppelin version supports solc 8.x for now. I am not sure if you can use OpenZeppelin-Upgrades functionality with that.

Should we start with solc 7.latest, OpenZeppelin solc-7 branch and OpenZeppelin Upgrades?

I would appreciate your guidance on this? Although, I say “starting a new project” we have quite some code using solc 8.0. We would need to downgrade to solc 7 if that’s the only way to get upgrade functionality?

Many thanks for your time.

Regards,
Nihat

1 Like

Hi @ngurmen,

Welcome to the community :wave:

I would recommend using OpenZeppelin Contracts Upgradeable 3.4 with Solidity 0.7 today.

Depending on your development timeline, once a release of OpenZeppelin Contracts supports Solidity 0.8 then you could move to that.

@abcoathup, thank you for your message.

The upgradeable does not seem to have 3.4.0 branch under releases but it is available under Tags. So for now, do we need to go with 3.3.0-solc-0.7? Or maybe it will be available shortly. Looking at the docs the commands to install the packages would be as follows for hardhat. Am I on the right track, say for 3.3.0-solc-0.7 (I suppose it will be 3.4.0-solc-0.7 in a short while)?

npm install @openzeppelin-contracts-upgradeable@3.3.0-solc-0.7
npm install --save-dev @openzeppelin/hardhat-upgrades
npm install --save-dev @nomiclabs/hardhat-ethers ethers # peer dependencies
// hardhat.config.js require('@openzeppelin/hardhat-upgrades');

Thanks,
Nihat

1 Like

Hi Nihat (@ngurmen),

You can install OpenZeppelin Contracts Upgradeable Solidity 0.7 branch

npm install @openzeppelin/contracts-upgradeable@solc-0.7

Hi @abcoathup, thank you for your help. Nihat

1 Like