-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix tokenvoting ivotes checks #600
Conversation
Giorgi Lagidze seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
token, | ||
_dao, | ||
PermissionLib.NO_CONDITION, | ||
GovernanceERC20(token).MINT_PERMISSION_ID() |
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.
Removing the mint permission would technically be a breaking change. It can still be granted later, though
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.
Why would it be breaking ? we only remove mint permission inside uninstallation of plugin.
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 see. The point being that it would be "breaking" in the sense of version 1 having one behaviour and version 2 having a different behaviour.
Not just adding a feature or fixing a bug, but instead changing the specs of what happens
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.
This change is not breaking in any sense at all. Nowhere in the UI, we say that we use the specific spec - This would be breaking in some sense if something was working before and now, it's not working the same way which is not the case here.
Description
Why this PR ?
This PR addresses the following problem: some users, even though they were using OZ's
ERC20Votes
, they didn't have ERC165(supportsInterface
function) implemented in their contracts. This caused the problem where our TokenVotingSetup always would wrap such a token and the token applied on TokenVoting would be a wrapped one even though there was no need for that. Note that even though token would be wrapped, that wouldn't be a critical issue or cause any bricking because people would just callapprove + depositFor
and still maintain the same features. The problem I'm referring is that they would need to have extra layer of calling approve/depositFor which is not ideal and not only that, they were confused why the wrapping was necessary.Does the solution solve it ?
There're 2 ways to solve this problem.
supportsInterface
check and exactly do the checks I have in this PR.How the checks work:
Why making this PR to
main
branch ?If we want to have this fix before 1.4.0 is audited, then we can't use
TokenVotingPlugin
repo(post-split) since this repo uses 1.4.0. So we have no choice but to usemain
branch onosx
. It would be great though NOT to merge this PR, because if we do,main
branch will contain this new fix code whereas in audit report(by hellborn) didn't sign on this. It's a question of whether we want to have the non-audited code on main branch. I'd say no and go for the option that we leave this code on this PR, audit internally and anyways release it.Can Old tokens that were wrapped incorrectly be fixed ?
The only fix is to add
update
code inside TokenVotingSetup that callsinitializeV2
on the tokenVoting and passes new/fixed token. This has so many problems as if the proposal is already created on TokenVoting with old token, it must continue using old one and new proposals must use new tokens, but still, tokens that were wrapped incorrectly already use the funds on it and if we deploy new tokens, those funds won't be on this token. Long story short, this needs much,much deeper thoughts.One more change in
prepareUninstallation
We think that there's no need to revoke
MINT_PERMISSION
on the token contract for dao. Why ? Even though plugin(tokenvoting) was uninstalled, token still should continue to be operated by dao as it kind of belongs to dao. Think about it - if we still revoke this permission, nobody will have MINT_PERMISSION on the token and token becomes useless(only in minting case) even though it has funds ? We still think dao still should continue operating it. - Please think about this as we're not sold on either ideas.Last thoughts
I haven't implemented the tests as I would first like to get a grasp of what you all thinking.