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: add wonderGovernor and wonderVotes contract examples #5

Merged
merged 2 commits into from
Dec 21, 2023

Conversation

0xRaccoon
Copy link
Member

No description provided.

Signed-off-by: 0xRaccoon <raccoon@defi.sucks>
Signed-off-by: 0xRaccoon <raccoon@defi.sucks>
Copy link
Collaborator

@0xParticle 0xParticle left a comment

Choose a reason for hiding this comment

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

loving it ser


function quorum(uint256 _timepoint, uint8 _proposalType) public view override returns (uint256) {
// same quorum for all proposals types and timepoints
return 400_000e18;
Copy link
Collaborator

Choose a reason for hiding this comment

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

it would be cool to see some example where this has logic, like a percentage of IERC20(VoteToken).totalSupply()

Copy link
Collaborator

Choose a reason for hiding this comment

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

For another instance, ofc

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly, this could be calling votes.getPastTotalSupply(_proposalType, _timepoint) and calculate a percentage of that, or it could also combine with the total supply to ensure that a minimum threshold of voting power is being tracked for new proposal types.

}

function _weightNormalizer() internal view virtual override returns (uint256) {
return 100;
Copy link
Collaborator

Choose a reason for hiding this comment

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

hehe <3

Copy link
Collaborator

Choose a reason for hiding this comment

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

can't we just use a state variable instead of a function for this? use the getter

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we could. But that will require us to change the WonderVotes parent contract and use a variable we would override or change in the child contract instead a function. I think a function ensures that the child will override it by not having it implemented in the parent contract. We can change this one if we consider that is more convenient constant in a next pr.

@0xRaccoon 0xRaccoon merged commit 5bfd84b into dev Dec 21, 2023
@0xRaccoon 0xRaccoon deleted the feat/add-examples branch December 21, 2023 12:18
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

2 participants