Skip to content
Verified contractPartialMIT

ZKsyncOSSettlementLayerV31Upgrade

Address0xc8dd2bf1d3e195934b9e87f61548028598de1627
Balance

0 ETH

 

Transactions

0

 

Compiler

solc 0.8.28

 

Same code

1 more 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,129,695
Creation transaction
0x81f4a2d9cd…2ae0774af8

80 files

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

contracts/upgrades/ZKsyncOSSettlementLayerV31Upgrade.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.8.28;

import {SettlementLayerV31UpgradeBase} from "./SettlementLayerV31UpgradeBase.sol";
import {IComplexUpgrader} from "../state-transition/l2-deps/IComplexUpgrader.sol";
import {L2UpgradeTxLib} from "./L2UpgradeTxLib.sol";
import {Bytes} from "../vendor/Bytes.sol";

/// @author Matter Labs
/// @title ZKsyncOSSettlementLayerV31Upgrade
/// @dev V31 upgrade for ZKsyncOS chains. Handles
/// IComplexUpgrader.forceDeployAndUpgradeUniversal(UniversalContractUpgradeInfo[], address, bytes).
/// @custom:security-contact [email protected]
contract ZKsyncOSSettlementLayerV31Upgrade is SettlementLayerV31UpgradeBase {
    using Bytes for bytes;

    /// @inheritdoc SettlementLayerV31UpgradeBase
    function getL2UpgradeTxData(
        address _bridgehub,
        uint256 _chainId,
        bool _zksyncOS,
        bytes memory _existingTxData
    ) public view override returns (bytes memory) {
        L2UpgradeTxLib.validateZKsyncOSFlag(_zksyncOS, true);
        L2UpgradeTxLib.validateUpgradeSelector(
            _existingTxData,
            IComplexUpgrader.forceDeployAndUpgradeUniversal.selector
        );

        (
            IComplexUpgrader.UniversalContractUpgradeInfo[] memory forceDeployments,
            address delegateTo,
            bytes memory existingUpgradeCalldata
        ) = abi.decode(_existingTxData.slice(4), (IComplexUpgrader.UniversalContractUpgradeInfo[], address, bytes));

        L2UpgradeTxLib.validateWrappedUpgrade(existingUpgradeCalldata);
        bytes memory l2V31UpgradeCalldata = L2UpgradeTxLib.buildL2V31UpgradeCalldata(
            _bridgehub,
            _chainId,
            _zksyncOS,
            existingUpgradeCalldata
        );

        return
            abi.encodeCall(
                IComplexUpgrader.forceDeployAndUpgradeUniversal,
                (forceDeployments, delegateTo, l2V31UpgradeCalldata)
            );
    }
}
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.