0

I compiled my code on 0.6.6 solidity compiler and the code ABI for the function im calling is:

{ "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], "name": "getAssetIds", "outputs": [{ "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }

The code is deployed on Ropsten

web3 version is: 1.2.8

When I try getting data from getAssetIds function using the above ABI, I stuck into following error:

Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.

The code snippet im using to get data is:

var Contract = await new web3.eth.Contract(abi, contractAddress); 

Contract.methods.getLockedAsset(assetIds[i]).call().then(async(lockedAsset) => {
                        lockedAssets.push(lockedAsset);
                        next();


        });

Any help will be appreciated please. Thanks for your time reading the question.

  • You posted the ABI of function getAssetIds, but your code for calling function getLockedAsset. How exactly are we supposed to help you with that??? We would also need to see the actual code of the function (whichever it is you are having a problem with. Please reorganize your question. – goodvibration Jun 9 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.