From 91db2f76b9857e828c3e54661d31eba168ee0aaf Mon Sep 17 00:00:00 2001 From: octavioamu Date: Fri, 15 Nov 2019 17:27:14 -0300 Subject: [PATCH 1/4] bounties creation/payout --- app/assets/v2/js/pages/kudos_send.js | 5 ++++- app/assets/v2/js/pages/process_bounty.js | 2 +- app/retail/templates/shared/footer_scripts_lite.html | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/assets/v2/js/pages/kudos_send.js b/app/assets/v2/js/pages/kudos_send.js index a48d3dc9bdb..a0e0520f4e4 100644 --- a/app/assets/v2/js/pages/kudos_send.js +++ b/app/assets/v2/js/pages/kudos_send.js @@ -604,6 +604,7 @@ function sendKudos(email, github_url, from_name, username, amountInEth, comments var total_send = ((gas_money + kudosGasEstimateInWei + kudosPriceInWei.toNumber()) * new web3.BigNumber(num_redemptions)).toString(); web3.eth.sendTransaction({ + from: account, to: destinationAccount, // Add gas_money + gas cost for kudos contract transaction + cost of kudos token (Gitcoin keeps this amount?) value: total_send, @@ -644,7 +645,9 @@ function sendKudos(email, github_url, from_name, username, amountInEth, comments // web3.currentProvider.publicConfigStore.on('update', function(e) { var error; -window.ethereum.publicConfigStore.on('update', checkNetwork); +if (window.ethereum.publicConfigStore) { + window.ethereum.publicConfigStore.on('update', checkNetwork); +} function checkNetwork(e) { if (error) { return; diff --git a/app/assets/v2/js/pages/process_bounty.js b/app/assets/v2/js/pages/process_bounty.js index 7c9a11e0fe7..62854debd41 100644 --- a/app/assets/v2/js/pages/process_bounty.js +++ b/app/assets/v2/js/pages/process_bounty.js @@ -257,7 +257,7 @@ window.onload = function() { }; // just sent payout var send_payout = function() { - bounty.acceptFulfillment(bountyId, fulfillmentId, {gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9))}, final_callback); + bounty.acceptFulfillment(bountyId, fulfillmentId, {gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9)), from: web3.eth.accounts[0]}, final_callback); }; // send both tip and payout diff --git a/app/retail/templates/shared/footer_scripts_lite.html b/app/retail/templates/shared/footer_scripts_lite.html index 55d442cbc75..5af14b475ac 100644 --- a/app/retail/templates/shared/footer_scripts_lite.html +++ b/app/retail/templates/shared/footer_scripts_lite.html @@ -50,6 +50,9 @@ +{% if not ignore_inject_web3 %} + {% include 'shared/shared_scripts.html' %} +{% endif %} {% endif %} -{% include 'shared/messages.html' %} \ No newline at end of file +{% include 'shared/messages.html' %} From d2fe30bef5775c0a824924d6169fd6a09b78c15b Mon Sep 17 00:00:00 2001 From: octavioamu Date: Fri, 15 Nov 2019 17:42:19 -0300 Subject: [PATCH 2/4] bulk payout --- app/assets/v2/js/pages/bulk_payout.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/v2/js/pages/bulk_payout.js b/app/assets/v2/js/pages/bulk_payout.js index ac46db5ad92..6ce692591be 100644 --- a/app/assets/v2/js/pages/bulk_payout.js +++ b/app/assets/v2/js/pages/bulk_payout.js @@ -108,6 +108,7 @@ $(document).ready(function($) { bounty.killBounty( $('#standard_bounties_id').val(), gas_dict, + {from: web3.eth.accounts[0]}, callback ); @@ -448,4 +449,4 @@ $(document).on('click', '.user-fulfiller', function(event) { $('input[type=radio][name=pay_with]').on('change', event => { update_registry(); -}); \ No newline at end of file +}); From 8b68fc8bd36569d64eb4bacece6e7b6f2371b67b Mon Sep 17 00:00:00 2001 From: octavioamu Date: Fri, 15 Nov 2019 18:23:22 -0300 Subject: [PATCH 3/4] work submission --- app/assets/v2/js/pages/fulfill_bounty.js | 5 ++++- app/dashboard/templates/bounty/fulfill.html | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/assets/v2/js/pages/fulfill_bounty.js b/app/assets/v2/js/pages/fulfill_bounty.js index 64fda1102d0..1b874666de4 100644 --- a/app/assets/v2/js/pages/fulfill_bounty.js +++ b/app/assets/v2/js/pages/fulfill_bounty.js @@ -119,7 +119,9 @@ window.onload = function() { txid: result }); - localStorage['pendingProject'] = true; + if (document.eventTag){ + localStorage['pendingProject'] = true; + } var finishedComment = function() { dataLayer.push({ event: 'claimissue' }); @@ -162,6 +164,7 @@ window.onload = function() { bountyId, document.ipfsDataHash, { + from: web3.eth.accounts[0], gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9)) }, web3Callback diff --git a/app/dashboard/templates/bounty/fulfill.html b/app/dashboard/templates/bounty/fulfill.html index 0990d9cebc0..1589829c662 100644 --- a/app/dashboard/templates/bounty/fulfill.html +++ b/app/dashboard/templates/bounty/fulfill.html @@ -99,11 +99,15 @@

{% trans "Submit Work" %}

{% include 'shared/analytics.html' %} {% include 'shared/footer_scripts.html' %} {% include 'shared/footer.html' %} - + From 0e4bfa52223ccdeb14bb3951a78211ff1fa77aef Mon Sep 17 00:00:00 2001 From: octavioamu Date: Fri, 15 Nov 2019 18:55:48 -0300 Subject: [PATCH 4/4] lint --- app/assets/v2/js/pages/fulfill_bounty.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/v2/js/pages/fulfill_bounty.js b/app/assets/v2/js/pages/fulfill_bounty.js index 1b874666de4..ef767c6bcb8 100644 --- a/app/assets/v2/js/pages/fulfill_bounty.js +++ b/app/assets/v2/js/pages/fulfill_bounty.js @@ -119,7 +119,7 @@ window.onload = function() { txid: result }); - if (document.eventTag){ + if (document.eventTag) { localStorage['pendingProject'] = true; }