$> Kaya
~/tools/event-log-decoder可交互
/tools/event-log-decoder

事件日志解码工具

这个事件日志解码工具可以结合 Solidity 事件片段,对 Ethereum 的 topics 和 data 做解码并还原事件参数。

~/tools/event-log-decoderInterface.parseLog
事件日志解码结果
~/tools/event-log-decoder/examplesusage.txt

使用示例

  • 把 ERC-20 Transfer 事件的 topics 和 data 解码为可读值。
  • 调试日志时区分 indexed 和非 indexed 事件参数。
  • 检查合约事件是否真的发出了前端预期的数值。
~/tools/event-log-decoder/guideREADME.md

事件日志解码工具说明

事件日志解码工具适合在你已经知道事件定义的前提下,查看一条 Ethereum log 里真实记录了什么。你输入 Solidity 事件片段、topics 和 data 后,工具会把事件参数还原为可读结果。它对区块浏览器日志检查、链上监控、前端日志调试和合约审计都很有帮助。由于 Ethereum 事件把 indexed 参数放在 topics、其余参数放在 data 中,手工解析很容易出错,用工具直接查看会快很多。

~/tools/event-log-decoder/faq3 items

常见问题

Ethereum 日志里的 topics 是什么?

Topics 是定长字段,用来存放事件签名以及被标记为 indexed 的事件参数。

为什么一定要有精确事件片段?

因为事件解码依赖正确的参数顺序、类型和 indexed 配置,定义不对就无法准确还原。

能同时解码 indexed 和非 indexed 参数吗?

可以。只要事件片段匹配,工具会结合 topics 和 data 一起还原完整参数。

~/tools/event-log-decoder/related5 links
~/tools/event-log-decoder/links站内