不幸的是,基于以下来源,我发送后会遇到上述错误。
const web3 = new Web3('https://bsc-dataseed1.binance.org:443');
const contractX = new web3.eth.Contract(abi, "0x723927ca03863672A5a5E49eBC348d5Fd3916C61", {
from: "0x3185d62503cCAE8CEbbc76fd21aDb3a8eaB4E12E", // default from address
gasPrice: '10000000000' // default gas price in wei, 20 gwei in this case
});
web3.eth.accounts.wallet.add(privateKey);
const receipt = contractX.methods.transfer('0x67ca93Fa2a6B5a1a72B5398f97379cb8E7b6bBc3', 300000000).send({
gas: web3.utils.toHex(21608),
});
返回信息
errors.js:87 Uncaught (in promise) Error: Transaction has been reverted by the EVM: { "blockHash": "0x7e8bc9b35d3a805028372409df8b07f18ba56996b0fb8b651a202df74e81a2e1", "blockNumber": 12476445, "contract": 1 null,
"cumulative:3Used": 1 null, "cumulative:3Used" :“0x3185d62503ccae8cebbc76fd21adb3a8eab4e12e”,“gasUsed”:21608,
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": false, "to": "0x723927ca03863672a5a5e49ebc348d5fd3916c61", "transactionHash": "0xc3c7664957e4e5f44053bf8c558aad7b039e7cea22f3de9a4565ea18399f7116", "transactionIndex": 7, "type": "0x0", "events":{} } 在 Object.TransactionError (errors.js:87) 在 Object.TransactionRevertedWithoutReasonError (errors.js:98) 在 index.js:394 在 c (runtime.js:63) 在 Generator._invoke (runtime.js:294 ) 在 Generator.next (runtime.js:119) 在 n (asyncToGenerator.js:3) 在 s (asyncToGenerator.js:25) 在 asyncToGenerator.js:32 在 new Promise () TransactionError @ errors.js:87 TransactionRevertedWithoutReasonError @ errors.js:98(匿名)@index.js:394 c@runtime.js:63(匿名)@runtime.js:294(匿名)@runtime.js:119 n@asyncToGenerator.js:3 s @asyncToGenerator。 js:25(匿名)@asyncToGenerator.js:32(匿名)@asyncToGenerator.js:21(匿名)@index.js:238 setTimeout(异步)_fireError@index.js:63(匿名)@index.js:394 c@runtime.js:63(匿名)@runtime.js:294(匿名)@runtime.js:119 n@asyncToGenerator.js:3 s @asyncToGenerator。js:25(匿名)@asyncToGenerator.js:32(匿名)@asyncToGenerator.js:21(匿名)@index.js:238 Promise.then(异步)E@index.js:345 setInterval(异步)r@index .js:442 (匿名) @ index.js:446 (匿名) @ index.js:475 Promise.then (async) m._confirmTransaction @ index.js:466 o @ index.js:557 (匿名) @ index. js:307 i.onreadystatechange @index.js:98 XMLHttpRequest.send (async) s.send @index.js:106 u.send @index.js:161 a @index.js:566 Promise.then (async) s @index.js:589 n @index.js:654 y._executeMethod @index.js:869 main @Index:88 (匿名) @Index:138_confirmTransaction@index.js:466 o@index.js:557(匿名)@index.js:307 i.onreadystatechange@index.js:98 XMLHttpRequest.send(异步)s.send@index.js:106 u.send @index.js:161 a @index.js:566 Promise.then (async) s @index.js:589 n @index.js:654 y._executeMethod @index.js:869 main @Index:88 (匿名) @索引:138_confirmTransaction@index.js:466 o@index.js:557(匿名)@index.js:307 i.onreadystatechange@index.js:98 XMLHttpRequest.send(异步)s.send@index.js:106 u.send @index.js:161 a @index.js:566 Promise.then (async) s @index.js:589 n @index.js:654 y._executeMethod @index.js:869 main @Index:88 (匿名) @索引:138
交易链接:https ://bscscan.com/tx/0xb2f52bbba331661371279c8b9aaf0aa412489c1ea5d5e218c215c7335a2f8f99