# 可能的报错

### Nonce 不连续

![](/files/SPnAKRfw8stBSofJgSMC)

如果出现上面截图中的报错，很有可能是重复提交了相同 nonce 的交易，通常出现在循环连续执行交易的情况下。建议手动维护一个 nonce 值，从链上获取到的最新 nonce 开始计数，每执行一个交易后手动+1 ，避免连续执行交易的时候由于链上信息更新不及时，导致本地获取的 nonce 和之前的交易重复而报错。

其他 nonce 不连续的情况也会导致交易无法执行成功，比如两笔连续的交易，前一笔的 nonce 是 1， 后一笔的 nonce 是 3，这种情况会导致 nonce 为 3 的交易一直 pengding，需要再发送一笔 nonce 为 2 的交易。

关于 Nonce 概念，请查看此文档对交易字段的说明: <https://developer.confluxnetwork.org/sending-tx/en/transaction_explain/>

### 交易所需的 Gas 不足

![](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQWBPZIrHSnkEHg85sC9e%2Fuploads%2F3iV3W92FFE0yuX8JoYh6%2FinsufficientCFX.jpg?alt=media\&token=a9363316-1e5e-4de7-b712-f2285edb54ff)

如上图所示的报错通常是因为用于发送交易的账户地址中的 CFX 余额不足以支付 Gas 费用。如果是与合约交互，可以检查一下是否正确设置了代付。

### 转账代币余额不足

![](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQWBPZIrHSnkEHg85sC9e%2Fuploads%2FYVD5P1k9RUz76xI9eU39%2FinsufficientToken.jpg?alt=media\&token=074c6715-c458-452d-8d35-f05d1da9dc91)

​在进行 CRC20/721/1155 合约的代币转账时，如果转移的代币金额超过发送交易的账户所持有的余额，就会产生 “Insufficient balance for transfer" 的报错。如果转移的是 CRC721/1155 标准的 NFT，可以检查一下调用转账方法时 "tokenId" 参数是否填写正确。

### 重复调用 addPrivateKey

![](/files/cFSLTZ75pj3vCLjPDl9E)

在本地 Node 环境使用 js-conflux-sdk 来发送交易时，不需要重复将`conflux.wallet.addPrivateKey(privateKey)` 方法返回值作为 `sendTransaction`的 from 参数，保存在变量中使用即可。SDK 的正确使用姿势请参考: <https://docs.confluxnetwork.org/js-conflux-sdk/docs/account>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://conflux-technical-support.gitbook.io/conflux-nft-kai-fa-zhi-nan/kai-fa-chang-jian-wen-ti/ke-neng-de-bao-cuo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
