在Rinkeby网络中检查交易时,我会面临问题。
概述:我有一个交易哈希(TXHASH),所以我想知道用户是否以特定的数量从钱包转移到我的钱包。
因此,我连接到RPC并拥有提供商,我通过使用getTransactionReceipt函数获得了交易的完整信息,并使用ABI JSON来解析编码的数据,
但是,有些交易具有1个日志,其他人有2个日志,3,4 ...日志,交易的价值数量在响应的日志中,那么我现在该怎么办? check data at logs[0] or foreach the logs and find the right log
For example,
我有1个日志,交易成功
https://rinkeby.etherscan .io/tx/0x9305efb42f70d4289fcf39c6f8377855deeef512b12af654f31815a714722186#eventlog
我有4个日志,交易成功,但没有显示细节
I am facing a problem when checking a transaction in the Rinkeby network.
Overview: I have a transaction hash (txHash), so I want to know if users transfer from their wallet to my wallet with a specific amount.
So I connect to rpc and have the provider, I got the full info of transaction by using getTransactionreceipt function, and use abi json to parse the data encoded,
BUT, some transaction have 1 logs, others has 2,3,4... logs, and the value amount of transaction is in logs of response, so what should I do now? check data at logs[0] or foreach the logs and find the right log
For example,
https://rinkeby.etherscan.io/tx/0xd0296c60df12ccdcdb5fab3d61c4c05c22820d543a76bf741b4ee6f8565f3327
I get 0 logs , transaction success

https://rinkeby.etherscan.io/tx/0x50df0b293537ab076b7738fe6205239bf1a3e39510667d5ffe20d4dbb7b0fc09
I get 1 logs , transaction success

https://rinkeby.etherscan.io/tx/0x9305efb42f70d4289fcf39c6f8377855deeef512b12af654f31815a714722186#eventlog
I get 4 logs , transaction success but not show detail

发布评论
评论(1)
以我的经验,交易有两种不显示日志的可能性,一个是收件人不是合同,另一个是合同的创建者不使用事件函数作为您所调用的方法。 :)
In my experience, there are two possibilities for transactions not to show logs, one is that the recipient is not a contract, and the other is that the creator of the contract doesn't use event functions for the methods you call. :)