From 500d2bd0a4d3ee5a611f2340ee14e78ced482b4b Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 30 Aug 2023 03:32:45 -0700 Subject: [PATCH] Fix proof calculation for self-withdrawal: specify relayer only when recalculating proof for relayer --- store/application.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/store/application.js b/store/application.js index 98bbcaf..363abcb 100644 --- a/store/application.js +++ b/store/application.js @@ -672,7 +672,7 @@ const actions = { const nativeCurrency = rootGetters['metamask/nativeCurrency'] const withdrawType = state.withdrawType - const relayer = BigInt(rootState.relayer.selectedRelayer.address) + let relayer = BigInt(0) let fee = 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 if (withdrawType !== 'relayer') return calculateSnarkProof() + relayer = BigInt(rootState.relayer.selectedRelayer.address) fee = BigInt(rootState.fees.withdrawalFeeViaRelayer) const naiveProof = await calculateSnarkProof() if (Number(note.netId) === 1) return naiveProof // Don't need to smart-estimate fee if we use V4 withdrawal