I have used the following code successfully:

contractInstance.PublicStateVariable.call((e, r) => {
    if(e) {
        //handle the error
    } else {
        //handle the response

Let's say I've got 50 different PublicStateVariable, should I write 50 different call methods for each one of them?

  • If you're on a recent truffle version then you can get rid of the .call. – goodvibration May 4 '18 at 12:26
  • I'm on a text editor. I've managed to get the value of the public state variable by calling "web3.eth.call{{to:"address", data:"variable getter hash"}, callback()}" But now I don't know how to decode the output given that I can't know the returned type in advance – cAos May 4 '18 at 12:43
  • If youn can post your contract code, that would help more. – Kaki Master Of Time May 4 '18 at 16:06
  • Kaki you should read the question carefully – cAos May 4 '18 at 16:38

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.