ISystemContext

Git Source

Author: Matter Labs

Contract that stores some of the context variables, that may be either block-scoped, tx-scoped or system-wide.

Note: security-contact: security@matterlabs.dev

Functions

chainId

function chainId() external view returns (uint256);

origin

function origin() external view returns (address);

gasPrice

function gasPrice() external view returns (uint256);

blockGasLimit

function blockGasLimit() external view returns (uint256);

coinbase

function coinbase() external view returns (address);

difficulty

function difficulty() external view returns (uint256);

baseFee

function baseFee() external view returns (uint256);

txNumberInBlock

function txNumberInBlock() external view returns (uint16);

getBlockHashEVM

function getBlockHashEVM(uint256 _block) external view returns (bytes32);

getBatchHash

function getBatchHash(uint256 _batchNumber)
  external
  view
  returns (bytes32 hash);

getBlockNumber

function getBlockNumber() external view returns (uint128);

getBlockTimestamp

function getBlockTimestamp() external view returns (uint128);

getBatchNumberAndTimestamp

function getBatchNumberAndTimestamp()
  external
  view
  returns (uint128 blockNumber, uint128 blockTimestamp);

getL2BlockNumberAndTimestamp

function getL2BlockNumberAndTimestamp()
  external
  view
  returns (uint128 blockNumber, uint128 blockTimestamp);

gasPerPubdataByte

function gasPerPubdataByte() external view returns (uint256 gasPerPubdataByte);

getCurrentPubdataSpent

function getCurrentPubdataSpent()
  external
  view
  returns (uint256 currentPubdataSpent);

setChainId

function setChainId(uint256 _newChainId) external;

Structs

BlockInfo

struct BlockInfo {
  uint128 timestamp;
  uint128 number;
}

VirtualBlockUpgradeInfo

A structure representing the timeline for the upgrade from the batch numbers to the L2 block numbers.

It will be used for the L1 batch -> L2 block migration in Q3 2023 only.

struct VirtualBlockUpgradeInfo {
  uint128 virtualBlockStartBatch;
  uint128 virtualBlockFinishL2Block;
}