我想了解以下事务哈希的详细信息:https://ropsten.etherscan.io/tx/0x8b43cf5e2c9d4eabb1121036de3d60354f64e9ccc6004caccba0e478c50ed2e6。Ropsten有一个API来获取事件的细节。我正在实现的事件是在sendBounty() (薄荷标记)中实现的:
function sendBounty(address _to, uint256 _tokens) returns (bool) {
require(_tokens + bountyCount < MAX_Bounty_Tokens );
bountyCount= bountyCount+_tokens;
mint(_to,_tokens);
}
function mint(address _to, uint256 _amount) public canMint returns (bool){
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}我想使用的API是https://ropsten.etherscan.io/apis#logs。
我无法理解术语topic0,topic1,topic2,topic3,以及如何使用它。(事先请求帮助和感谢:)
发布于 2018-11-28 12:11:54
日志的主题数组是日志表示的事件的参数列表,第一个主题是事件标识符。基本上,您必须使用契约ABI将日志转换为可读的事件。正如Olivers的评论使用Ropsten的事件API中所指出的那样,这个回答很能说明细节:https://ethereum.stackexchange.com/a/12951/48513
您可以使用https://github.com/ConsenSys/abi-decoder自己解码日志。
如果你不想经历这些麻烦,你可以看看https://eth.events (无耻的插头,我是首席技术官),只需搜索被翻译的事件:-)
https://ethereum.stackexchange.com/questions/58916
复制相似问题