1

Currently going through Ethernaut, it involves contracts with different Solidity versions that import OpenZeppelin contracts.

To add Openzeppelin lib in foundry:

forge install OpenZeppelin/openzeppelin-contracts will install the latest version.

To add Openzeppelin lib with Solidity 0.6, in releases, it says to use v3.4.0, so in foundry:

forge install OpenZeppelin/[email protected]

The problem is that it replaces my current OpenZeppelin installation. How can I have both v3.4.0 and the latest (v4.8.1).

Thanks!

2

1 Answer 1

2

I just found out how to do so following these instructions:

To add the good version into another name, type:

forge install openzeppelin-contracts-06=OpenZeppelin/[email protected]

And add into remappings.txt :

openzeppelin-contracts-06/=lib/openzeppelin-contracts-06

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.