send-crypto icon indicating copy to clipboard operation
send-crypto copied to clipboard

Returned error: The execution failed due to an exception.

Open alvin854 opened this issue 5 years ago • 1 comments

Code:

const CryptoAccount = require("send-crypto");
const keys = require("../../config/keys");

const account = new CryptoAccount(keys.privateKey, {
  network: "kovan"
});

account
  .send("0x868c75dFB5460797EB4cc12e60B1ab468439c337", 10, {
    type: "ERC20",
    address: keys.contractAddress
  })
  .catch(console.error);

Response:

Error: Returned error: The execution failed due to an exception.
    at Object.ErrorResponse (/Users/me/Desktop/myproject/node_modules/web3-core-helpers/src/errors.js:29:16)
    at /Users/me/Desktop/myproject/node_modules/web3-core-requestmanager/src/index.js:140:36
    at XMLHttpRequest.request.onreadystatechange (/Users/me/Desktop/myproject/node_modules/web3-providers-http/src/index.js:110:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/me/Desktop/myproject/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
    at XMLHttpRequest._setReadyState (/Users/me/Desktop/myproject/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
    at XMLHttpRequest._onHttpResponseEnd (/Users/me/Desktop/myproject/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
    at IncomingMessage.<anonymous> (/Users/me/Desktop/myproject/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
    at IncomingMessage.emit (events.js:323:22)
    at endReadableNT (_stream_readable.js:1204:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

Error object from /node_modules/web3-core-helpers/src/errors.js:29:16

{
  jsonrpc: '2.0',
  id: 2,
  error: {
    code: -32016,
    data: 'Reverted',
    message: 'The execution failed due to an exception.'
  }
}

alvin854 avatar Apr 14 '20 06:04 alvin854

You ever get this figured out?

ccoop1 avatar Sep 24 '21 03:09 ccoop1