From ea36a42020279f41883be8d13b974ff9151bb3ac Mon Sep 17 00:00:00 2001 From: Dan Lipert Date: Tue, 11 Jun 2019 20:36:50 +0900 Subject: [PATCH] fix approve calculation and new grants, add quill --- app/assets/v2/js/grants/fund.js | 5 +++-- app/grants/templates/grants/newv0.html | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/v2/js/grants/fund.js b/app/assets/v2/js/grants/fund.js index ed4b46b7f29..c7ba85b6996 100644 --- a/app/assets/v2/js/grants/fund.js +++ b/app/assets/v2/js/grants/fund.js @@ -169,7 +169,8 @@ $(document).ready(function() { } else if (data.contract_version == 0) { console.log('grant amount: ' + grant_amount); console.log('gitcoin grant amount: ' + gitcoin_grant_amount); - realApproval = Number(((grant_amount * data.num_periods) + gitcoin_grant_amount) * Math.pow(10, decimals) + 1 ); + // don't need to approve for gitcoin_grant_amount since we will directly transfer it + realApproval = Number(((grant_amount * data.num_periods)) * Math.pow(10, decimals) + 1 ); } //} @@ -210,7 +211,7 @@ $(document).ready(function() { // call splitter after approval splitPayment(accounts[0], data.admin_address, gitcoinDonationAddress, Number(grant_amount * Math.pow(10, decimals)).toLocaleString('fullwide', {useGrouping: false}), Number(gitcoin_grant_amount * Math.pow(10, decimals)).toLocaleString('fullwide', {useGrouping: false})); } else { - if (gitcoin_grant_amount > 0) { + if (data.contract_version == 0 && gitcoin_grant_amount > 0) { donationPayment(deployedToken, accounts[0], Number(gitcoin_grant_amount * Math.pow(10, decimals)).toLocaleString('fullwide', {useGrouping: false})); } subscribeToGrant(transactionHash); diff --git a/app/grants/templates/grants/newv0.html b/app/grants/templates/grants/newv0.html index fdfb233516e..678caeb6738 100644 --- a/app/grants/templates/grants/newv0.html +++ b/app/grants/templates/grants/newv0.html @@ -22,6 +22,9 @@ {% include 'shared/cards.html' %} + + + {% include 'shared/tag_manager_2.html' %}