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

Sharing contract versions in the same repo #5187

Open
adjisb opened this issue Sep 4, 2024 · 0 comments
Open

Sharing contract versions in the same repo #5187

adjisb opened this issue Sep 4, 2024 · 0 comments

Comments

@adjisb
Copy link

adjisb commented Sep 4, 2024

  • We use a combination of OZ version 4 and 5 in the same repository because we have a set of different contracts in the same project.
  • To do that we have entries like the following: "@openzeppelin/contracts-upgradeable-5.0.2": "npm:@openzeppelin/[email protected]" in the package.json file.
  • Openzeppelin V5 upgradables expect a to have the regular contracts (non upgradables) in a fixed place.
  • When we try to compile we get: Error HH411: The library @openzeppelin/contracts, imported from @openzeppelin/contracts-upgradeable-5.0.2/token/ERC721/ERC721Upgradeable.sol, is not installed. Try installing it using npm.
  • This is because ERC721Upgradeable is importing: IERC721 from @openzeppelin/contracts/token/ERC721/IERC721.sol so it expects to have IERC721.sol inside the @openzeppelin/contracts directory.

It seems that having the regular version of the contracts as a implicit dependency of the upgradable ones is a bad idea or if this is the choose solution it sounds like a good idea to add the version to the directory (and also to the package.json dependencies).

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