1

I can call payable functions that mutate the state of the contract just fine. I cannot call non-payable functions that mutate the state.

The problem isn't the function, I can call it fine on Remix IDE.

await contract.methods.test().send({from:account}).catch(err=>console.log(err))

What am I doing wrong?

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • 1
    Does this answer your question? [Error: The method eth\_sendTransaction does not exist/is not available](https://stackoverflow.com/questions/55154713/error-the-method-eth-sendtransaction-does-not-exist-is-not-available) – Petr Hejda Jul 25 '21 at 15:45

1 Answers1

1

You need to pass 0 to value parameter.

contract.methods.test().send({from:account, value: 0})

Ferit
  • 8,692
  • 8
  • 34
  • 59