Hello Everyone, I am new to Solidity and blockchain and have came across a small problem

In my App.js file, I typed the following

contract.methods.addImage(hash).send({from:'THE_ADDRESS'},(res)=>{console.log(res)})

Here contract is reference to the smart contract created and deployed in Ganache. But the above is giving the following error

Error: "Node error: {"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0xff2be8b00363a7fc0ab0fc4958b87d12314f9d8967696e16af38ff4ed6052e8f":{"error":"revert","program_counter":103,"return":"0x"},"stack":"Error: \n at Function.RuntimeError.fromResults (/tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/lib/utils/runtimeerror.js:89:13)\n at /tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/lib/blockchain_double.js:604:28\n at /tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/async/internal/once.js:12:16\n at replenish (/tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/async/internal/eachOfLimit.js:61:25)\n at /tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/async/internal/eachOfLimit.js:71:9\n at eachLimit (/tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/async/eachLimit.js:43:36)\n at /tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/async/internal/doLimit.js:9:16\n at VM.AsyncEventEmitter.emit (/tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/async-eventemitter/lib/AsyncEventEmitter.js:42:3)\n at afterBlock (/tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/ethereumjs-vm/dist/runBlock.js:75:10)\n at /tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/ethereumjs-vm/dist/runBlock.js:252:9\n at /tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/ethereumjs-vm/dist/state/stateManager.js:426:9\n at /tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/async/dist/async.js:969:16\n at next (/tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/async/dist/async.js:5225:18)\n at /tmp/.mount_ganachB8189y/resources/app.asar/node_modules/ganache-core/node_modules/async/dist/async.js:119:16\n at _combinedTickCallback (internal/process/next_tick.js:131:7)\n at process._tickCallback (internal/process/next_tick.js:180:9)","name":"RuntimeError"}}"

Apr 8, 2020, 10:26 PM
Someone please help me with this error
Apr 8, 2020, 10:27 PM

© 2024 Draquery.com All rights reserved.