ETH Price: $2,793.07 (+4.05%)
    /

    Contract

    0x0000000000000000000000000000000000008005

    Overview

    ETH Balance

    0 ETH

    ETH Value

    $0.00

    More Info

    Private Name Tags

    ContractCreator

    GENESIS at txn GENESIS_0000000000000000000000000000000000008005

    Multichain Info

    No addresses found
    Transaction Hash
    Method
    Block
    Age
    From
    To
    GENESIS_00000000000000000000000000000000000080050x000100000-
    GENESIS
    IN
    Create: ImmutableSimulator
     
    0 ETH00

    Parent Transaction Hash Block Age From To Amount
    View All Internal Transactions
    Loading...
    Loading

    Contract Source Code Verified (Genesis Bytecode Match Only)

    Contract Name:
    ImmutableSimulator

    Compiler Version
    v0.8.20+commit.a1b79de6

    ZkSolc Version
    v1.5.0

    Optimization Enabled:
    Yes with Mode 3

    Other Settings:
    default evmVersion, MIT license
    File 1 of 25 : ImmutableSimulator.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    import {IImmutableSimulator, ImmutableData} from "./interfaces/IImmutableSimulator.sol";
    import {DEPLOYER_SYSTEM_CONTRACT} from "./Constants.sol";
    /**
    * @author Matter Labs
    * @custom:security-contact security@matterlabs.dev
    * @notice System smart contract that simulates the behavior of immutable variables in Solidity.
    * @dev The contract stores the immutable variables created during deployment by other contracts on his storage.
    * @dev This simulator is needed so that smart contracts with the same Solidity code but different
    * constructor parameters have the same bytecode.
    * @dev The users are not expected to call this contract directly, only indirectly via the compiler simulations
    * for the immutable variables in Solidity.
    */
    contract ImmutableSimulator is IImmutableSimulator {
    /// @dev mapping (contract address) => (index of immutable variable) => value
    /// @notice that address uses `uint256` type to leave the option to introduce 32-byte address space in future.
    mapping(uint256 contractAddress => mapping(uint256 index => bytes32 value)) internal immutableDataStorage;
    /// @notice Method that returns the immutable with a certain index for a user.
    /// @param _dest The address which the immutable belongs to.
    /// @param _index The index of the immutable.
    /// @return The value of the immutables.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 2 of 25 : IImmutableSimulator.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    struct ImmutableData {
    uint256 index;
    bytes32 value;
    }
    interface IImmutableSimulator {
    function getImmutable(address _dest, uint256 _index) external view returns (bytes32);
    function setImmutables(address _dest, ImmutableData[] calldata _immutables) external;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 3 of 25 : Constants.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    import {IAccountCodeStorage} from "./interfaces/IAccountCodeStorage.sol";
    import {INonceHolder} from "./interfaces/INonceHolder.sol";
    import {IContractDeployer} from "./interfaces/IContractDeployer.sol";
    import {IKnownCodesStorage} from "./interfaces/IKnownCodesStorage.sol";
    import {IImmutableSimulator} from "./interfaces/IImmutableSimulator.sol";
    import {IBaseToken} from "./interfaces/IBaseToken.sol";
    import {IL1Messenger} from "./interfaces/IL1Messenger.sol";
    import {ISystemContext} from "./interfaces/ISystemContext.sol";
    import {ICompressor} from "./interfaces/ICompressor.sol";
    import {IComplexUpgrader} from "./interfaces/IComplexUpgrader.sol";
    import {IBootloaderUtilities} from "./interfaces/IBootloaderUtilities.sol";
    import {IPubdataChunkPublisher} from "./interfaces/IPubdataChunkPublisher.sol";
    /// @dev All the system contracts introduced by zkSync have their addresses
    /// started from 2^15 in order to avoid collision with Ethereum precompiles.
    uint160 constant SYSTEM_CONTRACTS_OFFSET = 0x8000; // 2^15
    /// @dev Unlike the value above, it is not overridden for the purpose of testing and
    /// is identical to the constant value actually used as the system contracts offset on
    /// mainnet.
    uint160 constant REAL_SYSTEM_CONTRACTS_OFFSET = 0x8000;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 4 of 25 : IAccountCodeStorage.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    interface IAccountCodeStorage {
    function storeAccountConstructingCodeHash(address _address, bytes32 _hash) external;
    function storeAccountConstructedCodeHash(address _address, bytes32 _hash) external;
    function markAccountCodeHashAsConstructed(address _address) external;
    function getRawCodeHash(address _address) external view returns (bytes32 codeHash);
    function getCodeHash(uint256 _input) external view returns (bytes32 codeHash);
    function getCodeSize(uint256 _input) external view returns (uint256 codeSize);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 5 of 25 : INonceHolder.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    /**
    * @author Matter Labs
    * @dev Interface of the nonce holder contract -- a contract used by the system to ensure
    * that there is always a unique identifier for a transaction with a particular account (we call it nonce).
    * In other words, the pair of (address, nonce) should always be unique.
    * @dev Custom accounts should use methods of this contract to store nonces or other possible unique identifiers
    * for the transaction.
    */
    interface INonceHolder {
    event ValueSetUnderNonce(address indexed accountAddress, uint256 indexed key, uint256 value);
    /// @dev Returns the current minimal nonce for account.
    function getMinNonce(address _address) external view returns (uint256);
    /// @dev Returns the raw version of the current minimal nonce
    /// (equal to minNonce + 2^128 * deployment nonce).
    function getRawNonce(address _address) external view returns (uint256);
    /// @dev Increases the minimal nonce for the msg.sender.
    function increaseMinNonce(uint256 _value) external returns (uint256);
    /// @dev Sets the nonce value `key` as used.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 6 of 25 : IContractDeployer.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    interface IContractDeployer {
    /// @notice Defines the version of the account abstraction protocol
    /// that a contract claims to follow.
    /// - `None` means that the account is just a contract and it should never be interacted
    /// with as a custom account
    /// - `Version1` means that the account follows the first version of the account abstraction protocol
    enum AccountAbstractionVersion {
    None,
    Version1
    }
    /// @notice Defines the nonce ordering used by the account
    /// - `Sequential` means that it is expected that the nonces are monotonic and increment by 1
    /// at a time (the same as EOAs).
    /// - `Arbitrary` means that the nonces for the accounts can be arbitrary. The operator
    /// should serve the transactions from such an account on a first-come-first-serve basis.
    /// @dev This ordering is more of a suggestion to the operator on how the AA expects its transactions
    /// to be processed and is not considered as a system invariant.
    enum AccountNonceOrdering {
    Sequential,
    Arbitrary
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 7 of 25 : IKnownCodesStorage.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    /**
    * @author Matter Labs
    * @custom:security-contact security@matterlabs.dev
    * @notice The interface for the KnownCodesStorage contract, which is responsible
    * for storing the hashes of the bytecodes that have been published to the network.
    */
    interface IKnownCodesStorage {
    event MarkedAsKnown(bytes32 indexed bytecodeHash, bool indexed sendBytecodeToL1);
    function markFactoryDeps(bool _shouldSendToL1, bytes32[] calldata _hashes) external;
    function markBytecodeAsPublished(bytes32 _bytecodeHash) external;
    function getMarker(bytes32 _hash) external view returns (uint256);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 8 of 25 : IBaseToken.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    interface IBaseToken {
    function balanceOf(uint256) external view returns (uint256);
    function transferFromTo(address _from, address _to, uint256 _amount) external;
    function totalSupply() external view returns (uint256);
    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function mint(address _account, uint256 _amount) external;
    function withdraw(address _l1Receiver) external payable;
    function withdrawWithMessage(address _l1Receiver, bytes calldata _additionalData) external payable;
    event Mint(address indexed account, uint256 amount);
    event Transfer(address indexed from, address indexed to, uint256 value);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 9 of 25 : IL1Messenger.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    /// @dev The log passed from L2
    /// @param l2ShardId The shard identifier, 0 - rollup, 1 - porter. All other values are not used but are reserved for the future
    /// @param isService A boolean flag that is part of the log along with `key`, `value`, and `sender` address.
    /// This field is required formally but does not have any special meaning.
    /// @param txNumberInBlock The L2 transaction number in a block, in which the log was sent
    /// @param sender The L2 address which sent the log
    /// @param key The 32 bytes of information that was sent in the log
    /// @param value The 32 bytes of information that was sent in the log
    // Both `key` and `value` are arbitrary 32-bytes selected by the log sender
    struct L2ToL1Log {
    uint8 l2ShardId;
    bool isService;
    uint16 txNumberInBlock;
    address sender;
    bytes32 key;
    bytes32 value;
    }
    /// @dev Bytes in raw L2 to L1 log
    /// @dev Equal to the bytes size of the tuple - (uint8 ShardId, bool isService, uint16 txNumberInBlock, address sender, bytes32 key, bytes32 value)
    uint256 constant L2_TO_L1_LOG_SERIALIZE_SIZE = 88;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 10 of 25 : ISystemContext.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    /**
    * @author Matter Labs
    * @custom:security-contact security@matterlabs.dev
    * @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.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 11 of 25 : ICompressor.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    // The bitmask by applying which to the compressed state diff metadata we retrieve its operation.
    uint8 constant OPERATION_BITMASK = 7;
    // The number of bits shifting the compressed state diff metadata by which we retrieve its length.
    uint8 constant LENGTH_BITS_OFFSET = 3;
    // The maximal length in bytes that an enumeration index can have.
    uint8 constant MAX_ENUMERATION_INDEX_SIZE = 8;
    /**
    * @author Matter Labs
    * @custom:security-contact security@matterlabs.dev
    * @notice The interface for the Compressor contract, responsible for verifying the correctness of
    * the compression of the state diffs and bytecodes.
    */
    interface ICompressor {
    function publishCompressedBytecode(
    bytes calldata _bytecode,
    bytes calldata _rawCompressedData
    ) external returns (bytes32 bytecodeHash);
    function verifyCompressedStateDiffs(
    uint256 _numberOfStateDiffs,
    uint256 _enumerationIndexSize,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 12 of 25 : IComplexUpgrader.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    /**
    * @author Matter Labs
    * @custom:security-contact security@matterlabs.dev
    * @notice The interface for the ComplexUpgrader contract.
    */
    interface IComplexUpgrader {
    function upgrade(address _delegateTo, bytes calldata _calldata) external payable;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 13 of 25 : IBootloaderUtilities.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    import {Transaction} from "../libraries/TransactionHelper.sol";
    interface IBootloaderUtilities {
    function getTransactionHashes(
    Transaction calldata _transaction
    ) external view returns (bytes32 txHash, bytes32 signedTxHash);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 14 of 25 : IPubdataChunkPublisher.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    /**
    * @author Matter Labs
    * @custom:security-contact security@matterlabs.dev
    * @notice Interface for contract responsible chunking pubdata into the appropriate size for EIP-4844 blobs.
    */
    interface IPubdataChunkPublisher {
    /// @notice Chunks pubdata into pieces that can fit into blobs.
    /// @param _pubdata The total l2 to l1 pubdata that will be sent via L1 blobs.
    function chunkAndPublishPubdata(bytes calldata _pubdata) external;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 15 of 25 : TransactionHelper.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    import {IERC20} from "../openzeppelin/token/ERC20/IERC20.sol";
    import {SafeERC20} from "../openzeppelin/token/ERC20/utils/SafeERC20.sol";
    import {IPaymasterFlow} from "../interfaces/IPaymasterFlow.sol";
    import {BASE_TOKEN_SYSTEM_CONTRACT, BOOTLOADER_FORMAL_ADDRESS} from "../Constants.sol";
    import {RLPEncoder} from "./RLPEncoder.sol";
    import {EfficientCall} from "./EfficientCall.sol";
    /// @dev The type id of zkSync's EIP-712-signed transaction.
    uint8 constant EIP_712_TX_TYPE = 0x71;
    /// @dev The type id of legacy transactions.
    uint8 constant LEGACY_TX_TYPE = 0x0;
    /// @dev The type id of legacy transactions.
    uint8 constant EIP_2930_TX_TYPE = 0x01;
    /// @dev The type id of EIP1559 transactions.
    uint8 constant EIP_1559_TX_TYPE = 0x02;
    /// @notice Structure used to represent a zkSync transaction.
    struct Transaction {
    // The type of the transaction.
    uint256 txType;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 16 of 25 : IERC20.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev Interface of the ERC20 standard as defined in the EIP.
    */
    interface IERC20 {
    /**
    * @dev Emitted when `value` tokens are moved from one account (`from`) to
    * another (`to`).
    *
    * Note that `value` may be zero.
    */
    event Transfer(address indexed from, address indexed to, uint256 value);
    /**
    * @dev Emitted when the allowance of a `spender` for an `owner` is set by
    * a call to {approve}. `value` is the new allowance.
    */
    event Approval(address indexed owner, address indexed spender, uint256 value);
    /**
    * @dev Returns the amount of tokens in existence.
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 17 of 25 : SafeERC20.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
    pragma solidity ^0.8.0;
    import {IERC20} from "../IERC20.sol";
    import {IERC20Permit} from "../extensions/IERC20Permit.sol";
    import {Address} from "../../../utils/Address.sol";
    /**
    * @title SafeERC20
    * @dev Wrappers around ERC20 operations that throw on failure (when the token
    * contract returns false). Tokens that return no value (and instead revert or
    * throw on failure) are also supported, non-reverting calls are assumed to be
    * successful.
    * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
    * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
    */
    library SafeERC20 {
    using Address for address;
    function safeTransfer(
    IERC20 token,
    address to,
    uint256 value
    ) internal {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 18 of 25 : IPaymasterFlow.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    /**
    * @author Matter Labs
    * @dev The interface that is used for encoding/decoding of
    * different types of paymaster flows.
    * @notice This is NOT an interface to be implemented
    * by contracts. It is just used for encoding.
    */
    interface IPaymasterFlow {
    function general(bytes calldata input) external;
    function approvalBased(address _token, uint256 _minAllowance, bytes calldata _innerInput) external;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 19 of 25 : RLPEncoder.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    /**
    * @author Matter Labs
    * @custom:security-contact security@matterlabs.dev
    * @notice This library provides RLP encoding functionality.
    */
    library RLPEncoder {
    function encodeAddress(address _val) internal pure returns (bytes memory encoded) {
    // The size is equal to 20 bytes of the address itself + 1 for encoding bytes length in RLP.
    encoded = new bytes(0x15);
    bytes20 shiftedVal = bytes20(_val);
    assembly {
    // In the first byte we write the encoded length as 0x80 + 0x14 == 0x94.
    mstore(add(encoded, 0x20), 0x9400000000000000000000000000000000000000000000000000000000000000)
    // Write address data without stripping zeros.
    mstore(add(encoded, 0x21), shiftedVal)
    }
    }
    function encodeUint256(uint256 _val) internal pure returns (bytes memory encoded) {
    unchecked {
    if (_val < 128) {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 20 of 25 : EfficientCall.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    import {SystemContractHelper, ADDRESS_MASK} from "./SystemContractHelper.sol";
    import {SystemContractsCaller, CalldataForwardingMode, RAW_FAR_CALL_BY_REF_CALL_ADDRESS, SYSTEM_CALL_BY_REF_CALL_ADDRESS,
        MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT, MIMIC_CALL_BY_REF_CALL_ADDRESS} from "./SystemContractsCaller.sol";
    import {Utils} from "./Utils.sol";
    import {SHA256_SYSTEM_CONTRACT, KECCAK256_SYSTEM_CONTRACT, MSG_VALUE_SYSTEM_CONTRACT} from "../Constants.sol";
    /**
    * @author Matter Labs
    * @custom:security-contact security@matterlabs.dev
    * @notice This library is used to perform ultra-efficient calls using zkEVM-specific features.
    * @dev EVM calls always accept a memory slice as input and return a memory slice as output.
    * Therefore, even if the user has a ready-made calldata slice, they still need to copy it to memory
    * before calling. This is especially inefficient for large inputs (proxies, multi-calls, etc.).
    * In turn, zkEVM operates over a fat pointer, which is a set of (memory page, offset, start, length) in the memory/calldata/returndata.
    * This allows forwarding the calldata slice as is, without copying it to memory.
    * @dev Fat pointer is not just an integer, it is an extended data type supported on the VM level.
    * zkEVM creates the wellformed fat pointers for all the calldata/returndata regions, later
    * the contract may manipulate the already created fat pointers to forward a slice of the data, but not
    * to create new fat pointers!
    * @dev The allowed operation on fat pointers are:
    * 1. `ptr.add` - Transforms `ptr.offset` into `ptr.offset + u32(_value)`. If overflow happens then it panics.
    * 2. `ptr.sub` - Transforms `ptr.offset` into `ptr.offset - u32(_value)`. If underflow happens then it panics.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 21 of 25 : IERC20Permit.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Permit.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
    * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
    *
    * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
    * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
    * need to send a transaction, and thus is not required to hold Ether at all.
    */
    interface IERC20Permit {
    /**
    * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
    * given ``owner``'s signed approval.
    *
    * IMPORTANT: The same issues {IERC20-approve} has related to transaction
    * ordering also apply here.
    *
    * Emits an {Approval} event.
    *
    * Requirements:
    *
    * - `spender` cannot be the zero address.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 22 of 25 : Address.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
    pragma solidity ^0.8.1;
    /**
    * @dev Collection of functions related to the address type
    */
    library Address {
    /**
    * @dev Returns true if `account` is a contract.
    *
    * [IMPORTANT]
    * ====
    * It is unsafe to assume that an address for which this function returns
    * false is an externally-owned account (EOA) and not a contract.
    *
    * Among others, `isContract` will return false for the following
    * types of addresses:
    *
    * - an externally-owned account
    * - a contract in construction
    * - an address where a contract will be created
    * - an address where a contract lived, but was destroyed
    * ====
    *
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 23 of 25 : SystemContractHelper.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    import {MAX_SYSTEM_CONTRACT_ADDRESS} from "../Constants.sol";
    import {CALLFLAGS_CALL_ADDRESS, CODE_ADDRESS_CALL_ADDRESS, EVENT_WRITE_ADDRESS, EVENT_INITIALIZE_ADDRESS, GET_EXTRA_ABI_DATA_ADDRESS,
        LOAD_CALLDATA_INTO_ACTIVE_PTR_CALL_ADDRESS, META_CODE_SHARD_ID_OFFSET, META_CALLER_SHARD_ID_OFFSET, META_SHARD_ID_OFFSET,
        META_AUX_HEAP_SIZE_OFFSET, META_HEAP_SIZE_OFFSET, META_PUBDATA_PUBLISHED_OFFSET, META_CALL_ADDRESS, PTR_CALLDATA_CALL_ADDRESS,
        PTR_ADD_INTO_ACTIVE_CALL_ADDRESS, PTR_SHRINK_INTO_ACTIVE_CALL_ADDRESS, PTR_PACK_INTO_ACTIVE_CALL_ADDRESS, PRECOMPILE_CALL_ADDRESS,
        SET_CONTEXT_VALUE_CALL_ADDRESS, TO_L1_CALL_ADDRESS} from "./SystemContractsCaller.sol";
    uint256 constant UINT32_MASK = type(uint32).max;
    uint256 constant UINT64_MASK = type(uint64).max;
    uint256 constant UINT128_MASK = type(uint128).max;
    uint256 constant ADDRESS_MASK = type(uint160).max;
    /// @notice NOTE: The `getZkSyncMeta` that is used to obtain this struct will experience a breaking change in 2024.
    struct ZkSyncMeta {
    uint32 pubdataPublished;
    uint32 heapSize;
    uint32 auxHeapSize;
    uint8 shardId;
    uint8 callerShardId;
    uint8 codeShardId;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 24 of 25 : SystemContractsCaller.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    import {MSG_VALUE_SYSTEM_CONTRACT, MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT} from "../Constants.sol";
    import {Utils} from "./Utils.sol";
    // Addresses used for the compiler to be replaced with the
    // zkSync-specific opcodes during the compilation.
    // IMPORTANT: these are just compile-time constants and are used
    // only if used in-place by Yul optimizer.
    address constant TO_L1_CALL_ADDRESS = address((1 << 16) - 1);
    address constant CODE_ADDRESS_CALL_ADDRESS = address((1 << 16) - 2);
    address constant PRECOMPILE_CALL_ADDRESS = address((1 << 16) - 3);
    address constant META_CALL_ADDRESS = address((1 << 16) - 4);
    address constant MIMIC_CALL_CALL_ADDRESS = address((1 << 16) - 5);
    address constant SYSTEM_MIMIC_CALL_CALL_ADDRESS = address((1 << 16) - 6);
    address constant MIMIC_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 7);
    address constant SYSTEM_MIMIC_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 8);
    address constant RAW_FAR_CALL_CALL_ADDRESS = address((1 << 16) - 9);
    address constant RAW_FAR_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 10);
    address constant SYSTEM_CALL_CALL_ADDRESS = address((1 << 16) - 11);
    address constant SYSTEM_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 12);
    address constant SET_CONTEXT_VALUE_CALL_ADDRESS = address((1 << 16) - 13);
    address constant SET_PUBDATA_PRICE_CALL_ADDRESS = address((1 << 16) - 14);
    address constant INCREMENT_TX_COUNTER_CALL_ADDRESS = address((1 << 16) - 15);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 25 of 25 : Utils.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity 0.8.20;
    import {EfficientCall} from "./EfficientCall.sol";
    /**
    * @author Matter Labs
    * @custom:security-contact security@matterlabs.dev
    * @dev Common utilities used in zkSync system contracts
    */
    library Utils {
    /// @dev Bit mask of bytecode hash "isConstructor" marker
    bytes32 constant IS_CONSTRUCTOR_BYTECODE_HASH_BIT_MASK =
    0x00ff000000000000000000000000000000000000000000000000000000000000;
    /// @dev Bit mask to set the "isConstructor" marker in the bytecode hash
    bytes32 constant SET_IS_CONSTRUCTOR_MARKER_BIT_MASK =
    0x0001000000000000000000000000000000000000000000000000000000000000;
    function safeCastToU128(uint256 _x) internal pure returns (uint128) {
    require(_x <= type(uint128).max, "Overflow");
    return uint128(_x);
    }
    function safeCastToU32(uint256 _x) internal pure returns (uint32) {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Settings
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    {
    "optimizer": {
    "enabled": true,
    "mode": "3"
    },
    "outputSelection": {
    "*": {
    "*": [
    "storageLayout",
    "abi",
    "evm.methodIdentifiers",
    "metadata"
    ],
    "": [
    "ast"
    ]
    }
    },
    "evmVersion": "paris",
    "libraries": {}
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Contract Security Audit

    Contract ABI

    [{"inputs":[{"internalType":"address","name":"_dest","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getImmutable","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_dest","type":"address"},{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"bytes32","name":"value","type":"bytes32"}],"internalType":"structImmutableData[]","name":"_immutables","type":"tuple[]"}],"name":"setImmutables","outputs":[],"stateMutability":"nonpayable","type":"function"}]

    0x00010000000000020007000000000002000000000701034f00000000000703550000008001000039000000400010043f000000000107001900000060011002700000002f0110019700000001022001900000002d0000c13d000000040210008c0000005c0000413d000000000207043b000000e002200270000000310320009c000000350000613d000000320220009c0000005c0000c13d0000000002000416000000000202004b0000005c0000c13d000000040110008a000000400110008c0000005c0000413d0000000401700370000000000101043b000000330210009c0000005c0000213d0000000000100435000000200000043f0000000001000019000700000007035300b800a10000040f000000070200035f0000002402200370000000000202043b0000000000200435000000200010043f000000000100001900b800a10000040f000000000101041a000000800010043f0000003b01000041000000b90001042e0000000001000416000000000101004b0000005c0000c13d0000002001000039000001000010044300000120000004430000003001000041000000b90001042e0000000002000416000000000202004b0000005c0000c13d000000040210008a000000400220008c0000005c0000413d0000000402700370000000000202043b000300000002001d000000330220009c0000005c0000213d0000002402700370000000000202043b000000340320009c0000005c0000213d00000023032000390000003504000041000000000513004b000000000500001900000000050480190000003503300197000000000603004b0000000004008019000000350330009c000000000405c019000000000304004b0000005c0000c13d0000000403200039000000000337034f000000000303043b000200000003001d000000340330009c0000005c0000213d000100240020003d000000020200002900000006022002100000000102200029000000000112004b0000005e0000a13d0000000001000019000000ba000104300000000001000411000080060110008c000000950000c13d000000020100006b000000930000613d0000002f0400004100008010050000390000000002000019000700000005001d000500000002001d00000006012002100000000101100029000000200210003900000000022003670000000001100367000000000101043b000600000001001d000000000102043b000400000001001d00000003010000290000000000100435000000200000043f00000000010004140000002f0210009c0000000001048019000000c0011002100000003a011001c7000000000205001900b800b30000040f00000001022001900000005c0000613d000000000101043b00000006020000290000000000200435000000200010043f00000000010004140000002f0210009c0000002f01008041000000c0011002100000003a011001c7000000070200002900b800b30000040f00000001022001900000005c0000613d000000000101043b0000000402000029000000000021041b00000005020000290000000102200039000000020120006c0000002f040000410000000705000029000000670000413d0000000001000019000000b90001042e0000003601000041000000800010043f0000002001000039000000840010043f0000002d01000039000000a40010043f0000003701000041000000c40010043f0000003801000041000000e40010043f0000003901000041000000ba000104300000002f020000410000002f0310009c000000000102801900000000030004140000002f0430009c0000000003028019000000c0023002100000004001100210000000000121019f0000003a011001c7000080100200003900b800b30000040f0000000102200190000000b10000613d000000000101043b000000000001042d0000000001000019000000ba00010430000000b6002104230000000102000039000000000001042d0000000002000019000000000001042d000000b800000432000000b90001042e000000ba00010430000000000000000000000000000000000000000000000000000000000000000000000000ffffffff000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000ad7e232e00000000000000000000000000000000000000000000000000000000310ab089000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffff800000000000000000000000000000000000000000000000000000000000000008c379a00000000000000000000000000000000000000000000000000000000043616c6c61626c65206f6e6c7920627920746865206465706c6f7965722073797374656d20636f6e7472616374000000000000000000000000000000000000000000000000000000000000000000000000000084000000800000000000000000020000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000008000000000000000005184ad44eb537daf53990c8a48bc6d0708a5d2bc518dc7fc021463e90afefc85

    Deployed Bytecode

    0x00010000000000020007000000000002000000000701034f00000000000703550000008001000039000000400010043f000000000107001900000060011002700000002f0110019700000001022001900000002d0000c13d000000040210008c0000005c0000413d000000000207043b000000e002200270000000310320009c000000350000613d000000320220009c0000005c0000c13d0000000002000416000000000202004b0000005c0000c13d000000040110008a000000400110008c0000005c0000413d0000000401700370000000000101043b000000330210009c0000005c0000213d0000000000100435000000200000043f0000000001000019000700000007035300b800a10000040f000000070200035f0000002402200370000000000202043b0000000000200435000000200010043f000000000100001900b800a10000040f000000000101041a000000800010043f0000003b01000041000000b90001042e0000000001000416000000000101004b0000005c0000c13d0000002001000039000001000010044300000120000004430000003001000041000000b90001042e0000000002000416000000000202004b0000005c0000c13d000000040210008a000000400220008c0000005c0000413d0000000402700370000000000202043b000300000002001d000000330220009c0000005c0000213d0000002402700370000000000202043b000000340320009c0000005c0000213d00000023032000390000003504000041000000000513004b000000000500001900000000050480190000003503300197000000000603004b0000000004008019000000350330009c000000000405c019000000000304004b0000005c0000c13d0000000403200039000000000337034f000000000303043b000200000003001d000000340330009c0000005c0000213d000100240020003d000000020200002900000006022002100000000102200029000000000112004b0000005e0000a13d0000000001000019000000ba000104300000000001000411000080060110008c000000950000c13d000000020100006b000000930000613d0000002f0400004100008010050000390000000002000019000700000005001d000500000002001d00000006012002100000000101100029000000200210003900000000022003670000000001100367000000000101043b000600000001001d000000000102043b000400000001001d00000003010000290000000000100435000000200000043f00000000010004140000002f0210009c0000000001048019000000c0011002100000003a011001c7000000000205001900b800b30000040f00000001022001900000005c0000613d000000000101043b00000006020000290000000000200435000000200010043f00000000010004140000002f0210009c0000002f01008041000000c0011002100000003a011001c7000000070200002900b800b30000040f00000001022001900000005c0000613d000000000101043b0000000402000029000000000021041b00000005020000290000000102200039000000020120006c0000002f040000410000000705000029000000670000413d0000000001000019000000b90001042e0000003601000041000000800010043f0000002001000039000000840010043f0000002d01000039000000a40010043f0000003701000041000000c40010043f0000003801000041000000e40010043f0000003901000041000000ba000104300000002f020000410000002f0310009c000000000102801900000000030004140000002f0430009c0000000003028019000000c0023002100000004001100210000000000121019f0000003a011001c7000080100200003900b800b30000040f0000000102200190000000b10000613d000000000101043b000000000001042d0000000001000019000000ba00010430000000b6002104230000000102000039000000000001042d0000000002000019000000000001042d000000b800000432000000b90001042e000000ba00010430000000000000000000000000000000000000000000000000000000000000000000000000ffffffff000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000ad7e232e00000000000000000000000000000000000000000000000000000000310ab089000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffff800000000000000000000000000000000000000000000000000000000000000008c379a00000000000000000000000000000000000000000000000000000000043616c6c61626c65206f6e6c7920627920746865206465706c6f7965722073797374656d20636f6e7472616374000000000000000000000000000000000000000000000000000000000000000000000000000084000000800000000000000000020000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000008000000000000000005184ad44eb537daf53990c8a48bc6d0708a5d2bc518dc7fc021463e90afefc85

    Block Age Transaction Gas Used Reward
    view all blocks produced

    Block Age Uncle Number Difficulty Gas Used Reward
    View All Uncles
    Loading...
    Loading

    OVERVIEW

    This contract simulates the behavior of immutable variables in Solidity. It exists so that smart contracts with the same Solidity code but different constructor parameters have the same bytecode.

    Loading...
    Loading

    Validator Index Block Age Amount
    View All Withdrawals

    Transaction Hash Block Age Value Eth2 PubKey Valid
    View All Deposits
    [ Download: CSV Export  ]

    A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.