-
Notifications
You must be signed in to change notification settings - Fork 53
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
Voting Connector: Support vote rewards #338
base: master
Are you sure you want to change the base?
Conversation
ef0b2f1
to
095d1ac
Compare
4a53c87
to
0f56ea6
Compare
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.
Great work and well done with the unit testing. Reading them made me realize that the final structure you choose for the data was the right one. I left a couple of comments and an open question about your thoughts for the getRewards
function.
@0xGabi I spent a nice chunk of time not knowing this 🥇 |
|
||
const VOTING_SUBGRAPH_URL = | ||
'https://api.thegraph.com/subgraphs/name/aragon/aragon-voting-rinkeby-staging' | ||
'https://api.thegraph.com/subgraphs/name/aragon/aragon-voting-rinkeby' |
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.
the tests did not ran successfully, even after swapping the VOTING_SUBGRAPH_URL as stated in the PR description.
- can you provide more context or instruction how you run test locally?
- Is there a way to run the test successfully without swapping the URL?
This PR builds on top of #336 and addreses the DeepDao's Gitcoin bounty related to supporting vote rewards.
It adds a new functionality to the
Vote
model that allows you to get all the actions inside the votescript
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:
-- 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.
-- 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:
transfer(address _token, address _to, uint256 _value)
.newImmediatePayment(address _token, address _receiver, uint256 _amount, string _reference)
.If you want to quickly test the connector with these changes you can use a private subgraph that I deployed just for testing: https://thegraph.com/hosted-service/subgraph/pjcolombo/connect-voting-status
You only need to change the
VOTING_SUBGRAPH_URL
variable value here.