One of my forge installed libraries uses this import path for it's OZ dependency:
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
Another one of the contracts from a different library uses this import path:
import "openzeppelin-contracts/contracts/access/AccessControl.sol";
My OZ dependency lives in lib/openzeppelin-contracts
My remappings are as such:
@openzeppelin=lib/openzeppelin-contracts/
openzeppelin-contracts/=lib/openzeppelin-contracts/
Unfortunately, the hardhat preprocess does a sed which means that it does the following:
- Replace
@openzeppelin with lib/openzeppelin-contracts/
- Replace
lib/openzeppelin-contracts/ with lib/lib/openzeppelin-contracts/
I was able to resolve the issue by changing the order of my remappings to avoid the overlap, but this issue may affect others
One of my forge installed libraries uses this import path for it's OZ dependency:
Another one of the contracts from a different library uses this import path:
My OZ dependency lives in
lib/openzeppelin-contractsMy remappings are as such:
Unfortunately, the hardhat preprocess does a
sedwhich means that it does the following:@openzeppelinwithlib/openzeppelin-contracts/lib/openzeppelin-contracts/withlib/lib/openzeppelin-contracts/I was able to resolve the issue by changing the order of my remappings to avoid the overlap, but this issue may affect others