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

Enable partial transpilation for upgradeable package #4628

Merged
merged 36 commits into from
Sep 28, 2023

Conversation

frangio
Copy link
Contributor

@frangio frangio commented Sep 27, 2023

Things that don't need to be transpiled for upgradeability, such as interfaces, libraries, and some stateless contracts, are now imported into @openzeppelin/contracts-upgradeable from a peer dependency on @openzeppelin/contracts.

Uses OpenZeppelin/openzeppelin-transpiler#130.

Fixes #3928.

@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2023

🦋 Changeset detected

Latest commit: 5336454

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@frangio frangio marked this pull request as draft September 27, 2023 03:43
@@ -36,7 +37,8 @@ npx @openzeppelin/upgrade-safe-transpiler@latest -D \
-x '!contracts/proxy/beacon/IBeacon.sol' \
-p 'contracts/**/presets/**/*' \
-n \
-N 'contracts/mocks/**/*'
-N 'contracts/mocks/**/*' \
-q '@openzeppelin/'
Copy link
Contributor Author

@frangio frangio Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Amxx Does this look right to you? We have to do this because the contract source paths already have a contracts/ prefix, but it's not really true that @openzeppelin/ is the peer dependency. Ideally I would write something like @openzeppelin/contracts/=contracts/, like a Foundry remapping, but I don't want to complicate the transpiler more...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used to do -q '@openzeppelin/contracts/.. for my tests. What you wrote works just fine.

We can change to a remaping / remapings in a further version of the transpiler

@socket-security
Copy link

socket-security bot commented Sep 27, 2023

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@openzeppelin/upgrade-safe-transpiler 0.3.30 filesystem +0 482 kB frangio
hardhat-exposed 0.3.12-1 None +0 130 kB frangio

@socket-security
Copy link

socket-security bot commented Sep 27, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

This was referenced Sep 10, 2024
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

Successfully merging this pull request may close these issues.

Don't rename interfaces IWhatever -> IWhateverUpgradeable
2 participants