hardhat
hardhat copied to clipboard
hardhat-foundry: please support remapping contexts
Describe the feature
While forge build
works fine, we're unable to compile using hardhat.
Our remapping file looks like this:
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
../../node_modules/@openzeppelin/contracts-upgradeable-v5:@openzeppelin/contracts=../../node_modules/@openzeppelin/contracts-v5
The compilation error we get is:
Error in plugin hardhat-foundry: Invalid remapping '../../node_modules/@openzeppelin/contracts-upgradeable-v5:@openzeppelin/contracts/=../../node_modules/@openzeppelin/contracts-v5/', remapping contexts are not allowed
We need this because we're using two versions of openzeppelin in parallel (4.1 and 5), and openzeppelin-upgradeable v5 has imports that point to @openzeppelin/contracts
, which without proper remapping is resolving to v4.1, while we need to to resolve to v5.
Thank you!
Search terms
No response
remapping works for me with
remappings = [ "lib/an-essential-dependency/lib/openzeppelin-contracts/=node_modules/@openzeppelin/", ]
have you tried with absolute path?