You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the imports for openzeppelin contracts are relying on a remapping file being present in the parent project (if used in a foundry project) or the right contracts being installed in a hardhat project:
Upgades.sol:
...
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {UpgradeableBeacon} from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
import {BeaconProxy} from "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";
...
However, this can potentially point to the wrong version of the contracts. Specifically a project can make heavy use of contracts v4 but still want to deploy using the new proxies from v5 and uses different folder naming schemas. Among other potential incompatibilities down the road, out of the box, the interfaces for UpgradeableBeacon in v4 and v5 are incompatible during compile time already.
Separating the necessary contract versions for proxies by bringing them along and not relying on the parent project having them installed is potentially a solution to this. It would just need to be present as a git submodule:
Right now, the imports for openzeppelin contracts are relying on a remapping file being present in the parent project (if used in a foundry project) or the right contracts being installed in a hardhat project:
Upgades.sol:
However, this can potentially point to the wrong version of the contracts. Specifically a project can make heavy use of contracts v4 but still want to deploy using the new proxies from v5 and uses different folder naming schemas. Among other potential incompatibilities down the road, out of the box, the interfaces for
UpgradeableBeacon
in v4 and v5 are incompatible during compile time already.Separating the necessary contract versions for proxies by bringing them along and not relying on the parent project having them installed is potentially a solution to this. It would just need to be present as a git submodule:
Is that something that can be considered, or any other feedback? Happy to open a PR for it, if this idea gets positive feedback...
The text was updated successfully, but these errors were encountered: