can not find the foundry dependencies from parent module of the hardhat project
Stevewu1234 opened this issue · comments
stevewu commented
I have tried to import seadrop into my token contract which is based on hardhat and finish the foundry installation on hardhat project. But when I try to compile the token contract which has imported ERC721Seadrop.sol, it failed and reports:
Error HH404: File operator-filter-registry/DefaultOperatorFilterer.sol, imported from lib/seadrop/src/ERC721SeaDrop.sol, not found.
Error HH413: File utility-contracts/TwoStepOwnable.sol => lib/seadrop/lib/utility-contracts/TwoStepOwnable.sol, imported from lib/seadrop/src/ERC721ContractMetadata.sol, not found.
It seems the submodule fail to remapping dependencies, how can I do?
Ryan Ghods commented
You'll need to add the hardhat-preprocess step as written here to rewrite the imports:
- https://github.com/ProjectOpenSea/seadrop/blob/main/hardhat.config.ts#L17-L23
- https://github.com/ProjectOpenSea/seadrop/blob/main/hardhat.config.ts#L62-L75
You'll want to update remappings.txt to point to the right lib location.
Alternatively you could write the tests in foundry and it should work with the remappings already available.