Skip to content
Verified contractPartialMIT

EraChainTypeManager

Address0xe642b64ac222503573ffbebfbd7bb7f072c99ef7
Balance

0 ETH

 

Transactions

0

 

Compiler

solc 0.8.28

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.28+commit.7893614a
Language
solidity
Optimization
Yes, 9,999,999 runs
EVM version
prague
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,378,190
Creation transaction
0x087d522567…f55d378cbe

83 files

The source code is large: one file is shown at a time. Choose a file in the list.

contracts/common/interfaces/ISystemContext.sol

// SPDX-License-Identifier: MIT
// We use a floating point pragma here so it can be used within other projects that interact with the ZKsync ecosystem without using our exact pragma version.
pragma solidity ^0.8.20;

/**
 * @author Matter Labs
 * @custom:security-contact [email protected]
 * @notice Contract that stores some of the context variables, that may be either
 * block-scoped, tx-scoped or system-wide.
 */
interface ISystemContext {
    struct BlockInfo {
        uint128 timestamp;
        uint128 number;
    }

    /// @notice A structure representing the timeline for the upgrade from the batch numbers to the L2 block numbers.
    /// @dev It will be used for the L1 batch -> L2 block migration in Q3 2023 only.
    struct VirtualBlockUpgradeInfo {
        /// @notice In order to maintain consistent results for `blockhash` requests, we'll
        /// have to remember the number of the batch when the upgrade to the virtual blocks has been done.
        /// The hashes for virtual blocks before the upgrade are identical to the hashes of the corresponding batches.
        uint128 virtualBlockStartBatch;
        /// @notice L2 block when the virtual blocks have caught up with the L2 blocks. Starting from this block,
        /// all the information returned to users for block.timestamp/number, etc should be the information about the L2 blocks and
        /// not virtual blocks.
        uint128 virtualBlockFinishL2Block;
    }

    function chainId() external view returns (uint256);

    function origin() external view returns (address);

    function gasPrice() external view returns (uint256);

    function blockGasLimit() external view returns (uint256);

    function coinbase() external view returns (address);

    function difficulty() external view returns (uint256);

    function baseFee() external view returns (uint256);

    function currentSettlementLayerChainId() external view returns (uint256);

    function txNumberInBlock() external view returns (uint16);

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

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

    function getBlockNumber() external view returns (uint128);

    function getBlockTimestamp() external view returns (uint128);

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

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

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

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

    function setChainId(uint256 _newChainId) external;
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "runs": 9999999,
    "enabled": true
  },
  "evmVersion": "prague",
  "remappings": [
    "@ensdomains/=node_modules/@ensdomains/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "eth-gas-reporter/=node_modules/eth-gas-reporter/",
    "forge-std/=lib/forge-std/src/",
    "hardhat/=node_modules/hardhat/",
    "murky/=lib/murky/src/",
    "foundry-test/=test/foundry/",
    "l2-contracts/=../l2-contracts/contracts/",
    "system-contracts/=../system-contracts/",
    "@openzeppelin/contracts-v4/=lib/openzeppelin-contracts-v4/contracts/",
    "@openzeppelin/contracts-upgradeable-v4/=lib/openzeppelin-contracts-upgradeable-v4/contracts/",
    "test-utils/=test/foundry/l1/integration/utils/",
    "openzeppelin-contracts-upgradeable-v4/=lib/openzeppelin-contracts-upgradeable-v4/",
    "openzeppelin-contracts-v4/=lib/openzeppelin-contracts-v4/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.