Developers Forum for XinFin XDC Network

Shreyash Tripathi
Shreyash Tripathi

Posted on • Updated on

failing while calling a function in smart contract using web3.js

Hello,

so i have been trying to hit a function in the smart contract deployed on the XDC mainnet using the web3.js for my dapp " Edubuk", here is what i am trying to build and do.

I am tring to register a file on IPFS and then catch the CID to register it in the next step, automated in JS code (backend), on the blockchain using the smart contract function. When I hit the register button it prmpts the metamask and the contract interaction is done successfully txn hash is also received. But the the backend crashes and stops with error of " Error while executing a function inside the smart contract". Inside the smart contract we did the transaction and the function ran smoothly on the remix IDE as the file gets successfully registered and we can verify the file also in the blockchain. Also I would like to add that from the backend the files are successfully added in the IPFS data base and we can see their CID as well and fetched at out terminal too. I am now struck at this issue of why this error is persistent and what can be possible error.

I tried to increase the gasPrice to : 12500000000 wie.

If anyone can suggest the possible error and also you can take reference from the product demo video below along the error.

Video link: https://drive.google.com/file/d/1EQMO6RASh-OX3-SmY8VRdwLNnM5AKG1p/view?usp=sharing ( refer to last 10:52 to 20:37 )

I can share the functions also if needed.

You can happily connect with me on: shreyash@edubukeseal.org

Thanks,
Shreyash

Discussion (1)

Collapse
juklee0ira profile image
JukLee0ira

Hello Shreyash,
Thank you for your response. We will reproduce the error and resolve it as soon as possible. If you have any further information about the error, please contact me at:
jukhaalee@gmail.com