SystemContext
Abstract0x000000000000000000000000000000000000800b
Solidity v0.8.20+commit.a1b79de6
Overview
Read Functions
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns the hash of the given batch.
Parameters
| Name | Type | Description |
|---|---|---|
| _blockNumber | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| hash | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | address |
Returns the current batch's number and timestamp.
Returns
| Name | Type | Description |
|---|---|---|
| blockInfo | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns the hash of the given batch.
Parameters
| Name | Type | Description |
|---|---|---|
| _batchNumber | uint256 | The number of the batch. |
Returns
| Name | Type | Description |
|---|---|---|
| hash | bytes32 | hash The hash of the batch. |
Returns the current batch's number and timestamp.
Returns
| Name | Type | Description |
|---|---|---|
| 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.
Parameters
| Name | Type | Description |
|---|---|---|
| _block | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| hash | bytes32 | hash The blockhash of the block with the given number. |
Returns the current L2 block's number.
Returns
| Name | Type | Description |
|---|---|---|
| — | uint128 | blockNumber The current L2 block's number. |
Returns the current batch's number and timestamp.
Returns
| Name | Type | Description |
|---|---|---|
| blockNumber | uint256 | |
| blockTimestamp | uint256 |
Returns the current L2 block's timestamp.
Returns
| Name | Type | Description |
|---|---|---|
| — | uint128 | timestamp The current L2 block's timestamp. |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns the current block's number and timestamp.
Returns
| Name | Type | Description |
|---|---|---|
| blockNumber | uint128 | blockNumber and blockTimestamp tuple of the current L2 block's number and the current block's timestamp |
| blockTimestamp | uint128 |
Returns
| Name | Type | Description |
|---|---|---|
| — | address |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint16 |
Write Functions
Appends the transaction hash to the rolling hash of the current L2 block.
Parameters
| Name | Type | Description |
|---|---|---|
| _txHash | bytes32 | The hash of the transaction. |
Publishes L2->L1 logs needed to verify the validity of this batch on L1.
Set the chainId origin.
Parameters
| Name | Type | Description |
|---|---|---|
| _newChainId | uint256 | The chainId |
Set the the current gas price.
Parameters
| Name | Type | Description |
|---|---|---|
| _gasPrice | uint256 | The new tx gasPrice. |
Sets the current block number and timestamp of the L2 block.
Parameters
| Name | Type | Description |
|---|---|---|
| _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
Parameters
| Name | Type | Description |
|---|---|---|
| _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.
Parameters
| Name | Type | Description |
|---|---|---|
| _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.
Parameters
| Name | Type | Description |
|---|---|---|
| _newOrigin | address | The new tx origin. |
A testing method that manually sets the current blocks' number and timestamp.
Parameters
| Name | Type | Description |
|---|---|---|
| _newTimestamp | uint256 | |
| _number | uint256 | |
| _baseFee | uint256 |