Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed May 14, 2020
1 parent 35eead3 commit 982b952
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
16 changes: 3 additions & 13 deletions app/assets/v2/js/grants/fund.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ $(document).ready(function() {
set_form_disabled(false);
return;
}
$('#gas_price').val(1);
$('#sub_new_approve_tx_id').val(txid);

var data = {};
Expand Down Expand Up @@ -368,14 +367,6 @@ $(document).ready(function() {
realApproval = Number(((grant_amount * data.num_periods)) * Math.pow(10, decimals) + approve_buffer);
}

let realGasPrice = Number(gitcoin_grant_amount * Math.pow(10, decimals)); // optional grants fee

if (contractVersion == 0) {
realGasPrice = 1;
}

$('#gas_price').val(realGasPrice);

let approvalSTR = realApproval.toLocaleString('fullwide', { useGrouping: false });

web3.eth.getAccounts(function(err, accounts) {
Expand Down Expand Up @@ -506,7 +497,8 @@ const subscribeToGrant = (transactionHash) => {
'network': $('#network').val(),
'match_direction': $('input[name=match_direction]:checked').val(),
'is_postive_vote': ($('input[name=match_direction]:checked').val() == '-') ? 0 : 1,
'csrfmiddlewaretoken': $("#js-fundGrant input[name='csrfmiddlewaretoken']").val()
'csrfmiddlewaretoken': $("#js-fundGrant input[name='csrfmiddlewaretoken']").val(),
'gas_price': 1
};

$.ajax({
Expand Down Expand Up @@ -535,7 +527,7 @@ const subscribeToGrant = (transactionHash) => {
web3.utils.toChecksumAddress(selected_token), // token denomination / address
web3.utils.toTwosComplement(Number(grant_amount * Math.pow(10, decimals)).toLocaleString('fullwide', {useGrouping: false})),
web3.utils.toTwosComplement(realPeriodSeconds),
web3.utils.toTwosComplement(data.gas_price),
web3.utils.toTwosComplement(1),
web3.utils.toTwosComplement(nonce)
];

Expand Down Expand Up @@ -641,8 +633,6 @@ const splitPayment = (account, toFirst, toSecond, valueFirst, valueSecond) => {

let deployedSplitter = new web3.eth.Contract(compiledSplitter.abiDefinition, splitterAddress);

let token_address = $('#js-token').length ? $('#js-token').val() : $('#sub_token_address').val();

indicateMetamaskPopup();
deployedSplitter.methods.splitTransfer(toFirst, toSecond, valueFirst, valueSecond, tokenAddress).send({
from: account,
Expand Down
1 change: 0 additions & 1 deletion app/grants/templates/grants/fund.html
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ <h2 class="font-title-lg my-4">{% if direction == '-' %} Negative {%endif%} {%
<input type="hidden" id="grant_id" name="grant_id" value="{{ grant.id }}">
<input type="hidden" id="admin_address" name="admin_address" value="{{ grant.admin_address }}">
<input type="hidden" id="token_address" name="token_address" value="{{ grant.token_address }}">
<input type="hidden" id="gas_price" name="gas_price" value="">
<input type="hidden" id="contract_address" name="contract_address" value="{{ grant.contract_address }}">
<input type="hidden" id="contract_version" name="contract_version" value="{{ grant.contract_version }}">
<input type="hidden" id="splitter_contract_address" name="splitter_contract_address" value="{{ splitter_contract_address }}">
Expand Down

0 comments on commit 982b952

Please sign in to comment.