Add Bug Title Here
Ethers Version
6.2.3
Search Terms
No response
Describe the Problem
ii. 等待交易在区块链确认(需要几分钟) file:///d:/F/ethersjs/node_modules/ethers/lib.esm/utils/errors.js:116 error = new Error(message); ^
Error: insufficient funds (transaction={ "from": "0xe16c1623c1aa7d919cd2241d8b36d9e79c1be2a2", "nonce": "0x2aa", "to": "0xa98c9fe63bb9477d001d75c50b69cee0355443c9", "value": "0x38d7ea4c68000" }, info={ "error": { "code": -32000, "message": "failed with 550000000 gas: insufficient funds for gas * price + value: address 0xe16C1623c1AA7D919cd2241d8b36d9E79C1Be2A2 have 0 want 1000000000000000" }, "payload": { "id": 12, "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0xe16c1623c1aa7d919cd2241d8b36d9e79c1be2a2", "nonce": "0x2aa", "to": "0xa98c9fe63bb9477d001d75c50b69cee0355443c9", "value": "0x38d7ea4c68000" } ] } }, code=INSUFFICIENT_FUNDS, version=6.2.3) at makeError (file:///d:/F/ethersjs/node_modules/ethers/lib.esm/utils/errors.js:116:21) at JsonRpcProvider.getRpcError (file:///d:/F/ethersjs/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js:572:24) at file:///d:/F/ethersjs/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js:247:52 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 'INSUFFICIENT_FUNDS', transaction: { nonce: '0x2aa', value: '0x38d7ea4c68000', from: '0xe16c1623c1aa7d919cd2241d8b36d9e79c1be2a2', to: '0xa98c9fe63bb9477d001d75c50b69cee0355443c9' }, info: { payload: { method: 'eth_estimateGas', params: [ { nonce: '0x2aa', value: '0x38d7ea4c68000', from: '0xe16c1623c1aa7d919cd2241d8b36d9e79c1be2a2', to: '0xa98c9fe63bb9477d001d75c50b69cee0355443c9' } ], id: 12, jsonrpc: '2.0' }, error: { code: -32000, message: 'failed with 550000000 gas: insufficient funds for gas * price + value: address 0xe16C1623c1AA7D919cd2241d8b36d9E79C1Be2A2 have 0 want 1000000000000000' } } }
Code Snippet
const tx = {
to: address1,
value: ethers.parseEther("0.001")
}
// iii. 发送交易,获得收据
console.log(`\nii. 等待交易在区块链确认(需要几分钟)`)
const receipt = await wallet2.sendTransaction(tx)
Contract ABI
No response
Errors
No response
Environment
No response
Environment (Other)
No response