1
    #[ink(message)]
    pub fn dummy_function(
        &mut self,
        value: u64,
    ) -> u64 {
        debug_println!("inside user contract dummy_function");
        return 45 * value;
    }

This is my contract function that i was testing on rococo network. This basic txn is giving me outOfGas error. What are the possible issues I can have in my contract and how can i resolve them?

1
  • What version of ink!, cargo-contract are you running? If your code fails on local chain too, what is the version of substrate-contracts-node? Commented Feb 23, 2023 at 20:08

1 Answer 1

1

It's because of Insufficent Balance (i.e. ROC) in your account. You can get dummy ROC by using this element link. Just type !drip "your account key" and send message you will get 100 ROC. I have tested in ROCOCO network, haven't faced any issue.

enter image description here

3
  • 1
    I already have funds. Also I tried to execute flipper contract's flip function on rococo and local network. On both network I am getting Out of Gas Error. For get() function I am getting "{ Err: { Module: { index: 7 error: 0x02000000 } } }" error Commented Jan 24, 2023 at 12:30
  • 4
    I think you have used polkadot.js yes? as per this response by @P.Ossun he stated that weightV2 isn't merged yet. So you can use this one. However, I have used contracts ui
    – go11li
    Commented Jan 24, 2023 at 13:17
  • use.ink docs now has a convenient webpage getting faucet tokens: use.ink/faucet Commented Feb 23, 2023 at 20:04

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.