0

With web3, you can call read-only functions using 'call()' (eg, balanceOf), and functions that mutate state with 'send({from: adr, value: 10})'

I'm able to call payable and non-payable functions fine, but I have one function that is non-payable but mutates state (mints new coins).

If I call using 'call({from: adr})' it "works" and returns the right value to be minted, but the state doesn't change (nothing actually gets minted).

If I call using 'send({from: adr})' or 'send({from: adr, value: 0})', I get;

Error: Returned error: The method eth_sendTransaction does not exist/is not available

Any ideas on what's happening? The function works fine when calling in Remix IDE.

4
  • What library/framework are you using to make this call? Web3.js?
    – Filip
    Jul 22, 2021 at 7:17
  • Web3, that's correect Jul 22, 2021 at 23:48
  • Are you connected to a web3 provider?
    – Filip
    Jul 23, 2021 at 4:30
  • Yes, like I said, I can call and send normally. It's just methods that aren't payable but mutate state that I can't call/send Jul 24, 2021 at 0:43

0

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.