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

ERC20Wrapper underlying variable is public #4026

Closed
ernestognw opened this issue Feb 3, 2023 · 3 comments · Fixed by kimanikelly/openzeppelin-contracts#1 or #4029
Closed

ERC20Wrapper underlying variable is public #4026

ernestognw opened this issue Feb 3, 2023 · 3 comments · Fixed by kimanikelly/openzeppelin-contracts#1 or #4029
Labels
good first issue Low hanging fruit for new contributors to get involved!
Milestone

Comments

@ernestognw
Copy link
Member

📝 Details

For ERC20Wrapper, the Upgradeable version's underlying variable is public and the immutable is removed.

We don't want that since child contracts should not be able to override it.

It's then needed to replace the public visibility of the underlying variable in the ERC20Wrapper contract and create a public view function that replaces its access.

@ernestognw ernestognw added the good first issue Low hanging fruit for new contributors to get involved! label Feb 3, 2023
@ernestognw ernestognw mentioned this issue Feb 3, 2023
3 tasks
@frangio frangio added this to the 4.9 milestone Feb 3, 2023
@kimanikelly
Copy link
Contributor

kimanikelly commented Feb 4, 2023

@ernestognw @frangio

Changes made in https://github.com/kimanikelly/openzeppelin-contracts/tree/issue-4026

Are there any other details I'm missing to complete this task, if so please let me know, so I can make those changes and submit a PR, thanks.

Removed the public visibility from IERC20 immutable _underlying; and refactored it to include the _ due to linting errors.
Screen Shot 2023-02-04 at 9 35 43 AM

Implemented the underlying() public view function to return the value of the _underlying variable
Screen Shot 2023-02-04 at 9 35 20 AM

A test for underlying was already included in test/token/ERC20/extensions/ERC20Wrapper.test.js but after the refactor the call targets the new public view function instead of the previous public underlying variable
Screen Shot 2023-02-04 at 9 42 34 AM

@ernestognw
Copy link
Member Author

@kimanikelly Thanks!

Feel free to open a PR for this, it doesn't require major test changes since it's already covered as you mention, and maybe only a Changeset entry.

I think we all agree on the implementation of this so we can add comments to your PR

@kimanikelly
Copy link
Contributor

@ernestognw I went ahead and created the PR #4029. All tests/checks have passed and are currently pending on a reviewer, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Low hanging fruit for new contributors to get involved!
Projects
None yet
3 participants