0

I have a question concerning the data parameter of the json RPC method eth_sendTransaction.

Is it possible to send any kind of data structure with this method to a smart contract?

Is it possible to store the data send with this method on the blockchain then, by storing it in a variable within the smart contract code?

I am asking because when we can send any external data to the client, why the need of oracle's?

1 Answer 1

0

No, the data parameter needs to get the function selector (Example) and encoded arguments if needed when calling a method of a smart contract. It isn't used for like sending a custom string saying "Hi there" or so which then could be stored in a variable!

=> Have a look here under "Execute a Function on a Deployed Contract"

eth_sendTransaction() parameters

Parameters to call a function with eth_sendTransaction()

1
  • But can't I send the string as arguments encoded?
    – Jwf
    Mar 12, 2021 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.