Skip to content
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

(WIP -- jasonrhaas) Standard bounties integration #140

Closed

Conversation

jasonrhaas
Copy link
Contributor

@jasonrhaas jasonrhaas commented Dec 18, 2017

Description

This is a continuation of PR #48. This PR will be updated with new information going forward.

Create new bounty

Create new bounty from Gitcoin, and then issue + activate it on the bounties network. If successful, this should show up in the BountiesFactory explorer.

  • Update network settings for new Standard Bounties contract
  • Send new bounty from Gitcoin to Bounties Network on Rinkeby Network
  • Add new description field to Gitcoin /funding/new and send to Bounties Network
  • Sync bounty details to backend database
  • Verify on Gitcoin Dashboard that bounty made it to Bounties Network
  • FIx bounty details page. Currently nothing gets add to the database, and nothing shows up in the explorer. it appears the python view.py code isn't used at all in the HTML.
  • Fix callbacks after bounty has been submitted (currently Gitcoin website hangs)

Fulfill bounty

Standard Bounties has the ability for multiple people to submit work for a bounty. This functionality could be implemented in the Gitcoin interface or we can just use the bounties network.

  • Change naming of buttons and pages from "claim" to "fulfill"
  • Send fulfill request to standard bounties contract
  • Update backend database
  • Allow multiple people to fulfill bounty?
  • Github integration?

Accept fulfillment

Acceptance can be from the creator. Adding an arbiter and transferring the bounty will be added in the future.

  • Send accept request to standard bounties contract
  • Update backend database
  • Only allow acceptance of latest fulfillment for now (Gitcoin only allows on at the moment)

Kill Bounty

Bounties can be killed and funds can be clawed back in any stated except accepted.

  • Change clawback_expired_bounty to kill_bounty
  • Update backend database
  • Make Kill Bounty button available at any state except accepted
  • Add new state called dead, which is a bounty after it has been killed
  • Allow the issuer to re-activate the contract after it has been killed

Bonus Round

It would be nice if we could code into the bounty the ability to pay out the bounty automatically once the Github Pull Request is merged in.

Testing

These are the instructions to test out the integration of Gitcoin and Standard Bounties on the rinkeby network. It uses the Gitcoin Web App and the Bounties Factory App.

  • git clone [email protected]:jasonrhaas/web.git
  • git clone [email protected]:ConsenSys/BountiesFactory.git
  • cd BountiesFactory
  • npm install
  • npm start. This should load up the Bounties Factory page. In metamask, make sure you switch to the rinkeby network.
  • In a new window, cd web
  • git checkout standard_bounties_integration
  • docker-compose pull && docker-compose up -d --build. This will run the web app and the database inside docker containers.

Funding a New Issue on GitCoin

  • Open up a new browser window and navigate to localhost:8000/funding/new

  • Copy/Paste a github issue for funding, such as funded issue links are long and clunky #201

  • Click the Advanced drop down menu and make sure that the Title and Description are populated.

  • Click the Fund Issue button. A metamask popup should come up verifying that you want to make the transaction. Click Submit.

  • You will be directed to the Details page and you will see a blue banner until the transaction is confirmed on web3.

  • After you see the Github details on that page, go to localhost:3000 (Bounties Network) and verify that the bounty has been posted.

Fulfilling an issue on GitCoin

  • Navigate to localhost:8000/explorer and find the issue that you just posted.

  • Notice that you are not able to "Fulfill" the issue since you are the one who posted it. Verify that is says Mine by the issue.

  • Switch to a different Rinkey Account in MetaMask.

  • Refresh the explorer page and click on the bounty we have been using.

  • Click the "Fulfill" button, and enter any appropriate fields such as github username

  • Click the "Fulfill Bounty" button and do the metamask thing. You should be directed back to the details page.

  • Navigate again to localhost:3000 and refresh the page.

  • Click on your bounty, scroll down, and verify that you have submitted a Fulfillment from your other account.

Accepting Fulfillment via GitCoin

  • Go back to Gitcoin and find the bounty that you original submitted
  • Switch back to your original Rinkeby account and refresh the page.
  • You should now see the option to accept fulfillment of the issue.
  • Click the Accept Fulfillment button and do the MetaMask thing.
  • Confirm that the state has changed to accepted, and you should see the correct information in the details page.
  • Check the bounties factory page at http://localhost:3000 to see that it has also been updated.

Killing a Bounty via GitCoin

Any bounty is "killable" in any state except for the accepted state.

  • Pick a bounty in the issue explored and click the "Kill Bounty" button.
  • It will bring you to the "Kill Bounty and Clawback Funds" page.
  • Click the "Kill Bounty" button and verify that the state has changed to dead and the funds have been returned to the issuer (you).

🍰 👯

@@ -22,6 +33,10 @@ services:
- db
stdin_open: true
tty: true
testrpc:
image: trufflesuite/ganache-cli
Copy link
Contributor

Choose a reason for hiding this comment

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

🙏

@codecov
Copy link

codecov bot commented Dec 18, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@b931d86). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #140   +/-   ##
=========================================
  Coverage          ?   12.09%           
=========================================
  Files             ?       66           
  Lines             ?     3149           
  Branches          ?      346           
=========================================
  Hits              ?      381           
  Misses            ?     2768           
  Partials          ?        0
Impacted Files Coverage Δ
app/app/urls.py 0% <ø> (ø)
app/dashboard/models.py 38.11% <ø> (ø)
app/dashboard/helpers.py 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b931d86...5750e93. Read the comment docs.

@jasonrhaas
Copy link
Contributor Author

jasonrhaas commented Jan 14, 2018

Happy to report that all comments and features and been implemented or accounted for. Ready for testing again! 👍 It's deployed on https://stage.gitcoin.co

@owocki
Copy link
Contributor

owocki commented Jan 15, 2018

TODO: code the metamask module to work within stdbounties http://bits.owocki.com/0Q1s0m2r042K/Image%202018-01-15%20at%2010.29.19%20AM.png

@owocki
Copy link
Contributor

owocki commented Jan 15, 2018

whats is the most viable migration plan for the current gitcoin bounties over to stdbounties?

i think we

  1. close down all the current bounties manually via the UI.
  2. deploy standard bounties.
  3. reopen them on standard bounties on the new UI.

@mbeacom @jasonrhaas any thoughts on the above?

@owocki
Copy link
Contributor

owocki commented Jan 15, 2018

how do we want to handle multiple bounties per github issue URL?

right now, via the current stdbounties UI... someone can submit mulitiple bounties on the same GH URL. this is confusing because while standardbounties supports it.. the gitcoin UI does not..

maybe we add a validation step if someone tries to enter a currently active bounty into funding/new, we tell them they can't (or solicit them adding funds to the bounty instead?)..

@owocki
Copy link
Contributor

owocki commented Jan 15, 2018

on https://stage.gitcoin.co/funding/fulfill

if i try to fulfill a bounty that does not exist (ex: https://github.com/gitcoinco/web/pull/140/files ) ... it just spins forever.. we should handle this and present the user with an error

@owocki
Copy link
Contributor

owocki commented Jan 15, 2018

i get a 'gas limit set dangerously high' message when i try to fulfill a bounty..

http://bits.owocki.com/3A2t0R3j3m3D/Screen%20Shot%202018-01-15%20at%2010.52.57%20AM.png

i think we need to apply an .estimateGas() to the submission code on line 119 in fulfill_bounty.js

and probably for all other web3 interactions too..

@owocki
Copy link
Contributor

owocki commented Jan 15, 2018

@mbeacom @jasonrhaas

mark, we will need to figure out how to massage the 'express interest' functionality into this PR.. is it better if we create one integration branch and merge them all together? im thinking itd be nice if we can all be committing to the same branch and very quickly turning around any and all issues

@owocki
Copy link
Contributor

owocki commented Jan 15, 2018

i think we need to apply an .estimateGas() to the submission code on line 119 in fulfill_bounty.js

also, this tx 'throw()'ed and the frontend thought that it succeeded and updated the bounty anyway.

https://rinkeby.etherscan.io/tx/0x1a546bd7296113658b91d5b3badeb98cb11487fe9891eab3726a4c873117bb12

parent: 'right_actions',
color: enabled ? 'darkBlue' : 'darkGrey',
extraClass: enabled ? '' : 'disabled',
title: enabled ? 'Claim an issue when you sincerely intend to work on it.\n\n It is not necessary to have started work when you claim an issue, but please (1) comment on the github thread after you claim it, (2) claim an issue only if you plan to start work within the next 12 hours & (3) only claim it if you feel like you understand the scope and can see it to completion. ' : 'Can only be performed if you are not the funder.',
title: enabled ? '' : 'Can only be performed if you are the funder.',
Copy link
Contributor

Choose a reason for hiding this comment

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

for the title if enabled:

This will kill the bounty and return the funds.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok i guess ill just do this

// bounty is a web3.js eth.contract address
// The Ethereum network requires using ether to do stuff on it
// issueAndActivateBounty is a method definied in the StandardBounties solidity contract.
var bountyIndex = bounty.issueAndActivateBounty(
Copy link
Contributor

Choose a reason for hiding this comment

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

i think that the issueAndActivateBounty should be wrapped in an .estimateGas() method... so that way we know what gas / gaslimit to pass into metamask... no?

estimategas returns errors, gas, where gas will be an integer we can use to do this.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is actually really important for making new issue submissions as cheap as possible gas-wise.

if(localStorage['issueURL']){
$('input[name=issueURL]').val(localStorage['issueURL']);
}
// if(localStorage['issueURL']){
Copy link
Contributor

Choose a reason for hiding this comment

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

id love to get this uncommented out and then reissue the fetchTitle() and related calls IFF (localStorage['issueURL'] is not falsy

@owocki
Copy link
Contributor

owocki commented Jan 16, 2018

closing this as it's been moved over to standard_bounties_integration

@abitrolly
Copy link
Contributor

https://github.com/gitcoinco/web/tree/standard_bounties_integration

Is there any PR for tracking what's left?

@owocki
Copy link
Contributor

owocki commented Jan 25, 2018

@abitrolly we are tracking the remainder of the project here => https://github.com/gitcoinco/web/projects/1

@abitrolly
Copy link
Contributor

👍 Is there any way to subscribe for updates?

@mbeacom
Copy link
Contributor

mbeacom commented Jan 25, 2018

@abitrolly You can track changes at: #240

owocki pushed a commit that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants