1

I'm trying to make a sendTransaction json rpc call and I don't know how to calculate the data paramether.

From the documentation:

data: DATA - The compiled code of a contract OR the hash of the invoked method signature and encoded parameters. For details see Ethereum Contract ABI 

There is no specification how this should be made: the hash of the invoked method signature and encoded parameters

1 Answer 1

0

Yes, there's an Application Binary Interface Specification

The Application Binary Interface is the standard way to interact with contracts in the Ethereum ecosystem, both from outside the blockchain and for contract-to-contract interaction. Data is encoded according to its type, as described in this specification. The encoding is not self describing and thus requires a schema in order to decode.

There are several questions here about it:

6
  • Yeah but I'm not trying to communicate with a contract just a simple eth transfer.. Commented Mar 28, 2018 at 7:11
  • That is really easy, data should be empty. Commented Mar 28, 2018 at 14:24
  • So its an none optional paramether but it has to be empty? Commented Mar 29, 2018 at 18:23
  • 1
    Sorry, I didn't express myself correctly, I meant it can be empty. Usualy an empty data is enough, but you can embed any string there. Some application use data to embed a transaction id for example. Commented Mar 29, 2018 at 20:31
  • Sorry, coming in late. Could you invoke another method from a smart contract (using the data field) thus deceiving the transfer the user thought it was signing? I am afraid after signing such a message. Or is it purely informative in the case of this kind of transaction? Thanks Commented Nov 29, 2021 at 22:18

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.