From 334412c803272fa08b3e103a3fa03b4cb79e1ef0 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 30 Aug 2023 03:28:05 -0700 Subject: [PATCH] Fix gas limit estimation for metamask & bump gas limit for self-withdrawal without relayer to 20% --- store/application.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/store/application.js b/store/application.js index c933018..98bbcaf 100644 --- a/store/application.js +++ b/store/application.js @@ -553,7 +553,7 @@ const actions = { const callParams = { method: 'eth_sendTransaction', - params: Object.assign({ gasLimit }, incompletedTx), + params: Object.assign({ gas: numberToHex(gasLimit) }, incompletedTx), watcherParams: { title: { path: 'depositing', amount, currency }, successTitle: { @@ -763,7 +763,7 @@ const actions = { throw new Error(e.message) } }, - async withdraw({ state, rootState, dispatch, getters }, { note }) { + async withdraw({ state, rootState, rootGetters, dispatch, getters }, { note }) { try { const [, currency, amount, netId] = note.split('-') const config = networkConfig[`netId${netId}`] @@ -779,13 +779,14 @@ const actions = { const incompletedTx = { data, value: args[5], - to: contractInstance._address + to: contractInstance._address, + from: ethAccount } - const gasLimit = await rootGetters['fees/oracle'].getGasLimit(incompletedTx, 'user_withdrawal') + const gasLimit = await rootGetters['fees/oracle'].getGasLimit(incompletedTx, 'other', 20) const callParams = { method: 'eth_sendTransaction', - params: Object.assign({ gasLimit }, incompletedTx), + params: Object.assign({ gas: numberToHex(gasLimit) }, incompletedTx), watcherParams: { title: { path: 'withdrawing', amount, currency }, successTitle: {