esaulpaugh / headlong

High-performance Contract ABI and RLP for Ethereum
Apache License 2.0
76 stars 20 forks source link

ask for helf #27

Closed zouqingfeng closed 3 years ago

zouqingfeng commented 3 years ago

Can you tell me the process of calling ABIV2 contract function on the chain of blocks ?

esaulpaugh commented 3 years ago

function arguments are encoded into calldata. that's what headlong does.

Other tools can encode and sign the transaction that contains the calldata. then the transaction has to be broadcast to the network by an ethereum node.

web3j can be used to do the transaction encoding and broadcasting

zouqingfeng commented 3 years ago

so , I can use web3j to call on ethereum node and then get headlong to call funtion. Finally , do the transaction by web3j . That right ?

esaulpaugh commented 3 years ago

broadcasting through an ethereum node is the final step. encoding the function call with headlong should be the first step.

web3j docs say they have "Support for Alchemy and Infura, so you don't have to run an Ethereum client yourself"