【问题标题】:How to identify an Ethereum smart contract transfer using RPC / web3 / ether.js?如何使用 RPC/web3/ether.js 识别以太坊智能合约转账?
【发布时间】:2019-04-02 08:55:36
【问题描述】:

如果

1) 钱包 A 将 1 个以太币转入智能合约 B

同时

2) 智能合约 B 将以太币转移到钱包 C

A->B->C

使用eth_getTransactionReceipt,如何查看已发送到钱包C的金额?

【问题讨论】:

    标签: blockchain ethereum web3 ether


    【解决方案1】:

    为了使用 eth_getTransactionReceipt 方法,您需要 b -> c 转账的 TX 编号。您可以通过多种方式获取 TX,但通常是发出事件的方式。获得 TX 后,您可以如下调用:

    curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["<TX number goes here>"],"id":1}'
    

    链接自:https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionreceipt

    【讨论】:

      猜你喜欢
      • 2019-04-07
      • 2021-09-29
      • 1970-01-01
      • 2018-07-22
      • 2021-02-24
      • 1970-01-01
      • 2022-06-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多