In hardhat multiple versions of a dependency can be installed as follows in the package.json
(assuming yarn
is being used):
"@openzeppelin/contracts": "^4.3.2",
"openzeppelin-contracts-solc-0.7": "yarn:@openzeppelin/[email protected]",
If you want to use v4.3.2
then you can import "@openzeppelin/contracts/..."
and similarly if you want to use v3.4.2-solc-0.7
then you can import "openzeppelin-contracts-solc-0.7/..."
How can this be achieved in foundry?
Best Answer
If you want to install say the 2 versions of
@openzeppelin/contracts
stated in the question, they can be installed as follows: