From fa884e4605117615044e09ea9d7fcf3a705d9a14 Mon Sep 17 00:00:00 2001 From: akoszowski Date: Mon, 4 Sep 2023 11:52:40 +0200 Subject: [PATCH 1/2] Settle safeTxGas to 0 --- packages/core/src/helpers/gnosisSafeUtils.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/core/src/helpers/gnosisSafeUtils.ts b/packages/core/src/helpers/gnosisSafeUtils.ts index 34c556ff6..e5accab76 100644 --- a/packages/core/src/helpers/gnosisSafeUtils.ts +++ b/packages/core/src/helpers/gnosisSafeUtils.ts @@ -77,6 +77,11 @@ export const calculateSafeTransactionHash = ( safeTx: SafeTransaction, chainId: BigNumberish ): string => { + // TODO: Remove after WalletConnectV2 fix + // WalletConnectV2 incorrectly passes safeTxGas value, equal 0 (default value). + // Thus we have a mismatch between gnosis safeTxHash and one calculated by useDApp (safeTxGas is based on estimation) + safeTx = {...safeTx, safeTxGas: 0} + return utils._TypedDataEncoder.hash({ verifyingContract: safe.address, chainId }, EIP712_SAFE_TX_TYPE, safeTx) } From 63505c5aa420557a66ccccb7bde2b12af578181c Mon Sep 17 00:00:00 2001 From: akoszowski Date: Mon, 4 Sep 2023 12:50:33 +0200 Subject: [PATCH 2/2] Lint --- packages/core/src/helpers/gnosisSafeUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/helpers/gnosisSafeUtils.ts b/packages/core/src/helpers/gnosisSafeUtils.ts index e5accab76..3225279ee 100644 --- a/packages/core/src/helpers/gnosisSafeUtils.ts +++ b/packages/core/src/helpers/gnosisSafeUtils.ts @@ -80,7 +80,7 @@ export const calculateSafeTransactionHash = ( // TODO: Remove after WalletConnectV2 fix // WalletConnectV2 incorrectly passes safeTxGas value, equal 0 (default value). // Thus we have a mismatch between gnosis safeTxHash and one calculated by useDApp (safeTxGas is based on estimation) - safeTx = {...safeTx, safeTxGas: 0} + safeTx = { ...safeTx, safeTxGas: 0 } return utils._TypedDataEncoder.hash({ verifyingContract: safe.address, chainId }, EIP712_SAFE_TX_TYPE, safeTx) }