Voting connector: Support vote statuses and rewards #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR builds on top of #31. It updates both the Voting connector and subgraph in order to expose the vote status
The vote status can be one of the following:
-Ongoing: The vote hasn't ended.
-Accepted: The vote ended and it's waiting to be executed (pending).
-Rejected: The vote ended and it didn't reach the minimum accepted quorum nor minimum support.
-Executed: The vote was enacted.
It also adds a new functionality to the
Vote
model that allows you to get all the actions inside the vote script which is a set of codified DAO's app contract calls that are executed once the vote is enacted.An action has the following fields:
to: The target contract address.
fnData: Data related to the function being called.
-- abi: the ABI function fragment.
-- roles: The ACL roles needed to execute the function.
-- sig: The function signature (e.g. transfer(address,address,uint256)).
-- params: The function parameter values.
-- notice: The function radspec description.
rewards: An array containing all the action rewards. A reward has the following fields:
-- amount: The reward's token amount.
-- receiver: The account that receives the reward.
-- token: The reward's token contract address.
If an action involves a token transfer from the DAO to an account then the rewards field is filled.
Right now, the following are considered to be token transfer actions:
Calls to the Vault/Agent's contract function transfer(address _token, address _to, uint256 _value).
Calls to the Finance's contract function newImmediatePayment(address _token, address _receiver, uint256 _amount, string _reference).
Pending tasks: