Skip to content

Don't automatically exclude files ending in Upgradeable #157

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Amxx
Copy link
Contributor

@Amxx Amxx commented Jun 16, 2025

In @openzeppelin/contracts, the file contracts/proxy/utils/UUPSUpgradeable.sol is automatically excluded by the transpiler because of its basename ending in Upgradeable. I think this is not desirable, because we then have to manually exclude it from the list. In the end, we the file is present in the upgradeable packages, which IMO should not be the case of a stateless contract.

I believe this contract should be marked as @custom:stateless, and not be transpiled.

However, doing so gives us errors from mock contract trying to use it. When transpiling these mocks we get an error from using a symbol that comes from an excluded file.

When we look at the current exlude logic, we see that files can be excluded because they are in the excludeSet, because they match one of the excludeMatch (that is controlled by options.exclude) or because they are flagged as already renamed. That last part is IMO not right because it basically just another pattern that is applied. If we remove the last case, it's easy to re-enable that behavior using the **/*Upgradeable.* exclude pattern. IMO, this gives more granular control, which IMO is better.

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.

1 participant