0

Consider me a beginner to writing smart contracts. My question is, openzeppelin's contracts are using latest versions of solidity (by their repo). How do I use say 0.6 version, do they have it available?

This is because I'm also importing another contract which is of 0.6, so I can't use it with OpenZeppelin's contracts which are 0.8

5
  • You need to download a lower version of openZeppelin contracts library, npm openZeppelin v4 library use 0.8 and v3.4.0 use 0.7 , I don’t recommend you to use a lower version than v3. The best way is to try to update that contract to 0.7 and there is no huge breaking change between 6 and 7 look in the documentation docs.soliditylang.org/en/v0.7.1/070-breaking-changes.html
    – Majd TL
    Apr 28, 2021 at 6:13
  • I'm trying to use chainlinks VRF for random number, its ^0.6.6 so it cant be changed, so which version should i download? lower than v3 i assume?
    – Yash
    Apr 28, 2021 at 9:34
  • npm i @openzeppelin/[email protected] try this version, the compiler version is between 6 and 8
    – Majd TL
    Apr 28, 2021 at 10:08
  • sorry i thought all v3 has the 0.7.0 but that was wrong -> this version has solidity 0.6 npm i @openzeppelin/[email protected] but try the above comment first
    – Majd TL
    Apr 28, 2021 at 10:10
  • all good, it helped
    – Yash
    Apr 29, 2021 at 9:47

1 Answer 1

1

If you are using npm and if I have to download version 3.9.0 then I would at first delete the existing openzeppelin file(if exist) then write npm install "@openzeppelin@^3.9.0" , it should work.

1
  • 1
    As said by Majd the correct command should be npm install @openzeppelin/[email protected]
    – Ismael
    Sep 9, 2021 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.