Compare commits
3 Commits
6137e1328a
...
e8a7fec326
Author | SHA1 | Date | |
---|---|---|---|
e8a7fec326 | |||
500d2bd0a4 | |||
334412c803 |
@ -553,7 +553,7 @@ const actions = {
|
|||||||
|
|
||||||
const callParams = {
|
const callParams = {
|
||||||
method: 'eth_sendTransaction',
|
method: 'eth_sendTransaction',
|
||||||
params: Object.assign({ gasLimit }, incompletedTx),
|
params: Object.assign({ gas: numberToHex(gasLimit) }, incompletedTx),
|
||||||
watcherParams: {
|
watcherParams: {
|
||||||
title: { path: 'depositing', amount, currency },
|
title: { path: 'depositing', amount, currency },
|
||||||
successTitle: {
|
successTitle: {
|
||||||
@ -672,7 +672,7 @@ const actions = {
|
|||||||
const nativeCurrency = rootGetters['metamask/nativeCurrency']
|
const nativeCurrency = rootGetters['metamask/nativeCurrency']
|
||||||
const withdrawType = state.withdrawType
|
const withdrawType = state.withdrawType
|
||||||
|
|
||||||
const relayer = BigInt(rootState.relayer.selectedRelayer.address)
|
let relayer = BigInt(0)
|
||||||
let fee = BigInt(0)
|
let fee = BigInt(0)
|
||||||
let refund = BigInt(0)
|
let refund = BigInt(0)
|
||||||
|
|
||||||
@ -718,6 +718,7 @@ const actions = {
|
|||||||
// Don't need to calculate or estimate relayer fee, so, return proof immediately
|
// Don't need to calculate or estimate relayer fee, so, return proof immediately
|
||||||
if (withdrawType !== 'relayer') return calculateSnarkProof()
|
if (withdrawType !== 'relayer') return calculateSnarkProof()
|
||||||
|
|
||||||
|
relayer = BigInt(rootState.relayer.selectedRelayer.address)
|
||||||
fee = BigInt(rootState.fees.withdrawalFeeViaRelayer)
|
fee = BigInt(rootState.fees.withdrawalFeeViaRelayer)
|
||||||
const naiveProof = await calculateSnarkProof()
|
const naiveProof = await calculateSnarkProof()
|
||||||
if (Number(note.netId) === 1) return naiveProof // Don't need to smart-estimate fee if we use V4 withdrawal
|
if (Number(note.netId) === 1) return naiveProof // Don't need to smart-estimate fee if we use V4 withdrawal
|
||||||
@ -763,7 +764,7 @@ const actions = {
|
|||||||
throw new Error(e.message)
|
throw new Error(e.message)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async withdraw({ state, rootState, dispatch, getters }, { note }) {
|
async withdraw({ state, rootState, rootGetters, dispatch, getters }, { note }) {
|
||||||
try {
|
try {
|
||||||
const [, currency, amount, netId] = note.split('-')
|
const [, currency, amount, netId] = note.split('-')
|
||||||
const config = networkConfig[`netId${netId}`]
|
const config = networkConfig[`netId${netId}`]
|
||||||
@ -779,13 +780,14 @@ const actions = {
|
|||||||
const incompletedTx = {
|
const incompletedTx = {
|
||||||
data,
|
data,
|
||||||
value: args[5],
|
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 = {
|
const callParams = {
|
||||||
method: 'eth_sendTransaction',
|
method: 'eth_sendTransaction',
|
||||||
params: Object.assign({ gasLimit }, incompletedTx),
|
params: Object.assign({ gas: numberToHex(gasLimit) }, incompletedTx),
|
||||||
watcherParams: {
|
watcherParams: {
|
||||||
title: { path: 'withdrawing', amount, currency },
|
title: { path: 'withdrawing', amount, currency },
|
||||||
successTitle: {
|
successTitle: {
|
||||||
|
@ -249,7 +249,7 @@ export const actions = {
|
|||||||
const isUpdatedMajor = major === requiredMajor
|
const isUpdatedMajor = major === requiredMajor
|
||||||
|
|
||||||
if (prerelease) return false
|
if (prerelease) return false
|
||||||
return isUpdatedMajor && (Number(patch) >= 4 || netId !== 1) // Patch checking - also backwards compatibility for Mainnet
|
return isUpdatedMajor && (Number(patch) >= 5 || netId !== 1) // Patch checking - also backwards compatibility for Mainnet
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isRelayerUpdated()) {
|
if (!isRelayerUpdated()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user