Skip to content

Permission moveFundsBetweenPots properly for voting#956

Merged
kronosapiens merged 9 commits intodevelopfrom
maint/voting-move-funds
May 20, 2021
Merged

Permission moveFundsBetweenPots properly for voting#956
kronosapiens merged 9 commits intodevelopfrom
maint/voting-move-funds

Conversation

@area
Copy link
Copy Markdown
Member

@area area commented May 11, 2021

This is my take at fixing up moveFundsBetweenPots so that what movement of funds are allowed is consistent regardless of whether the function is being executed directly or a motion has been made.

I tried a couple of other ways, but there just simply isn't enough information provided in the combination of the existing action and the existing motion creation function. You have to prove:

The domain I have the permission in is a parent of the 'fromPot' domain
The domain I have the permission in is a parent of the 'toPot' domain
The domain the vote is taking place in is a parent of the 'fromPot' domain
The domain the vote is taking place in is a parent of the 'toPot' domain

But we only have three proofs, between createMotion and the action if we create special functions to extract the second proof from the action. The action would provide the first two, but there's no way to prove both of the second with a single proof.

Stepping back, I realised that we're in this predicament is because there is an ambiguity in the general case for moveFundsBetweenPots as to which domain we're acting in. Consider the domain hierarchy:

      A 
      |
      B
    /   \
   C     D

Let's say I have the permission explicitly in A, and I want to move funds from C to D. What domain am I acting in? We could say it's A by convention, but that would mean it would be impossible to have a vote in B about this, which clearly should be allowed. There's no way to specify which domain we're acting in. So the solution I've implemented here adds a new moveFundsBetweenPots that removes this ambiguity. It still includes multiple domain proofs, but those now prove that the domain we're acting in is a parent of C and a parent of D and so don't need to be considered for the creation of the motion, nor do they need to meet the unofficial standard we've adopted (which the proof for 'which domain we're acting in' does, and therefore plays nicely with the motions and disputes).

Comment thread contracts/colony/ColonyFunding.sol
Comment thread contracts/extensions/VotingReputation.sol Outdated
Comment thread contracts/colony/ColonyFunding.sol Outdated
@area area force-pushed the maint/voting-move-funds branch from 52812f4 to 06ad490 Compare May 14, 2021 10:49
@area area marked this pull request as ready for review May 14, 2021 10:55
Comment thread contracts/extensions/VotingReputation.sol Outdated
Comment thread contracts/extensions/VotingReputation.sol
Comment thread test/contracts-network/colony-funding.js
Comment thread contracts/colony/ColonyFunding.sol Outdated
Comment thread contracts/extensions/VotingReputation.sol Outdated
@kronosapiens kronosapiens force-pushed the maint/voting-move-funds branch from 8d9163c to 264571b Compare May 19, 2021 18:39
@kronosapiens kronosapiens force-pushed the maint/voting-move-funds branch from 264571b to 26b9c58 Compare May 19, 2021 22:29
@kronosapiens kronosapiens merged commit b28c897 into develop May 20, 2021
@kronosapiens kronosapiens deleted the maint/voting-move-funds branch May 20, 2021 03:51
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.

2 participants