-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
Signed-off-by: 0xRaccoon <raccoon@defi.sucks>
Signed-off-by: 0xRaccoon <raccoon@defi.sucks>
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.
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; |
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.
it would be cool to see some example where this has logic, like a percentage of IERC20(VoteToken).totalSupply()
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.
For another instance, ofc
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.
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; |
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.
hehe <3
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.
can't we just use a state variable instead of a function for this? use the getter
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.
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.
No description provided.