diff --git a/app/assets/onepager/js/send.js b/app/assets/onepager/js/send.js
index ac62a610d08..babaf9857d4 100644
--- a/app/assets/onepager/js/send.js
+++ b/app/assets/onepager/js/send.js
@@ -1,8 +1,5 @@
/* eslint-disable no-console */
var get_gas_price = function() {
- if ($('#gasPrice').length) {
- return $('#gasPrice').val() * Math.pow(10, 9);
- }
if (typeof defaultGasPrice != 'undefined') {
return defaultGasPrice;
}
diff --git a/app/assets/v2/css/base.css b/app/assets/v2/css/base.css
index d688048840d..d1b5e448d44 100644
--- a/app/assets/v2/css/base.css
+++ b/app/assets/v2/css/base.css
@@ -246,48 +246,6 @@ p a {
float:right;
}
-#gas-section .gas-image {
- height: 4.5rem;
-}
-
-#gas-section .font-body {
- margin: 0;
-}
-
-#gas-section .recommended-prices {
- cursor: pointer;
- text-align: center;
-}
-
-#gas-section .gas-dark-bg {
- background-color: #FAFAFA;
-}
-
-#gas-section .gas-rates .active {
- font-weight: 600;
- background-color: #0ECF7C;
-}
-
-#gas-section #metamask_context {
- display: none;
-}
-
-#gas-section #accordion-set-own-limit {
- cursor: pointer;
- border-bottom: 1px solid rgba(0,0,0,.1);
- border-top: 1px solid rgba(0,0,0,.1);
-}
-
-#gas-section #accordion-set-own-limit i {
- float: right;
-}
-
-#gas-section #default-recommended-gas,
-#gas-section .message {
- display: none;
- text-align: center;
-}
-
.btn-warning,
.btn-success,
.btn-info {
@@ -685,52 +643,6 @@ input[type=text].loading {
color: #000;
}
-.metamask_recc {
- width: 45%;
- display: inline-block;
-}
-
-#metamask_label img {
- position: relative;
- top: -2px;
-}
-
-#metamask_context .red_warning {
- background-color: #fbe0d6;
- color: #fb9470;
- padding: 5px 10px;
- border-radius: 2px;
- margin-bottom: 15px;
- display: block;
-}
-
-#metamask_context .red_warning a {
- color: #fb9470 !important;
- font-weight: bold;
- text-decoration: underline;
-}
-
-#metamask_context ul {
- font-size: 0.85rem;
- margin-top: 0.5rem;
- padding-left: 1rem;
-}
-
-#metamask_context li a {
- color: #0D0764;
-}
-
-#metamask_context .warning {
- text-align: center;
- background-color: #ff9800;
- border-radius: 5px;
-}
-
-#metamask_context .warning a {
- color: black;
- font-weight: bold;
-}
-
.bottom_notification a {
color: currentColor;
text-decoration: underline;
diff --git a/app/assets/v2/css/grants/fund.css b/app/assets/v2/css/grants/fund.css
index 87eaa6076c7..1ab59505af2 100644
--- a/app/assets/v2/css/grants/fund.css
+++ b/app/assets/v2/css/grants/fund.css
@@ -70,10 +70,6 @@
bottom: 2px;
}
-#accordion-set-own-limit {
- font-size: 12px;
-}
-
#gitcoin-grant-section .custom {
width: 4.25rem;
position: relative;
diff --git a/app/assets/v2/js/grants/cancel_subscription.js b/app/assets/v2/js/grants/cancel_subscription.js
index 234d5f34adc..bd47571b804 100644
--- a/app/assets/v2/js/grants/cancel_subscription.js
+++ b/app/assets/v2/js/grants/cancel_subscription.js
@@ -33,11 +33,9 @@ $(document).ready(() => {
let realTokenAmount = Number(data.amount_per_period * 10 ** decimals);
let amountSTR = realTokenAmount.toLocaleString('fullwide', { useGrouping: false });
- let realGasPrice = $('#gasPrice').val() * Math.pow(10, 9);
-
web3.eth.getAccounts(function(err, accounts) {
- deployedToken.methods.approve(data.contract_address, web3.utils.toTwosComplement(0)).send({from: accounts[0], gasPrice: realGasPrice})
+ deployedToken.methods.approve(data.contract_address, web3.utils.toTwosComplement(0)).send({from: accounts[0]})
.on('transactionHash', function(transactionHash) {
$('#sub_end_approve_tx_id').val(transactionHash);
const linkURL = get_etherscan_url(transactionHash);
@@ -56,7 +54,6 @@ $(document).ready(() => {
data.token_address, // testing token
web3.utils.toTwosComplement(amountSTR), // data.amount_per_period
web3.utils.toTwosComplement(data.real_period_seconds), // data.period_seconds
- web3.utils.toTwosComplement(realGasPrice), // data.gas_price
web3.utils.toTwosComplement(nonce), // nonce
data.signature // contributor_signature
];
@@ -66,7 +63,6 @@ $(document).ready(() => {
...parts
).send({
from: accounts[0],
- gasPrice: realGasPrice,
gas: web3.utils.toHex(gas_amount(document.location.href)),
gasLimit: web3.utils.toHex(gas_amount(document.location.href))
})
diff --git a/app/assets/v2/js/grants/detail.js b/app/assets/v2/js/grants/detail.js
index 8e690101310..cf2d52d854f 100644
--- a/app/assets/v2/js/grants/detail.js
+++ b/app/assets/v2/js/grants/detail.js
@@ -201,8 +201,7 @@ $(document).ready(function() {
deployedSubscription.methods.endContract()
.send({
from: accounts[0],
- gas: 3000000,
- gasPrice: web3.utils.toHex($('#gasPrice').val() * Math.pow(10, 9))
+ gas: 3000000
}).on('transactionHash', function(transactionHash) {
grant_cancel_tx_id = $('#grant_cancel_tx_id').val();
const linkURL = get_etherscan_url(transactionHash);
diff --git a/app/assets/v2/js/grants/fund.js b/app/assets/v2/js/grants/fund.js
index f2481b40aca..12c29701554 100644
--- a/app/assets/v2/js/grants/fund.js
+++ b/app/assets/v2/js/grants/fund.js
@@ -22,8 +22,6 @@ var set_form_disabled = function(is_disabled) {
$(document).ready(function() {
- // _alert({ message: gettext('Note: Brave users seem to have issues while contributing to Grants while using both Brave Wallet and MetaMask. We recommend disabling one. For more info, see this issue') }, 'warning');
-
// set defaults
var set_defaults = function() {
var lookups = {
@@ -281,8 +279,7 @@ $(document).ready(function() {
web3.eth.sendTransaction({
from: accounts[0],
to: to_address,
- value: to_addr_amount,
- gasPrice: parseInt(web3.utils.toHex($('#gasPrice').val() * Math.pow(10, 9)))
+ value: to_addr_amount
}, function(err, txid) {
indicateMetamaskPopup(1);
if (err) {
@@ -339,8 +336,7 @@ $(document).ready(function() {
web3.eth.sendTransaction({
from: accounts[0],
to: gitcoinDonationAddress,
- value: gitcoin_amount,
- gasPrice: parseInt(web3.utils.toHex($('#gasPrice').val() * Math.pow(10, 9)))
+ value: gitcoin_amount
}, success_callback);
}
});
@@ -372,11 +368,8 @@ $(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
+ const realGasPrice = Number(gitcoin_grant_amount * Math.pow(10, decimals)); // optional grants fee
- if (contractVersion == 0) {
- realGasPrice = 1;
- }
$('#gas_price').val(realGasPrice);
@@ -408,7 +401,6 @@ $(document).ready(function() {
web3.utils.toTwosComplement(approvalSTR)
).send({
from: accounts[0],
- gasPrice: web3.utils.toHex(parseInt($('#gasPrice').val() * Math.pow(10, 9))),
gas: web3.utils.toHex(gas_amount(document.location.href)),
gasLimit: web3.utils.toHex(gas_amount(document.location.href))
}).on('error', function(error) {
@@ -647,9 +639,8 @@ 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).estimateGas(function(err, gas_amount) {
if (err) {
_alert('There was an error', 'error');
@@ -659,8 +650,7 @@ const splitPayment = (account, toFirst, toSecond, valueFirst, valueSecond) => {
}
deployedSplitter.methods.splitTransfer(toFirst, toSecond, valueFirst, valueSecond, tokenAddress).send({
from: account,
- gas: web3.utils.toHex(gas_amount + 1000),
- gasPrice: parseInt(web3.utils.toHex($('#gasPrice').val() * Math.pow(10, 9)))
+ gas: web3.utils.toHex(gas_amount + 1000)
}).on('error', function(error) {
console.log('1', error);
indicateMetamaskPopup(1);
diff --git a/app/assets/v2/js/grants/new.js b/app/assets/v2/js/grants/new.js
index ab5df13e0f1..c8f6747749c 100644
--- a/app/assets/v2/js/grants/new.js
+++ b/app/assets/v2/js/grants/new.js
@@ -149,21 +149,6 @@ const init = () => {
// trusted relayer
web3.utils.toChecksumAddress(data.trusted_relayer)
];
- } else if ($('#contract_version').val() == 0) {
- args = [
- // admin_address
- web3.utils.toChecksumAddress(data.admin_address),
- // required token
- web3.utils.toChecksumAddress(data.denomination),
- // required tokenAmount
- web3.utils.toTwosComplement(0),
- // data.frequency
- web3.utils.toTwosComplement(0),
- // data.gas_price
- web3.utils.toTwosComplement(0),
- // contract version
- web3.utils.toTwosComplement(0)
- ];
}
web3.eth.getAccounts(function(err, accounts) {
@@ -174,7 +159,6 @@ const init = () => {
arguments: args
}).send({
from: accounts[0],
- gasPrice: web3.utils.toHex($('#gasPrice').val() * Math.pow(10, 9)),
gas: web3.utils.toHex(gas_amount(document.location.href)),
gasLimit: web3.utils.toHex(gas_amount(document.location.href))
}).on('error', function(error) {
diff --git a/app/assets/v2/js/pages/bulk_payout.js b/app/assets/v2/js/pages/bulk_payout.js
index 5fa7c5359de..8a42d85ce38 100644
--- a/app/assets/v2/js/pages/bulk_payout.js
+++ b/app/assets/v2/js/pages/bulk_payout.js
@@ -108,14 +108,13 @@ $(document).ready(function($) {
});
}
};
+
var bounty = web3.eth.contract(bounty_abi).at(bounty_address());
- var gas_dict = { gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9)) };
indicateMetamaskPopup();
web3.eth.getAccounts(function(_, accounts) {
bounty.killBounty(
$('#standard_bounties_id').val(),
- gas_dict,
{from: accounts[0]},
callback
);
diff --git a/app/assets/v2/js/pages/cancel_bounty/ETH.js b/app/assets/v2/js/pages/cancel_bounty/ETH.js
index dec9d91e5be..b449546f8af 100644
--- a/app/assets/v2/js/pages/cancel_bounty/ETH.js
+++ b/app/assets/v2/js/pages/cancel_bounty/ETH.js
@@ -114,10 +114,7 @@ const ethCancelBounty = data => {
web3.eth.getAccounts(function(_, accounts) {
bounty.killBounty(
bountyId,
- {
- from: accounts[0],
- gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9))
- },
+ { from: accounts[0] },
final_callback
);
});
diff --git a/app/assets/v2/js/pages/create_bounty/ETH.js b/app/assets/v2/js/pages/create_bounty/ETH.js
index 4ef55cc6ed3..d10b367cb1f 100644
--- a/app/assets/v2/js/pages/create_bounty/ETH.js
+++ b/app/assets/v2/js/pages/create_bounty/ETH.js
@@ -220,7 +220,6 @@ const ethCreateBounty = async (data) => {
{
from: account,
value: eth_amount,
- gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9)),
gas: web3.toHex(318730),
gasLimit: web3.toHex(318730)
},
@@ -232,7 +231,6 @@ const ethCreateBounty = async (data) => {
handleTokenAuth().then(() => {
const fee = Number((Number(data.amount) * FEE_PERCENTAGE).toFixed(4));
const to_address = '0x00De4B13153673BCAE2616b67bf822500d325Fc3';
- const gas_price = web3.toHex($('#gasPrice').val() * Math.pow(10, 9));
indicateMetamaskPopup();
if (FEE_PERCENTAGE == 0) {
@@ -243,7 +241,6 @@ const ethCreateBounty = async (data) => {
to: to_address,
from: account,
value: web3.toWei(fee, 'ether'),
- gasPrice: gas_price
}, function(error, txnId) {
indicateMetamaskPopup(true);
if (error) {
@@ -262,7 +259,7 @@ const ethCreateBounty = async (data) => {
const amountInWei = fee * 1.0 * Math.pow(10, token.decimals);
const token_contract = web3.eth.contract(token_abi).at(tokenAddress);
- token_contract.transfer(to_address, amountInWei, { gasPrice: gas_price },
+ token_contract.transfer(to_address, amountInWei,
function(error, txnId) {
indicateMetamaskPopup(true);
if (error) {
@@ -305,7 +302,6 @@ const ethCreateBounty = async (data) => {
to: '0x00De4B13153673BCAE2616b67bf822500d325Fc3',
from: web3.account,
value: web3.toWei(ethFeaturedPrice, 'ether'),
- gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9)),
gas: web3.toHex(318730),
gasLimit: web3.toHex(318730)
},
diff --git a/app/assets/v2/js/pages/fulfill_bounty/ETH.js b/app/assets/v2/js/pages/fulfill_bounty/ETH.js
index 1573ff7fba5..0156f5c3395 100644
--- a/app/assets/v2/js/pages/fulfill_bounty/ETH.js
+++ b/app/assets/v2/js/pages/fulfill_bounty/ETH.js
@@ -134,10 +134,7 @@ const ethFulfillBounty = data => {
bounty.fulfillBounty(
bountyId,
document.ipfsDataHash,
- {
- from: accounts[0],
- gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9))
- },
+ { from: accounts[0] },
web3Callback
);
});
diff --git a/app/assets/v2/js/pages/increase_bounty.js b/app/assets/v2/js/pages/increase_bounty.js
index 378362a7706..94cc8f87eaf 100644
--- a/app/assets/v2/js/pages/increase_bounty.js
+++ b/app/assets/v2/js/pages/increase_bounty.js
@@ -220,8 +220,7 @@ $(document).ready(async function() {
{
from: account,
value: ethAmount,
- gas: web3.toHex(652690),
- gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9))
+ gas: web3.toHex(652690)
},
web3Callback
);
@@ -231,7 +230,6 @@ $(document).ready(async function() {
if (act_as_funder) {
const to_address = '0x00De4B13153673BCAE2616b67bf822500d325Fc3';
- const gas_price = web3.toHex($('#gasPrice').val() * Math.pow(10, 9));
const fee = (Number($('#summary-bounty-amount').html()) * FEE_PERCENTAGE).toFixed(4);
indicateMetamaskPopup();
@@ -242,8 +240,7 @@ $(document).ready(async function() {
web3.eth.sendTransaction({
to: to_address,
from: account,
- value: web3.toWei(fee, 'ether'),
- gasPrice: gas_price
+ value: web3.toWei(fee, 'ether')
}, function(error, txnId) {
indicateMetamaskPopup(true);
if (error) {
@@ -257,7 +254,7 @@ $(document).ready(async function() {
const amountInWei = fee * 1.0 * Math.pow(10, token.decimals);
const token_contract = web3.eth.contract(token_abi).at(tokenAddress);
- token_contract.transfer(to_address, amountInWei, { gasPrice: gas_price }, function(error, txnId) {
+ token_contract.transfer(to_address, amountInWei, function(error, txnId) {
indicateMetamaskPopup(true);
if (error) {
_alert({ message: gettext('Unable to pay bounty fee. Please try again.') }, 'error');
diff --git a/app/assets/v2/js/pages/kudos_send.js b/app/assets/v2/js/pages/kudos_send.js
index 3d49aabdcda..b62f96a7af5 100644
--- a/app/assets/v2/js/pages/kudos_send.js
+++ b/app/assets/v2/js/pages/kudos_send.js
@@ -1,9 +1,6 @@
/* eslint-disable no-console */
var get_gas_price = function() {
- if ($('#gasPrice').length) {
- return $('#gasPrice').val() * Math.pow(10, 9);
- }
if (typeof defaultGasPrice != 'undefined') {
return defaultGasPrice;
}
diff --git a/app/assets/v2/js/pages/process_bounty.js b/app/assets/v2/js/pages/process_bounty.js
index e22f2306920..35e44c6834a 100644
--- a/app/assets/v2/js/pages/process_bounty.js
+++ b/app/assets/v2/js/pages/process_bounty.js
@@ -268,7 +268,7 @@ window.onload = function() {
// just sent payout
var send_payout = function() {
web3.eth.getAccounts(function(_, accounts) {
- bounty.acceptFulfillment(bountyId, fulfillmentId, {gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9)), from: accounts[0]}, final_callback);
+ bounty.acceptFulfillment(bountyId, fulfillmentId, {from: accounts[0]}, final_callback);
});
};
diff --git a/app/assets/v2/js/pages/shared_bounty_mutation_estimate_gas.js b/app/assets/v2/js/pages/shared_bounty_mutation_estimate_gas.js
index f164965c03e..ee7a2021bf5 100644
--- a/app/assets/v2/js/pages/shared_bounty_mutation_estimate_gas.js
+++ b/app/assets/v2/js/pages/shared_bounty_mutation_estimate_gas.js
@@ -1,8 +1,5 @@
-// Wait until page is loaded, then run the function
-
var gas_amount = function(page_url) {
- var gasLimitEstimate = 0;
- // new new funding page
+ let gasLimitEstimate = 0;
if (page_url.indexOf('issue/fulfill') != -1) {
gasLimitEstimate = 207103;
@@ -38,43 +35,4 @@ var gas_amount = function(page_url) {
gasLimitEstimate = 318730;
}
return gasLimitEstimate;
-};
-
-jQuery(document).ready(function() {
-
- var gasLimitEstimate = gas_amount(document.location.href);
-
- var estimateGas = function(success_callback, failure_callback, final_callback) {
- // TODO: could do a web3 .estimateGas()
- success_callback(gasLimitEstimate, gasLimitEstimate, '');
- final_callback();
- };
- // updates recommended metamask settings
- var updateInlineGasEstimate = function() {
- var success_callback = function(gas, gasLimit, _) {
- jQuery('#gasLimit').val(parseInt(gas));
- update_metamask_conf_time_and_cost_estimate();
- };
- var failure_callback = function(errors) {
- jQuery('#gasLimit').val('Unknown');
- update_metamask_conf_time_and_cost_estimate();
- };
- var final_callback = function() {
- // …
- };
-
- estimateGas(success_callback, failure_callback, final_callback);
- };
-
- // only check for updating gas estimates IFF we're on a page where
- // update_metamask_conf_time_and_cost_estimate() is defined
- if (typeof update_metamask_conf_time_and_cost_estimate != 'undefined') {
- setTimeout(function() {
- updateInlineGasEstimate();
- }, 500);
- jQuery('input').change(updateInlineGasEstimate);
- jQuery('#gasPrice').keyup(update_metamask_conf_time_and_cost_estimate);
- }
-
-
-});
+};
\ No newline at end of file
diff --git a/app/assets/v2/js/pages/wallet_estimate.js b/app/assets/v2/js/pages/wallet_estimate.js
deleted file mode 100644
index 863b4817f9e..00000000000
--- a/app/assets/v2/js/pages/wallet_estimate.js
+++ /dev/null
@@ -1,133 +0,0 @@
-window.addEventListener('load', function() {
- try {
- if (web3 && web3.currentProvider.isTrust) {
- $('#trust_label').show();
- } else {
- $('#metamask_label').show();
- }
- } catch (ignore) {
- console.log('%c error: web3 not defined. ensure metamask is installed & unlocked', 'color: red');
- }
- setTimeout(prefill_recommended_prices, 1000);
-
- $(document).on('click', '#accordion-set-own-limit', function() {
- $('#metamask_context').toggle();
- $('#gas-section .recommended-prices').removeClass('active');
- if ($('#accordion-set-own-limit i').hasClass('fa-angle-down')) {
- $('#accordion-set-own-limit i').removeClass('fa-angle-down').addClass('fa-angle-up');
- } else {
- $('#accordion-set-own-limit i').removeClass('fa-angle-up').addClass('fa-angle-down');
- }
- });
-
- $(document).on('click', '#gas-section .recommended-prices', function() {
- var gasLimit = parseInt($('#gasLimit').val());
- var usdAmount = $(this).data('amount-usd');
- var ethAmount = Math.round(1000000 * usdAmount / document.eth_usd_conv_rate) / 1000000;
- var gasPrice = $(this).data('amount');
-
- $('#gas-section .recommended-prices').removeClass('active');
- $(this).addClass('active');
- $('#gas-usd').html('$' + usdAmount);
- $('#gas-eth').html(ethAmount + 'ETH');
- gasPrice = Math.round(gasPrice * 10) / 10.0;
- if (gasPrice < 0.1) {
- gasPrice = 0.1;
- }
- $('#gasPrice').val(gasPrice);
- update_metamask_conf_time_and_cost_estimate();
- });
-});
-
-function gasToUSD(gasPrice) {
- var gasLimit = parseInt($('#gasLimit').val());
- var ethAmount = Math.round(1000 * gasLimit * gasPrice / Math.pow(10, 9)) / 1000;
- var usdAmount = Math.round(10 * ethAmount * document.eth_usd_conv_rate) / 10;
-
- return usdAmount;
-}
-
-function get_recommended_prices() {
- var slow_price_index = Math.round(document.conf_time_spread.length / 9);
- var avg_price_index = Math.round(document.conf_time_spread.length / 3);
- var fast_price_index = Math.round(document.conf_time_spread.length / 9 * 5);
-
- var slow_price_range = [];
-
- for (var i = 0; i < document.conf_time_spread.length; i++) {
- if (gasPrice <= parseFloat(next_ele[0]) && gasPrice > parseFloat(this_ele[0])) {
- confTime = Math.round(10 * next_ele[1]) / 10;
- }
- }
-
- var recommendations = {
- 'slow': {
- 'amount': gasToUSD(document.conf_time_spread[slow_price_index][0]),
- 'time': document.conf_time_spread[slow_price_index][1]
- },
- 'avg': {
- 'amount': gasToUSD(document.conf_time_spread[avg_price_index][0]),
- 'time': document.conf_time_spread[avg_price_index][1]
- },
- 'fast': {
- 'amount': gasToUSD(document.conf_time_spread[fast_price_index][0]),
- 'time': document.conf_time_spread[fast_price_index][1]
- }
- };
-
- return recommendations;
-}
-
-function prefill_recommended_prices() {
- var slow_data = get_updated_metamask_conf_time_and_cost(parseFloat($('#slow-recommended-gas').data('amount')));
- var avg_data = get_updated_metamask_conf_time_and_cost(parseFloat($('#average-recommended-gas').data('amount')));
- var fast_data = get_updated_metamask_conf_time_and_cost(parseFloat($('#fast-recommended-gas').data('amount')));
-
- if (fast_data && fast_data['time'] == 'unknown') {
- $('#default-recommended-gas').show();
- $('#default-recommended-gas').html('The confirmation time is unknown.
However we recommend a gas price of $' + parseFloat(fast_data['usd']).toFixed(2));
- $('#default-recommended-gas').data('amount-usd', parseFloat(fast_data['usd']).toFixed(2));
- $('#gasPriceRecommended').val($('#average-recommended-gas').data('amount'));
- $('#slow-recommended-gas').hide();
- $('#average-recommended-gas').hide();
- $('#fast-recommended-gas').hide();
- let new_gas_price = Math.round($('#average-recommended-gas').data('amount') * 10) / 10;
-
- $('#gasPrice').val(new_gas_price);
- $('#gas-usd').html('$' + parseFloat(fast_data['usd']).toFixed(2));
- $('#gas-eth').html(avg_data['eth'] + 'ETH');
- } else if (slow_data && slow_data['time'] < 20 && parseFloat($('#slow-recommended-gas').data('amount')) < 2) {
- $('#slow-recommended-gas').hide();
- $('#default-recommended-gas').hide();
- $('#average-recommended-gas').hide();
- $('#fast-recommended-gas').show();
- $('.gas-rates .message').html('Good news! The network is pretty fast right now').show();
- $('#fast-recommended-gas').html('Fast $' + parseFloat(fast_data['usd']).toFixed(2) + ' ~' + fast_data['time'] + ' minutes').addClass('active');
- $('#fast-recommended-gas').data('amount-usd', parseFloat(fast_data['usd']).toFixed(2));
- $('#fast-recommended-gas').parent().removeClass('justify-content-between').addClass('justify-content-around');
- let new_gas_price = Math.round($('#average-recommended-gas').data('amount') * 10) / 10;
-
- $('#gasPrice').val(new_gas_price);
- $('#gas-usd').html('$' + parseFloat(fast_data['usd']).toFixed(2));
- $('#gas-eth').html(fast_data['eth'] + 'ETH');
- } else {
- $('#fast-recommended-gas').parent().addClass('justify-content-between').removeClass('justify-content-around');
- let new_gas_price = Math.round($('#average-recommended-gas').data('amount') * 10) / 10;
-
- $('#gasPrice').val(new_gas_price);
- $('#gas-usd').html('$' + parseFloat(avg_data['usd']).toFixed(2));
- $('#gas-eth').html(avg_data['eth'] + 'ETH');
- }
-
- // Slow recommendation prefills
- $('#slow-recommended-gas').html('Slow $' + parseFloat(slow_data['usd']).toFixed(2) + ' ~' + slow_data['time'] + ' minutes');
- $('#slow-recommended-gas').data('amount-usd', parseFloat(slow_data['usd']).toFixed(2));
-
- // Avg recommendation prefills
- $('#average-recommended-gas').html('Average $' + parseFloat(avg_data['usd']).toFixed(2) + ' ~' + avg_data['time'] + ' minutes');
- $('#average-recommended-gas').data('amount-usd', parseFloat(avg_data['usd']).toFixed(2));
-
- // Fast recommendation prefills
- $('#fast-recommended-gas').html('Fast $' + parseFloat(fast_data['usd']).toFixed(2) + ' ~' + fast_data['time'] + ' minutes');
- $('#fast-recommended-gas').data('amount-usd', parseFloat(fast_data['usd']).toFixed(2));
-}
diff --git a/app/assets/v2/js/shared.js b/app/assets/v2/js/shared.js
index a10026392b9..5eeb341ac24 100644
--- a/app/assets/v2/js/shared.js
+++ b/app/assets/v2/js/shared.js
@@ -92,7 +92,6 @@ var reloadCbAddress = function() {
reloadCbAddress();
-
const Web3Modal = window.Web3Modal.default;
window.Web3Modal.providers.push({
@@ -146,66 +145,6 @@ if (web3Modal.cachedProvider) {
});
}
-var update_metamask_conf_time_and_cost_estimate = function() {
- var confTime = 'unknown';
- var ethAmount = 'unknown';
- var usdAmount = 'unknown';
-
- var gasLimit = parseInt($('#gasLimit').val());
- var gasPrice = parseFloat($('#gasPrice').val());
-
- if (gasPrice) {
- var eth_amount_unrounded = gasLimit * gasPrice / Math.pow(10, 9);
-
- ethAmount = Math.round(1000000 * eth_amount_unrounded) / 1000000;
- usdAmount = Math.round(1000 * eth_amount_unrounded * document.eth_usd_conv_rate) / 1000;
- }
-
- if (typeof document.conf_time_spread == 'undefined') return;
-
- for (var i = 0; i < document.conf_time_spread.length - 1; i++) {
- var this_ele = (document.conf_time_spread[i]);
- var next_ele = (document.conf_time_spread[i + 1]);
-
- if (gasPrice <= parseFloat(next_ele[0]) && gasPrice > parseFloat(this_ele[0])) {
- confTime = Math.round(10 * next_ele[1]) / 10;
- }
- }
-
- $('#ethAmount').html(ethAmount);
- $('#usdAmount').html(usdAmount);
- $('#confTime').html(confTime);
-};
-
-var get_updated_metamask_conf_time_and_cost = function(gasPrice) {
-
- var confTime = 'unknown';
- var ethAmount = 'unknown';
- var usdAmount = 'unknown';
-
- var gasLimit = parseInt($('#gasLimit').val());
-
- if (gasPrice) {
- var eth_amount_unrounded = gasLimit * gasPrice / Math.pow(10, 9);
-
- ethAmount = Math.round(1000000 * eth_amount_unrounded) / 1000000;
- usdAmount = Math.round(100 * eth_amount_unrounded * document.eth_usd_conv_rate) / 100;
- }
-
- if (typeof document.conf_time_spread == 'undefined') return;
-
- for (var i = 0; i < document.conf_time_spread.length - 1; i++) {
- var this_ele = (document.conf_time_spread[i]);
- var next_ele = (document.conf_time_spread[i + 1]);
-
- if (gasPrice <= parseFloat(next_ele[0]) && gasPrice > parseFloat(this_ele[0])) {
- confTime = Math.round(10 * next_ele[1]) / 10;
- }
- }
-
- return {'eth': ethAmount, 'usd': usdAmount, 'time': confTime};
-};
-
var unloading_button = function(button) {
button.prop('disabled', false);
button.removeClass('disabled');
diff --git a/app/dashboard/templates/bounty/cancel.html b/app/dashboard/templates/bounty/cancel.html
index 5d77346f92e..b01a3d4ab6b 100644
--- a/app/dashboard/templates/bounty/cancel.html
+++ b/app/dashboard/templates/bounty/cancel.html
@@ -139,12 +139,6 @@