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

Add ERC721Votes for NFT-based governance #2944

Merged
merged 329 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
329 commits
Select commit Hold shift + click to select a range
abeaf5c
Fixing checkpoints count
JulissaDantes Oct 31, 2021
798baa0
Updating ERC721Vote tests
JulissaDantes Oct 31, 2021
4f5a44d
Renaming supplied tokenId on tests
JulissaDantes Nov 1, 2021
13d4a91
Updating tests based on new contract changes
JulissaDantes Nov 1, 2021
6ae58d3
Updating execution order inside of mint
JulissaDantes Nov 2, 2021
c8abe20
Adding Mocks for testing and integrating nft minting to current workf…
JulissaDantes Nov 2, 2021
a5d52d9
Governance adocs update
JulissaDantes Nov 2, 2021
a2ec66b
Updating contracts listing order
JulissaDantes Nov 3, 2021
d8147d4
Following lint suggestions
JulissaDantes Nov 3, 2021
2b03bf9
Delete of test contract
JulissaDantes Nov 3, 2021
c987124
Merge branch 'master' of https://github.com/JulissaDantes/openzeppeli…
JulissaDantes Nov 24, 2021
69c6bb1
Delete unused test file
JulissaDantes Nov 24, 2021
339aa31
Update changelog
JulissaDantes Nov 25, 2021
1cabd29
Create Checkpoints and Voting libraries
JulissaDantes Nov 25, 2021
ec5ea0e
Update ERC721Votes contract to use library
JulissaDantes Nov 25, 2021
5f15d46
Add function to Voting library
JulissaDantes Nov 26, 2021
82b1565
Update ERC721Governance contracts
JulissaDantes Nov 26, 2021
8e3feae
Documentation for Checkpoints library
JulissaDantes Nov 26, 2021
d3f3502
Add documentation for Voting library
JulissaDantes Nov 26, 2021
1b95cc8
Add Mock contracts for Voting and checkpoints test
JulissaDantes Nov 26, 2021
9335d04
Add Voting library tests
JulissaDantes Nov 26, 2021
c88fd74
Add Checkpoints library tests
JulissaDantes Nov 26, 2021
b2c0568
Add more documentation for voting library
JulissaDantes Nov 26, 2021
f0dc612
Merge pull request #12 from JulissaDantes/VotingLibrary
JulissaDantes Nov 26, 2021
88edb90
Merge branch 'master' into ERC721Governance
JulissaDantes Nov 26, 2021
a0a26ce
Initial contracts creation
JulissaDantes Oct 31, 2021
0991757
creating permit tests
JulissaDantes Oct 31, 2021
9c3f9fd
Fixing checkpoints count
JulissaDantes Oct 31, 2021
0b0406e
Updating ERC721Vote tests
JulissaDantes Oct 31, 2021
4d3ca3a
Updating ERC721Vote tests descriptions
JulissaDantes Oct 31, 2021
d71fb49
Updating ERC721Vote contract and tests
JulissaDantes Oct 31, 2021
dd4a695
Finished tests
JulissaDantes Nov 1, 2021
2d834df
Adding _afterTokenTransfer to base ERC271 contract
JulissaDantes Nov 1, 2021
a207eb5
Renaming supplied tokenId on tests
JulissaDantes Nov 1, 2021
052d4a1
Updating tests based on new contract changes
JulissaDantes Nov 1, 2021
adbbbfb
Updating execution order inside of mint
JulissaDantes Nov 2, 2021
4899be8
Adding Mocks for testing and integrating nft minting to current workf…
JulissaDantes Nov 2, 2021
1f85057
Implementing override test
JulissaDantes Nov 2, 2021
3d0f1e4
Removing .only from tests
JulissaDantes Nov 2, 2021
9a3f2a1
Updating contracts READMEs
JulissaDantes Nov 2, 2021
f3d8453
Governance adocs update
JulissaDantes Nov 2, 2021
ec047ac
Removing test contract
JulissaDantes Nov 3, 2021
1179e90
Initial contracts creation
JulissaDantes Oct 31, 2021
913946b
creating permit tests
JulissaDantes Oct 31, 2021
e999d78
Fixing checkpoints count
JulissaDantes Oct 31, 2021
3c63a1d
Updating ERC721Vote tests
JulissaDantes Oct 31, 2021
b42d0ab
Renaming supplied tokenId on tests
JulissaDantes Nov 1, 2021
dc0ec55
Updating tests based on new contract changes
JulissaDantes Nov 1, 2021
9d0f7fe
Updating execution order inside of mint
JulissaDantes Nov 2, 2021
9efd8c1
Adding Mocks for testing and integrating nft minting to current workf…
JulissaDantes Nov 2, 2021
87cf640
Governance adocs update
JulissaDantes Nov 2, 2021
b135af5
Updating contracts listing order
JulissaDantes Nov 3, 2021
510c373
Following lint suggestions
JulissaDantes Nov 3, 2021
f58c91e
Delete of test contract
JulissaDantes Nov 3, 2021
8663d84
Initial contracts creation
JulissaDantes Oct 31, 2021
6d69091
creating permit tests
JulissaDantes Oct 31, 2021
72c887d
Fixing checkpoints count
JulissaDantes Oct 31, 2021
b94e475
Updating ERC721Vote tests
JulissaDantes Oct 31, 2021
a7397ba
Updating ERC721Vote tests descriptions
JulissaDantes Oct 31, 2021
6ed1ccd
Adding _afterTokenTransfer to base ERC271 contract
JulissaDantes Nov 1, 2021
718274a
Updating tests based on new contract changes
JulissaDantes Nov 1, 2021
e341b83
Governance adocs update
JulissaDantes Nov 2, 2021
130664e
Removing test contract
JulissaDantes Nov 3, 2021
5c9e993
Initial contracts creation
JulissaDantes Oct 31, 2021
1ad617a
creating permit tests
JulissaDantes Oct 31, 2021
13d3b7c
Fixing checkpoints count
JulissaDantes Oct 31, 2021
f9fa57a
Updating ERC721Vote tests
JulissaDantes Oct 31, 2021
af0d1a5
Updating ERC721Vote contract and tests
JulissaDantes Oct 31, 2021
3ccfdd9
Adding _afterTokenTransfer to base ERC271 contract
JulissaDantes Nov 1, 2021
05e8cee
Renaming supplied tokenId on tests
JulissaDantes Nov 1, 2021
b9c8e7b
Updating tests based on new contract changes
JulissaDantes Nov 1, 2021
068da60
Updating execution order inside of mint
JulissaDantes Nov 2, 2021
e350d15
Adding Mocks for testing and integrating nft minting to current workf…
JulissaDantes Nov 2, 2021
c5f44f7
Implementing override test
JulissaDantes Nov 2, 2021
7a9228f
Governance adocs update
JulissaDantes Nov 2, 2021
49a378f
Updating contracts listing order
JulissaDantes Nov 3, 2021
22c672e
Delete of test contract
JulissaDantes Nov 3, 2021
514e0aa
Updating comment and documentation
JulissaDantes Nov 3, 2021
074430d
Update docs/modules/ROOT/pages/governance.adoc
JulissaDantes Nov 4, 2021
a9d6cff
Improving documentation, adding spaces, renaming variables
JulissaDantes Nov 4, 2021
05ed326
Update contracts/token/ERC721/extensions/ERC721Votes.sol
JulissaDantes Nov 4, 2021
3eb6d74
Update contracts/token/ERC721/extensions/ERC721Votes.sol
JulissaDantes Nov 4, 2021
d8ff5cc
Update docs/modules/ROOT/pages/governance.adoc
JulissaDantes Nov 4, 2021
367f9bb
Adding constructor
JulissaDantes Nov 4, 2021
cca8ff2
Updating tests setting more NFT voting power to single voter
JulissaDantes Nov 4, 2021
1e0f543
Update erc721.adoc
JulissaDantes Nov 4, 2021
84d97db
Adding method to return token voting power
JulissaDantes Nov 4, 2021
8147461
Delete local file
JulissaDantes Nov 4, 2021
c914c84
Update contracts/token/ERC721/extensions/draft-ERC721Votes.sol
JulissaDantes Nov 5, 2021
2a45f36
Including getVotingPower
JulissaDantes Nov 5, 2021
deb2b1e
After prettier run, updating format
JulissaDantes Nov 5, 2021
6fe31e9
Renaming totalSupply to totalVotingPower for the code to be cleaner
JulissaDantes Nov 5, 2021
51ade3f
Update changelog
JulissaDantes Nov 25, 2021
3aec0a7
Create Checkpoints and Voting libraries
JulissaDantes Nov 25, 2021
41aa303
Update ERC721Votes contract to use library
JulissaDantes Nov 25, 2021
4d1912b
Add function to Voting library
JulissaDantes Nov 26, 2021
2524a87
Update ERC721Governance contracts
JulissaDantes Nov 26, 2021
1e46d25
Documentation for Checkpoints library
JulissaDantes Nov 26, 2021
7d4c5fe
Add documentation for Voting library
JulissaDantes Nov 26, 2021
44df89d
Add Mock contracts for Voting and checkpoints test
JulissaDantes Nov 26, 2021
55213f5
Add Voting library tests
JulissaDantes Nov 26, 2021
054c78f
Add Checkpoints library tests
JulissaDantes Nov 26, 2021
92936c8
Add more documentation for voting library
JulissaDantes Nov 26, 2021
c7c9b29
Lint run
JulissaDantes Nov 26, 2021
d05cb0a
change after rebase
JulissaDantes Nov 26, 2021
8582932
Merge branch 'master' into ERC721Governance
JulissaDantes Nov 26, 2021
b57a3dc
Remove empty spaces
JulissaDantes Nov 26, 2021
02115ae
Run prettier
JulissaDantes Nov 26, 2021
abc90f9
Merge pull request #13 from JulissaDantes/ERC721Governance
JulissaDantes Nov 26, 2021
51002f9
Remove whitespaces
JulissaDantes Nov 29, 2021
54d80db
Remove whitespaces
JulissaDantes Nov 29, 2021
acd9a00
Update changelog after merge
JulissaDantes Nov 29, 2021
7f5a8f4
Merge pull request #14 from JulissaDantes/ERC721Governance
JulissaDantes Nov 29, 2021
c919980
Initial contracts creation
JulissaDantes Oct 31, 2021
5a10153
creating permit tests
JulissaDantes Oct 31, 2021
792ce18
Fixing checkpoints count
JulissaDantes Oct 31, 2021
71301aa
Updating ERC721Vote tests
JulissaDantes Oct 31, 2021
9c39e32
Updating ERC721Vote tests descriptions
JulissaDantes Oct 31, 2021
a3396c5
Updating ERC721Vote contract and tests
JulissaDantes Oct 31, 2021
3aef1f9
Finished tests
JulissaDantes Nov 1, 2021
9784e04
Adding _afterTokenTransfer to base ERC271 contract
JulissaDantes Nov 1, 2021
1a3dc28
Renaming supplied tokenId on tests
JulissaDantes Nov 1, 2021
e37f4bf
Updating tests based on new contract changes
JulissaDantes Nov 1, 2021
f275406
Updating execution order inside of mint
JulissaDantes Nov 2, 2021
6a9caf0
Adding Mocks for testing and integrating nft minting to current workf…
JulissaDantes Nov 2, 2021
5a58fc2
Implementing override test
JulissaDantes Nov 2, 2021
e07dfa6
Removing .only from tests
JulissaDantes Nov 2, 2021
0bc0ab5
Updating contracts READMEs
JulissaDantes Nov 2, 2021
61523ed
Governance adocs update
JulissaDantes Nov 2, 2021
f82873e
Removing test contract
JulissaDantes Nov 3, 2021
4f0f39e
Initial contracts creation
JulissaDantes Oct 31, 2021
acc4aa7
creating permit tests
JulissaDantes Oct 31, 2021
82e313b
Fixing checkpoints count
JulissaDantes Oct 31, 2021
e55511a
Updating ERC721Vote tests
JulissaDantes Oct 31, 2021
9eaa01d
Renaming supplied tokenId on tests
JulissaDantes Nov 1, 2021
29b0e16
Updating tests based on new contract changes
JulissaDantes Nov 1, 2021
3c49d6c
Updating execution order inside of mint
JulissaDantes Nov 2, 2021
d344647
Adding Mocks for testing and integrating nft minting to current workf…
JulissaDantes Nov 2, 2021
d687e09
Governance adocs update
JulissaDantes Nov 2, 2021
101a82c
Updating contracts listing order
JulissaDantes Nov 3, 2021
5201c96
Following lint suggestions
JulissaDantes Nov 3, 2021
4f9cc0a
Delete of test contract
JulissaDantes Nov 3, 2021
4175ade
Updating comment and documentation
JulissaDantes Nov 3, 2021
c8e1c94
Update docs/modules/ROOT/pages/governance.adoc
JulissaDantes Nov 4, 2021
de45b91
Update contracts/token/ERC721/extensions/ERC721Votes.sol
JulissaDantes Nov 4, 2021
6af56a9
Update docs/modules/ROOT/pages/governance.adoc
JulissaDantes Nov 4, 2021
9079397
Update erc721.adoc
JulissaDantes Nov 4, 2021
6eb60da
Delete unused test file
JulissaDantes Nov 24, 2021
29e7a02
Create Checkpoints and Voting libraries
JulissaDantes Nov 25, 2021
9a26c4d
Add function to Voting library
JulissaDantes Nov 26, 2021
af23b86
Documentation for Checkpoints library
JulissaDantes Nov 26, 2021
9b4d4cf
Add Mock contracts for Voting and checkpoints test
JulissaDantes Nov 26, 2021
aa3c0db
Governance adocs update
JulissaDantes Nov 2, 2021
2a3e090
Removing test contract
JulissaDantes Nov 3, 2021
e3730e1
Initial contracts creation
JulissaDantes Oct 31, 2021
731586f
Renaming supplied tokenId on tests
JulissaDantes Nov 1, 2021
9dad235
Updating contracts listing order
JulissaDantes Nov 3, 2021
ae4d235
Fixing checkpoints count
JulissaDantes Oct 31, 2021
897938f
Adding _afterTokenTransfer to base ERC271 contract
JulissaDantes Nov 1, 2021
c0cab85
Governance adocs update
JulissaDantes Nov 2, 2021
3b031da
Removing test contract
JulissaDantes Nov 3, 2021
9829c08
creating permit tests
JulissaDantes Oct 31, 2021
ada5c98
Adding Mocks for testing and integrating nft minting to current workf…
JulissaDantes Nov 2, 2021
c730f4d
Implementing override test
JulissaDantes Nov 2, 2021
98a6618
Updating contracts listing order
JulissaDantes Nov 3, 2021
ef43fb2
Update erc721.adoc
JulissaDantes Nov 4, 2021
ec7e892
Update changelog
JulissaDantes Nov 25, 2021
b813f9c
Run prettier
JulissaDantes Nov 26, 2021
09da50d
Update changelog after merge
JulissaDantes Nov 29, 2021
e0e8d74
Update after rebase
JulissaDantes Nov 29, 2021
fb2bd07
Merge branch 'master' of https://github.com/JulissaDantes/openzeppeli…
JulissaDantes Nov 29, 2021
d7f1dda
Remove unused library
JulissaDantes Nov 29, 2021
5506617
Prevent version mismatch
JulissaDantes Nov 29, 2021
25eadd0
Merge pull request #15 from JulissaDantes/ERC721Governance
JulissaDantes Nov 30, 2021
424af50
Remove minting restriction
JulissaDantes Nov 30, 2021
b2b7f5b
Remove afterToken transfer and Add _transfer function
JulissaDantes Nov 30, 2021
ef252c9
Remove checkpoints methods
JulissaDantes Nov 30, 2021
83eeac5
Update contract structure
JulissaDantes Dec 1, 2021
176d166
Add _getDelegatorVotes function for ERC721Votes
JulissaDantes Dec 1, 2021
bb32fba
Update Voting test and Mock
JulissaDantes Dec 1, 2021
1d0c1ea
Update Votes mock and tests
JulissaDantes Dec 2, 2021
3e14830
Fix functions visibility on Votes contract
JulissaDantes Dec 2, 2021
f7a7b51
Run lint
JulissaDantes Dec 2, 2021
5740f3c
Merge pull request #16 from JulissaDantes/ERC721Governance
JulissaDantes Dec 2, 2021
5704b3b
Fix delegation, add test coverage, fix moveVotingPower
JulissaDantes Dec 2, 2021
be216d0
Merge pull request #17 from JulissaDantes/ERC721Governance
JulissaDantes Dec 2, 2021
c37502f
Change inheritance order
JulissaDantes Dec 2, 2021
a28a4b2
Merge pull request #18 from JulissaDantes/ERC721Governance
JulissaDantes Dec 2, 2021
9ea08be
Update documentation contract
JulissaDantes Dec 2, 2021
6bcff2b
Update CHANGELOG.md
JulissaDantes Dec 3, 2021
73bb657
Update checkpoints storage variable names
JulissaDantes Dec 3, 2021
3ffdb76
Update docs/modules/ROOT/pages/governance.adoc
JulissaDantes Dec 3, 2021
b6cbe1d
Update variable names, Remove index based functions, update documenta…
JulissaDantes Dec 3, 2021
099fa20
Merge branch 'ERC721Governance' of https://github.com/JulissaDantes/o…
JulissaDantes Dec 3, 2021
f054441
Update delegate arguments, rename variables, add function call on bas…
JulissaDantes Dec 3, 2021
0c8b601
Update _moveVotingPower
JulissaDantes Dec 3, 2021
7de147c
Update tests
JulissaDantes Dec 3, 2021
d852c08
Run lint
JulissaDantes Dec 3, 2021
5efd9a2
Add IVote interface an update tests
JulissaDantes Dec 3, 2021
052f064
Remove .only from test
JulissaDantes Dec 3, 2021
76d47c7
Merge pull request #19 from JulissaDantes/ERC721Governance
JulissaDantes Dec 3, 2021
499559a
Merge branch 'master' of https://github.com/OpenZeppelin/openzeppelin…
JulissaDantes Dec 3, 2021
eb6304b
Update contract inheriting from GovernorVotes
JulissaDantes Dec 3, 2021
e5fecaf
Indentitation/format consistency
Amxx Dec 3, 2021
9addc4f
Improve format
JulissaDantes Dec 3, 2021
f536b1b
Merge branch 'ERC721Governance' of https://github.com/JulissaDantes/o…
JulissaDantes Dec 3, 2021
b8639e7
Update contracts/utils/Votes.sol
JulissaDantes Dec 3, 2021
f5f6aab
Update contracts/token/ERC20/extensions/ERC20Votes.sol
JulissaDantes Dec 3, 2021
87bd7b2
Update contracts/utils/Checkpoints.sol
JulissaDantes Dec 3, 2021
93a2079
Update IVotes and Votes directory
JulissaDantes Dec 3, 2021
829f074
Remove .only from test files
JulissaDantes Dec 3, 2021
8fdb1e0
Update storage variables names
JulissaDantes Dec 3, 2021
dfe225c
Change inheritance order
JulissaDantes Dec 3, 2021
ee10185
Merge pull request #20 from JulissaDantes/ERC721Governance
JulissaDantes Dec 3, 2021
1cca7be
Add function to handle mint and burn before moving voting power
JulissaDantes Dec 6, 2021
c173749
Update README.adoc
frangio Dec 6, 2021
f2cccc3
rename files to new names
frangio Dec 6, 2021
2f8cf7b
Rename function getTotalSupply
JulissaDantes Dec 6, 2021
628567c
Merge branch 'ERC721Governance' of https://github.com/JulissaDantes/o…
JulissaDantes Dec 6, 2021
edf795b
Change test function name
JulissaDantes Dec 6, 2021
7f90b88
Fix documentation after function rename
JulissaDantes Dec 6, 2021
7cda9a3
improve documentation
frangio Dec 6, 2021
a82fc9c
Update Votes.sol documentation
JulissaDantes Dec 6, 2021
b171720
Add Chekpoints.sol documentation
JulissaDantes Dec 6, 2021
7e134d8
Improve ERc721 documentation
JulissaDantes Dec 6, 2021
1197d84
Erc721 governance documentation improvement (#21)
JulissaDantes Dec 6, 2021
c60d9b5
add Checkpoints: prefix to revert reason
frangio Dec 6, 2021
81972f7
fix revert reason
frangio Dec 6, 2021
4773334
remove revert reason prefix from test
frangio Dec 6, 2021
7ead55f
Update CHANGELOG.md
JulissaDantes Dec 7, 2021
f099426
Add checkpoints tests
JulissaDantes Dec 7, 2021
c4d3dfd
Improve format
JulissaDantes Dec 7, 2021
43abcee
revert back to previous error message
frangio Dec 8, 2021
cd3ab17
restructure Checkpoints tests
frangio Dec 8, 2021
c349618
lint
frangio Dec 8, 2021
ebd3082
improve Checkpoints docs
frangio Dec 8, 2021
ce1df1f
Update revert message
JulissaDantes Dec 8, 2021
5cb991b
Add VotesWorklfow to aid testing
JulissaDantes Dec 8, 2021
37c9e73
Add mint before delegate on votes tests
JulissaDantes Dec 8, 2021
d556b27
Merge branch 'ERC721Governance' of https://github.com/JulissaDantes/o…
JulissaDantes Dec 8, 2021
94d63e0
Update token specific test for ERC721Votes
JulissaDantes Dec 8, 2021
547cba4
Merge branch 'master' into ERC721Governance
JulissaDantes Dec 8, 2021
90ca1e2
remove added whitespace
frangio Dec 10, 2021
9d705ce
further improve docs and rename for new concept of vote units
frangio Dec 10, 2021
8e74446
rename VotesWorkflow to Votes behavior
frangio Dec 10, 2021
d6ae076
remove unused helpers
frangio Dec 10, 2021
92537f3
Rename tests variables based on contract renamed variable
JulissaDantes Dec 10, 2021
b306e61
fix missing name variable
frangio Dec 10, 2021
53847b4
revert event argument change
frangio Dec 10, 2021
bd6ec00
Merge branch 'master' into ERC721Governance
frangio Dec 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updating ERC721Vote contract and tests
  • Loading branch information
JulissaDantes committed Nov 29, 2021
commit a3396c5a192b86f02f265eddc977d3f208b81e9c
2 changes: 0 additions & 2 deletions contracts/token/ERC721/extensions/ERC721Votes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import "../../../utils/cryptography/ECDSA.sol";
* @dev Extension of ERC721 to support Compound-like voting and delegation. This version is more generic than Compound's,
* and supports token supply up to 2^224^ - 1, while COMP is limited to 2^96^ - 1.
*
* NOTE: If exact COMP compatibility is required, use the {ERC721VotesComp} variant of this module.
*
* This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either
* by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting
* power can be queried through the public accessors {getVotes} and {getPastVotes}.
Expand Down
2 changes: 1 addition & 1 deletion test/token/ERC721/extensions/ERC721Votes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ contract('ERC721Votes', function (accounts) {

describe('getPastTotalSupply', function () {
beforeEach(async function () {
// await this.token.delegate(holder, { from: holder });
await this.token.delegate(holder, { from: holder });
});

it('reverts if block number >= current block', async function () {
Expand Down