Skip to content

Commit

Permalink
1162 nonce bug (#1163)
Browse files Browse the repository at this point in the history
* Nonce bug fix

* Changeset version file
  • Loading branch information
0xp3gasus authored May 20, 2024
1 parent de27a52 commit 540326d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thirty-chairs-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xchainjs/xchain-evm': patch
---

Bug fix related to the nonce at making approve and transfer transactions with Keystore clients
2 changes: 1 addition & 1 deletion packages/xchain-evm/src/clients/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ export class Client extends BaseXChainClient implements EVMClient {

const tx = await ethers.utils.resolveProperties(transactionRequest)
const signedTx = await this.getSigner().signApprove({
sender: await this.getAddressAsync(),
sender,
tx: {
type: 1,
chainId: tx.chainId,
Expand Down
2 changes: 2 additions & 0 deletions packages/xchain-evm/src/signers/keystoreSigner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class KeystoreSigner extends Signer implements IKeystoreSigner {
to: tx.to,
data: tx.data,
value: tx.value,
nonce: tx.nonce ? ethers.BigNumber.from(tx.nonce).toNumber() : undefined,
gasLimit: tx.gasLimit,
gasPrice: tx.gasPrice,
maxPriorityFeePerGas: tx.maxPriorityFeePerGas,
Expand All @@ -134,6 +135,7 @@ export class KeystoreSigner extends Signer implements IKeystoreSigner {
to: tx.to,
value: tx.value,
data: tx.data,
nonce: tx.nonce ? ethers.BigNumber.from(tx.nonce).toNumber() : undefined,
gasPrice: tx.gasPrice,
gasLimit: tx.gasLimit,
})
Expand Down

0 comments on commit 540326d

Please sign in to comment.