0

I'm having trouble doing an RPC call using polkadot.js.

My contract is here: https://github.com/kanishkatn/ink-test/tree/master/flipper

I tried making the RPC call using the selector from metadata.json. But, it always throws this error

{
  gasConsumed: 0
  gasRequired: 0
  storageDeposit: {
    Charge: 0
  }
  debugMessage: 
  result: {
    Err: {
      Module: {
        index: 7
        error: 0x02000000
      }
    }
  }
}

I also wrote my own client, it throws the same error as well. My client is here: https://github.com/kanishkatn/ink-test/tree/master/client

The instantiate call works properly on polkadot.js/apps as well as contracts-ui. I'm able to call other methods in contracts-ui as well. So, clearly I haven't understood how the selector and the data works in call.

What did I do wrong?

1 Answer 1

4

Looks like your gasLimit is too low. Increase gas limit or simply set it to -1 which will use max. gas available.

1
  • That was it. Thank you!
    – Kanishka
    Jul 28, 2022 at 17:29

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.