-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 EIP-5805: Voting with delegation #5805
Conversation
All tests passed; auto-merging...(pass) eip-5805.md
|
Co-authored-by: Pandapip1 <[email protected]>
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.
There's some formatting stuff that could be improved, but this is fine for a draft.
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.
Hi @Amxx , glad to see this EIP. I think it's a super important area to address.
Left some comments of the first round.
status: Draft | ||
type: Standards Track | ||
category: ERC | ||
created: 2022-07-04 |
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.
Shall this be update to 2022-10-19 to reflect its start time?
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.
I started writing the draft of this document in july ... but waited until post-devcon to create the PR. I'm not sure what "created" is supposed to represent. I'd don't really care. If you editor thing 2022-10-19 is a better date, then I'm ok with that
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.
Sure. I think the nature of this is more of use the date for time it first get drafted, I don't have a preference either. Leaving it for @Pandapip1 and @SamWilsn who have more authoritative answer
inputs: | ||
- name: account | ||
type: address | ||
- name: timepoint |
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.
The timepoint parameter should match the operating mode of the contract.
The wording is not entire clear to me. Does it require timepoint to be consistent with now()
?
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 needs to be consistent in the sens that:
- if
now()
returns a block.number (or ifnow()
does not exist), thentimepoint
should be a block number. - if
now()
returns a timestamp, thentimepoint
should be a timestamp.
### Solidity interface | ||
|
||
```sol | ||
interface IERC_XXXX { |
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.
[Optional] Do you want to consider adding EIP-165 identifer?
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.
I'm not sure, that is a good point.
I love EIP-165 but the truth is I don't see it used that often in the field.
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.
also, with "now()" being optional, I'm not sure what the identifier should be?
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.
but the truth is I don't see it used that often in the field.
Strongly agreed with you. I am working on a proposal providing a competing identifier of EIP-165 https://eips.ethereum.org/EIPS/eip-5269 to rethink how we could make identifier useful. Happy to chat and get valueable input from you, If you @Amxx, being the main author of openzeppelin, also think that EIP-165 has been restricted of adoption, that speaks a lot.
That said, if you are not sure, maybe consider putting that into the Rationale
section if you choose to or not to add EIP-165 because it's quite
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.
also, with "now()" being optional, I'm not sure what the identifier should be?
Good point. It also makes restriction usage of EIP-165. I think the common approach is to make EIP-165 out of all required field, and then any optional one will have an IERC5805Extension
kind of thing which has its own EIP-165 identifier.
|
||
When a "delegator" delegates its tokens voting power to a "delegatee", its balance is added to the voting power of the delegatee. If the delegator changes its delegation, the voting power is subtracted from the old delegatee's voting power and added to the new delegate's voting power. The voting power of each account is tracked through time so that it is possible to query its value in the past. With tokens being delegated to at most one delegate at a given point in time, double voting is prevented. | ||
|
||
Whenever tokens are transferred from one account to another, the associated voting power should be deducted from the sender's delegate and added to the receiver's delegate. |
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.
I wonder if you want to specify whether this is SHOULD
or "MUST" for handling the transfer behavior
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.
In this EIP, the notion of "voting power" is purposefully open to interpretation. The most obvious case is to use the balances, but I think it is important to not be to restrictive and allow for other approaches.
In particular, I want this EIP to support quadratic voting. This means that, when an account transfers tokens to another, the new voting power of delegate might actually not change because of quadratic effects.
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.
That's totally reasonable. If it's purposefully open to interpretation, I'd suggest
- change the "should" to "MAY"
- articulate it's purposefully open to interpretation / implementation choice in the
Rationale
section
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.
I'll stay with SHOULD .. because that what you should do unless you have a good reason not to, and not what you may do and you are not sure.
I'll add something in the Rationale section
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.
Sounds good
We might need to rename the Should we go for |
|
Is it the intention of the function I feel the I'd brainstorm something like |
Also, realizing snapshot doesn't work at blocknum level. I am proposing #5875 to retrieve TX Num. Wondering if for better security, we should support TX level of voting weight snapshot |
There has been no activity on this pull request for 2 weeks. It will be closed after 3 months of inactivity. If you would like to move this PR forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
There is still ongoing discution about this EIP (which IMO should happen on the ethereum magician thread, and not here) ... but I believe the proposal state is sufficient to merge as a draft. If there is anything preventing that from being merged (as a draft), please let me know what needs to be fixed. |
The only rule about the creation date is it can't be in the future. |
No description provided.