Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding openzeppelin contracts as submodule #78

Open
tomw1808 opened this issue Oct 14, 2024 · 0 comments
Open

Consider adding openzeppelin contracts as submodule #78

tomw1808 opened this issue Oct 14, 2024 · 0 comments

Comments

@tomw1808
Copy link

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:


[submodule "lib/openzeppelin-contracts"]
	path = lib/openzeppelin-contracts
	url = https://github.com/OpenZeppelin/openzeppelin-contracts
	branch = release-v5.1

Is that something that can be considered, or any other feedback? Happy to open a PR for it, if this idea gets positive feedback...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant