diff --git a/store/application.js b/store/application.js index b7d7357..dfbf7c3 100644 --- a/store/application.js +++ b/store/application.js @@ -641,13 +641,15 @@ const actions = { } }, async estimateRelayerWithdrawGasLimit( - { getters, rootState, commit }, + { getters, rootState, rootGetters, commit }, { currency, amount, netId, proof, withdrawCallArgs } ) { const tornadoProxy = getters.tornadoProxyContract({ netId }) const tornadoInstance = getters.instanceContract({ currency, amount, netId }) const relayer = rootState.relayer.selectedRelayer.address + const gasPrice = toBN(rootGetters['gasPrices/gasPrice']) + let gasLimit try { const fetchedGasLimit = await tornadoProxy.methods @@ -655,7 +657,9 @@ const actions = { .estimateGas({ from: relayer, to: tornadoProxy._address, - value: withdrawCallArgs[5] || 0 + value: withdrawCallArgs[5] || 0, + gasPrice, + gasLimit: getters.defaultWithdrawGas }) gasLimit = Math.floor(fetchedGasLimit * 1.3) } catch (e) { diff --git a/store/gasPrices.js b/store/gasPrices.js index 4c993a1..8498cac 100644 --- a/store/gasPrices.js +++ b/store/gasPrices.js @@ -23,7 +23,7 @@ export const getters = { return new GasPriceOracle({ chainId: netId, defaultRpc: rootGetters['settings/currentRpc'].url, - minPriority: netId === 1 ? 2 : 0.05, + minPriority: netId === 1 || netId === 5 ? 2 : 0.05, percentile: 5, blocksCount: 20, defaultFallbackGasPrices: gasPrices @@ -73,7 +73,20 @@ export const actions = { try { // Bump more for Polygon (MATIC) and for Goerli, because minPriority for this sidechains don't affect correctly - const bumpPercent = netId === 137 || netId === 5 ? 30 : 10 + let bumpPercent + switch (netId) { + case 5: + bumpPercent = 100 + break + case 137: + case 43114: + case 100: + bumpPercent = 30 + break + default: + bumpPercent = 10 + } + let txGasParams = {} try { // Use maxFeePerGas if eip1599 gas support by chain, use fast if legacy gas fetched