-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Add ERC721Votes for NFT-based governance #2944
Add ERC721Votes for NFT-based governance #2944
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, great work!
Note regarding next steps: There are some challenges around implementing |
I implemented erc721 voting with different weights and delegation. Since I was working with a diamond I moved the whole logic into a library, though the function names are the same as in the oz implementation. Maybe this helps as well.. Note: I did not compare the implementation on this pr with my own so I might have missed something. I will check that in the next days. |
We will resume this PR next week. |
* Add function to handle mint and burn before moving voting power * Update README.adoc * rename files to new names * Rename function getTotalSupply * Change test function name * Fix documentation after function rename * improve documentation * Update Votes.sol documentation * Add Chekpoints.sol documentation * Improve ERc721 documentation Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
…penzeppelin-contracts into ERC721Governance Pull latest change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
Fixes #2873
Governance with NFT-backed votes. An ERC721Votes extension of ERC721 and a GovernorVotesERC721 module for OZ Governor contract. The contracts is be analogous to ERC20Votes and GovernorVotes, but for NFTs.
PR Checklist
Suggested Next steps
So far this implementation account for 1 Token = 1 vote, if a
_getVotingPower
internal virtual function is created, taking the token Id and returning the voting power of such token, that would allow for differently weighted token(you could call it token rarity or token value) to be used as voting power.