@account-abstraction-06 depends on "@openzeppelin/contracts": "^4.2.0",
and @account-abstraction-07 depends on "@openzeppelin/contracts": "^5.0.0",
Both of these dependencies import OpenZeppelin contracts with the same base path, i.e., @openzeppelin/contracts .
This presents a problem because I cannot simply install both versions of the @openzeppelin/contracts without causing a conflict.
And I cannot use aliases as this would require modifying the source in @account-abstraction-06 and @account-abstraction-07
add this import to Lock.sol import "@account-abstraction-07/contracts/core/BasePaymaster.sol"; hardhat compile
Compilation will fail with the following error TypeError: Wrong argument count for modifier invocation: 1 arguments given but expected 0.
@andrewwahid did you figure this one out? I find myself in the same situation as you: libraries that i'm inheriting "base contracts" from using conflicting versions of OZ contracts (with the same import file path). can't modify the source "base contracts" because they're in node_modules.
This answer assumes that I am directly importing OZ contracts in my project, but the fact is multiple libraries that I use are importing OZ contracts but in different versions, the problem is that hardhat uses only 1 version of OZ during compilation which of course leads to errors
This is actually a hardhat problem that is not relevant to OZ at all
You can understand the issue better from those 2 github issues