区块和交易属性

区块和交易属性

1、 blockhash(uint blockNumber) returns (bytes32):
指定区块的区块哈希 —— 仅可用于最新的 256 个区块且不包括当前区块,否则返回 0 。

2、block.basefee (uint):
当前区块的基础费用,参考: (EIP-3198 和 EIP-1559)

3、block.chainid (uint):
当前链 id

4、block.coinbase ( address ):
挖出当前区块的矿工地址

5、block.difficulty ( uint ):
当前区块难度

6、block.gaslimit ( uint ):
当前区块 gas 限额

7、block.number ( uint ):
当前区块号

8、block.timestamp ( uint):
自 unix epoch 起始当前区块以秒计的时间戳

9、gasleft() returns (uint256) :
剩余的 gas

10、msg.data ( bytes ):
完整的 calldata

11、msg.sender ( address ):
消息发送者(当前调用)

12、msg.sig ( bytes4 ):
calldata 的前 4 字节(也就是函数标识符)

13、msg.value ( uint ):
随消息发送的 wei 的数量

14、tx.gasprice (uint):
交易的 gas 价格

15、tx.origin ( address ):
交易发起者(完全的调用链)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值