0

How can i find the value of erc20 token in a transaction using the hash generated? I can't seem to find answers anywhere.

Edit:
I found that it is possible to use w.eth.getTransactionReceipt('0xxxxxHashValue') and then int('0x0000000000000000000000000000000000000000000000000000000000000050',0) from the log value of the result to get the amount of token sent.

However, i am still confused as to how to achieve this using PHP.

0

Partial answer, in an ethereum transaction there is a data field used for interacting with the smartcontract address. So if you're looking for an amount of erc-20 token using the hash of a transaction, it could mean you probably want to know the amount of an erc-20 token transfered by a specific transaction using its hash:

  • I would investigate the data or input field using either the web3ethgettransaction
  • Investigate at the log receipt with the getTransactionReceipt

If your goal is to know the actual balance of an ethereum account, you should read the smartcontract using an ethereum address, either the sender or the beneficiary depending on your use case.

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.