SystemContext
Abstract0x000000000000000000000000000000000000800b
Solidity v0.8.20+commit.a1b79de6
概览
读取函数
Returns the current protocol base fee used to calculate transaction gas prices.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The current base fee in wei (uint256) used for gas price calculations.✨ AI |
Returns the current block gas limit.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The current block gas limit (maximum gas allowed for a block) as a uint256.✨ AI |
Returns the hash of the given batch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _blockNumber | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| hash | bytes32 |
Return the current chain ID.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The chain ID of the current blockchain as a uint256.✨ AI |
Return the address of the current block miner (coinbase).✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The address of the miner or validator for the current block (equivalent to block.coinbase).✨ AI |
Returns the current batch's number and timestamp.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| blockInfo | uint256 |
Return the current block difficulty as reported by the execution environment.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | Current block difficulty metric for the executing block, represented as a uint256.✨ AI |
Returns the configured gas cost charged per byte of public data (pubdata).✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The gas cost, as a uint256, charged for each byte of public calldata (pubdata).✨ AI |
Returns the current gas price (in wei) from the system context.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The current gas price in wei as a uint256.✨ AI |
Returns the hash of the given batch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _batchNumber | uint256 | The number of the batch. |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| hash | bytes32 | hash The hash of the batch. |
Returns the current batch's number and timestamp.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| batchNumber | uint128 | batchNumber and batchTimestamp tuple of the current batch's number and the current batch's timestamp |
| batchTimestamp | uint128 |
The method that emulates `blockhash` opcode in EVM.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _block | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| hash | bytes32 | hash The blockhash of the block with the given number. |
Returns the current L2 block's number.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint128 | blockNumber The current L2 block's number. |
Returns the current batch's number and timestamp.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| blockNumber | uint256 | |
| blockTimestamp | uint256 |
Returns the current L2 block's timestamp.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint128 | timestamp The current L2 block's timestamp. |
Returns the current pubdata cost used to calculate transaction fees.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | Current pubdata cost as a uint256 value denominated in wei for fee computation.✨ AI |
Return the amount of public data (pubdata) spent so far in the current transaction.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | Total pubdata consumed so far in the current transaction, expressed as a uint256 number of bytes.✨ AI |
Returns the current block's number and timestamp.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| blockNumber | uint128 | blockNumber and blockTimestamp tuple of the current L2 block's number and the current block's timestamp |
| blockTimestamp | uint128 |
Returns the address that originated the current transaction.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The address that originated the transaction (tx.origin).✨ AI |
Return the transaction's index within the current block as a uint16.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint16 | The transaction's index within the current block as a uint16 value.✨ AI |
写入函数
Appends the transaction hash to the rolling hash of the current L2 block.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _txHash | bytes32 | The hash of the transaction. |
Increment the transaction number tracked for the current batch.✨ AI
Publishes L2->L1 logs needed to verify the validity of this batch on L1.
Reset the transaction number counter for the current batch.✨ AI
Set the chainId origin.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _newChainId | uint256 | The chainId |
Set the the current gas price.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _gasPrice | uint256 | The new tx gasPrice. |
Sets the current block number and timestamp of the L2 block.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _l2BlockNumber | uint128 | The number of the new L2 block. |
| _l2BlockTimestamp | uint128 | The timestamp of the new L2 block. |
| _expectedPrevL2BlockHash | bytes32 | The expected hash of the previous L2 block. |
| _isFirstInBatch | bool | Whether this method is called for the first time in the batch. |
| _maxVirtualBlocksToCreate | uint128 | The maximum number of virtual block to create with this L2 block. |
Increments the current batch number and sets the new timestamp
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _prevBatchHash | bytes32 | The hash of the previous batch. |
| _newTimestamp | uint128 | The timestamp of the new batch. |
| _expectedNewNumber | uint128 | The new batch's number. |
| _baseFee | uint256 | The new batch's base fee |
Sets the number of L2 gas that is needed to pay a single byte of pubdata.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _gasPerPubdataByte | uint256 | The amount L2 gas that the operator charge the user for single byte of pubdata. |
| _basePubdataSpent | uint256 | The number of pubdata spent as of the start of the transaction. |
Set the current tx origin.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _newOrigin | address | The new tx origin. |
A testing method that manually sets the current blocks' number and timestamp.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| _newTimestamp | uint256 | |
| _number | uint256 | |
| _baseFee | uint256 |