-
Notifications
You must be signed in to change notification settings - Fork 114
Description
Summary
Expenditures offers a more advanced payment system. It provides functionality to make payments to multiple recipients, in multiple different tokens, of varying amounts, and with differing claim delays all in one action. E.g. five recipients, each receiving CLNY + xDai in differing amounts with varying claim delays.
This feature will require the development of a new extension to interact with the existing base expenditures contract and enable the required additional functionality. This is defined in the breakdown below.
Design for reference: Figma Link
Overview
- Multiple states of expenditure
- Staking to create an Expenditure
- Single motion when funding multiple tokens
- Allow partial funding when underfunded
- Single motion when updating multiple values
- Releasing funds
-
Can change the 'Owner' - Account for over-funding
- Expenditure metadata updates
- Handle differing claim delays
- Deleting and Canceling an expenditure
Breakdown
Multiple states of expenditure
There is a need to have multiple states/statuses of an expenditure. These include:
- Draft: The expenditure is staked, however, any details on the expenditure can be changed by the owner without requiring Administration permissions or a motion.
- Locked: The values of the expenditure are locked. Any updates to the details will require Arbitration permission or a motion.
- Funded: The expenditure is fully funded and can be released by the owner at any time.
- Released: The funds for expenditure can be released and starts the claim delay.
- Claimed: All recipients have claimed their payments and there are no funds remaining in the expenditure funding pot.
- Cancelled: The expenditure has been cancelled.
Staking to create an Expenditure (without a Motion)
In order to minimise the number of required motions to create an expenditure, it is required that a staking mechanism be put in place. While this could still be up for discussion, at this stage the calculation for determining the amount to be staked will be the same that is used to stake on a motion (for lack of a better solution at the moment).
Single motion when funding multiple tokens
Funding an expenditure will require a motion (if Motions & Disputes extension is enabled) and when multiple tokens are required to be funded as a part of an expenditure, it is required that only one motion is created.
Handle state and partial funding when underfunded
When changes are made to an already funded expenditure to increase the amount due, it is required to update the status of the expenditure back to unfunded. It will also require the ability to calculate how much is required to fund and allow funding for that amount.
Single motion when updating multiple values
To avoid the creation of multiple motions when making updates to a locked expenditure, it is necessary to allow for the updating of any number of values in a single motion.
Releasing funds
Only the 'Owner' of an expenditure, a Motion, or the Arbitration permission will be able to trigger the 'Release Funds' function of an expenditure, this will start the claim delay for each of the recipients to then be able to claim their payments.
## Can change the 'Owner' Not necessary with motions being able to release funds.
As the 'Owner' is the only one who can 'Release Funds', there needs to be the capability to change the 'Owner'. This should be allowable with the right permissions or via a motion. Given the owner stakes the expenditure originally, it will be necessary to keep track of the address that staked so that their stake can be returned.
Account for over-funding
We need to be able to account for over-funding in the expenditure funding pot, for example a change is made to reduce an expenditure after initial funding. Handling over-funding should happen during the claim period, where the first person to claim will also calculate the over-funding and return it to the original domain funding pot of the expenditure.
Expenditure metadata updates
Similar to how ColonyMetadata works, it will also be required to be able to change details stored on IPFS, such as title and description, on an expenditure with a motion.
Handle differing claim delays
It will be required to be able to handle varying claim delays for multiple recipients or even the same recipient as a separate payment. From my understanding, this is already possible in expenditures, however I am making note of it here.
Deleting and Canceling an expenditure
Delete: It should be possible to delete an expenditure that is still in Draft and not locked. This should return the stake with no penalty to the stake or their reputation.
Cancel: It should be possible to cancel an expenditure that is in a locked, funded or released state. This will require Arbitration permission or a motion to do. The person cancelling will be able to punish the original address that staked or decide not to punish them. The punishment calculation will be the owners full stake and the equivalent in reputation.



