1

Low level function calls work in Truffle, Solidity is not the problem.
Other method invocations are working with the JS and HTML.
This is my first attempt at using .call instead of .send; I am not sure why I am getting this error.
For the record, I am using Web3 1.x

ERROR:

Error: Returned values aren't valid, did it run Out of Gas?

JS:

await this.KYCinstance.methods.readFraud(fraudID).call({from:this.accounts[0], gas:3000000});

SOLIDITY:

function readFraud (uint256 fraudID) external view returns(address, string memory, string memory, uint256, uint256) {
    Fraud memory fraud = frauds[fraudID];
    return(fraud.bank, fraud.accountNumber, fraud.routingNumber, fraud.amount, fraud.timestamp);
}   
2
  • can you provide more js code like your contract address and your account address that calling function? Commented Feb 23, 2019 at 4:06
  • which exact version of web3 are u using? I had similar problems with web3-beta41, solved by updating to web3-beta46 Commented Feb 23, 2019 at 8:56

1 Answer 1

1

This all was easy to fix.

The address that was being pointed to by MetaMask was not the valid address for this blockchain, so the return value was an error since fraud[0] didn't exist.

I redeployed the contracts using truffle console --network <my_network>, migrate --reset.

Everything works as expected now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.