Closed 3commascapital closed 2 years ago
This may be an issue with Hardhat. Hardhat does not support nested Solidity dependencies because different package managers (and configuration options like resolutions
) create inconsistent node_modules
directory structures. This plugin simply creates a temporary .sol
file with a pragma of *
and an import
of the path specified in Hardhat config. This means that the dependency resolution is handled internally by Hardhat.
Installing the sub-dependencies as top-level dependencies might work.
gotcha. thanks for clarifying
hi there, i am working with a contract that depends on
@uniswap/v3-periphery
, which in turn depends on@openzeppelin/contracts@3.4.1
which has a pragma solidity declaration of >=6, <8.However my project uses 0.8.9 and the
@openzeppelin/contracts@4.5.0
which uses a different structure, and fails when the dependency compiler path is used. I have installed the node_module in the sub directory, atproject-root/node_modules/@uniswap/v3-periphery/node_modules/@openzeppelin/contracts
, using theresolutions
key as defined byyarn
, and that seemed to work (i can see the folder) but dependency compiler does not seem to see the resolutions folder or that there is a node_modules in the uniswap periphery folder.All this to ask, does it make sense to utilize sub / localized dependencies when compiling dependencies?