From 27a84aa45d3a83cf4384fddf87c5db3c53f5af9d Mon Sep 17 00:00:00 2001 From: Adri <19190248+adrifdez@users.noreply.github.com> Date: Tue, 14 Dec 2021 12:17:32 +0100 Subject: [PATCH 1/2] fix deposit --- src/tx.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/tx.js b/src/tx.js index c9c654c..620e807 100644 --- a/src/tx.js +++ b/src/tx.js @@ -84,14 +84,11 @@ const deposit = async ( const accounts = await getAccounts(hezEthereumAddress, [token.id]) .catch(() => undefined) const account = typeof accounts !== 'undefined' ? accounts.accounts[0] : null - - const overrides = { - gasPrice: await getGasPrice(providerUrl) - } + const overrides = await getGasPrice(providerUrl) const usePermit = await isPermitSupported(fromTokenContract) const permitSignature = - usePermit + await isPermitSupported() ? await permit(fromTokenContract, ethereumAddress, CONTRACT_ADDRESSES[ContractNames.Hermez], signerData, providerUrl) : '0x' From 839c2a09718c2239b3a30bba4fb6199a79c63179 Mon Sep 17 00:00:00 2001 From: Adri <19190248+adrifdez@users.noreply.github.com> Date: Tue, 14 Dec 2021 12:35:36 +0100 Subject: [PATCH 2/2] reset usePermit --- src/tx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tx.js b/src/tx.js index 620e807..4add8b9 100644 --- a/src/tx.js +++ b/src/tx.js @@ -88,7 +88,7 @@ const deposit = async ( const usePermit = await isPermitSupported(fromTokenContract) const permitSignature = - await isPermitSupported() + usePermit ? await permit(fromTokenContract, ethereumAddress, CONTRACT_ADDRESSES[ContractNames.Hermez], signerData, providerUrl) : '0x'