Open s6thgehr opened 2 years ago
That seems reasonable, what is the scope of the change? We should stick to using ERC20Votes base contract as much as possible. At a glance, I see that ERC20Votes has delegates(address account)
public function that returns delegatee for given address so implementation should not be a problem.
What if we delegate our votes to two different parties? How would the code choose who to delegate the new votes to? LastDelegate? I see that the delegate Fx does indeed delegate all of your votes to one specified address, but if you get more votes, and then delegate them all to a second address, this could get complicated.
Ideas (I'm mostly a fan of 3, because it gets complicated fast):
Write an override for the delegate function that emits an event on every new delegation for convenient alerting, and let the delegatee decide what to do with their new votes.
Create lastDelegate address in ballots to store whoever you delegated to most recently, who will then receive all future votes if your contract receives new votes. On delegation, automatically forward a delegatee's new votes to lastDelegate address if set. Otherwise do nothing. This could get complicated if there are loops set up in members' lastDelegated addresses.
Do nothing, letting the user check their votes manually via script, Etherscan, Infura, etc.
What if we delegate our votes to two different parties? How would the code choose who to delegate the new votes to? LastDelegate? I see that the delegate Fx does indeed delegate all of your votes to one specified address, but if you get more votes, and then delegate them all to a second address, this could get complicated.
I think the idea is if user delegates his voting power, then all other voting power delegated to that user would be delegated further to his delegatee. So the original user can not delegate his second batch of voting power to anyone else, delegatee has that voting power by default. Of course, user can always delegate back to himself to restore his voting power.
I'm submitting a feature request
What is the current behavior? If I delegate all my votes to address1 and address2 delegates some votes to me, those votes are not forwarded to address1.
What is the expected behavior? If I delegate all my votes to address1 and address2 delegates votes to me, those votes should be forwarded to address1.
What is the motivation / use case for changing the behavior? If I delegate all my votes to someone, I think I've done my voting duty. But with the current behavior I have to check until the end of the voting period if someone delegated votes to me to eventually vote myself so that the votes are not lost.