Skip to content

Commit 7f4caf0

Browse files
Fix nonce value for ethers5 adapter (#2881)
Co-authored-by: Kien Ngo <kien@cavies.xyz>
1 parent 8ae8e6a commit 7f4caf0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/blue-boxes-protect.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix nonce value for ethers5 adapter

packages/thirdweb/src/adapters/ethers5.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ async function alignTxFromEthers(
515515
chainId,
516516
to,
517517
data: (data ?? undefined) as Hex | undefined,
518-
nonce: nonce ? ethers.BigNumber.from(gasPrice).toNumber() : undefined,
518+
nonce: nonce ? ethers.BigNumber.from(nonce).toNumber() : undefined,
519519
value: value ? ethers.BigNumber.from(value).toBigInt() : undefined,
520520
gasPrice: gasPrice
521521
? ethers.BigNumber.from(gasPrice).toBigInt()
@@ -533,7 +533,7 @@ async function alignTxFromEthers(
533533
chainId,
534534
to,
535535
data: (data ?? undefined) as Hex | undefined,
536-
nonce: nonce ? ethers.BigNumber.from(gasPrice).toNumber() : undefined,
536+
nonce: nonce ? ethers.BigNumber.from(nonce).toNumber() : undefined,
537537
value: value ? ethers.BigNumber.from(value).toBigInt() : undefined,
538538
gas: gasLimit ? ethers.BigNumber.from(gasLimit).toBigInt() : undefined,
539539
maxFeePerGas: maxFeePerGas
@@ -550,7 +550,7 @@ async function alignTxFromEthers(
550550
chainId,
551551
to,
552552
data: (data ?? undefined) as Hex | undefined,
553-
nonce: nonce ? ethers.BigNumber.from(gasPrice).toNumber() : undefined,
553+
nonce: nonce ? ethers.BigNumber.from(nonce).toNumber() : undefined,
554554
value: value ? ethers.BigNumber.from(value).toBigInt() : undefined,
555555
gasPrice: gasPrice
556556
? ethers.BigNumber.from(gasPrice).toBigInt()

0 commit comments

Comments
 (0)