Skip to content

Conversation

@kronosapiens
Copy link
Contributor

@kronosapiens kronosapiens commented Feb 2, 2021

Closes #921

Supports #915, allowing extensions (here, VotingToken) to lock & unlock user's tokens.

@kronosapiens kronosapiens changed the title Allow network-managed extensions to lock & unlock tokens Extension token locking Feb 2, 2021
@kronosapiens kronosapiens force-pushed the feat/extension-locking branch from 9b3c01f to 288ab75 Compare February 2, 2021 02:13
@kronosapiens kronosapiens self-assigned this Feb 2, 2021
@kronosapiens kronosapiens force-pushed the feat/extension-locking branch from 288ab75 to 528f5f8 Compare February 2, 2021 16:59
@kronosapiens kronosapiens force-pushed the feat/extension-locking branch from 93bd554 to d515877 Compare February 5, 2021 19:05
Copy link
Member

@area area left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, while I think this implementation is now fine, I don't think it can be merged in the current state. The problem is that with the existence of the VotingReputation contract (which can call arbitrary functions on a colony with a root motion), anyone can unlock anyone else's tokens arbitrarily if this function is introduced.

@kronosapiens
Copy link
Contributor Author

kronosapiens commented Feb 8, 2021

Ah! You're so right. I think the fix here is to add a mapping of [extension][lockId] => bool so you can only unlock the locks you've created.

@area
Copy link
Member

area commented Feb 9, 2021

Also unfortunately, such a mapping cannot be trusted because of recovery mode.

@kronosapiens
Copy link
Contributor Author

@area I don't think that's a major concern. A lot of things "cannot be trusted" because of recovery mode, but by definition it's a highly trusted mode so I'm not worried. If anything we could call it a feature -- a bug was found in an extension, we need to remove the lock so we "give" the lock to another voting contract, etc. Using recovery mode as part of an attack on a token lock seems like much more trouble than it's worth.

@kronosapiens kronosapiens force-pushed the feat/extension-locking branch from fd93293 to e66862c Compare February 9, 2021 19:01
@kronosapiens kronosapiens force-pushed the feat/extension-locking branch from e66862c to 671ece6 Compare February 9, 2021 20:23
@area area force-pushed the feat/extension-locking branch from b508063 to 43d9974 Compare February 10, 2021 14:13
@area area force-pushed the feat/extension-locking branch from 77abc02 to 3943592 Compare February 11, 2021 07:34
@area area merged commit d2723d7 into develop Feb 11, 2021
@area area deleted the feat/extension-locking branch February 11, 2021 10:50
@area
Copy link
Member

area commented Feb 11, 2021

You've not commented on my changes to the tokenlocking event or the requireExecuteCall changes so I assume you're good with them 😛

@kronosapiens
Copy link
Contributor Author

Definitely :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow network-managed extensions to lock tokens

3 participants