Solidity 进阶
这里介绍 Solidity 的进阶概念。
单位 - unit
全局变量/全局函数
Block 及 Transaction 处理
// 为兼容提供,在 TVM 中无具体意义
block.difficulty (uint): current block difficulty
gasleft() returns (uint256): remaining gas
block.gaslimit (uint): current block gaslimit
tx.gasprice (uint): gas price of the transaction
blockhash(uint blockNumber) returns (bytes32): hash of the given block - only works for 256 most recent, excluding current, blocks
block.coinbase (address payable): current block miner’s address
block.number (uint): current block number
block.timestamp (uint): current block timestamp as seconds since unix epoch
msg.data (bytes calldata): complete calldata
msg.sender (address payable): sender of the message (current call)
msg.sig (bytes4): first four bytes of the calldata (i.e. function identifier)
msg.value (uint): number of wei sent with the message
msg.tokenvalue (uint): TRC10 token value
msg.tokenid (trcToken): TRC10 token 10
now (uint): current block timestamp (alias for block.timestamp)
tx.origin (address payable): sender of the transaction (full call chain)address 成员函数
ABI Encoding and Decoding Functions
错误处理
数学和加密函数
内联汇编 - assembly
内部交易 - inline transaction / internal transaction
最后更新于