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

Feat/token voting target improvements #38

Merged
merged 98 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
c4605ea
feat: update majority voting to support min approvals
clauBv23 Aug 26, 2024
5d955d8
ci: separate the updateMinApproval in a different function and add it…
clauBv23 Aug 26, 2024
6a2456c
feat: add minApproval to token voting, duplicate init function to con…
clauBv23 Aug 26, 2024
bdba026
fix: tests and compilation errors
clauBv23 Aug 26, 2024
88f9d04
feat: update the token voting setup so the min advance value in prope…
clauBv23 Aug 26, 2024
635b96c
fix: typo in the setup function selector
clauBv23 Aug 26, 2024
42ef256
feat: add new installation and update param in the build metadata file
clauBv23 Aug 26, 2024
77f3d6f
fix: update tests to work with new setup and configuration param
clauBv23 Aug 26, 2024
0403d51
feat: add natspec comments to the majority votes interface
clauBv23 Aug 26, 2024
902eb13
feat: add natspect comment to the token voting contract
clauBv23 Aug 26, 2024
7ec12c9
ci: remove not needed contract
clauBv23 Aug 26, 2024
59165e4
feat: add natspect and needed event when updating the min approval value
clauBv23 Aug 26, 2024
5d1c070
feat: add test for checking the proposal can not be executed when the…
clauBv23 Aug 28, 2024
b6e9ca7
feat: define new interfaces to check them on the tests
clauBv23 Aug 28, 2024
9b7394c
ci: move the min approval variable definition position
clauBv23 Aug 28, 2024
04ca7fb
fix: min approval values
clauBv23 Aug 28, 2024
8955f48
feat: add test for edge cases
clauBv23 Aug 28, 2024
638ea07
feat: modify the majority votes init function to receive the min appr…
clauBv23 Aug 28, 2024
7ec2e54
feat: add tets for checking the updateMinApproval function
clauBv23 Aug 28, 2024
e39d535
ci: remove comment
clauBv23 Aug 28, 2024
cb01be0
feat: add test for old interfaces on majority votes
clauBv23 Aug 28, 2024
f175112
fix: import missing constant
clauBv23 Aug 28, 2024
a959426
feat: add validation for minimal approval value
clauBv23 Aug 28, 2024
c0bd627
fixL typos
clauBv23 Aug 28, 2024
08409b5
feat: change test to the new initialize function
clauBv23 Aug 28, 2024
9bc036a
feat: define the initialize function signature as constant to reuse it
clauBv23 Aug 28, 2024
bb689ff
feat: revert on old initialize function
clauBv23 Aug 28, 2024
119e15c
feat: use new constant signatures and add test to check deprecated in…
clauBv23 Aug 28, 2024
7bf608b
ci: improve natspec comment
clauBv23 Aug 28, 2024
5c04b20
ci: remove comments
clauBv23 Aug 28, 2024
6f7d789
ci: remove comment
clauBv23 Aug 28, 2024
65198a0
ci: comment
clauBv23 Aug 28, 2024
8a69416
fix: typo
clauBv23 Aug 28, 2024
af67a74
feat: rename min approval variable
clauBv23 Aug 28, 2024
939dac7
fix: remove check no longer needed
clauBv23 Aug 28, 2024
1219954
ci: refact
clauBv23 Aug 28, 2024
210afb0
ci: remove comment
clauBv23 Aug 28, 2024
fb95ba5
ci: add comment
clauBv23 Aug 29, 2024
f7e0f97
fic: rename function for consistency
clauBv23 Aug 29, 2024
345d6b7
fix: update metadata description
clauBv23 Aug 29, 2024
4fe246c
fix lint
clauBv23 Aug 29, 2024
9b6cf85
ci: rename all vars name
clauBv23 Aug 29, 2024
92070c4
ci: rename functions for consistency
clauBv23 Aug 29, 2024
4ce4388
feat: change the min approval type from uint32 to uint256
clauBv23 Aug 29, 2024
c720fed
fix: test
clauBv23 Aug 29, 2024
1073c87
fix test
clauBv23 Aug 29, 2024
cb368a3
feat: add condition
clauBv23 Aug 30, 2024
6173c49
feat: add new params to token voting
clauBv23 Aug 30, 2024
7b44355
add target configs permanently and fix tests
novaknole Sep 8, 2024
5ce8060
reinitializer number fixed and old interface
novaknole Sep 10, 2024
84ef2cd
remove todo comments
novaknole Sep 10, 2024
207d988
initializeFrom with build number and data
novaknole Sep 10, 2024
5dfccfc
ivotes checks
novaknole Sep 17, 2024
b2eef30
add initialization modifier for safety + improved targetconfig
novaknole Sep 19, 2024
96bf27b
bytes param added
novaknole Sep 19, 2024
cd5543e
rename param function
novaknole Sep 19, 2024
42073e3
Update packages/contracts/src/TokenVoting.sol
novaknole Sep 25, 2024
2051e27
Update packages/contracts/src/TokenVoting.sol
novaknole Sep 25, 2024
70f28e6
fix typo
novaknole Sep 25, 2024
ccfe8ec
add delegate call
novaknole Sep 26, 2024
f3cb27c
silence warnings
novaknole Sep 26, 2024
386d417
add executor interface
novaknole Sep 26, 2024
329e76b
action as free level
novaknole Sep 27, 2024
283c2c6
Merge pull request #34 from aragon/feature/executors
novaknole Sep 27, 2024
fba0116
Merge pull request #32 from aragon/feature/bytes-param-add
novaknole Sep 27, 2024
6b02e12
remove unneccessary revoke
novaknole Sep 27, 2024
4a8be44
Merge branch 'feat/token-voting-target-improvements' into feature/bet…
novaknole Sep 27, 2024
41b5d7f
Merge pull request #31 from aragon/feature/better-ivote-checks
novaknole Sep 28, 2024
93e6d31
better upgrade tests
novaknole Sep 28, 2024
5178b67
remove hardcoded value
novaknole Sep 28, 2024
4780717
Merge pull request #35 from aragon/feature/add-initializeFrom-upgrade…
novaknole Sep 28, 2024
2690267
callinitialization from osx-commons
novaknole Sep 28, 2024
630bfd9
Merge branch 'feat/token-voting-target-improvements' of https://githu…
novaknole Sep 28, 2024
0647d5d
fix tohex
novaknole Sep 29, 2024
4f86c7c
metadata extension
novaknole Oct 8, 2024
f316675
Update packages/contracts/src/MajorityVotingBase.sol
novaknole Oct 8, 2024
ccfa5d9
Update packages/contracts/src/TokenVoting.sol
novaknole Oct 8, 2024
d49093c
Update packages/contracts/src/TokenVoting.sol
novaknole Oct 8, 2024
ab1af36
Update packages/contracts/src/TokenVoting.sol
novaknole Oct 8, 2024
3176cd4
Update packages/contracts/src/TokenVotingSetup.sol
novaknole Oct 8, 2024
3de9e37
Update packages/contracts/src/TokenVotingSetup.sol
novaknole Oct 8, 2024
9799f4e
Update packages/contracts/src/TokenVotingSetup.sol
novaknole Oct 8, 2024
7b3d080
permission added
novaknole Oct 8, 2024
ba6dcf8
Merge pull request #36 from aragon/feature/metadata
novaknole Oct 8, 2024
4e5d291
metadata rename
novaknole Oct 9, 2024
a857d9e
fix tests and contract (#37)
novaknole Oct 14, 2024
8e9b423
condition reorder
novaknole Oct 25, 2024
f365fb5
feat: add auth to execute() and update Setup & testing
Rekard0 Oct 31, 2024
9f4dbf2
add explicit test when auth revert without permission
Rekard0 Oct 31, 2024
b1969cc
fix: fix comment
Rekard0 Oct 31, 2024
1f0faed
unused comments
novaknole Oct 31, 2024
75949c6
add test for recording vote with tryEralyExecution when call don't ha…
Rekard0 Oct 31, 2024
a5e7dca
remove .only
novaknole Nov 1, 2024
427a7f5
Merge pull request #39 from aragon/feature/add-auth-to-execute
novaknole Nov 1, 2024
e906746
hassucceeded
novaknole Nov 4, 2024
def23ed
reverts
novaknole Nov 4, 2024
d86f894
Merge pull request #40 from aragon/feature/hasSucceeded
novaknole Nov 4, 2024
2a39ba9
remove comment
novaknole Nov 5, 2024
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
8 changes: 6 additions & 2 deletions packages/contracts/deploy/20_new_version/23_publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
createVersion: {
_release: VERSION.release,
_pluginSetup: setup.address,
_buildMetadata: toHex(buildMetadataURI),
_releaseMetadata: toHex(releaseMetadataURI),
_buildMetadata: ethers.utils.hexlify(
ethers.utils.toUtf8Bytes(buildMetadataURI)
),
_releaseMetadata: ethers.utils.hexlify(
ethers.utils.toUtf8Bytes(releaseMetadataURI)
),
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const config: HardhatUserConfig = {
deploy: './deploy',
},
mocha: {
timeout: 60_000,
timeout: 6000000,
},
solidity: {
version: '0.8.17',
Expand Down
11 changes: 11 additions & 0 deletions packages/contracts/src/IMajorityVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ interface IMajorityVoting {
/// @return The support threshold parameter.
function supportThreshold() external view returns (uint32);

/// @notice Returns the min approval value stored configured.
/// @return The minimal approval value.
function minApproval() external view returns (uint256);

/// @notice Returns the minimum participation parameter stored in the voting settings.
/// @return The minimum participation parameter.
function minParticipation() external view returns (uint32);
Expand All @@ -61,6 +65,13 @@ interface IMajorityVoting {
/// @return Returns `true` if the participation is greater than the minimum participation and `false` otherwise.
function isMinParticipationReached(uint256 _proposalId) external view returns (bool);

/// @notice Checks if the min approval value defined as:
///$$\texttt{minApproval} = \frac{N_\text{yes}}{N_\text{total}}$$
/// for a proposal vote is greater or equal than the minimum approval value.
/// @param _proposalId The ID of the proposal.
/// @return Returns `true` if the participation is greater than the minimum participation and `false` otherwise.
function isMinApprovalReached(uint256 _proposalId) external view returns (bool);

/// @notice Checks if an account can participate on a proposal vote. This can be because the vote
/// - has not started,
/// - has ended,
Expand Down
Loading
Loading