From daaf000c37b95bf3b34b49796fa5f8fc6ebdcb51 Mon Sep 17 00:00:00 2001 From: netbonus <151201453+netbonus@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:49:19 -0400 Subject: [PATCH] revert eip712 `v` change --- src/ethereum.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ethereum.ts b/src/ethereum.ts index d76c00a5..c6787787 100644 --- a/src/ethereum.ts +++ b/src/ethereum.ts @@ -76,7 +76,7 @@ const validateEthereumMsgResponse = function (res, req) { const digest = prehash ? prehash : encoded; const chainId = parseInt(input.payload.domain.chainId, 16); // Get recovery param with a `v` value of [27,28] by setting `useEIP155=false` - return addRecoveryParam(digest, sig, signer, { chainId }); + return addRecoveryParam(digest, sig, signer, { chainId, useEIP155: false }); } else { throw new Error('Unsupported protocol'); } @@ -495,7 +495,7 @@ function getRecoveryParam(v, txData: any = {}) { // transaction payload. if (type === 1 || type === 2) { return ensureHexBuffer(v, true); // 0 or 1, with 0 expected as an empty buffer - } else if (false === useEIP155 || chainId === null) { + } else if (!useEIP155 || !chainId) { // For ETH messages and non-EIP155 chains the set should be [27, 28] for `v` return Buffer.from(new BN(v).plus(27).toString(16), 'hex'); }