OpenZeppelin version control

I need to know that im using 2 different version of openzeppelin repos (one has my one required contract which is an old repo and other are in latest) how can i control version for this.I tried npm install @openzeppelin/contracts@3.4.0 but then the latest one broke.

You can install another version with a different name like this:

npm install openzeppelin-contracts-3@npm:@openzeppelin/contracts@3.4.0

Then you can use it in Solidity as import "openzeppelin-contracts-3/token/...";

1 Like