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

Make ERC20Votes independent from ERC20Permit #3816

Merged
merged 24 commits into from Nov 29, 2022

Conversation

JulissaDantes
Copy link
Contributor

Fixes #3160

This PR introduces a new contract, Nonces, to be used where keeping track of nonces is required. Also, ERC20Votes will now be inherited directly from EIP712 instead of using ERC20Permit.

This is a breaking change due to the changes in the storage layout.

PR Checklist

  • Tests
  • Documentation
  • Changelog entry

CHANGELOG.md Outdated Show resolved Hide resolved
contracts/token/ERC20/extensions/ERC20Votes.sol Outdated Show resolved Hide resolved
contracts/token/ERC20/extensions/ERC20Votes.sol Outdated Show resolved Hide resolved
@JulissaDantes JulissaDantes changed the title [next-v5.0] Make ERC20Votes independent from ERC20Permit Make ERC20Votes independent from ERC20Permit Nov 17, 2022
test/utils/Nonces.test.js Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
test/governance/utils/Votes.behavior.js Outdated Show resolved Hide resolved
test/token/ERC20/extensions/ERC20Votes.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

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

Need to add back numCheckpoints and checkpoints.

contracts/token/ERC20/extensions/ERC20Votes.sol Outdated Show resolved Hide resolved
contracts/token/ERC20/extensions/ERC20Votes.sol Outdated Show resolved Hide resolved
contracts/utils/Checkpoints.sol Outdated Show resolved Hide resolved
JulissaDantes and others added 2 commits November 29, 2022 07:34
Co-authored-by: Francisco <frangio.1@gmail.com>
Co-authored-by: Francisco <frangio.1@gmail.com>
JulissaDantes and others added 2 commits November 29, 2022 07:34
Co-authored-by: Francisco <frangio.1@gmail.com>
Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

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

Thanks!

@frangio frangio merged commit e2d2ebc into OpenZeppelin:next-v5.0 Nov 29, 2022
@gitpoap-bot
Copy link

gitpoap-bot bot commented Nov 29, 2022

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2022 OpenZeppelin Contracts Contributor:

GitPOAP: 2022 OpenZeppelin Contracts Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

@k06a
Copy link
Contributor

k06a commented Dec 2, 2022

Isn't it an issue that inheriting from both ERC20Permit and ERC20Votes would reuse same nonces for 2 different actions? I would suggest to refactor Nonces to NoncesLib to be able to have separate instances of it in these 2 abstract contracts. Same way as we are proposing to have ReentrancyGuardLib here: #3846

@k06a
Copy link
Contributor

k06a commented Dec 2, 2022

Proposed these changes here: #3848

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.

None yet

3 participants