type
status
date
slug
summary
tags
category
icon
password
Txs, Traces, Logs
Transactions:Etherscan(dune中为ethereum.transactions)
- Transaction Hash:是以下所有变量放在一起的哈希值,是该tx唯一的标识
- Status:包括<Failed>, <Cancelled>, <Dropped>, <Replaced>
- Block:包含该tx的区块号码
- Timestamp:略
- From:签署tx的账户地址
- To:目标合约的地址(可以是合约地址或EOA地址,如果该合约是contract depolyer就为空)
- Value:从“From”地址转出的ETH数量,该ETH的接收者只能通过Internal txs(traces)来查询
- Transaction Fee:=(gas used * gas price) / 1e18 执行该交易所交的gas费(如果是L2,这个字段会有所不同,比如Arb上叫Effective Price
- Gas Price:每单位gas的价格
- Gas Limit:这笔tx最多能消耗的gas unit数量,如果tx消耗的gas unit超出Gas Limit,那么交易将失败(且这笔失败的交易的gas费将不能返还
- Usage by Tx:实际消耗的gas unit数量(不超出gas limit)
- Gas Fees:
Base fee,所在的区块内的交易所需的base fee(被销毁)
Max fee,这笔交易用户所能提供的最大费用
Max Priority,用户能提供的最大小费,不包含base fee(给矿工)
即用户最终提交的是 Base + Priority,Base被销毁,Priority给矿工
- Tx Type:1是在EIP-1559前的交易,2是1559后的交易
- Nonce:钱包的每一笔交易必须要有不同的Nonce
- Position In Block:在区块内该交易的执行排序
- Input data
如果是EOA和EOA之间的交易,Input data就像一个message。如果”to“地址是合约地址,那Input data就代表被调用的合约中的某个被调用的函数。此时Input Data的前8个字符是函数签名

Event Logs:Etherscan(Dune中为ethereum.logs)
Topics:
左上角的28是事件在整个块中的index
topic 0:32bytes,类似于函数签名
topic1 & topic2:更快的导出参数名和参数值(参数值用hex表示)
Data: 其它没有在合约中被标为indexed的参数名和参数值

Traces (Dune中为ethereum.traces)
Trace的类型:
- CREATE:this is a trace emitted when a new contract is deployed.
Check out the ethereum.creation_traces table for a simpler view of these.
- DELEGATECALL:委托调用,一般在分析trace时会被忽略
- CALL:this is the most common trace.可以是调用函数,也可以是transfer ETH
- STATICCALL:这是一个不修改任何状态的函数调用。像预言机价格反馈、AMM 价格计算、清算比率检查、余额检查等都发生在静态调用中。通常为view和pure函数
Trace可以在phalcon blocksec中查看:https://app.blocksec.com/explorer

- Author:Norrent Yu
- URL:http://blog.transnature.top/post/transactions-traces-logs
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts