-
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 support for proposal types #2
Conversation
Signed-off-by: 0xRaccoon <[email protected]>
@@ -32,6 +39,7 @@ abstract contract WonderGovernor is Context, ERC165, EIP712, Nonces, IGovernor, | |||
keccak256('ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)'); | |||
|
|||
struct ProposalCore { | |||
uint8 proposalType; |
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.
beauty <3
is there any difference between placing this first or last?
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.
Good question; since there is no other uint8
data in the struct, I guess that the members' order won't significantly impact packing efficiency. We should put it in the best logical order for the best readability. What do you think will be a more readable placing proposalType
before or after the proposer
?
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.
tbh I have no idea. Is there a standard for this? it could be a question for the web3-devs channel
*/ | ||
function getVotesWithParams( | ||
address account, | ||
uint8 proposalType, |
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.
is proposalType necessary to get the votes?
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. This one, in its implementation, should query the token to get the votes by proposalType
, which data will be in the Votes
contract in the
mapping(address delegatee => mapping(uint8 proposalType => Checkpoints.Trace208)) private _delegateCheckpoints;
member
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.
looks solid. Added a few minor comments.
Signed-off-by: 0xRaccoon <[email protected]>
Signed-off-by: 0xRaccoon <[email protected]>
Signed-off-by: 0xRaccoon <[email protected]>
Tech spec