false
false
0
The new Blockscout UI is now open source! Learn how to deploy it here

Contract Address Details

0x2Fa4805846C3a81563E4b34c9F91115532Aaeec4

Contract Name
EtnaInbox
Creator
0x4779d1–4df7b8 at 0xf48393–dfd682
Balance
0 ETH
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
52742
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
EtnaInbox




Optimization enabled
true
Compiler version
v0.8.30+commit.73712a01




Optimization runs
200
EVM Version
osaka




Verified at
2026-11-15T13:57:19.680430Z

Constructor Arguments

0x000000000000000000000000044c2e53e9edddd1353a9d923fa39c1fa821e88e000000000000000000000000b261c6facc0707b674c7491338412fdf44733a4b0000000000000000000000002ec730f0830803a022262e46375e33023fad65e50000000000000000000000000000000000000000000000000000000000028c590000000000000000000000000000000000000000000000000000000000000078000000000000000000000000000000000000000000000000000000000098968000000000000000000000000000000000000000000000000000000000000000320000000000000000000000007777777777777777777777777777777777777777000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
              

contracts/layer1/etna/impl/EtnaInbox.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import { IEtnaInbox } from "../iface/IEtnaInbox.sol";
import { IEtnaStakingRegistry } from "../iface/IEtnaStakingRegistry.sol";
import { LibEtnaForcedInclusion } from "../libs/LibEtnaForcedInclusion.sol";
import { IInbox } from "src/layer1/core/iface/IInbox.sol";
import { IProofVerifier } from "src/layer1/verifiers/IProofVerifier.sol";
import { EssentialContract } from "src/shared/common/EssentialContract.sol";
import { LibAddress } from "src/shared/libs/LibAddress.sol";
import { ICheckpointStore } from "src/shared/signal/ICheckpointStore.sol";
import { ISignalService } from "src/shared/signal/ISignalService.sol";

import "./EtnaInbox_Layout.sol"; // DO NOT DELETE

/// @title EtnaInbox
/// @notice The L1 Inbox of an Etna PoS chain; see `IEtnaInbox`.
/// @dev The proxy first runs `EtnaInboxBootstrap`; its owner then upgrades to this contract and
/// calls `init`. On a new network `init` also writes the Etna start at block 0; on a switching
/// network the originWriter writes it later with `setOrigin`. Storage follows spec appendix B
/// exactly: its named slots 258, 268-274, 278-282, 284, 285, 290, 292 and 293 sit where it lists
/// them, reserved slots 283, 286-289 and 291 are never read or written, and slots 251-257,
/// 259-267 and 275-277 are unused padding.
/// @custom:security-contact security@taiko.xyz
// solhint-disable-next-line max-states-count
contract EtnaInbox is IEtnaInbox, EssentialContract {
    using LibAddress for address;
    using LibEtnaForcedInclusion for LibEtnaForcedInclusion.Storage;

    // ---------------------------------------------------------------
    // Structs
    // ---------------------------------------------------------------

    /// @dev Slot 282: the forced inclusion parameters in seconds, packed from the
    /// least-significant bit.
    struct ForcedInclusionConfig {
        uint48 delay;
        uint48 maxAnchorAge;
    }

    /// @dev The 23 static words of the landing statement in appendix A order; its ABI encoding is
    /// the 736-byte statement preimage.
    struct LandStatement {
        bytes32 tag;
        uint256 l1ChainId;
        uint256 l2ChainId;
        address inbox;
        address stakingRegistry;
        uint256 generation;
        uint256 parentHeight;
        bytes32 parentHash;
        bytes32 parentCometHash;
        bytes32 parentValStateHash;
        bytes32 committeeConfigHash;
        uint256 lastHeight;
        bytes32 lastBlockHash;
        bytes32 lastCometHash;
        bytes32 lastValStateHash;
        bytes32 lastStateRoot;
        uint256 l1ReferenceBlockNumber;
        bytes32 l1ReferenceBlockHash;
        bytes32 blobHashesHash;
        uint256 forcedInclusionHeadBefore;
        uint256 forcedInclusionHeadAfter;
        uint256 activeCommitteeSnapshot;
        bytes32 cutHash;
    }

    // ---------------------------------------------------------------
    // Constants
    // ---------------------------------------------------------------

    /// @notice `K`: landings end only at heights h with h - S a multiple of this (spec 6.1).
    uint256 public constant GRID_INTERVAL = 6;

    /// @notice The landing statement version emitted by `Landed`.
    uint8 public constant VERSION = 1;

    /// @notice The maximum byte length of a forced transaction (spec 7.1).
    uint256 public constant MAX_FORCED_TX_BYTES = 8192;

    /// @notice The maximum number of blobs of a landing (spec 6.1).
    uint256 public constant MAX_BLOBS = 6;

    /// @notice The slot 258 value once initialized.
    uint8 public constant INITIALIZED_STATUS = 3;

    /// @dev The domain tag of `committeeConfigHash` (appendix A).
    bytes32 private constant _COMMITTEE_CONFIG_TAG = bytes32("ETNA_PARENT_ANCHOR_V1");

    /// @dev The minimum epoch length `L` in L2 blocks (spec 10).
    uint256 private constant _MIN_EPOCH_LEN_L2 = 3;

    /// @dev The minimum `maxAnchorAge` in seconds (spec 10).
    uint256 private constant _MIN_MAX_ANCHOR_AGE = 1152;

    /// @dev The minimum `vp_unit`, which keeps the committee's total voting power from overflowing
    /// (spec 4.3).
    uint256 private constant _MIN_VP_UNIT = 867_361_738;

    /// @dev The maximum `n_max`, the registry's capacity.
    uint256 private constant _MAX_COMMITTEE_SIZE = 4096;

    /// @dev The maximum `U`, the largest multiple of 6 below 2^16 (spec 10).
    uint256 private constant _MAX_UNSETTLED_LIMIT = 65_532;

    /// @dev The maximum `maxBatchBlocks` (spec 11). L2 height never exceeds c + U (spec 6.4), so a
    /// landing from c never needs more. At this limit the 10,921 leaves are 349,472 calldata
    /// bytes, about 14.0M gas at today's EIP-7623 floor of 40 gas per non-zero byte, within the
    /// EIP-7825 per-transaction cap of 2^24 gas. A higher calldata floor would need a lower limit.
    uint256 private constant _MAX_BATCH_BLOCKS_LIMIT = _MAX_UNSETTLED_LIMIT;

    /// @dev The domain tag of the landing statement (appendix A).
    bytes32 private constant _LAND_STATEMENT_TAG = bytes32("TAIKO_ETNA_LAND_V1");

    /// @dev The domain tag of `cutHash` (appendix A).
    bytes32 private constant _LAND_CUTS_TAG = bytes32("ETNA_LAND_CUTS_V1");

    /// @dev Every landed height is below 2^48, the width of a height in slots 270 and 285.
    uint256 private constant _HEIGHT_LIMIT = 2 ** 48;

    /// @dev The number of most recent L1 blocks whose hash `blockhash` returns.
    uint256 private constant _BLOCKHASH_WINDOW = 256;

    /// @dev The EIP-2935 history storage contract.
    address private constant _HISTORY_STORAGE_ADDRESS = 0x0000F90827F1C53a10cb7A02335B175320002935;

    /// @dev The number of most recent L1 blocks whose hash the EIP-2935 contract serves.
    uint256 private constant _HISTORY_SERVE_WINDOW = 8191;

    /// @dev keccak256(""): the txHash recovery writes over a blanked forced inclusion (spec 8
    /// step 3).
    bytes32 private constant _BLANK_TX_HASH = keccak256("");

    // ---------------------------------------------------------------
    // Immutable Variables
    // ---------------------------------------------------------------

    /// @dev The verifier of `land` proofs.
    IProofVerifier internal immutable _proofVerifier;

    /// @dev The L1 SignalService that stores the landed checkpoints.
    ISignalService internal immutable _signalService;

    /// @dev The staking registry.
    IEtnaStakingRegistry internal immutable _stakingRegistry;

    /// @inheritdoc IEtnaInbox
    uint64 public immutable override l2ChainId;

    /// @inheritdoc IEtnaInbox
    uint64 public immutable override maxBatchBlocks;

    /// @inheritdoc IEtnaInbox
    uint64 public immutable override forcedInclusionFeeInGwei;

    /// @inheritdoc IEtnaInbox
    uint64 public immutable override forcedInclusionFeeDoubleThreshold;

    /// @inheritdoc IEtnaInbox
    address public immutable override protocolFeeRecipient;

    /// @inheritdoc IEtnaInbox
    address public immutable override originWriter;

    /// @inheritdoc IEtnaInbox
    address public immutable override unzenInbox;

    /// @inheritdoc IEtnaInbox
    uint48 public immutable override etnaForkTime;

    // ---------------------------------------------------------------
    // State Variables
    // ---------------------------------------------------------------

    /// @dev Slots 251-257: reserved.
    uint256[7] private __reserved251;

    /// @dev Slot 258: `INITIALIZED_STATUS` once initialized; zero before.
    uint8 private _initStatus;

    /// @dev Slots 259-267: reserved.
    uint256[9] private __reserved259;

    /// @dev Slot 268: the recovery generation.
    uint48 private _recoveryGeneration;

    /// @dev Slot 269: the committee configuration hash.
    bytes32 private _committeeConfigHash;

    /// @dev Slots 270-271: the latest landed checkpoint.
    LandedCheckpoint private _lastCheckpoint;

    /// @dev Slots 272-274: the start record.
    GenesisRecord private _genesis;

    /// @dev Slots 275-277: reserved.
    uint256[3] private __reserved275;

    /// @dev Slot 278: the committee 0 record hash.
    bytes32 private _genesisCommitteeRecordHash;

    /// @dev Slot 279: the registry snapshot block of committee 0.
    uint48 private _genesisCutoff;

    /// @dev Slots 280-281: the forced inclusion queue and its packed head and tail.
    LibEtnaForcedInclusion.Storage private _forcedInclusions;

    /// @dev Slot 282: the forced inclusion delay and the maximum anchor age.
    ForcedInclusionConfig private _forcedInclusionConfig;

    /// @dev Slot 283: reserved; never read or written.
    uint256 private __reserved283;

    /// @dev Slot 284: the selection snapshot of the committee that signed the latest checkpoint.
    uint256 private _activeCommitteeSnapshot;

    /// @dev Slot 285: the landing record of every checkpoint height.
    mapping(uint256 height => Landing landing) private _landings;

    /// @dev Slots 286-289: reserved; never read or written.
    uint256[4] private __reserved286;

    /// @dev Slot 290: the fixed origin of every recovery generation.
    mapping(uint256 generation => Origin origin) private _origins;

    /// @dev Slot 291: reserved; never read or written.
    uint256 private __reserved291;

    /// @dev Slot 292: monotonic recovery authorization nonce, never restored from history.
    uint256 private _recoveryNonce;

    /// @dev Slot 293: the rules schedule.
    RulesSchedule private _rulesSchedule;

    uint256[7] private __gap;

    // ---------------------------------------------------------------
    // Constructor
    // ---------------------------------------------------------------

    /// @notice Sets the implementation's immutable parameters.
    /// @param _config The configuration: non-zero addresses and L2 chain id, `maxBatchBlocks` in
    /// [6, 65,532], non-zero forced inclusion fee parameters, and either no switching parameters
    /// (a new network) or all three with an Unzen Inbox that has code (a switching network).
    constructor(Config memory _config) {
        bool switching = _config.unzenInbox != address(0);
        require(
            (_config.originWriter != address(0)) == switching
                && (_config.etnaForkTime != 0) == switching
                && (!switching || _config.unzenInbox.code.length != 0),
            InvalidSwitchConfig()
        );
        require(_config.proofVerifier != address(0), ZERO_ADDRESS());
        require(_config.signalService != address(0), ZERO_ADDRESS());
        require(_config.stakingRegistry != address(0), ZERO_ADDRESS());
        require(_config.protocolFeeRecipient != address(0), ZERO_ADDRESS());
        require(_config.l2ChainId != 0, ZERO_VALUE());
        require(
            _config.maxBatchBlocks >= GRID_INTERVAL
                && _config.maxBatchBlocks <= _MAX_BATCH_BLOCKS_LIMIT,
            InvalidMaxBatchBlocks()
        );
        require(_config.forcedInclusionFeeInGwei != 0, ForcedInclusionFeeZero());
        require(
            _config.forcedInclusionFeeDoubleThreshold != 0, ForcedInclusionFeeDoubleThresholdZero()
        );

        _proofVerifier = IProofVerifier(_config.proofVerifier);
        _signalService = ISignalService(_config.signalService);
        _stakingRegistry = IEtnaStakingRegistry(_config.stakingRegistry);
        l2ChainId = _config.l2ChainId;
        maxBatchBlocks = _config.maxBatchBlocks;
        forcedInclusionFeeInGwei = _config.forcedInclusionFeeInGwei;
        forcedInclusionFeeDoubleThreshold = _config.forcedInclusionFeeDoubleThreshold;
        protocolFeeRecipient = _config.protocolFeeRecipient;
        originWriter = _config.originWriter;
        unzenInbox = _config.unzenInbox;
        etnaForkTime = _config.etnaForkTime;
    }

    // ---------------------------------------------------------------
    // External Functions
    // ---------------------------------------------------------------

    /// @inheritdoc IEtnaInbox
    /// @dev Writes only the non-zero appendix B values: a proxy that has only run the bootstrap
    /// holds zero in every other Inbox slot, which is the remaining initial state (generation 0,
    /// nonce 0, an empty queue and rules schedule 0).
    function init(InitParams calldata _params) external reinitializer(2) onlyOwner {
        _checkRegistryUnlocked();
        _validateInitParams(_params);

        bytes32 configHash = _hashCommitteeConfig(_params.committeeConfig);
        uint48 cutoff = uint48(_params.genesisCutoff);

        _initStatus = INITIALIZED_STATUS;
        _committeeConfigHash = configHash;
        _genesis.epochLenL2 = uint48(_params.epochLenL2);
        _genesisCommitteeRecordHash = _params.committeeRecordHash;
        _genesisCutoff = cutoff;
        _forcedInclusionConfig = ForcedInclusionConfig({
            delay: uint48(_params.forcedInclusionDelay), maxAnchorAge: uint48(_params.maxAnchorAge)
        });
        _activeCommitteeSnapshot = cutoff;

        emit EtnaInitialized(_params.epochLenL2, cutoff, _params.committeeRecordHash, configHash);

        if (unzenInbox == address(0)) {
            _writeStart(0, _params.genesisBlockHash, _params.genesisStateRoot);
            _signalService.saveCheckpoint(
                ICheckpointStore.Checkpoint({
                    blockNumber: 0,
                    blockHash: _params.genesisBlockHash,
                    stateRoot: _params.genesisStateRoot
                })
            );
        }
    }

    /// @inheritdoc IEtnaInbox
    /// @dev Unaffected by pause. Makes no external call besides the registry lock check.
    function setOrigin(
        uint256 _height,
        bytes32 _blockHash,
        bytes32 _stateRoot
    )
        external
        onlyFrom(originWriter)
        nonReentrant
    {
        _checkRegistryUnlocked();
        require(_initStatus == INITIALIZED_STATUS, NotInitialized());
        require(_genesis.genesisBlockHash == 0, StartAlreadyWritten());
        require(block.timestamp >= etnaForkTime, BeforeEtnaForkTime());
        require(
            _height != 0 && _height < _HEIGHT_LIMIT && _blockHash != 0 && _stateRoot != 0,
            InvalidStart()
        );
        require(
            block.number <= type(uint48).max && block.timestamp <= type(uint48).max, ValueOverflow()
        );
        _writeStart(_height, _blockHash, _stateRoot);
    }

    /// @inheritdoc IEtnaInbox
    /// @dev Follows the spec 6.1 reference Solidity: its checks in its order, all before any
    /// write. Before the start write it needs no extra check: c = 0 forces p = 0, and the
    /// unwritten landings[0] fails step 2. Unaffected by pause. The only external calls are the
    /// registry's lock view, the proof verifier, the EIP-2935 history contract, the Unzen Inbox
    /// and SignalService views while c is S on a switching network (all static) and the
    /// SignalService checkpoint write.
    function land(
        LandInput calldata _input,
        bytes32[] calldata _leaves,
        bytes calldata _proof
    )
        external
        nonReentrant
    {
        _checkRegistryUnlocked();
        uint48 generation = _recoveryGeneration;
        uint256 c = _lastCheckpoint.height;

        // Steps 1-4.
        Landing memory origin = _checkRangeAndOrigin(_input, c, generation);
        uint256 headAfter = _checkLeavesAndHead(_input, _leaves, c);

        // Steps 5 and 6: the statement reads and checks the reference block and the blobs.
        bytes32 cutHash = keccak256(
            abi.encode(
                _LAND_CUTS_TAG,
                uint256(generation),
                _input.parentHeight,
                _input.lastHeight,
                keccak256(abi.encodePacked(_leaves))
            )
        );
        _proofVerifier.verifyProof(
            0, _hashLandStatement(_input, origin, generation, cutHash), _proof
        );

        // Step 7.
        _settle(_input, c, generation, headAfter, cutHash);
    }

    /// @inheritdoc IEtnaInbox
    /// @dev Unaffected by pause. The refund is the last step, after every write and the event, and
    /// a failed refund reverts the whole submission.
    function saveForcedInclusion(bytes calldata _tx) external payable nonReentrant {
        _checkRegistryUnlocked();
        require(_genesis.genesisBlockHash != 0, StartNotWritten());
        require(_tx.length <= MAX_FORCED_TX_BYTES, ForcedTransactionTooLarge());

        uint256 feeWei = uint256(
            _forcedInclusions.currentFee(
                forcedInclusionFeeInGwei, forcedInclusionFeeDoubleThreshold
            )
        ) * 1 gwei;
        require(msg.value >= feeWei, InsufficientFee());

        uint48 index = _forcedInclusions.tail;
        _forcedInclusions.queue[index] = ForcedInclusion({
            txHash: keccak256(_tx),
            timestamp: _toUint48(block.timestamp),
            l1Block: _toUint48(block.number)
        });
        _forcedInclusions.tail = index + 1;

        emit ForcedInclusionSaved(index, _tx, feeWei);

        msg.sender.sendEtherAndVerify(msg.value - feeWei);
    }

    /// @inheritdoc IEtnaInbox
    /// @dev Also sweeps ETH forced into the Inbox without a call. A zero balance transfers nothing.
    /// Unaffected by pause.
    function sweepProtocolFees() external nonReentrant {
        _checkRegistryUnlocked();
        uint256 amount = address(this).balance;
        emit ProtocolFeesSwept(amount);
        protocolFeeRecipient.sendEtherAndVerify(amount);
    }

    /// @inheritdoc IEtnaInbox
    /// @dev The Inbox makes all of its own checks (initialization, the start write, the expected
    /// values, the grid, the 48-bit bounds, the ruleset and both lists) before any effect. The new
    /// generation's origin is always unwritten: only the start write (generation 0) and this
    /// function (generation + 1) write origins, and the generation only grows by one. The effects
    /// then run in this order: `forceExit` per exclusion, the blanking, the generation, nonce and
    /// origin writes, `Recovered`, then the slot 293 write and its event. The registry checks
    /// each exclusion inside its `forceExit`, after the earlier exclusions have been applied; the
    /// call is atomic, so a failing `forceExit` reverts them all. Unaffected by pause. The only
    /// external calls are the registry's lock view and `forceExit` on the fixed registry. At
    /// block.number == 2^48 - 1 recovery passes its own bound but any exclusion reverts in the
    /// registry, which stores no L1 block at its no-exit sentinel.
    function recover(
        uint48 _expectedGeneration,
        uint256 _expectedC,
        uint256 _expectedRecoveryNonce,
        uint256 _validUntil,
        Exclusion[] calldata _exclusions,
        uint256[] calldata _fiToClear,
        uint48 _rules
    )
        external
        onlyOwner
        nonReentrant
    {
        _checkRegistryUnlocked();
        (uint48 c, uint48 newGeneration) = _checkRecoveryState(
            _expectedGeneration, _expectedC, _expectedRecoveryNonce, _validUntil
        );
        RulesSchedule memory schedule = _recoveredRulesSchedule(_rules);
        _checkRecoveryLists(_exclusions, _fiToClear);

        for (uint256 i; i < _exclusions.length; ++i) {
            _stakingRegistry.forceExit(_exclusions[i].bondId, _exclusions[i].entryKey);
        }
        for (uint256 i; i < _fiToClear.length; ++i) {
            _forcedInclusions.queue[_fiToClear[i]].txHash = _BLANK_TX_HASH;
        }
        _recoveryGeneration = newGeneration;
        _recoveryNonce = _expectedRecoveryNonce + 1;
        _origins[newGeneration] =
            Origin({ startHeight: c, l1BlockNumber: block.number, l1Timestamp: block.timestamp });

        emit Recovered(newGeneration, c, block.number, block.timestamp, _exclusions, _fiToClear);
        _setRulesSchedule(schedule);
    }

    /// @inheritdoc IEtnaInbox
    /// @dev Unaffected by pause. The promotion of a due `nextRules` happens in memory, so a failed
    /// check keeps it from being stored.
    function scheduleRules(uint48 _rules, uint48 _time) external onlyOwner nonReentrant {
        _checkRegistryUnlocked();
        require(_initStatus == INITIALIZED_STATUS, NotInitialized());
        RulesSchedule memory schedule = _rulesSchedule;
        uint256 earliest = block.timestamp + _forcedInclusionConfig.maxAnchorAge;

        if (block.timestamp >= schedule.rulesTime) {
            schedule.activeRules = schedule.nextRules;
        } else {
            require(earliest < schedule.rulesTime, RulesLocked());
        }
        require(
            _rules == schedule.nextRules || uint256(_rules) == uint256(schedule.nextRules) + 1,
            InvalidRules()
        );
        require(_time >= earliest, InvalidScheduleTime());

        schedule.nextRules = _rules;
        schedule.rulesTime = _time;
        _setRulesSchedule(schedule);
    }

    /// @inheritdoc IEtnaInbox
    /// @dev Unaffected by pause.
    function scheduleStop(uint48 _time, uint48 _grid) external onlyOwner nonReentrant {
        _checkRegistryUnlocked();
        require(_initStatus == INITIALIZED_STATUS, NotInitialized());
        RulesSchedule memory schedule = _rulesSchedule;
        uint256 earliest = block.timestamp + _forcedInclusionConfig.maxAnchorAge;

        if (schedule.stopTime != 0) require(earliest < schedule.stopTime, StopLocked());
        if (_time != 0 || _grid != 0) {
            require(_time >= earliest && _grid != 0 && _grid % GRID_INTERVAL == 0, InvalidStop());
        }

        schedule.stopTime = _time;
        schedule.stopGrid = _grid;
        _setRulesSchedule(schedule);
    }

    /// @inheritdoc IEtnaInbox
    function invalidateRecoveryNonce(uint256 _expectedRecoveryNonce)
        external
        onlyOwner
        nonReentrant
    {
        _checkRegistryUnlocked();
        require(_initStatus == INITIALIZED_STATUS, NotInitialized());
        require(_expectedRecoveryNonce == _recoveryNonce, RecoveryNonceMismatch());
        uint256 nextNonce = _recoveryNonce + 1;
        _recoveryNonce = nextNonce;
        emit RecoveryNonceInvalidated(_expectedRecoveryNonce, nextNonce);
    }

    /// @inheritdoc IEtnaInbox
    function recoveryNonce() external view returns (uint256 nonce_) {
        return _recoveryNonce;
    }

    /// @inheritdoc IEtnaInbox
    function isInitialized() external view returns (bool) {
        return _initStatus == INITIALIZED_STATUS;
    }

    /// @inheritdoc IEtnaInbox
    function recoveryGeneration() external view returns (uint48) {
        return _recoveryGeneration;
    }

    /// @inheritdoc IEtnaInbox
    function committeeConfigHash() external view returns (bytes32) {
        return _committeeConfigHash;
    }

    /// @inheritdoc IEtnaInbox
    function lastCheckpoint() external view returns (LandedCheckpoint memory) {
        return _lastCheckpoint;
    }

    /// @inheritdoc IEtnaInbox
    function genesis() external view returns (GenesisRecord memory) {
        return _genesis;
    }

    /// @inheritdoc IEtnaInbox
    function etnaStart() external view returns (uint48 height_, bytes32 blockHash_) {
        return (_genesis.genesisHeight, _genesis.genesisBlockHash);
    }

    /// @inheritdoc IEtnaInbox
    function rulesSchedule() external view returns (RulesSchedule memory) {
        return _rulesSchedule;
    }

    /// @inheritdoc IEtnaInbox
    function genesisCommitteeRecordHash() external view returns (bytes32) {
        return _genesisCommitteeRecordHash;
    }

    /// @inheritdoc IEtnaInbox
    function genesisCutoff() external view returns (uint48) {
        return _genesisCutoff;
    }

    /// @inheritdoc IEtnaInbox
    function forcedInclusionDelay() external view returns (uint48) {
        return _forcedInclusionConfig.delay;
    }

    /// @inheritdoc IEtnaInbox
    function maxAnchorAge() external view returns (uint48) {
        return _forcedInclusionConfig.maxAnchorAge;
    }

    /// @inheritdoc IEtnaInbox
    function activeCommitteeSnapshot() external view returns (uint256) {
        return _activeCommitteeSnapshot;
    }

    /// @inheritdoc IEtnaInbox
    function landings(uint256 _height) external view returns (Landing memory) {
        return _landings[_height];
    }

    /// @inheritdoc IEtnaInbox
    function origins(uint256 _generation) external view returns (Origin memory) {
        return _origins[_generation];
    }

    /// @inheritdoc IEtnaInbox
    function generationStartHeight() external view returns (uint256) {
        require(_genesis.genesisBlockHash != 0, StartNotWritten());
        return _origins[_recoveryGeneration].startHeight;
    }

    /// @inheritdoc IEtnaInbox
    function recoverySnapshot() external view returns (uint256) {
        require(_genesis.genesisBlockHash != 0, StartNotWritten());
        return _origins[_recoveryGeneration].l1BlockNumber;
    }

    /// @inheritdoc IEtnaInbox
    function getForcedInclusionState() external view returns (uint48 head_, uint48 tail_) {
        return (_forcedInclusions.head, _forcedInclusions.tail);
    }

    /// @inheritdoc IEtnaInbox
    function getForcedInclusion(uint48 _index) external view returns (ForcedInclusion memory) {
        return _forcedInclusions.queue[_index];
    }

    /// @inheritdoc IEtnaInbox
    function getForcedInclusions(
        uint48 _start,
        uint48 _maxCount
    )
        external
        view
        returns (ForcedInclusion[] memory)
    {
        return _forcedInclusions.getForcedInclusions(_start, _maxCount);
    }

    /// @inheritdoc IEtnaInbox
    function getCurrentForcedInclusionFee() external view returns (uint64 feeInGwei_) {
        return
            _forcedInclusions.currentFee(
                forcedInclusionFeeInGwei, forcedInclusionFeeDoubleThreshold
            );
    }

    /// @inheritdoc IEtnaInbox
    function stakingRegistry() external view returns (address) {
        return address(_stakingRegistry);
    }

    /// @inheritdoc IEtnaInbox
    function signalService() external view returns (address) {
        return address(_signalService);
    }

    /// @inheritdoc IEtnaInbox
    function proofVerifier() external view returns (address) {
        return address(_proofVerifier);
    }

    // ---------------------------------------------------------------
    // Public Functions
    // ---------------------------------------------------------------

    /// @notice Upgrades the implementation and calls `_data` on it, without accepting ETH.
    /// @dev Only `saveForcedInclusion` accepts ETH (spec 7.1). The override must stay payable, so
    /// it rejects a non-zero `msg.value` itself; the owner check is unchanged.
    /// @param _newImplementation The new implementation.
    /// @param _data The call to delegate to the new implementation.
    function upgradeToAndCall(
        address _newImplementation,
        bytes memory _data
    )
        public
        payable
        override
    {
        require(msg.value == 0, EtherNotAccepted());
        super.upgradeToAndCall(_newImplementation, _data);
    }

    // ---------------------------------------------------------------
    // Private Functions
    // ---------------------------------------------------------------

    /// @dev Spec 6.1 steps 1 and 2: generationStartHeight() <= p <= c < h < 2^48, p - S and h - S
    /// on the grid, h - p <= maxBatchBlocks, a retained origin record in the current generation
    /// unless p is the generation's start height, and the Unzen start check while c is S on a
    /// switching network.
    /// @param _input The landing inputs.
    /// @param _c The checkpoint height.
    /// @param _generation The recovery generation.
    /// @return origin_ The landing record at p.
    function _checkRangeAndOrigin(
        LandInput calldata _input,
        uint256 _c,
        uint48 _generation
    )
        private
        view
        returns (Landing memory origin_)
    {
        uint256 p = _input.parentHeight;
        uint256 h = _input.lastHeight;
        uint256 startHeight = _origins[_generation].startHeight;
        uint256 s = _genesis.genesisHeight;

        require(_c < h, AlreadySettled());
        require(startHeight <= p && p <= _c && h < _HEIGHT_LIMIT, InvalidRange());
        // No underflow: every generation starts at or above S.
        require((p - s) % GRID_INTERVAL == 0 && (h - s) % GRID_INTERVAL == 0, OffGrid());
        require(h - p <= maxBatchBlocks, BatchTooLarge());

        origin_ = _landings[p];
        // A written record never has a zero EL hash: the start write rejects a zero start hash,
        // and `land` saves each hash as a SignalService checkpoint, which rejects a zero hash.
        require(origin_.elHash != 0, MissingOrigin());
        require(origin_.generation == _generation || p == startHeight, ForeignGeneration());

        // c == S forces p == S, so origin_ is S's record.
        if (_c == s && unzenInbox != address(0)) _checkUnzenStart(_c, origin_.elHash);
    }

    /// @dev Spec 6.1 LAND-6.1-8a: the Unzen Inbox has finalized every proposal (it numbers them
    /// from 1 after its finalized activation proposal 0) up to the block whose hash is the
    /// start's, and the SignalService checkpoint the Unzen Inbox saved at S holds that hash and
    /// the start's state root (slot 274).
    /// @param _s The Etna start S, equal to c.
    /// @param _startHash The EL hash in S's landing record.
    function _checkUnzenStart(uint256 _s, bytes32 _startHash) private view {
        IInbox.CoreState memory state = IInbox(unzenInbox).getCoreState();
        require(
            uint256(state.nextProposalId) == uint256(state.lastFinalizedProposalId) + 1,
            UnzenNotFinalized()
        );
        require(state.lastFinalizedBlockHash == _startHash, UnzenStartMismatch());

        // Reverts if the SignalService has no checkpoint at S.
        ICheckpointStore.Checkpoint memory checkpoint = _signalService.getCheckpoint(uint48(_s));
        require(
            checkpoint.blockHash == _startHash && checkpoint.stateRoot == _genesis.genesisStateRoot,
            StartCheckpointMismatch()
        );
    }

    /// @dev Spec 6.1 steps 3 and 4: exactly the (h - p) / 6 - 1 grid-point leaves, c's recorded
    /// queue head equal to the queue head, the leaf at c equal to cutLeaf(c) over c's record if
    /// c > p, and a new queue head in [head, tail] at most h - c past the head.
    /// @param _input The landing inputs.
    /// @param _leaves The cut leaves at the grid points in (p, h).
    /// @param _c The checkpoint height.
    /// @return headAfter_ The new queue head.
    function _checkLeavesAndHead(
        LandInput calldata _input,
        bytes32[] calldata _leaves,
        uint256 _c
    )
        private
        view
        returns (uint256 headAfter_)
    {
        uint256 p = _input.parentHeight;
        uint256 h = _input.lastHeight;
        require(_leaves.length == (h - p) / GRID_INTERVAL - 1, LeafCountMismatch());

        Landing storage cur = _landings[_c];
        uint256 head = cur.head;
        require(head == _forcedInclusions.head, ForcedInclusionHeadMismatch());
        if (_c > p) {
            require(
                _leaves[(_c - p) / GRID_INTERVAL - 1]
                    == keccak256(abi.encode(_c, cur.elHash, cur.cometHash, head, cur.valStateHash)),
                FrontierLeafMismatch()
            );
        }

        headAfter_ = _input.forcedInclusionHead;
        require(
            head <= headAfter_ && headAfter_ <= _forcedInclusions.tail
                && headAfter_ - head <= h - _c,
            InvalidForcedInclusionHead()
        );
    }

    /// @dev Spec 10 step 5b: the start write. Writes slot 272 as (S, L1_0 = block.number, L),
    /// slots 273/274, generation 0's origin (S, L1_0, block.timestamp), the checkpoint (S, hash)
    /// and landings[S] = (S, 0, 0, hash, 0, 0), and emits `StartWritten`. Callers check that S,
    /// block.number and block.timestamp fit 48 bits.
    /// @param _height The Etna start S.
    /// @param _blockHash The EL block hash of S.
    /// @param _stateRoot The state root of S.
    function _writeStart(uint256 _height, bytes32 _blockHash, bytes32 _stateRoot) private {
        uint48 s = uint48(_height);
        _genesis = GenesisRecord({
            genesisHeight: s,
            l1Block: uint48(block.number),
            epochLenL2: _genesis.epochLenL2,
            genesisBlockHash: _blockHash,
            genesisStateRoot: _stateRoot
        });
        _origins[0] = Origin({
            startHeight: _height, l1BlockNumber: block.number, l1Timestamp: block.timestamp
        });
        _lastCheckpoint = LandedCheckpoint({ height: s, blockHash: _blockHash });
        _landings[_height] = Landing({
            parentHeight: s,
            generation: 0,
            head: 0,
            elHash: _blockHash,
            cometHash: 0,
            valStateHash: 0
        });
        emit StartWritten(_height, _blockHash, _stateRoot);
    }

    /// @dev Spec 8.3: the Inbox is initialized and its start written, the expected generation,
    /// checkpoint and nonce are current, c - S is a multiple of K, the authorization has not
    /// expired, and the new generation, block.number and block.timestamp fit 48 bits (c already
    /// does).
    /// @param _expectedGeneration The authorized generation.
    /// @param _expectedC The authorized checkpoint height.
    /// @param _expectedRecoveryNonce The authorized nonce.
    /// @param _validUntil The inclusive authorization deadline.
    /// @return c_ The checkpoint height.
    /// @return newGeneration_ The generation recovery starts.
    function _checkRecoveryState(
        uint48 _expectedGeneration,
        uint256 _expectedC,
        uint256 _expectedRecoveryNonce,
        uint256 _validUntil
    )
        private
        view
        returns (uint48 c_, uint48 newGeneration_)
    {
        require(_initStatus == INITIALIZED_STATUS, NotInitialized());
        require(_genesis.genesisBlockHash != 0, StartNotWritten());
        uint48 generation = _recoveryGeneration;
        require(_expectedGeneration == generation, GenerationMismatch());
        c_ = _lastCheckpoint.height;
        require(_expectedC == c_, CheckpointMismatch());
        require((_expectedC - _genesis.genesisHeight) % GRID_INTERVAL == 0, CheckpointOffGrid());
        require(_expectedRecoveryNonce == _recoveryNonce, RecoveryNonceMismatch());
        require(block.timestamp <= _validUntil, AuthorizationExpired());
        newGeneration_ = _toUint48(uint256(generation) + 1);
        // RECOV-8.4-4: an origin record is written once. Only an upgrade that wrote the next
        // generation's record without advancing the generation could trip this.
        require(_origins[newGeneration_].l1BlockNumber == 0, OriginAlreadyWritten());
        require(
            block.number <= type(uint48).max && block.timestamp <= type(uint48).max, ValueOverflow()
        );
    }

    /// @dev Spec 8 RECOV-8-47a: checks a non-zero `_rules` against nextRules + 1 and returns the
    /// schedule recovery writes: the stop cleared and, for a non-zero `_rules`, activeRules =
    /// nextRules = `_rules` with rulesTime 0.
    /// @param _rules Zero, or the new generation's ruleset.
    /// @return schedule_ The new rules schedule.
    function _recoveredRulesSchedule(uint48 _rules)
        private
        view
        returns (RulesSchedule memory schedule_)
    {
        schedule_ = _rulesSchedule;
        if (_rules != 0) {
            require(uint256(_rules) == uint256(schedule_.nextRules) + 1, InvalidRules());
            schedule_.activeRules = _rules;
            schedule_.nextRules = _rules;
            schedule_.rulesTime = 0;
        }
        schedule_.stopTime = 0;
        schedule_.stopGrid = 0;
    }

    /// @dev Stores the rules schedule in slot 293 and emits its packed word.
    /// @param _schedule The new rules schedule.
    function _setRulesSchedule(RulesSchedule memory _schedule) private {
        _rulesSchedule = _schedule;
        emit RulesScheduleUpdated(uint256(_schedule.activeRules) | uint256(_schedule.nextRules)
                << 48 | uint256(_schedule.rulesTime) << 96 | uint256(_schedule.stopTime) << 144
                | uint256(_schedule.stopGrid) << 192);
    }

    /// @dev Spec 8 steps 1-3: exclusions sorted strictly by bond id, then queue indices strictly
    /// increasing and within [head, tail). Strict order makes the first and last indices bound
    /// the whole list.
    /// @param _exclusions The entries to force out.
    /// @param _fiToClear The queue indices to blank.
    function _checkRecoveryLists(
        Exclusion[] calldata _exclusions,
        uint256[] calldata _fiToClear
    )
        private
        view
    {
        for (uint256 i = 1; i < _exclusions.length; ++i) {
            require(_exclusions[i - 1].bondId < _exclusions[i].bondId, ExclusionsNotSorted());
        }

        uint256 count = _fiToClear.length;
        if (count == 0) return;
        for (uint256 i = 1; i < count; ++i) {
            require(_fiToClear[i - 1] < _fiToClear[i], FiToClearNotSorted());
        }
        require(
            _fiToClear[0] >= _forcedInclusions.head
                && _fiToClear[count - 1] < _forcedInclusions.tail,
            FiIndexOutOfRange()
        );
    }

    /// @dev Builds the landing statement (appendix A) and hashes its 23 words. Runs spec 6.1
    /// step 5: reads the reference block hash and the blob hashes, reverting if either is
    /// unavailable. A separate frame keeps `land` within the non-IR compiler's stack limit.
    /// @param _input The landing inputs.
    /// @param _origin The landing record at p: the source of parentHash, parentCometHash,
    /// parentValStateHash and headBefore.
    /// @param _generation The recovery generation.
    /// @param _cutHash The cut hash.
    /// @return The statement hash.
    function _hashLandStatement(
        LandInput calldata _input,
        Landing memory _origin,
        uint48 _generation,
        bytes32 _cutHash
    )
        private
        view
        returns (bytes32)
    {
        LandStatement memory statement;
        statement.tag = _LAND_STATEMENT_TAG;
        statement.l1ChainId = block.chainid;
        statement.l2ChainId = l2ChainId;
        statement.inbox = address(this);
        statement.stakingRegistry = address(_stakingRegistry);
        statement.generation = _generation;
        statement.parentHeight = _input.parentHeight;
        statement.parentHash = _origin.elHash;
        statement.parentCometHash = _origin.cometHash;
        statement.parentValStateHash = _origin.valStateHash;
        statement.committeeConfigHash = _committeeConfigHash;
        statement.lastHeight = _input.lastHeight;
        statement.lastBlockHash = _input.lastBlockHash;
        statement.lastCometHash = _input.lastCometHash;
        statement.lastValStateHash = _input.lastValStateHash;
        statement.lastStateRoot = _input.lastStateRoot;
        statement.l1ReferenceBlockNumber = _input.l1ReferenceBlockNumber;
        statement.l1ReferenceBlockHash = _readL1ReferenceBlockHash(_input.l1ReferenceBlockNumber);
        statement.blobHashesHash = _hashBlobHashes();
        statement.forcedInclusionHeadBefore = _origin.head;
        statement.forcedInclusionHeadAfter = _input.forcedInclusionHead;
        statement.activeCommitteeSnapshot = _input.activeCommitteeSnapshot;
        statement.cutHash = _cutHash;
        return keccak256(abi.encode(statement));
    }

    /// @dev Spec 6.1 step 7: moves the checkpoint to h, stores the proven snapshot and the new
    /// queue head, writes landings[h] with the actual parent c, saves the SignalService
    /// checkpoint and emits `Landed`. Every narrowing below is exact: h < 2^48 and the new head
    /// is at most the 48-bit tail.
    /// @param _input The landing inputs.
    /// @param _c The checkpoint height the landing settles on.
    /// @param _generation The recovery generation.
    /// @param _headAfter The new queue head.
    /// @param _cutHash The cut hash.
    function _settle(
        LandInput calldata _input,
        uint256 _c,
        uint48 _generation,
        uint256 _headAfter,
        bytes32 _cutHash
    )
        private
    {
        uint48 h = uint48(_input.lastHeight);
        bytes32 lastBlockHash = _input.lastBlockHash;

        _lastCheckpoint = LandedCheckpoint({ height: h, blockHash: lastBlockHash });
        _activeCommitteeSnapshot = _input.activeCommitteeSnapshot;
        _forcedInclusions.head = uint48(_headAfter);
        _landings[h] = Landing({
            parentHeight: uint48(_c),
            generation: _generation,
            head: uint48(_headAfter),
            elHash: lastBlockHash,
            cometHash: _input.lastCometHash,
            valStateHash: _input.lastValStateHash
        });

        _signalService.saveCheckpoint(
            ICheckpointStore.Checkpoint({
                blockNumber: h, blockHash: lastBlockHash, stateRoot: _input.lastStateRoot
            })
        );

        emit Landed(_input.parentHeight, _c, h, _cutHash, _input.activeCommitteeSnapshot, VERSION);
    }

    /// @dev Returns the hash of L1 block `_number`: from `blockhash` up to 256 blocks back, from
    /// the EIP-2935 history contract up to 8191 blocks back. The number is a full word, so a
    /// value of 2^64 or more is never in the past.
    /// @param _number The L1 block number.
    /// @return hash_ The block hash; reverts with `ReferenceBlockUnavailable` unless the block is
    /// in the past, within the window and its hash non-zero.
    function _readL1ReferenceBlockHash(uint256 _number) private view returns (bytes32 hash_) {
        require(_number < block.number, ReferenceBlockUnavailable());
        uint256 age = block.number - _number;
        if (age <= _BLOCKHASH_WINDOW) {
            hash_ = blockhash(_number);
        } else {
            require(age <= _HISTORY_SERVE_WINDOW, ReferenceBlockUnavailable());
            (bool success, bytes memory data) =
                _HISTORY_STORAGE_ADDRESS.staticcall(abi.encode(_number));
            require(success && data.length == 32, ReferenceBlockUnavailable());
            hash_ = abi.decode(data, (bytes32));
        }
        require(hash_ != 0, ReferenceBlockUnavailable());
    }

    /// @dev Returns keccak256(abi.encodePacked(blobHashes)) over the transaction's versioned blob
    /// hashes in index order, up to the first zero.
    /// @return The hash of the blob hash list; reverts with `InvalidBlobCount` unless there are
    /// 1 to 6 blobs.
    function _hashBlobHashes() private view returns (bytes32) {
        uint256 count;
        while (count <= MAX_BLOBS && blobhash(count) != 0) {
            ++count;
        }
        require(count != 0 && count <= MAX_BLOBS, InvalidBlobCount());

        bytes32[] memory hashes = new bytes32[](count);
        for (uint256 i; i < count; ++i) {
            hashes[i] = blobhash(i);
        }
        return keccak256(abi.encodePacked(hashes));
    }

    /// @dev Checks the spec 10 deployment constraints `init` can check, and that the genesis hash
    /// and state root are both non-zero on a new network and both zero on a switching network.
    /// Every stored 48-bit field fits once these pass: the cutoff is below `block.number`, itself
    /// below 2^48.
    /// @param _params The initialization inputs.
    function _validateInitParams(InitParams calldata _params) private view {
        bool newNetwork = unzenInbox == address(0);
        require(
            (_params.genesisBlockHash != 0) == newNetwork
                && (_params.genesisStateRoot != 0) == newNetwork,
            InvalidGenesis()
        );
        require(_params.committeeRecordHash != 0, ZeroCommitteeRecord());
        // L + 1 < 2^48.
        require(
            _params.epochLenL2 >= _MIN_EPOCH_LEN_L2 && _params.epochLenL2 < type(uint48).max,
            InvalidEpochLength()
        );
        require(_isValidCommitteeConfig(_params.committeeConfig), InvalidCommitteeConfig());
        require(
            _params.forcedInclusionDelay != 0 && _params.forcedInclusionDelay <= type(uint48).max,
            InvalidForcedInclusionDelay()
        );
        require(
            _params.maxAnchorAge >= _MIN_MAX_ANCHOR_AGE && _params.maxAnchorAge <= type(uint48).max,
            InvalidMaxAnchorAge()
        );
        require(
            block.number <= type(uint48).max && block.timestamp <= type(uint48).max, ValueOverflow()
        );
        // The registry must be this Inbox's before its checkpoints are trusted (spec 4.1).
        require(
            _stakingRegistry.inbox() == address(this) && _stakingRegistry.l2ChainId() == l2ChainId,
            RegistryMismatch()
        );
        require(_isValidGenesisCutoff(_params.genesisCutoff), InvalidGenesisCutoff());
    }

    /// @dev Returns whether `_cutoff` is a past L1 block at or after the registry's first
    /// checkpoint; a registry without checkpoints accepts none.
    /// @param _cutoff The genesis cutoff.
    /// @return Whether the cutoff is valid.
    function _isValidGenesisCutoff(uint256 _cutoff) private view returns (bool) {
        return _cutoff < block.number && _stakingRegistry.checkpointCount() != 0
            && _cutoff >= _stakingRegistry.checkpointAt(0).l1Block;
    }

    /// @dev Returns whether the committee configuration is within the spec 10 bounds:
    /// 6 <= U <= 65,532 with U a multiple of 6, vp_unit >= 867,361,738, s_min >= vp_unit and
    /// 1 <= n_max <= 4096.
    /// @param _config The committee configuration.
    /// @return Whether the configuration is valid.
    function _isValidCommitteeConfig(CommitteeConfig calldata _config) private pure returns (bool) {
        uint256 unsettledLimit = _config.unsettledLimit;
        return unsettledLimit >= GRID_INTERVAL && unsettledLimit <= _MAX_UNSETTLED_LIMIT
            && unsettledLimit % GRID_INTERVAL == 0 && _config.vpUnit >= _MIN_VP_UNIT
            && _config.sMin >= _config.vpUnit && _config.nMax != 0
            && _config.nMax <= _MAX_COMMITTEE_SIZE;
    }

    /// @dev Narrows `_value` to a 48-bit storage field (appendix B).
    /// @param _value The value to store.
    /// @return The value as a `uint48`; reverts with `ValueOverflow` if it is 2^48 or more.
    function _toUint48(uint256 _value) private pure returns (uint48) {
        require(_value <= type(uint48).max, ValueOverflow());
        return uint48(_value);
    }

    /// @dev Returns `committeeConfigHash`: keccak256 over the seven words (224 bytes) of the tag,
    /// the L2 chain id, the registry and the four configuration values (appendix A).
    /// @param _config The committee configuration.
    /// @return The configuration hash.
    function _hashCommitteeConfig(CommitteeConfig calldata _config) private view returns (bytes32) {
        return keccak256(
            abi.encode(
                _COMMITTEE_CONFIG_TAG,
                uint256(l2ChainId),
                address(_stakingRegistry),
                _config.vpUnit,
                _config.sMin,
                _config.nMax,
                _config.unsettledLimit
            )
        );
    }

    /// @dev Rejects callbacks from token transfers and other registry mutations. The reciprocal
    /// registry check blocks mutations during Inbox execution, except its authorized forceExit.
    function _checkRegistryUnlocked() private view {
        require(!EssentialContract(address(_stakingRegistry)).inNonReentrant(), RegistryLocked());
    }
}
        

contracts/layer1/etna/iface/IEtnaStakingRegistry.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

/// @title IEtnaStakingRegistry
/// @notice The TAIKO staking registry the Etna committees are selected from (spec 4.1).
/// @dev Section numbers refer to the Etna specification. Validators register a secp256k1
/// consensus key with a stake. Each registration issues a new bond id, counting up from 0 and
/// never reused, and takes the slot with the smallest value (an empty slot's value is 0, a held
/// slot's its bond's effStake + pendingTopUp; ties go to the lowest slot), displacing its bond if
/// it is held. A bond holds its slot until it is displaced or withdrawn; its record outlives the
/// slot. Every L1 block that changes the entry in a slot ends with one checkpoint holding the slot
/// count and the entries root at the end of that block. Nodes read only `checkpoints` (slot R)
/// and the slot-indexed `entries` (slot R + 1) of the ERC-7201 namespace `taiko.etna.registry`
/// with EIP-1186 proofs (spec appendix B); every packed word lays its fields out in declaration
/// order from the least-significant bit. The Inbox proxy is fixed at deployment.
/// @custom:security-contact security@taiko.xyz
interface IEtnaStakingRegistry {
    // ---------------------------------------------------------------
    // Structs
    // ---------------------------------------------------------------

    /// @notice The immutable parameters of a registry implementation (spec 11).
    struct Config {
        /// @notice The staked TAIKO token.
        address token;
        /// @notice The minimum stake of a registration in token base units; non-zero.
        uint256 minStake;
        /// @notice The L1 blocks from registration until the entry is active; in [1, 2^32).
        uint256 activationDelay;
        /// @notice The L1 blocks from the exit request, or the activation if later, until the
        /// exit takes effect; in [1, 2^32).
        uint256 exitDelay;
        /// @notice The L1 blocks from the exit confirmation until the bond can be withdrawn; in
        /// [1, 2^32). Spec 11 also asks for no less than the double-sign evidence window
        /// (suggested at least 50,400 L1 blocks), which the constructor does not check.
        uint256 withdrawalDelay;
        /// @notice The share of a slashed stake paid to the reporter, in basis points; below
        /// 10,000 (zero is allowed).
        uint256 slashBountyBps;
        /// @notice The receiver of a slashed stake minus the bounty; non-zero.
        address slashSink;
        /// @notice The chain id of the Etna L2; non-zero and equal to the Inbox's.
        uint64 l2ChainId;
        /// @notice The Etna Inbox proxy; must have code.
        address inbox;
        /// @notice The responsibility-forfeiture rate in basis points, in [1, 10,000].
        uint256 forfeitBps;
    }

    /// @notice The registry at the end of an L1 block that changed an entry (array at slot R, two
    /// words each); the first word packs `l1Block` and `count`.
    struct Checkpoint {
        /// @notice The L1 block.
        uint48 l1Block;
        /// @notice The number of slots used so far, empty ones included.
        uint48 count;
        /// @notice The entries root over the first `count` entries (appendix A).
        bytes32 entriesRoot;
    }

    /// @notice An entry, indexed by slot (array at slot R + 1, three words each); the third
    /// word packs `ckPrefix`, `activeFromL1` and `exitEffectiveL1`.
    /// @dev An empty slot's entry is all zero.
    struct Entry {
        /// @notice The X coordinate of the secp256k1 consensus key.
        bytes32 ckX;
        /// @notice The effective stake in token base units; zero once slashed.
        uint256 effStake;
        /// @notice The SEC1 prefix of the consensus key, 0x02 or 0x03.
        uint8 ckPrefix;
        /// @notice The first L1 block at which the entry may be selected.
        uint48 activeFromL1;
        /// @notice The L1 block at which the exit takes effect; 2^48 - 1 if no exit is set.
        uint48 exitEffectiveL1;
    }

    /// @notice A bond's record, kept from registration on whether or not it holds a slot.
    struct Bond {
        /// @notice The bond's fields, mirrored into its slot's entry while it holds one. Withdrawal
        /// zeros `effStake` and keeps the rest.
        Entry entry;
        /// @notice The slot the bond holds or last held.
        uint16 slot;
        /// @notice Whether the bond holds `slot`.
        bool holdsSlot;
        /// @notice Whether the bond was withdrawn.
        bool withdrawn;
    }

    /// @notice A CometBFT vote submitted as double-sign evidence (spec 4.1, appendix A).
    struct Vote {
        /// @notice The vote type: 1 for prevote, 2 for precommit.
        uint8 voteType;
        /// @notice The L2 height, in [1, 2^63).
        uint64 height;
        /// @notice The consensus round, below 2^31.
        uint32 round;
        /// @notice The block id hash: empty or exactly 32 bytes, including all-zero bytes.
        /// @dev A nil vote has both hashes empty and partsTotal zero.
        bytes blockHash;
        /// @notice The part set header total.
        uint32 partsTotal;
        /// @notice The part set header hash: empty or exactly 32 bytes, including all-zero bytes.
        bytes partsHash;
        /// @notice The seconds of the vote timestamp since the Unix epoch: a signed int64 carried
        /// as its 64-bit two's-complement pattern (e.g. -1 is 2^64 - 1). Every value is accepted,
        /// including seconds outside CometBFT's Timestamp range (0001-01-01T00:00:00Z up to
        /// 10000-01-01T00:00:00Z), which stock CometBFT would not sign.
        uint64 timestampSeconds;
        /// @notice The nanoseconds of the vote timestamp: a signed int32 carried as its 32-bit
        /// two's-complement pattern (e.g. -1 is 2^32 - 1). Every value is accepted, including
        /// negative nanos and nanos of 10^9 or more, which stock CometBFT would not sign.
        uint32 timestampNanos;
        /// @notice The recovery generation of the chain id the vote is signed under.
        uint48 generation;
        /// @notice The 65-byte signature R ‖ S ‖ V, with V in {0, 1} and S at most n / 2.
        bytes signature;
    }

    // ---------------------------------------------------------------
    // Events
    // ---------------------------------------------------------------

    /// @notice Emitted when a validator registers.
    /// @param bondId The new bond id.
    /// @param owner The bond owner, the caller.
    /// @param ckAddr The consensus key's address, keccak256(ckX ‖ ckY)[12:].
    /// @param ckPrefix The SEC1 prefix of the consensus key.
    /// @param ckX The X coordinate of the consensus key.
    /// @param amount The stake pulled from the owner.
    /// @param activeFromL1 The first L1 block at which the entry may be selected.
    event Registered(
        uint256 indexed bondId,
        address indexed owner,
        address indexed ckAddr,
        uint8 ckPrefix,
        bytes32 ckX,
        uint256 amount,
        uint48 activeFromL1
    );

    /// @notice Emitted when a registration displaces the bond holding the slot it takes.
    /// @param bondId The displaced bond.
    /// @param slot The slot.
    /// @param replacementBondId The new bond now holding the slot.
    event BondDisplaced(
        uint256 indexed bondId, uint256 indexed slot, uint256 indexed replacementBondId
    );

    /// @notice Emitted when the bond owner sets an exit.
    /// @param bondId The bond id.
    /// @param exitEffectiveL1 The L1 block at which the exit takes effect.
    event ExitRequested(uint256 indexed bondId, uint48 exitEffectiveL1);

    /// @notice Emitted when an owner deposits delayed principal (spec 4.1).
    /// @param bondId The bond id.
    /// @param amount The deposited TAIKO base units.
    /// @param readyAtL1 The first L1 block at which activation may be called.
    event TopUpDeposited(uint256 indexed bondId, uint256 amount, uint48 readyAtL1);

    /// @notice Emitted when pending principal becomes effective stake.
    /// @param bondId The bond id.
    /// @param amount The activated TAIKO base units.
    event TopUpActivated(uint256 indexed bondId, uint256 amount);

    /// @notice Emitted when the DAO deducts principal and forces an exit (spec 4.4).
    /// @param bondId The bond id.
    /// @param entryKey The lifetime consensus-key identity.
    /// @param incidentId The DAO's published attribution identifier; not globally unique.
    /// @param balanceBefore The effective and pending principal at execution.
    /// @param penalty The amount sent to slashSink.
    event Forfeited(
        uint256 indexed bondId,
        bytes32 indexed entryKey,
        bytes32 incidentId,
        uint256 balanceBefore,
        uint256 penalty
    );

    /// @notice Emitted when an exit is first confirmed.
    /// @param bondId The bond id.
    /// @param exitConfirmedAtL1 The L1 block of the confirmation, where the withdrawal delay
    /// starts.
    event ExitConfirmed(uint256 indexed bondId, uint256 exitConfirmedAtL1);

    /// @notice Emitted when a bond is withdrawn.
    /// @param bondId The bond id.
    /// @param to The recipient of the stake; zero when nothing is paid.
    /// @param amount The stake paid out; zero for a slashed bond.
    event StakeWithdrawn(uint256 indexed bondId, address indexed to, uint256 amount);

    /// @notice Emitted when double-sign evidence slashes a bond.
    /// @param bondId The bond id.
    /// @param reporter The caller, who receives the bounty.
    /// @param amount The slashed stake.
    /// @param bounty The part of `amount` paid to the reporter.
    /// @param generation The votes' recovery generation.
    /// @param height The votes' height.
    /// @param round The votes' round.
    /// @param voteType The votes' type.
    event DoubleSignSlashed(
        uint256 indexed bondId,
        address indexed reporter,
        uint256 amount,
        uint256 bounty,
        uint48 generation,
        uint64 height,
        uint32 round,
        uint8 voteType
    );

    /// @notice Emitted when governance recovery moves a bond's exit earlier.
    /// @param bondId The bond id.
    /// @param exitEffectiveL1 The new exit block, R.
    event ExitForced(uint256 indexed bondId, uint48 exitEffectiveL1);

    /// @notice Emitted when the current block's checkpoint is appended or overwritten.
    /// @param index The checkpoint index.
    /// @param l1Block The L1 block of the checkpoint, the current block.
    /// @param count The number of slots used so far.
    /// @param entriesRoot The entries root.
    event CheckpointWritten(
        uint256 indexed index, uint48 l1Block, uint48 count, bytes32 entriesRoot
    );

    // ---------------------------------------------------------------
    // External Functions
    // ---------------------------------------------------------------

    /// @notice Registers a consensus key with a stake pulled from the caller, who becomes the bond
    /// owner (spec 4.1).
    /// @dev `_publicKey` is exactly 33 bytes of canonical SEC1 compressed secp256k1 encoding,
    /// prefix 0x02 or 0x03 followed by the 32-byte big-endian X; the registry decompresses it
    /// (appendix A) and rejects any other encoding. `_popSig` is exactly 65 bytes R ‖ S ‖ V with
    /// V in {0, 1}, 0 < R < n and 0 < S <= n / 2, recovering over `registerDigest(msg.sender)` to
    /// the key's address. Each key address registers once, ever. Takes the slot of
    /// `admissionThreshold()` and requires `_amount >= minStake` and `_amount` above that slot's
    /// value. A bond holding the slot is displaced: it leaves the slot, its exit becomes
    /// min(its exit, block.number), `BondDisplaced` is emitted, and nothing else about it
    /// changes. The new entry stores only `ckPrefix` and `ckX`, becomes active `activationDelay`
    /// blocks later and has no exit set. Writes the current block's checkpoint.
    /// @param _publicKey The 33-byte compressed consensus key.
    /// @param _amount The stake; the caller must have approved it.
    /// @param _popSig The proof of possession.
    /// @return bondId_ The new bond id.
    function register(
        bytes calldata _publicKey,
        uint256 _amount,
        bytes calldata _popSig
    )
        external
        returns (uint256 bondId_);

    /// @notice Sets the exit of an entry (spec 4.1).
    /// @dev Only the bond owner, and only while no exit is set (so the bond holds its slot). The
    /// exit takes effect at max(block.number, activeFromL1) + exitDelay, which must be below
    /// 2^48 - 1. Writes the current block's checkpoint.
    /// @param _bondId The bond id.
    function requestExit(uint256 _bondId) external;

    /// @notice Deposits principal into an active bond without using another slot (spec 4.1).
    /// @dev Only its owner, with positive effective stake, no exit and no pending deposit.
    /// Transfers `_amount` TAIKO and records readiness after activationDelay L1 blocks.
    /// Pending principal has no voting power and changes no entry checkpoint, but it counts in
    /// the slot's admission value. Available before Inbox initialization; a ready deposit still
    /// requires explicit activation.
    /// @param _bondId The unwithdrawn bond.
    /// @param _amount The positive TAIKO base units approved to this registry.
    function topUp(uint256 _bondId, uint256 _amount) external;

    /// @notice Activates all pending principal once its L1 readiness block is reached.
    /// @dev Anyone may call, with a pending deposit and no exit set. Clears pending state and
    /// writes the usual entry checkpoint; historical snapshots and committees remain unchanged.
    /// @param _bondId The unwithdrawn bond.
    function activateTopUp(uint256 _bondId) external;

    /// @notice Deducts a fixed fraction of remaining principal and forces exit (spec 4.4).
    /// @dev Registry owner only after Inbox initialization, once per lifetime entryKey, through
    /// any DAO execution path. Checks the bond's key, positive effective plus pending principal,
    /// and block.timestamp <= _validUntil, whether or not the bond holds a slot. Deducts
    /// ceil(balance * forfeitBps / 10000) from effective stake first, then pending funds; pays
    /// only slashSink. Writes a checkpoint only if the bond holds a slot and its entry changed.
    /// Preserves any exit confirmation. No nonce, revocation, freeze or additional delay; landing
    /// and recovery do not invalidate an unexecuted authorization. Attribution is a governance
    /// responsibility.
    /// @param _bondId The unwithdrawn bond, including requested or confirmed exits.
    /// @param _entryKey keccak256(abi.encode(ckPrefix, ckX)) of the bond's key.
    /// @param _incidentId The published attribution identifier.
    /// @param _validUntil The inclusive L1 Unix timestamp deadline in seconds.
    function forfeit(
        uint256 _bondId,
        bytes32 _entryKey,
        bytes32 _incidentId,
        uint256 _validUntil
    )
        external;

    /// @notice Returns pending principal and its readiness block, both zero after withdrawal.
    /// @param _bondId The bond id.
    /// @return pendingTopUp_ Pending TAIKO base units, excluded from voting power.
    /// @return readyAtL1_ The L1 readiness block, or zero without pending principal.
    function topUpOf(uint256 _bondId)
        external
        view
        returns (uint256 pendingTopUp_, uint48 readyAtL1_);

    /// @notice Returns the lifetime forfeiture flag, never reset by withdrawal or recovery.
    /// @param _entryKey The consensus-key identity.
    /// @return forfeited_ Whether responsibility forfeiture already executed for this key.
    function forfeited(bytes32 _entryKey) external view returns (bool forfeited_);

    /// @notice Returns the deployment's fixed responsibility-forfeiture rate.
    /// @return forfeitBps_ The basis points, in [1, 10,000].
    function forfeitBps() external view returns (uint256 forfeitBps_);

    /// @notice Records the exit confirmation that starts the withdrawal delay (spec 4.1).
    /// @dev Callable by anyone. Reverts `InboxLocked` while any Inbox entry point that takes its
    /// reentrancy lock is executing. Requires an initialized Inbox, an unwithdrawn bond with an
    /// exit set, and the Inbox's `activeCommitteeSnapshot() >= exitEffectiveL1`: a landed
    /// committee no longer includes the stake. The first call records block.number; later calls
    /// succeed without moving it.
    /// @param _bondId The bond id.
    function confirmExit(uint256 _bondId) external;

    /// @notice Withdraws a bond after its confirmed exit, paying out any remaining stake
    /// (spec 4.1).
    /// @dev Reverts `InboxLocked` whenever the Inbox holds its reentrancy lock (see
    /// `confirmExit`). Requires an unwithdrawn bond, a confirmed exit and block.number >=
    /// exitConfirmedAtL1 + withdrawalDelay. Principal includes both effStake and pendingTopUp.
    /// With positive principal only the bond owner may call and the principal goes to a non-zero
    /// `_to`; a slashed bond is withdrawn by anyone without payment, `_to` is ignored and the
    /// event names the zero address. Zeros the bond's balance, clears its owner, confirmation
    /// and pending fields and marks it withdrawn, keeping its key, activation and exit; the key
    /// stays registered and its lifetime forfeiture flag is retained. If the bond holds a slot,
    /// the slot becomes empty and the current block's checkpoint is written.
    /// @param _bondId The bond id.
    /// @param _to The recipient of the stake; ignored when nothing is paid.
    function withdraw(uint256 _bondId, address _to) external;

    /// @notice Slashes an entry's whole stake for a same-round double sign (spec 4.1).
    /// @dev Callable by anyone once the Inbox is initialized. Both votes have the same type
    /// (prevote or precommit), height, round and generation and different block ids, and the
    /// generation is at most the Inbox's recoveryGeneration. Each signature recovers, over
    /// keccak256 of the vote's sign bytes under this deployment's chain id for that generation
    /// (appendix A), to the address of the bond's stored key. The bond must be unwithdrawn with
    /// a positive effective plus pending principal, whether or not it holds a slot. Clears both
    /// balances and top-up readiness, sets exitEffectiveL1 to min(existing, block.number), pays
    /// floor(principal * slashBountyBps / 10000) to the caller and the remainder to slashSink.
    /// The owner or signer may self-report and receives the same bounty. Sets the
    /// slot's admission value to 0 if the bond holds a slot. Writes the current block's
    /// checkpoint only if the bond holds a slot and its entry changed (a positive effStake or an
    /// exit after the current block).
    /// @param _bondId The bond id.
    /// @param _voteA One vote.
    /// @param _voteB The conflicting vote.
    function slashDoubleSign(uint256 _bondId, Vote calldata _voteA, Vote calldata _voteB) external;

    /// @notice Moves a bond's exit to the recovery execution block during governance recovery
    /// (spec 8 step 2).
    /// @dev Only the Inbox. Requires an issued bond, displaced or withdrawn ones included, whose
    /// key matches `_entryKey = keccak256(abi.encode(ckPrefix, ckX))`, and reverts
    /// `InvalidEventBlock` if `block.number >= 2^48 - 1`, the no-exit sentinel. If the current
    /// block is below the bond's exitEffectiveL1, sets it to that block without slashing, writes
    /// the checkpoint if the bond holds a slot and emits `ExitForced`; otherwise it keeps the
    /// existing exit and writes nothing.
    /// @param _bondId The bond id.
    /// @param _entryKey The bond's expected key.
    function forceExit(uint256 _bondId, bytes32 _entryKey) external;

    /// @notice Returns the number of checkpoints.
    /// @return The number of checkpoints.
    function checkpointCount() external view returns (uint256);

    /// @notice Returns a checkpoint; reverts if it does not exist.
    /// @param _index The checkpoint index.
    /// @return The checkpoint.
    function checkpointAt(uint256 _index) external view returns (Checkpoint memory);

    /// @notice Returns the number of slots used so far, empty ones included.
    /// @return The number of entries.
    function entryCount() external view returns (uint256);

    /// @notice Returns the entry of a slot.
    /// @param _slot The slot; reverts with `UnknownSlot` unless below 4096.
    /// @return entry_ The entry; all zero for an empty slot.
    function entryAt(uint256 _slot) external view returns (Entry memory entry_);

    /// @notice Returns the entries root over all `entryCount()` entries (appendix A).
    /// @dev Equals the latest checkpoint's root; zero with no entry.
    /// @return The entries root.
    function entriesRoot() external view returns (bytes32);

    /// @notice Returns the number of bonds issued, which is the next bond id.
    /// @return The bond count.
    function bondCount() external view returns (uint256);

    /// @notice Returns a bond's record.
    /// @param _bondId The bond id; reverts with `UnknownBond` unless issued.
    /// @return The bond.
    function bondAt(uint256 _bondId) external view returns (Bond memory);

    /// @notice Returns the bond a consensus key address was registered with (appendix A).
    /// @param _ckAddr The consensus key's address.
    /// @return registered_ Whether the key was ever registered; never cleared.
    /// @return bondId_ The bond id; 0 for an unused key.
    function bondForKey(address _ckAddr) external view returns (bool registered_, uint256 bondId_);

    /// @notice Returns the bond holding a slot (appendix A).
    /// @param _slot The slot; reverts with `UnknownSlot` unless below 4096.
    /// @return occupied_ Whether a bond holds the slot.
    /// @return bondId_ The bond id; 0 for an empty slot.
    function bondInSlot(uint256 _slot) external view returns (bool occupied_, uint256 bondId_);

    /// @notice Returns the slot a bond holds (appendix A).
    /// @param _bondId The bond id.
    /// @return holdsSlot_ Whether the bond holds a slot; false for an unissued, displaced or
    /// withdrawn bond.
    /// @return slot_ The slot; 0 if none.
    function slotOfBond(uint256 _bondId) external view returns (bool holdsSlot_, uint256 slot_);

    /// @notice Returns the slot the next registration takes and its value: the smallest
    /// effStake + pendingTopUp of a held slot, 0 for an empty one, ties going to the lowest slot.
    /// @dev A registration must stake more than `value_` and at least `minStake`.
    /// @return slot_ The slot.
    /// @return value_ Its value.
    function admissionThreshold() external view returns (uint256 slot_, uint256 value_);

    /// @notice Returns the owner of a bond.
    /// @param _bondId The bond id.
    /// @return The owner; zero for an unissued or withdrawn bond.
    function ownerOf(uint256 _bondId) external view returns (address);

    /// @notice Returns the L1 block at which a bond's exit was confirmed.
    /// @param _bondId The bond id.
    /// @return The confirmation block; zero if not confirmed.
    function exitConfirmedAtL1(uint256 _bondId) external view returns (uint256);

    /// @notice Returns the EIP-712 digest a registration's proof of possession signs
    /// (appendix A).
    /// @dev keccak256(0x1901 ‖ domainSeparator ‖ keccak256(abi.encode(keccak256("Register(address
    /// owner)"), _owner))), the domain being name "EtnaStakingRegistry", version "1",
    /// chainId = block.chainid and verifyingContract = this registry, computed on every call.
    /// @param _owner The bond owner.
    /// @return The digest.
    function registerDigest(address _owner) external view returns (bytes32);

    /// @notice Returns the Etna Inbox proxy fixed at deployment.
    /// @return The Inbox address.
    function inbox() external view returns (address);

    /// @notice Returns the chain id of the Etna L2.
    /// @return The L2 chain id.
    function l2ChainId() external view returns (uint64);

    // ---------------------------------------------------------------
    // Errors
    // ---------------------------------------------------------------

    /// @notice A constructor parameter is zero, codeless or out of bounds.
    error InvalidConfig();
    /// @notice The stake is below `minStake` or not above the admission threshold.
    error StakeTooLow();
    /// @notice The public key is not a canonical 33-byte compressed secp256k1 point.
    error InvalidPublicKey();
    /// @notice The signature is malformed or does not recover to the expected key.
    error InvalidSignature();
    /// @notice The consensus key was already registered.
    error KeyAlreadyUsed();
    /// @notice The bond id was never issued.
    error UnknownBond();
    /// @notice The slot is not below 4096.
    error UnknownSlot();
    /// @notice The caller is not the bond owner.
    error NotBondOwner();
    /// @notice The bond was withdrawn.
    error BondWithdrawn();
    /// @notice The entry already has an exit set.
    error ExitAlreadySet();
    /// @notice The entry has no exit set.
    error ExitNotSet();
    /// @notice An activation, exit or checkpoint block does not fit below the no-exit sentinel.
    error InvalidEventBlock();
    /// @notice The Inbox is not initialized.
    error InboxNotInitialized();
    /// @notice The Inbox holds its reentrancy lock: an Inbox entry point that takes it is
    /// executing.
    error InboxLocked();
    /// @notice No landed committee excludes the stake yet.
    error ExitNotCovered();
    /// @notice The exit is not confirmed.
    error ExitNotConfirmed();
    /// @notice The withdrawal delay has not elapsed.
    error WithdrawalNotReady();
    /// @notice A vote field is out of range.
    error InvalidVote();
    /// @notice The votes are not a same-round double sign.
    error NotDoubleSign();
    /// @notice The votes' generation is above the Inbox's recovery generation.
    error FutureGeneration();
    /// @notice The bond has no stake to slash.
    error NothingToSlash();
    /// @notice The bond's key does not match the expected entry key.
    error EntryKeyMismatch();
    /// @notice A slot value is not below 2^244.
    error BalanceTooLarge();
    /// @notice The checkpoint index does not exist.
    error UnknownCheckpoint();
    /// @notice The caller is not the Inbox.
    error NotInbox();
    /// @notice The bond is not active yet or has no effective stake.
    error TopUpNotAllowed();
    /// @notice The top-up amount is zero or would overflow the bond's principal.
    error InvalidTopUpAmount();
    /// @notice The bond already has a pending top-up.
    error TopUpPending();
    /// @notice No top-up is pending or its readiness block has not been reached.
    error TopUpNotReady();
    /// @notice The entry key was already forfeited.
    error AlreadyForfeited();
    /// @notice The authorization's `validUntil` deadline has passed.
    error AuthorizationExpired();
}
          

contracts/layer1/core/libs/LibBlobs.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

/// @title LibBlobs
/// @notice Library for handling blobs.
/// @custom:security-contact security@taiko.xyz
library LibBlobs {
    /// @notice Represents a segment of data that is stored in multiple consecutive blobs created
    /// in this transaction.
    struct BlobReference {
        /// @notice The starting index of the blob.
        uint16 blobStartIndex;
        /// @notice The number of blobs.
        uint16 numBlobs;
        /// @notice The field-element offset within the blob data.
        uint24 offset;
    }

    /// @notice Represents a frame of data that is stored in multiple blobs. Note the size is
    /// encoded as a bytes32 at the offset location.
    struct BlobSlice {
        /// @notice The blobs containing the proposal's content.
        bytes32[] blobHashes;
        /// @notice The byte offset of the proposal's content in the containing blobs.
        uint24 offset;
        /// @notice The timestamp when the frame was created.
        uint48 timestamp;
    }

    // ---------------------------------------------------------------
    // Functions
    // ---------------------------------------------------------------

    /// @dev Validates a blob locator and converts it to a blob slice.
    /// @param _blobReference The blob locator to validate.
    /// @return The blob slice.
    function validateBlobReference(BlobReference memory _blobReference)
        internal
        view
        returns (BlobSlice memory)
    {
        require(_blobReference.numBlobs > 0, NoBlobs());

        bytes32[] memory blobHashes = new bytes32[](_blobReference.numBlobs);
        for (uint256 i; i < _blobReference.numBlobs; ++i) {
            blobHashes[i] = blobhash(_blobReference.blobStartIndex + i);
            require(blobHashes[i] != 0, BlobNotFound());
        }

        return BlobSlice({
            blobHashes: blobHashes,
            offset: _blobReference.offset,
            timestamp: uint48(block.timestamp)
        });
    }

    // ---------------------------------------------------------------
    // Errors
    // ---------------------------------------------------------------

    error BlobNotFound();
    error NoBlobs();
}
          

contracts/layer1/etna/iface/IEtnaInbox.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

/// @title IEtnaInbox
/// @notice The L1 Inbox of an Etna PoS chain: it records the Etna start S, lands proven batches
/// that end at grid points, keeps the forced inclusion queue and the rules schedule and runs
/// governance recovery.
/// @dev Section numbers refer to the Etna specification. S is block 0 on a new network and the last
/// Unzen block on a network that switches from Unzen. Nodes, guests and landers read the storage
/// layout of spec appendix B (slots 258-293) with EIP-1186 proofs; each struct names the slots it
/// occupies. Every packed word lays its fields out in declaration order from the
/// least-significant bit. This file has no imports so clients can copy it as is.
/// @custom:security-contact security@taiko.xyz
interface IEtnaInbox {
    // ---------------------------------------------------------------
    // Structs
    // ---------------------------------------------------------------

    /// @notice The immutable parameters of an Inbox implementation (spec 11).
    struct Config {
        /// @notice The verifier of `land` proofs (spec 6.2).
        address proofVerifier;
        /// @notice The L1 SignalService that stores the landed L2 checkpoints.
        address signalService;
        /// @notice The staking registry whose snapshots select the committees (spec 4.1).
        address stakingRegistry;
        /// @notice The chain id of the Etna L2; non-zero.
        uint64 l2ChainId;
        /// @notice The maximum `h - p` of one landing; at least 6, one grid segment, and at most
        /// 65,532, so that the leaf calldata fits one transaction (spec 11).
        uint64 maxBatchBlocks;
        /// @notice The forced inclusion fee in Gwei with an empty queue (spec 7.1); non-zero.
        uint64 forcedInclusionFeeInGwei;
        /// @notice The number of pending forced inclusions at which the fee doubles; non-zero.
        uint64 forcedInclusionFeeDoubleThreshold;
        /// @notice The DAO treasury that receives the swept forced inclusion fees (spec 7.1);
        /// non-zero.
        address protocolFeeRecipient;
        /// @notice The multisig that writes the Etna start with `setOrigin` on a switching
        /// network; zero on a new network (spec 11).
        address originWriter;
        /// @notice The live Unzen Inbox proxy on a switching network, which must have code; zero
        /// on a new network.
        address unzenInbox;
        /// @notice `ETNA_FORK_TIME` in L1 Unix seconds on a switching network; zero on a new
        /// network.
        uint48 etnaForkTime;
    }

    /// @notice The committee derivation parameters opened by `committeeConfigHash` (spec 4.3, 6.4).
    /// @dev committeeConfigHash = keccak256(abi.encode(bytes32("ETNA_PARENT_ANCHOR_V1"),
    /// uint256(l2ChainId), stakingRegistry, vpUnit, sMin, nMax, unsettledLimit)): seven words,
    /// 224 bytes (appendix A).
    struct CommitteeConfig {
        /// @notice `vp_unit`: the stake per unit of voting power; at least 867,361,738.
        uint256 vpUnit;
        /// @notice `s_min`: the minimum effective stake of an eligible entry; at least `vpUnit`.
        uint256 sMin;
        /// @notice `n_max`: the maximum committee size, in [1, 4096].
        uint256 nMax;
        /// @notice `U`: the maximum number of unsettled L2 blocks, a multiple of 6 in [6, 65,532].
        uint256 unsettledLimit;
    }

    /// @notice The inputs of `init` (spec 10 step 5).
    struct InitParams {
        /// @notice The hash of L2 block 0 on a new network, non-zero; zero on a switching network,
        /// whose start `setOrigin` writes.
        bytes32 genesisBlockHash;
        /// @notice The state root of L2 block 0 on a new network, non-zero; zero on a switching
        /// network.
        bytes32 genesisStateRoot;
        /// @notice `L`: the epoch length in L2 blocks, with L >= 3 and L + 1 < 2^48 (spec 4.2).
        uint256 epochLenL2;
        /// @notice The registry snapshot block of committee 0: a past L1 block at or after the
        /// registry's first checkpoint (spec 4.3).
        uint256 genesisCutoff;
        /// @notice The committee 0 record hash (appendix A `record`); non-zero.
        bytes32 committeeRecordHash;
        /// @notice The committee derivation parameters; `init` validates them and stores their
        /// hash.
        CommitteeConfig committeeConfig;
        /// @notice The forced inclusion delay in seconds, in [1, 2^48) (spec 7.2).
        uint256 forcedInclusionDelay;
        /// @notice The maximum anchor age in seconds, in [1152, 2^48) (spec 3.4).
        uint256 maxAnchorAge;
    }

    /// @notice The public inputs of `land` (spec 6.1).
    struct LandInput {
        /// @notice `p`: the proof origin, a retained checkpoint and grid point at or below `c`.
        uint256 parentHeight;
        /// @notice `h`: the terminal height, a grid point above `c`.
        uint256 lastHeight;
        /// @notice The EL block hash at `h`.
        bytes32 lastBlockHash;
        /// @notice The CometBFT block hash at `h`.
        bytes32 lastCometHash;
        /// @notice The opaque validator-state hash at `h` (appendix A).
        bytes32 lastValStateHash;
        /// @notice The EL state root at `h`.
        bytes32 lastStateRoot;
        /// @notice The L1 block whose header chain holds every anchor and proving root used.
        uint256 l1ReferenceBlockNumber;
        /// @notice The forced inclusion queue head after `h`.
        uint256 forcedInclusionHead;
        /// @notice The selection snapshot of the committee actually signing `h`.
        uint256 activeCommitteeSnapshot;
    }

    /// @notice The latest landed L2 block `c` (slots 270/271).
    struct LandedCheckpoint {
        /// @notice The L2 height.
        uint48 height;
        /// @notice The EL block hash.
        bytes32 blockHash;
    }

    /// @notice The start record (slots 272-274); slot 272 packs the three 48-bit fields.
    /// @dev `init` writes `epochLenL2`; the start write writes the rest. The start is written
    /// exactly when `genesisBlockHash` is non-zero.
    struct GenesisRecord {
        /// @notice The Etna start S: block 0 on a new network, the last Unzen block on a switching
        /// network.
        uint48 genesisHeight;
        /// @notice `L1_0`: the L1 block of the start write.
        uint48 l1Block;
        /// @notice `L`: the epoch length in L2 blocks.
        uint48 epochLenL2;
        /// @notice The EL block hash of S.
        bytes32 genesisBlockHash;
        /// @notice The state root of S.
        bytes32 genesisStateRoot;
    }

    /// @notice The rules schedule (slot 293, spec 10.1), packed from the least-significant bit.
    /// @dev Zero at initialization: ruleset 0, nothing scheduled and no stop.
    struct RulesSchedule {
        /// @notice The ruleset of blocks before `rulesTime`.
        uint48 activeRules;
        /// @notice The ruleset of blocks at or after `rulesTime`.
        uint48 nextRules;
        /// @notice The L2 timestamp from which `nextRules` applies; 2^48 - 1 cancels it.
        uint48 rulesTime;
        /// @notice The planned stop time; zero means no stop.
        uint48 stopTime;
        /// @notice The planned stop's grid, a positive multiple of K when a stop is set.
        uint48 stopGrid;
    }

    /// @notice The landing record of a checkpoint height (slot 285 mapping, four words); the
    /// first word packs `parentHeight`, `generation` and `head`.
    /// @dev The start write records S as (S, 0, 0, start hash, 0, 0). Records are never pruned
    /// (spec 8.4).
    struct Landing {
        /// @notice The actual checkpoint `c` the landing settled on, never the proof origin.
        uint48 parentHeight;
        /// @notice The recovery generation of the landing.
        uint48 generation;
        /// @notice The forced inclusion queue head at this height.
        uint48 head;
        /// @notice The EL block hash at this height; never zero once written.
        bytes32 elHash;
        /// @notice The CometBFT block hash at this height; zero for the start S.
        bytes32 cometHash;
        /// @notice The opaque validator-state hash; zero for the start S.
        bytes32 valStateHash;
    }

    /// @notice The fixed origin of a recovery generation (slot 290 mapping, three words; spec 8.4).
    /// @dev Generation 0 is (S, L1_0, L1_0's timestamp), written by the start write; a recovery
    /// generation is (c, R.number, R.timestamp). Written once; every field is below 2^48.
    struct Origin {
        /// @notice The checkpoint height `c` the generation starts from.
        uint256 startHeight;
        /// @notice The origin L1 block: `R` for a recovery generation, `L1_0` for generation 0.
        uint256 l1BlockNumber;
        /// @notice The timestamp of that L1 block.
        uint256 l1Timestamp;
    }

    /// @notice A forced inclusion queue entry (slot 280 mapping, two words; spec 7.1); the second
    /// word packs `timestamp` and `l1Block`.
    struct ForcedInclusion {
        /// @notice keccak256 of the submitted bytes; recovery may replace it with keccak256("").
        bytes32 txHash;
        /// @notice The L1 timestamp of the submission.
        uint48 timestamp;
        /// @notice The L1 block of the submission.
        uint48 l1Block;
    }

    /// @notice A registry entry that recovery forces to exit at `R` (spec 8 step 2).
    struct Exclusion {
        /// @notice The bond id.
        uint256 bondId;
        /// @notice keccak256(abi.encode(ckPrefix, ckX)) of the bond's key.
        bytes32 entryKey;
    }

    // ---------------------------------------------------------------
    // Events
    // ---------------------------------------------------------------

    /// @notice Emitted once, when `init` runs (spec 10 step 5).
    /// @param epochLenL2 `L`, the epoch length in L2 blocks.
    /// @param genesisCutoff The registry snapshot block of committee 0.
    /// @param committeeRecordHash The committee 0 record hash.
    /// @param committeeConfigHash The stored committee configuration hash.
    event EtnaInitialized(
        uint256 epochLenL2,
        uint256 genesisCutoff,
        bytes32 committeeRecordHash,
        bytes32 committeeConfigHash
    );

    /// @notice Emitted once, by the start write: `init` on a new network, `setOrigin` on a
    /// switching network (spec 10 step 5).
    /// @param height The Etna start S.
    /// @param blockHash The EL block hash of S.
    /// @param stateRoot The state root of S.
    event StartWritten(uint256 height, bytes32 blockHash, bytes32 stateRoot);

    /// @notice Emitted by every successful `scheduleRules`, `scheduleStop` and `recover`.
    /// @param value The new slot 293 word, packed as in `RulesSchedule`.
    event RulesScheduleUpdated(uint256 value);

    /// @notice Emitted when `land` settles `(c, h]` with a proof covering `(p, h]` (spec 6.1).
    /// @param parentHeight `p`, the proof origin.
    /// @param checkpointHeight `c`, the checkpoint the landing settled on.
    /// @param lastHeight `h`, the new checkpoint.
    /// @param cutHash The hash over the cut leaves at the grid points in `(p, h)` (appendix A).
    /// @param activeCommitteeSnapshot The selection snapshot of the committee signing `h`.
    /// @param version The landing statement version, 1.
    event Landed(
        uint256 indexed parentHeight,
        uint256 indexed checkpointHeight,
        uint256 indexed lastHeight,
        bytes32 cutHash,
        uint256 activeCommitteeSnapshot,
        uint8 version
    );

    /// @notice Emitted when a transaction enters the forced inclusion queue (spec 7.1).
    /// @param index The assigned queue index.
    /// @param tx The submitted bytes; the entry stores only their hash.
    /// @param feeWei The fee charged in wei, excluding the refunded overpayment.
    event ForcedInclusionSaved(uint48 indexed index, bytes tx, uint256 feeWei);

    /// @notice Emitted when the Inbox's whole ETH balance is swept to `protocolFeeRecipient`.
    /// @param amount The amount swept in wei.
    event ProtocolFeesSwept(uint256 amount);

    /// @notice Emitted when the owner invalidates unexecuted recovery authorizations.
    /// @param oldNonce The previously current authorization nonce.
    /// @param newNonce The new nonce, exactly oldNonce + 1.
    event RecoveryNonceInvalidated(uint256 oldNonce, uint256 newNonce);

    /// @notice Emitted when governance recovery starts a new generation (spec 8).
    /// @param newGeneration The new recovery generation.
    /// @param checkpointHeight `c`, the checkpoint the generation starts from.
    /// @param l1BlockNumber The number of the execution block `R`.
    /// @param l1Timestamp The timestamp of `R`.
    /// @param exclusions The entries forced to exit at `R`, sorted strictly by bond id.
    /// @param fiToClear The blanked forced inclusion indices, strictly increasing.
    event Recovered(
        uint48 indexed newGeneration,
        uint256 checkpointHeight,
        uint256 l1BlockNumber,
        uint256 l1Timestamp,
        Exclusion[] exclusions,
        uint256[] fiToClear
    );

    // ---------------------------------------------------------------
    // External Functions
    // ---------------------------------------------------------------

    /// @notice Initializes the Inbox (spec 10 step 5).
    /// @dev Only the owner, by upgrading the proxy from its bootstrap implementation. Validates the
    /// spec 10 deployment constraints it can check: a non-zero committee record; L >= 3 and
    /// L + 1 < 2^48; a genesis cutoff below block.number and at or after the registry's first
    /// checkpoint; the committee configuration bounds; forcedInclusionDelay in [1, 2^48);
    /// maxAnchorAge in [1152, 2^48); block.number and block.timestamp below 2^48. The registry's
    /// fixed Inbox must be this proxy and its l2ChainId this Inbox's (spec 4.1). Stores
    /// committeeConfigHash (slot 269), L, the committee 0 record and cutoff, and
    /// activeCommitteeSnapshot = genesisCutoff; generation, nonce and rules schedule stay 0.
    /// On a new network (`unzenInbox() == address(0)`) the genesis hash and state root must be
    /// non-zero, and the same call performs the start write with S = 0 (see `setOrigin`) and
    /// saves the block-0 SignalService checkpoint. On a switching network both must be zero and
    /// nothing of the start is written. Any failure reverts everything.
    /// @param _params The initialization inputs.
    function init(InitParams calldata _params) external;

    /// @notice Writes the Etna start on a switching network (spec 10 step 5a).
    /// @dev Only `originWriter()`, once, on an initialized Inbox whose start is unwritten, at
    /// block.timestamp >= etnaForkTime(), with a non-zero hash and state root, 0 < _height < 2^48
    /// and block.number and block.timestamp below 2^48. A new-network Inbox has no originWriter,
    /// so every call reverts there. The start write sets slot 272 to (S, L1_0 = block.number, L),
    /// slots 273/274 to the hash and state root, origins[0] = (S, L1_0, block.timestamp), the
    /// checkpoint to (S, hash) and landings[S] = (S, 0, 0, hash, 0, 0), opens the forced inclusion
    /// queue and emits `StartWritten`. It writes no SignalService checkpoint: the one at S is the
    /// Unzen Inbox's, which `land` checks while c is S.
    /// @param _height The Etna start S, the last Unzen block.
    /// @param _blockHash The EL block hash of S.
    /// @param _stateRoot The state root of S.
    function setOrigin(uint256 _height, bytes32 _blockHash, bytes32 _stateRoot) external;

    /// @notice Lands a proven batch: settles `(c, h]` with a proof covering `(p, h]` (spec 6.1).
    /// @dev Permissionless and nonpayable; shares `recover`'s reentrancy lock. Before the start
    /// write no landing passes check 2, because landings[0] is unwritten. With K = 6, S the Etna
    /// start and `c` the latest checkpoint height read at execution, it requires, before any state
    /// change:
    /// 1. generationStartHeight() <= p <= c < h < 2^48 (c >= h means already settled), p - S and
    ///    h - S multiples of K, and h - p <= maxBatchBlocks;
    /// 2. landings[p].elHash != 0, and landings[p].generation == recoveryGeneration unless p is
    ///    the current generation's start height; on a switching network while c == S, the Unzen
    ///    Inbox's getCoreState() shows nextProposalId == lastFinalizedProposalId + 1 and
    ///    lastFinalizedBlockHash == landings[c].elHash, and the SignalService checkpoint at S
    ///    holds that hash and the start's state root;
    /// 3. _leaves.length == (h - p) / K - 1 and landings[c].head equal to the queue head; if
    ///    c > p, _leaves[(c - p) / K - 1] == keccak256(abi.encode(c, elHash, cometHash,
    ///    uint256(head), valStateHash)) over landings[c];
    /// 4. head <= forcedInclusionHead <= tail and forcedInclusionHead - head <= h - c;
    /// 5. l1ReferenceBlockNumber < block.number with a non-zero hash from `blockhash` (256 blocks)
    ///    or the EIP-2935 history contract (8191 blocks), and 1 to 6 blobs;
    /// 6. proofVerifier.verifyProof(0, statement, _proof) succeeds.
    /// cutHash = keccak256(abi.encode(bytes32("ETNA_LAND_CUTS_V1"), uint256(generation), p, h,
    /// keccak256(abi.encodePacked(_leaves)))). The statement is the keccak256 of 23 static ABI
    /// words (736 bytes): bytes32("TAIKO_ETNA_LAND_V1"), block.chainid, l2ChainId, this proxy,
    /// stakingRegistry, generation, p, parentHash, parentCometHash, parentValStateHash,
    /// committeeConfigHash, h, lastBlockHash, lastCometHash, lastValStateHash, lastStateRoot,
    /// l1ReferenceBlockNumber, its block hash, keccak256(abi.encodePacked(blobHashes)),
    /// headBefore, forcedInclusionHead, activeCommitteeSnapshot and cutHash, where parentHash,
    /// parentCometHash, parentValStateHash and headBefore are the elHash, cometHash, valStateHash
    /// and head of landings[p] (appendix A). It then sets the checkpoint to (h, lastBlockHash),
    /// activeCommitteeSnapshot, the queue head and landings[h] = (c, generation,
    /// forcedInclusionHead, lastBlockHash, lastCometHash, lastValStateHash), saves the
    /// SignalService checkpoint (h, lastBlockHash, lastStateRoot) and emits `Landed`. It pays no
    /// fee.
    /// @param _input The batch's public inputs.
    /// @param _leaves The cut leaves at the grid points p + K, ..., h - K, in height order.
    /// @param _proof The two sub-proofs (spec 6.2).
    function land(
        LandInput calldata _input,
        bytes32[] calldata _leaves,
        bytes calldata _proof
    )
        external;

    /// @notice Appends a forced transaction to the queue and charges the current fee (spec 7.1).
    /// @dev Requires the start write and at most 8,192 bytes; the encoding is not checked. Charges
    /// getCurrentForcedInclusionFee() Gwei, which stays in the Inbox until swept, and refunds any
    /// overpayment to the caller. Stores keccak256(_tx), block.timestamp and block.number, each
    /// below 2^48.
    /// @param _tx The raw transaction bytes, published in `ForcedInclusionSaved`.
    function saveForcedInclusion(bytes calldata _tx) external payable;

    /// @notice Sends the Inbox's whole ETH balance to `protocolFeeRecipient` (spec 7.1).
    /// @dev Permissionless and unaffected by pause; reverts if the transfer fails. Leaves the
    /// queue untouched.
    function sweepProtocolFees() external;

    /// @notice Starts a new recovery generation at the current checkpoint `c` (spec 8, 8.3, 8.4).
    /// @dev Only the owner; shares `land`'s reentrancy lock and is atomic: any failure reverts
    /// every effect. Reverts `NotInitialized` before `init` and `StartNotWritten` before the
    /// start write. Requires _expectedGeneration == recoveryGeneration() (`GenerationMismatch`),
    /// _expectedC == lastCheckpoint().height (`CheckpointMismatch`) with _expectedC - S a
    /// multiple of K (`CheckpointOffGrid`), an exact recovery nonce (`RecoveryNonceMismatch`)
    /// and block.timestamp <= _validUntil (`AuthorizationExpired`). A non-zero _rules must equal
    /// the schedule's nextRules + 1 (`InvalidRules`). Increments the authorization nonce without
    /// wrapping on success. The new generation, block.number and block.timestamp each below 2^48
    /// (`ValueOverflow`); exclusions sorted strictly by bond id and fiToClear strictly increasing
    /// within [head, tail). With R = block.number, the registry checks each exclusion's entry key
    /// and sets its exitEffectiveL1 to min(existing, R) (`IEtnaStakingRegistry.forceExit`), so
    /// any otherwise valid exclusion reverts `InvalidEventBlock` at block.number == 2^48 - 1, the
    /// registry's no-exit sentinel. Each listed queue entry's txHash becomes keccak256("").
    /// Increments the generation, writes origins[generation] = (c, R, block.timestamp) once
    /// (`OriginAlreadyWritten` if that record already exists) and emits `Recovered`. It then
    /// clears the planned stop and, for a non-zero _rules, sets activeRules = nextRules = _rules
    /// and rulesTime = 0, and emits `RulesScheduleUpdated`.
    /// The checkpoint, its landing record, the queue head and activeCommitteeSnapshot are kept.
    /// @param _expectedGeneration The recovery generation the call was authorized for.
    /// @param _expectedC The checkpoint height the call was authorized for.
    /// @param _expectedRecoveryNonce The exact current authorization nonce (slot 292).
    /// @param _validUntil The inclusive L1 Unix timestamp deadline in seconds.
    /// @param _exclusions The entries to force out, sorted strictly by bond id.
    /// @param _fiToClear The queue indices to blank, strictly increasing.
    /// @param _rules Zero, or the ruleset the new generation runs from its first block.
    function recover(
        uint48 _expectedGeneration,
        uint256 _expectedC,
        uint256 _expectedRecoveryNonce,
        uint256 _validUntil,
        Exclusion[] calldata _exclusions,
        uint256[] calldata _fiToClear,
        uint48 _rules
    )
        external;

    /// @notice Schedules the next ruleset (spec 10.1).
    /// @dev Owner only after initialization, under the Inbox lock. With M = maxAnchorAge(): if
    /// block.timestamp >= rulesTime it first sets activeRules = nextRules, otherwise it requires
    /// block.timestamp + M < rulesTime (`RulesLocked`). It then requires _rules to be nextRules
    /// or nextRules + 1 (`InvalidRules`) and _time >= block.timestamp + M (`InvalidScheduleTime`),
    /// sets nextRules = _rules and rulesTime = _time and emits `RulesScheduleUpdated`. An equal
    /// _rules reschedules the pending ruleset and _time = 2^48 - 1 cancels it.
    /// @param _rules The ruleset number.
    /// @param _time The L2 timestamp from which it applies.
    function scheduleRules(uint48 _rules, uint48 _time) external;

    /// @notice Schedules, moves or cancels the planned stop (spec 10.1).
    /// @dev Owner only after initialization, under the Inbox lock. With M = maxAnchorAge(): if a
    /// stop is set it requires block.timestamp + M < stopTime (`StopLocked`). It then requires
    /// (_time, _grid) to be (0, 0), which cancels the stop, or _time >= block.timestamp + M with
    /// _grid a positive multiple of K (`InvalidStop`), sets stopTime and stopGrid and emits
    /// `RulesScheduleUpdated`.
    /// @param _time The stop time.
    /// @param _grid The stop grid.
    function scheduleStop(uint48 _time, uint48 _grid) external;

    /// @notice Invalidates all unexecuted recovery authorizations carrying the current nonce.
    /// @dev Owner only after initialization, under the Inbox lock. Requires an exact nonce and
    /// increments it without wrapping. Neither landing nor registry forfeiture changes it.
    /// Verifier-failure rollback upgrades must preserve and increment the current nonce rather
    /// than restore a historical value (spec 8.3).
    /// @param _expectedRecoveryNonce The nonce to invalidate.
    function invalidateRecoveryNonce(uint256 _expectedRecoveryNonce) external;

    /// @notice Returns the monotonically increasing uint256 recovery authorization nonce.
    /// @return nonce_ Slot 292, initially zero; incremented by recovery or explicit invalidation.
    function recoveryNonce() external view returns (uint256 nonce_);

    /// @notice Returns whether `init` has run.
    /// @dev Slot 258 holds 3 once initialized.
    /// @return Whether the Inbox is initialized.
    function isInitialized() external view returns (bool);

    /// @notice Returns the recovery generation (slot 268), bound into every landing statement and
    /// CometBFT chain id.
    /// @return The recovery generation.
    function recoveryGeneration() external view returns (uint48);

    /// @notice Returns the committee configuration hash (slot 269).
    /// @return The configuration hash; zero before initialization.
    function committeeConfigHash() external view returns (bytes32);

    /// @notice Returns the latest landed checkpoint `c` (slots 270/271).
    /// @return The checkpoint; (S, start hash) right after the start write.
    function lastCheckpoint() external view returns (LandedCheckpoint memory);

    /// @notice Returns the start record (slots 272-274).
    /// @return The start record; only L before the start write, zero before initialization.
    function genesis() external view returns (GenesisRecord memory);

    /// @notice Returns the Etna start, which the L1 SignalService reads (spec 10 step 5).
    /// @dev Never reverts.
    /// @return height_ S (slot 272).
    /// @return blockHash_ The EL block hash of S (slot 273); zero exactly before the start write.
    function etnaStart() external view returns (uint48 height_, bytes32 blockHash_);

    /// @notice Returns the rules schedule (slot 293, spec 10.1).
    /// @return The rules schedule; zero at initialization.
    function rulesSchedule() external view returns (RulesSchedule memory);

    /// @notice Returns the committee 0 record hash (slot 278).
    /// @return The record hash; zero before initialization.
    function genesisCommitteeRecordHash() external view returns (bytes32);

    /// @notice Returns the registry snapshot block of committee 0 (slot 279).
    /// @return The genesis cutoff; zero before initialization.
    function genesisCutoff() external view returns (uint48);

    /// @notice Returns the forced inclusion delay in seconds (slot 282, bits 0-47).
    /// @return The forced inclusion delay; zero before initialization.
    function forcedInclusionDelay() external view returns (uint48);

    /// @notice Returns the maximum anchor age in seconds (slot 282, bits 48-95).
    /// @return The maximum anchor age; zero before initialization.
    function maxAnchorAge() external view returns (uint48);

    /// @notice Returns the selection snapshot of the committee that signed the latest checkpoint
    /// (slot 284).
    /// @dev Set to the genesis cutoff by `init` and afterwards written only by `land`, which
    /// stores the proven value; the registry's exit confirmation reads it.
    /// @return The L1 snapshot block.
    function activeCommitteeSnapshot() external view returns (uint256);

    /// @notice Returns the landing record of an L2 height (slot 285).
    /// @param _height The L2 height.
    /// @return The record; all zero if no landing ended at `_height`.
    function landings(uint256 _height) external view returns (Landing memory);

    /// @notice Returns the fixed origin of a recovery generation (slot 290).
    /// @param _generation The recovery generation.
    /// @return The origin; all zero if the generation has not started.
    function origins(uint256 _generation) external view returns (Origin memory);

    /// @notice Returns the current generation's start height,
    /// `origins(recoveryGeneration()).startHeight`.
    /// @dev Reverts with `StartNotWritten` before the start write, which writes generation 0's
    /// record: a missing record has no default (spec 8.4). Whatever starts a later generation
    /// (`recover`, or an Inbox upgrade correcting the start under spec 10 step 5c) writes its record
    /// in the same transaction.
    /// @return The start height.
    function generationStartHeight() external view returns (uint256);

    /// @notice Returns the current generation's origin L1 block,
    /// `origins(recoveryGeneration()).l1BlockNumber`.
    /// @dev `R` for a recovery generation; `L1_0` for generation 0, whose committee 0 is still
    /// selected at the genesis cutoff (spec 8.4). Reverts with `StartNotWritten` before the start
    /// write, like `generationStartHeight`.
    /// @return The origin L1 block.
    function recoverySnapshot() external view returns (uint256);

    /// @notice Returns the forced inclusion queue pointers (slot 281).
    /// @return head_ The index of the next entry to consume.
    /// @return tail_ The index of the next submission.
    function getForcedInclusionState() external view returns (uint48 head_, uint48 tail_);

    /// @notice Returns a stored queue entry, consumed or not.
    /// @param _index The queue index.
    /// @return The entry; all zero at or beyond the tail.
    function getForcedInclusion(uint48 _index) external view returns (ForcedInclusion memory);

    /// @notice Returns pending queue entries starting at `_start`.
    /// @dev Empty if `_start` is outside [head, tail) or `_maxCount` is zero.
    /// @param _start The first queue index.
    /// @param _maxCount The maximum number of entries.
    /// @return At most min(_maxCount, tail - _start) entries.
    function getForcedInclusions(
        uint48 _start,
        uint48 _maxCount
    )
        external
        view
        returns (ForcedInclusion[] memory);

    /// @notice Returns the fee in Gwei of the next forced inclusion (spec 7.1).
    /// @dev forcedInclusionFeeInGwei * (threshold + tail - head) / threshold, capped at
    /// type(uint64).max.
    /// @return feeInGwei_ The fee in Gwei.
    function getCurrentForcedInclusionFee() external view returns (uint64 feeInGwei_);

    /// @notice Returns the staking registry.
    /// @return The registry address.
    function stakingRegistry() external view returns (address);

    /// @notice Returns the SignalService that stores the landed checkpoints.
    /// @return The SignalService address.
    function signalService() external view returns (address);

    /// @notice Returns the verifier of `land` proofs.
    /// @return The verifier address.
    function proofVerifier() external view returns (address);

    /// @notice Returns the chain id of the Etna L2.
    /// @return The L2 chain id.
    function l2ChainId() external view returns (uint64);

    /// @notice Returns the maximum `h - p` of one landing.
    /// @return The maximum batch size in L2 blocks.
    function maxBatchBlocks() external view returns (uint64);

    /// @notice Returns the forced inclusion fee in Gwei with an empty queue.
    /// @return The base fee in Gwei.
    function forcedInclusionFeeInGwei() external view returns (uint64);

    /// @notice Returns the number of pending forced inclusions at which the fee doubles.
    /// @return The doubling threshold.
    function forcedInclusionFeeDoubleThreshold() external view returns (uint64);

    /// @notice Returns the DAO treasury that receives the swept forced inclusion fees.
    /// @return The protocol fee recipient.
    function protocolFeeRecipient() external view returns (address);

    /// @notice Returns the multisig that may write the Etna start; zero on a new network.
    /// @return The origin writer.
    function originWriter() external view returns (address);

    /// @notice Returns the Unzen Inbox `land` checks while c is S; zero on a new network.
    /// @return The Unzen Inbox proxy.
    function unzenInbox() external view returns (address);

    /// @notice Returns `ETNA_FORK_TIME`, the earliest time of `setOrigin`; zero on a new network.
    /// @return The fork time in L1 Unix seconds.
    function etnaForkTime() external view returns (uint48);

    // ---------------------------------------------------------------
    // Errors
    // ---------------------------------------------------------------

    /// @notice The Inbox is not initialized.
    error NotInitialized();
    /// @notice The Etna start is not written yet.
    error StartNotWritten();
    /// @notice The Etna start is already written.
    error StartAlreadyWritten();
    /// @notice `recover` finds the new generation's origin record already written.
    error OriginAlreadyWritten();
    /// @notice `setOrigin` is called before `etnaForkTime()`.
    error BeforeEtnaForkTime();
    /// @notice The start height is 0 or at least 2^48, or its hash or state root is zero.
    error InvalidStart();
    /// @notice The switching-network immutables are neither all zero nor all non-zero, or the
    /// Unzen Inbox has no code.
    error InvalidSwitchConfig();
    /// @notice The Unzen Inbox has an unfinalized proposal.
    error UnzenNotFinalized();
    /// @notice The Unzen Inbox's last finalized block hash differs from the start's hash.
    error UnzenStartMismatch();
    /// @notice The SignalService checkpoint at S differs from the start's hash or state root.
    error StartCheckpointMismatch();
    /// @notice The checkpoint height minus S is not a multiple of 6.
    error CheckpointOffGrid();
    /// @notice The ruleset is neither `nextRules` nor `nextRules + 1`, or not `nextRules + 1` in
    /// `recover`.
    error InvalidRules();
    /// @notice The rules time is earlier than `block.timestamp + maxAnchorAge`.
    error InvalidScheduleTime();
    /// @notice The pending ruleset can no longer be changed.
    error RulesLocked();
    /// @notice The planned stop can no longer be changed.
    error StopLocked();
    /// @notice The stop is neither (0, 0) nor a time at least `maxAnchorAge` ahead with a positive
    /// multiple of 6 as its grid.
    error InvalidStop();
    /// @notice The expected recovery nonce differs from the current one.
    error RecoveryNonceMismatch();
    /// @notice The authorization's `validUntil` deadline has passed.
    error AuthorizationExpired();
    /// @notice The staking registry holds its reentrancy lock.
    error RegistryLocked();
    /// @notice `maxBatchBlocks` is below 6 or above 65,532.
    error InvalidMaxBatchBlocks();
    /// @notice The forced inclusion fee is zero.
    error ForcedInclusionFeeZero();
    /// @notice The forced inclusion fee doubling threshold is zero.
    error ForcedInclusionFeeDoubleThresholdZero();
    /// @notice The genesis block hash or state root is zero on a new network, or non-zero on a
    /// switching network.
    error InvalidGenesis();
    /// @notice The epoch length is below 3 or its successor does not fit 48 bits.
    error InvalidEpochLength();
    /// @notice The genesis cutoff is not a past block at or after the registry's first
    /// checkpoint.
    error InvalidGenesisCutoff();
    /// @notice The committee 0 record hash is zero.
    error ZeroCommitteeRecord();
    /// @notice The committee configuration is out of bounds.
    error InvalidCommitteeConfig();
    /// @notice The forced inclusion delay is zero or does not fit 48 bits.
    error InvalidForcedInclusionDelay();
    /// @notice The maximum anchor age is below 1152 seconds or does not fit 48 bits.
    error InvalidMaxAnchorAge();
    /// @notice The registry's fixed Inbox or L2 chain id differs from this Inbox's.
    error RegistryMismatch();
    /// @notice A value does not fit its 48-bit storage field.
    error ValueOverflow();
    /// @notice The terminal height is already settled (`c >= h`).
    error AlreadySettled();
    /// @notice The proof origin is outside [generationStartHeight(), c] or `h` reaches 2^48.
    error InvalidRange();
    /// @notice `p - S` or `h - S` is not a multiple of 6.
    error OffGrid();
    /// @notice `h - p` exceeds `maxBatchBlocks`.
    error BatchTooLarge();
    /// @notice The proof origin has no landing record.
    error MissingOrigin();
    /// @notice The proof origin's record belongs to another generation.
    error ForeignGeneration();
    /// @notice The number of cut leaves is not `(h - p) / 6 - 1`.
    error LeafCountMismatch();
    /// @notice The checkpoint's recorded queue head differs from the stored queue head.
    error ForcedInclusionHeadMismatch();
    /// @notice The cut leaf at `c` differs from the one computed from `c`'s landing record.
    error FrontierLeafMismatch();
    /// @notice The new queue head goes back, passes the tail or advances more than `h - c`.
    error InvalidForcedInclusionHead();
    /// @notice The reference block is not in the past or its hash is unavailable.
    error ReferenceBlockUnavailable();
    /// @notice The transaction carries no blob or more than 6.
    error InvalidBlobCount();
    /// @notice The forced transaction exceeds 8,192 bytes.
    error ForcedTransactionTooLarge();
    /// @notice The forced inclusion fee is not covered.
    error InsufficientFee();
    /// @notice The expected generation is not the current one.
    error GenerationMismatch();
    /// @notice The expected checkpoint height is not the current one.
    error CheckpointMismatch();
    /// @notice The exclusions are not sorted strictly by bond id.
    error ExclusionsNotSorted();
    /// @notice The forced inclusion indices to clear are not strictly increasing.
    error FiToClearNotSorted();
    /// @notice A forced inclusion index to clear is outside [head, tail).
    error FiIndexOutOfRange();
    /// @notice The entry point does not accept ETH.
    error EtherNotAccepted();
}
          

contracts/layer1/core/iface/IInbox.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import { LibBlobs } from "../libs/LibBlobs.sol";

/// @title IInbox
/// @notice Interface for the Shasta inbox contracts
/// @custom:security-contact security@taiko.xyz
interface IInbox {
    /// @notice Configuration struct for Inbox constructor parameters
    struct Config {
        /// @notice The proof verifier contract
        address proofVerifier;
        /// @notice The proposer checker contract
        address proposerChecker;
        /// @notice The prover whitelist contract (address(0) means no whitelist)
        address proverWhitelist;
        /// @notice The signal service contract address
        address signalService;
        /// @notice The ERC20 bond token address
        address bondToken;
        /// @notice The minimum bond a proposer is required to have in gwei
        uint64 minBond;
        /// @notice The liveness bond amount in gwei
        uint64 livenessBond;
        /// @notice The withdrawal delay in seconds
        uint48 withdrawalDelay;
        /// @notice The proving window in seconds
        uint48 provingWindow;
        /// @notice The delay after which proving becomes permissionless when whitelist is enabled
        /// @dev Must be greater than provingWindow
        uint48 permissionlessProvingDelay;
        /// @notice Maximum delay allowed between consecutive proofs to still be on time.
        /// @dev Must be shorter than the expected proposal cadence to prevent backlog growth.
        uint48 maxProofSubmissionDelay;
        /// @notice The ring buffer size for storing proposal hashes
        uint48 ringBufferSize;
        /// @notice The percentage of basefee paid to coinbase
        uint8 basefeeSharingPctg;
        /// @notice The delay for forced inclusions measured in seconds
        uint16 forcedInclusionDelay;
        /// @notice The base fee for forced inclusions in Gwei used in dynamic fee calculation
        uint64 forcedInclusionFeeInGwei;
        /// @notice Queue size at which the forced inclusion fee doubles
        uint64 forcedInclusionFeeDoubleThreshold;
        /// @notice The multiplier to determine when a forced inclusion is too old so that proposing
        /// becomes permissionless
        uint8 permissionlessInclusionMultiplier;
    }

    /// @notice Represents a source of derivation data within a Proposal
    struct DerivationSource {
        /// @notice Whether this source is from a forced inclusion.
        bool isForcedInclusion;
        /// @notice Blobs that contain the source's manifest data.
        LibBlobs.BlobSlice blobSlice;
    }

    /// @notice Represents a proposal for L2 blocks.
    struct Proposal {
        /// @notice Unique identifier for the proposal.
        uint48 id;
        /// @notice The L1 block timestamp when the proposal was accepted.
        uint48 timestamp;
        /// @notice The timestamp of the last slot where the current preconfer can propose.
        uint48 endOfSubmissionWindowTimestamp;
        /// @notice Address of the proposer.
        address proposer;
        /// @notice Hash of the parent proposal (zero for genesis).
        bytes32 parentProposalHash;
        /// @notice The L1 block number when the proposal was accepted.
        uint48 originBlockNumber;
        /// @notice The hash of the origin block.
        bytes32 originBlockHash;
        /// @notice The percentage of base fee paid to coinbase.
        uint8 basefeeSharingPctg;
        /// @notice Array of derivation sources, where each can be regular or forced inclusion.
        DerivationSource[] sources;
    }

    /// @notice Represents the core state of the inbox.
    /// @dev All 5 uint48 fields (30 bytes) pack into a single storage slot.
    struct CoreState {
        /// @notice The next proposal ID to be assigned.
        uint48 nextProposalId;
        /// @notice The L1 block number where the most recent proposal was made.
        uint48 lastProposalBlockId;
        /// @notice The ID of the last proven (finalized) proposal.
        uint48 lastFinalizedProposalId;
        /// @notice The timestamp when the last proposal was proven (finalized).
        uint48 lastFinalizedTimestamp;
        /// @notice The timestamp when the last checkpoint was saved.
        /// @dev This is 0 until the first successful `prove` call saves a checkpoint.
        uint48 lastCheckpointTimestamp;
        /// @notice The block hash of the last proven (finalized) proposal.
        bytes32 lastFinalizedBlockHash;
    }

    /// @notice Input data for the propose function
    struct ProposeInput {
        /// @notice The deadline timestamp for transaction inclusion (0 = no deadline).
        uint48 deadline;
        /// @notice Blob reference for proposal data.
        LibBlobs.BlobReference blobReference;
        /// @notice The number of forced inclusions that the proposer wants to process.
        /// @dev This can be set to 0 if no forced inclusions are due and the proposer does not
        ///      wish to include any queued inclusions.
        uint16 numForcedInclusions;
    }

    /// @notice Transition data for a proposal used in prove
    struct Transition {
        /// @notice Address of the proposer.
        address proposer;
        /// @notice Timestamp of the proposal.
        uint48 timestamp;
        /// @notice The end block hash for the proposal.
        bytes32 blockHash;
    }

    /// @notice Commitment data that the prover commits to when submitting a proof.
    struct Commitment {
        /// @notice The ID of the first proposal being proven.
        uint48 firstProposalId;
        /// @notice The block hash of the parent of the first proposal.
        /// @dev Used to verify the proof range links to `CoreState.lastFinalizedBlockHash`.
        bytes32 firstProposalParentBlockHash;
        /// @notice The hash of the last proposal being proven.
        bytes32 lastProposalHash;
        /// @notice The actual prover who generated the proof.
        address actualProver;
        /// @notice The block number for the end L2 block in this proposal.
        uint48 endBlockNumber;
        /// @notice The state root for the end L2 block in this proposal.
        bytes32 endStateRoot;
        /// @notice Array of transitions for each proposal in the proof range.
        Transition[] transitions;
    }

    /// @notice Input data for the prove function.
    struct ProveInput {
        /// @notice The commitment data that the proof verifies.
        Commitment commitment;
    }

    /// @notice Payload data emitted in the Proved event
    struct ProvedEventPayload {
        /// @notice The ID of the first proposal being proven.
        uint48 firstProposalId;
        /// @notice The ID of the first proposal that had not been proven before.
        uint48 firstNewProposalId;
        /// @notice The ID of the last proposal being proven.
        uint48 lastProposalId;
        /// @notice The actual prover who generated the proof.
        address actualProver;
    }

    // ---------------------------------------------------------------
    // Events
    // ---------------------------------------------------------------

    /// @notice Emitted when a new proposal is proposed.
    /// @param id Unique identifier for the proposal.
    /// @param proposer Address of the proposer.
    /// @param parentProposalHash The hash of the parent proposal (zero for genesis).
    /// @param endOfSubmissionWindowTimestamp Last slot timestamp where the preconfer can propose.
    /// @param basefeeSharingPctg The percentage of base fee paid to coinbase.
    /// @param sources Array of derivation sources for this proposal.
    event Proposed(
        uint48 indexed id,
        address indexed proposer,
        bytes32 parentProposalHash,
        uint48 endOfSubmissionWindowTimestamp,
        uint8 basefeeSharingPctg,
        DerivationSource[] sources
    );

    /// @notice Emitted when a proof is submitted
    /// @param firstProposalId The first proposal ID covered by the proof (may include finalized ids)
    /// @param firstNewProposalId The first proposal ID that was newly proven by this proof
    /// @param lastProposalId The last proposal ID covered by the proof
    /// @param actualProver The prover that submitted the proof
    event Proved(
        uint48 firstProposalId,
        uint48 firstNewProposalId,
        uint48 lastProposalId,
        address indexed actualProver
    );

    /// @notice Emitted when the inbox core state is reset during incident recovery.
    /// @param nextProposalId The next proposal ID set by the recovery.
    /// @param lastFinalizedProposalId The last finalized proposal ID set by the recovery.
    /// @param lastFinalizedBlockHash The last finalized block hash set by the recovery.
    event StateRecovered(
        uint48 nextProposalId, uint48 lastFinalizedProposalId, bytes32 lastFinalizedBlockHash
    );

    /// @notice Emitted when queued forced inclusions are voided by moving the queue head.
    /// @param oldHead The queue head before the move.
    /// @param newHead The queue head after the move (equals the queue tail).
    event ForcedInclusionsVoided(uint48 oldHead, uint48 newHead);

    // ---------------------------------------------------------------
    // External Transactional Functions
    // ---------------------------------------------------------------

    /// @notice Proposes new L2 blocks and forced inclusions to the rollup using blobs for DA.
    /// @param _lookahead Encoded data forwarded to the proposer checker (i.e. lookahead payloads).
    /// @param _data The encoded ProposeInput struct.
    function propose(bytes calldata _lookahead, bytes calldata _data) external;

    /// @notice Verifies a batch proof covering multiple consecutive proposals and finalizes them.
    /// @param _data The encoded ProveInput struct.
    /// @param _proof The validity proof for the batch of proposals.
    function prove(bytes calldata _data, bytes calldata _proof) external;

    // ---------------------------------------------------------------
    // External View Functions
    // ---------------------------------------------------------------

    /// @notice Returns the configuration parameters of the Inbox contract
    /// @return config_ The configuration struct containing all immutable parameters
    function getConfig() external view returns (Config memory config_);

    /// @notice Returns the current core state.
    /// @return The core state struct.
    function getCoreState() external view returns (CoreState memory);

    /// @notice Returns the proposal hash for a given proposal ID.
    /// @param _proposalId The proposal ID to look up.
    /// @return proposalHash_ The hash stored at the proposal's ring buffer slot.
    function getProposalHash(uint256 _proposalId) external view returns (bytes32 proposalHash_);
}
          

contracts/layer1/etna/impl/EtnaInbox_Layout.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

/// @title EtnaInboxLayout
/// @notice Storage layout documentation for EtnaInbox
/// @dev This file is auto-generated by gen-layouts.sh. DO NOT EDIT MANUALLY.
/// @custom:security-contact security@taiko.xyz

// solhint-disable max-line-length
//   _initialized                   | uint8                                              | Slot: 0    | Offset: 0    | Bytes: 1   
//   _initializing                  | bool                                               | Slot: 0    | Offset: 1    | Bytes: 1   
//   __gap                          | uint256[50]                                        | Slot: 1    | Offset: 0    | Bytes: 1600
//   _owner                         | address                                            | Slot: 51   | Offset: 0    | Bytes: 20  
//   __gap                          | uint256[49]                                        | Slot: 52   | Offset: 0    | Bytes: 1568
//   _pendingOwner                  | address                                            | Slot: 101  | Offset: 0    | Bytes: 20  
//   __gap                          | uint256[49]                                        | Slot: 102  | Offset: 0    | Bytes: 1568
//   __gapFromOldAddressResolver    | uint256[50]                                        | Slot: 151  | Offset: 0    | Bytes: 1600
//   __reentry                      | uint8                                              | Slot: 201  | Offset: 0    | Bytes: 1   
//   __paused                       | uint8                                              | Slot: 201  | Offset: 1    | Bytes: 1   
//   __gap                          | uint256[49]                                        | Slot: 202  | Offset: 0    | Bytes: 1568
//   __reserved251                  | uint256[7]                                         | Slot: 251  | Offset: 0    | Bytes: 224 
//   _initStatus                    | uint8                                              | Slot: 258  | Offset: 0    | Bytes: 1   
//   __reserved259                  | uint256[9]                                         | Slot: 259  | Offset: 0    | Bytes: 288 
//   _recoveryGeneration            | uint48                                             | Slot: 268  | Offset: 0    | Bytes: 6   
//   _committeeConfigHash           | bytes32                                            | Slot: 269  | Offset: 0    | Bytes: 32  
//   _lastCheckpoint                | struct IEtnaInbox.LandedCheckpoint                 | Slot: 270  | Offset: 0    | Bytes: 64  
//   _genesis                       | struct IEtnaInbox.GenesisRecord                    | Slot: 272  | Offset: 0    | Bytes: 96  
//   __reserved275                  | uint256[3]                                         | Slot: 275  | Offset: 0    | Bytes: 96  
//   _genesisCommitteeRecordHash    | bytes32                                            | Slot: 278  | Offset: 0    | Bytes: 32  
//   _genesisCutoff                 | uint48                                             | Slot: 279  | Offset: 0    | Bytes: 6   
//   _forcedInclusions              | struct LibEtnaForcedInclusion.Storage              | Slot: 280  | Offset: 0    | Bytes: 64  
//   _forcedInclusionConfig         | struct EtnaInbox.ForcedInclusionConfig             | Slot: 282  | Offset: 0    | Bytes: 32  
//   __reserved283                  | uint256                                            | Slot: 283  | Offset: 0    | Bytes: 32  
//   _activeCommitteeSnapshot       | uint256                                            | Slot: 284  | Offset: 0    | Bytes: 32  
//   _landings                      | mapping(uint256 => struct IEtnaInbox.Landing)      | Slot: 285  | Offset: 0    | Bytes: 32  
//   __reserved286                  | uint256[4]                                         | Slot: 286  | Offset: 0    | Bytes: 128 
//   _origins                       | mapping(uint256 => struct IEtnaInbox.Origin)       | Slot: 290  | Offset: 0    | Bytes: 32  
//   __reserved291                  | uint256                                            | Slot: 291  | Offset: 0    | Bytes: 32  
//   _recoveryNonce                 | uint256                                            | Slot: 292  | Offset: 0    | Bytes: 32  
//   _rulesSchedule                 | struct IEtnaInbox.RulesSchedule                    | Slot: 293  | Offset: 0    | Bytes: 32  
//   __gap                          | uint256[7]                                         | Slot: 294  | Offset: 0    | Bytes: 224 
          

contracts/layer1/etna/libs/LibEtnaForcedInclusion.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import { IEtnaInbox } from "../iface/IEtnaInbox.sol";
import { LibMath } from "src/shared/libs/LibMath.sol";

/// @title LibEtnaForcedInclusion
/// @notice The Etna Inbox's calldata forced inclusion queue (spec 7.1).
/// @dev Preserves Shasta's fee formula without depending on its blob queue or linked library.
/// @custom:security-contact security@taiko.xyz
library LibEtnaForcedInclusion {
    using LibMath for uint256;

    // ---------------------------------------------------------------
    // Structs
    // ---------------------------------------------------------------

    /// @dev Inbox slots 280-281 (spec appendix B): the entries, retained after consumption,
    /// then `head` and `tail` packed into one word from the least-significant bit.
    struct Storage {
        mapping(uint256 index => IEtnaInbox.ForcedInclusion entry) queue;
        uint48 head;
        uint48 tail;
    }

    // ---------------------------------------------------------------
    // Internal Functions
    // ---------------------------------------------------------------

    /// @dev Returns `baseFee * (threshold + pending) / threshold`, capped at `type(uint64).max`.
    /// Reproduces `LibForcedInclusion.getCurrentForcedInclusionFee` for a non-zero threshold.
    /// @param $ The forced inclusion queue.
    /// @param _baseFeeInGwei The fee in Gwei with an empty queue.
    /// @param _feeDoubleThreshold The number of pending entries at which the fee doubles; non-zero
    /// (the Inbox constructor rejects zero).
    /// @return feeInGwei_ The fee in Gwei for the next entry.
    function currentFee(
        Storage storage $,
        uint64 _baseFeeInGwei,
        uint64 _feeDoubleThreshold
    )
        internal
        view
        returns (uint64 feeInGwei_)
    {
        (uint48 head, uint48 tail) = ($.head, $.tail);
        uint256 numPending = uint256(tail - head);

        uint256 multipliedFee =
            uint256(_baseFeeInGwei) * (uint256(_feeDoubleThreshold) + numPending);
        feeInGwei_ = uint64((multipliedFee / _feeDoubleThreshold).min(type(uint64).max));
    }

    /// @dev Reads pending entries with the same bounds as the original queue getters.
    /// @param $ The forced inclusion queue.
    /// @param _start The first queue index; must be in [head, tail).
    /// @param _maxCount The maximum number of entries to return.
    /// @return inclusions_ Pending entries, or an empty array for an invalid range.
    function getForcedInclusions(
        Storage storage $,
        uint48 _start,
        uint48 _maxCount
    )
        internal
        view
        returns (IEtnaInbox.ForcedInclusion[] memory inclusions_)
    {
        (uint48 head, uint48 tail) = ($.head, $.tail);
        if (_start < head || _start >= tail || _maxCount == 0) {
            return new IEtnaInbox.ForcedInclusion[](0);
        }
        uint256 count = uint256(tail - _start).min(_maxCount);
        inclusions_ = new IEtnaInbox.ForcedInclusion[](count);
        for (uint256 i; i < count; ++i) {
            inclusions_[i] = $.queue[i + _start];
        }
    }
}
          

contracts/layer1/verifiers/IProofVerifier.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @title IProofVerifier
/// @notice Interface for verifying validity proofs for state transitions
/// @custom:security-contact security@taiko.xyz
interface IProofVerifier {
    /// @notice Verifies a validity proof for a state transition
    /// @dev This function must revert if the proof is invalid
    /// @param _proposalAge The age in seconds of the proposal being proven. Only set for
    ///        single-proposal proofs (calculated as block.timestamp - proposal.timestamp).
    ///        For multi-proposal batches, this is always 0, meaning "not applicable".
    ///        Verifiers should interpret _proposalAge == 0 as "not applicable" rather than
    ///        "instant proof". This parameter enables age-based verification logic, such as
    ///        detecting and handling prover-killer proposals differently.
    /// @param _commitmentHash Hash of the last proposal hash and commitment data
    /// @param _proof The proof data
    function verifyProof(
        uint256 _proposalAge,
        bytes32 _commitmentHash,
        bytes calldata _proof
    )
        external
        view;
}
          

contracts/shared/common/EssentialContract.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import "./IResolver.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";

/// @title EssentialContract
/// @custom:security-contact security@taiko.xyz
abstract contract EssentialContract is UUPSUpgradeable, Ownable2StepUpgradeable {
    // ---------------------------------------------------------------
    // Constants and Immutable Variables
    // ---------------------------------------------------------------
    uint8 internal constant _FALSE = 1;
    uint8 internal constant _TRUE = 2;

    /// @dev Transient-storage slot for the reentry lock: keccak256("ownerUUPS.reentry_slot") + 1.
    /// The addition prevents collisions with EIP-1967-style slots (derived as keccak256(x) - 1)
    /// and SignalService slots (derived directly as keccak256(x)).
    bytes32 private constant _REENTRY_SLOT =
        0xa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b;

    address internal immutable __resolver;

    // ---------------------------------------------------------------
    // State Variables
    // ---------------------------------------------------------------

    uint256[50] private __gapFromOldAddressResolver;

    /// @dev Slot 1. __reentry is deprecated: the reentry lock lives in transient storage
    /// (_REENTRY_SLOT); the storage slot is retained only for layout compatibility.
    uint8 private __reentry;
    uint8 internal __paused;

    uint256[49] private __gap;

    // ---------------------------------------------------------------
    // Events
    // ---------------------------------------------------------------

    /// @notice Emitted when the contract is paused.
    /// @param account The account that paused the contract.
    event Paused(address account);

    /// @notice Emitted when the contract is unpaused.
    /// @param account The account that unpaused the contract.
    event Unpaused(address account);

    error INVALID_PAUSE_STATUS();
    error FUNC_NOT_IMPLEMENTED();
    error REENTRANT_CALL();
    error ACCESS_DENIED();
    error ZERO_ADDRESS();
    error ZERO_VALUE();

    // ---------------------------------------------------------------
    // Modifiers
    // ---------------------------------------------------------------

    /// @dev Modifier that ensures the caller is either the owner or a specified address.
    /// @param _addr The address to check against.
    modifier onlyFromOwnerOr(address _addr) {
        _checkOwnerOr(_addr);
        _;
    }

    /// @dev Modifier that reverts the function call, indicating it is not implemented.
    modifier notImplemented() {
        revert FUNC_NOT_IMPLEMENTED();
        _;
    }

    /// @dev Modifier that prevents reentrant calls to a function.
    modifier nonReentrant() {
        _checkReentrancy();
        _storeReentryLock(_TRUE);
        _;
        _storeReentryLock(_FALSE);
    }

    /// @dev Modifier that allows function execution only when the contract is paused.
    modifier whenPaused() {
        _checkPaused();
        _;
    }

    /// @dev Modifier that allows function execution only when the contract is not paused.
    modifier whenNotPaused() {
        _checkNotPaused();
        _;
    }

    /// @dev Modifier that ensures the provided address is not the zero address.
    /// @param _addr The address to check.
    modifier nonZeroAddr(address _addr) {
        _checkNonZeroAddr(_addr);
        _;
    }

    /// @dev Modifier that ensures the provided value is not zero.
    /// @param _value The value to check.
    modifier nonZeroValue(uint256 _value) {
        _checkNonZeroValue(_value);
        _;
    }

    /// @dev Modifier that ensures the provided bytes32 value is not zero.
    /// @param _value The bytes32 value to check.
    modifier nonZeroBytes32(bytes32 _value) {
        _checkNonZeroBytes32(_value);
        _;
    }

    /// @dev Modifier that ensures the caller is either of the two specified addresses.
    /// @param _addr1 The first address to check against.
    /// @param _addr2 The second address to check against.
    modifier onlyFromEither(address _addr1, address _addr2) {
        _checkFromEither(_addr1, _addr2);
        _;
    }

    /// @dev Modifier that ensures the caller is the specified address.
    /// @param _addr The address to check against.
    modifier onlyFrom(address _addr) {
        _checkFrom(_addr);
        _;
    }

    /// @dev Modifier that ensures the caller is the specified address.
    /// @param _addr The address to check against.
    modifier onlyFromOptional(address _addr) {
        _checkFromOptional(_addr);
        _;
    }

    // ---------------------------------------------------------------
    // Constructor
    // ---------------------------------------------------------------

    constructor() {
        _disableInitializers();
    }

    // ---------------------------------------------------------------
    // External & Public Functions
    // ---------------------------------------------------------------

    /// @notice Pauses the contract.
    function pause() public whenNotPaused {
        _pause();
        emit Paused(msg.sender);
        // We call the authorize function here to avoid:
        // Warning (5740): Unreachable code.
        _authorizePause(msg.sender, true);
    }

    /// @notice Unpauses the contract.
    function unpause() public whenPaused {
        _unpause();
        emit Unpaused(msg.sender);
        // We call the authorize function here to avoid:
        // Warning (5740): Unreachable code.
        _authorizePause(msg.sender, false);
    }

    function impl() public view returns (address) {
        return _getImplementation();
    }

    /// @notice Returns true if the contract is paused, and false otherwise.
    /// @return true if paused, false otherwise.
    function paused() public view virtual returns (bool) {
        return __paused == _TRUE;
    }

    function inNonReentrant() public view returns (bool) {
        return _loadReentryLock() == _TRUE;
    }

    /// @notice Returns the address of this contract.
    /// @return The address of this contract.
    function resolver() public view virtual returns (address) {
        return __resolver;
    }

    // ---------------------------------------------------------------
    // Internal Functions
    // ---------------------------------------------------------------

    /// @notice Initializes the contract.
    /// @param _owner The owner of this contract. msg.sender will be used if this value is zero.
    function __Essential_init(address _owner) internal virtual onlyInitializing {
        __Context_init();
        _transferOwnership(_owner == address(0) ? msg.sender : _owner);
        __paused = _FALSE;
    }

    function _pause() internal virtual {
        __paused = _TRUE;
    }

    function _unpause() internal virtual {
        __paused = _FALSE;
    }

    function _authorizeUpgrade(address) internal virtual override onlyOwner { }

    function _authorizePause(address, bool) internal virtual onlyOwner { }

    // Stores the reentry lock in transient storage (EIP-1153). This is deliberately not virtual:
    // L1 and L2 run the same EVM version, so the transient-storage lock is the single reentrancy
    // guard implementation.
    function _storeReentryLock(uint8 _reentry) internal {
        assembly {
            tstore(_REENTRY_SLOT, _reentry)
        }
    }

    // Loads the reentry lock
    function _loadReentryLock() internal view returns (uint8 reentry_) {
        assembly {
            reentry_ := tload(_REENTRY_SLOT)
        }
    }

    // ---------------------------------------------------------------
    // Private Functions
    // ---------------------------------------------------------------

    function _checkOwnerOr(address _addr) private view {
        require(msg.sender == owner() || msg.sender == _addr, ACCESS_DENIED());
    }

    function _checkReentrancy() private view {
        require(_loadReentryLock() != _TRUE, REENTRANT_CALL());
    }

    function _checkPaused() private view {
        require(paused(), INVALID_PAUSE_STATUS());
    }

    function _checkNotPaused() private view {
        require(!paused(), INVALID_PAUSE_STATUS());
    }

    function _checkNonZeroAddr(address _addr) private pure {
        require(_addr != address(0), ZERO_ADDRESS());
    }

    function _checkNonZeroValue(uint256 _value) private pure {
        require(_value != 0, ZERO_VALUE());
    }

    function _checkNonZeroBytes32(bytes32 _value) private pure {
        require(_value != 0, ZERO_VALUE());
    }

    function _checkFromEither(address _addr1, address _addr2) private view {
        require(msg.sender == _addr1 || msg.sender == _addr2, ACCESS_DENIED());
    }

    function _checkFrom(address _addr) private view {
        require(msg.sender == _addr, ACCESS_DENIED());
    }

    function _checkFromOptional(address _addr) private view {
        require(_addr == address(0) || msg.sender == _addr, ACCESS_DENIED());
    }
}
          

contracts/shared/common/IResolver.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @title IResolver
/// @notice This contract acts as a bridge for name-to-address resolution.
/// @custom:security-contact security@taiko.xyz
interface IResolver {
    error RESOLVED_TO_ZERO_ADDRESS();

    /// @notice Resolves a name to its address deployed on a specified chain.
    /// @param _chainId The chainId of interest.
    /// @param _name Name whose address is to be resolved.
    /// @param _allowZeroAddress If set to true, does not throw if the resolved
    /// address is `address(0)`.
    /// @return Address associated with the given name on the specified
    /// chain.
    function resolve(
        uint256 _chainId,
        bytes32 _name,
        bool _allowZeroAddress
    )
        external
        view
        returns (address);
}
          

contracts/shared/libs/LibAddress.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/// @title LibAddress
/// @dev Provides utilities for address-related operations.
/// @custom:security-contact security@taiko.xyz
library LibAddress {
    error ETH_TRANSFER_FAILED();

    /// @dev Sends Ether to the specified address. This method will not revert even if sending ether
    /// fails.
    /// This function is inspired by
    /// https://github.com/nomad-xyz/ExcessivelySafeCall/blob/main/src/ExcessivelySafeCall.sol
    /// @param _to The recipient address.
    /// @param _amount The amount of Ether to send in wei.
    /// @param _gasLimit The max amount gas to pay for this transaction.
    /// @return success_ true if the call is successful, false otherwise.
    function sendEther(
        address _to,
        uint256 _amount,
        uint256 _gasLimit,
        bytes memory _calldata
    )
        internal
        returns (bool success_)
    {
        // Check for zero-address transactions
        require(_to != address(0), ETH_TRANSFER_FAILED());
        // dispatch message to recipient
        // by assembly calling "handle" function
        // we call via assembly to avoid memcopying a very large returndata
        // returned by a malicious contract
        assembly ("memory-safe") {
            success_ := call(
                _gasLimit, // gas
                _to, // recipient
                _amount, // ether value
                add(_calldata, 0x20), // inloc
                mload(_calldata), // inlen
                0, // outloc
                0 // outlen
            )
        }
    }

    /// @dev Sends Ether to the specified address. This method will revert if sending ether fails.
    /// @param _to The recipient address.
    /// @param _amount The amount of Ether to send in wei.
    /// @param _gasLimit The max amount gas to pay for this transaction.
    function sendEtherAndVerify(address _to, uint256 _amount, uint256 _gasLimit) internal {
        if (_amount == 0) return;
        require(sendEther(_to, _amount, _gasLimit, ""), ETH_TRANSFER_FAILED());
    }

    /// @dev Sends Ether to the specified address. This method will revert if sending ether fails.
    /// @param _to The recipient address.
    /// @param _amount The amount of Ether to send in wei.
    function sendEtherAndVerify(address _to, uint256 _amount) internal {
        sendEtherAndVerify(_to, _amount, gasleft());
    }

    function supportsInterface(
        address _addr,
        bytes4 _interfaceId
    )
        internal
        view
        returns (bool result_)
    {
        (bool success, bytes memory data) =
            _addr.staticcall(abi.encodeCall(IERC165.supportsInterface, (_interfaceId)));
        if (success && data.length == 32) {
            result_ = abi.decode(data, (bool));
        }
    }
}
          

contracts/shared/libs/LibMath.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @title LibMath
/// @dev This library offers additional math functions for uint256.
/// @custom:security-contact security@taiko.xyz
library LibMath {
    /// @dev Returns the smaller of the two given values.
    /// @param _a The first number to compare.
    /// @param _b The second number to compare.
    /// @return The smaller of the two numbers.
    function min(uint256 _a, uint256 _b) internal pure returns (uint256) {
        return _a > _b ? _b : _a;
    }

    /// @dev Returns the larger of the two given values.
    /// @param _a The first number to compare.
    /// @param _b The second number to compare.
    /// @return The larger of the two numbers.
    function max(uint256 _a, uint256 _b) internal pure returns (uint256) {
        return _a > _b ? _a : _b;
    }

    function capToUint64(uint256 _value) internal pure returns (uint64) {
        return uint64(min(_value, type(uint64).max));
    }
}
          

contracts/shared/signal/ICheckpointStore.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @title ICheckpointStore
/// @notice Interface for storing and retrieving checkpoints
/// @custom:security-contact security@taiko.xyz
interface ICheckpointStore {
    // ---------------------------------------------------------------
    // Structs
    // ---------------------------------------------------------------

    /// @notice Represents a synced checkpoint
    struct Checkpoint {
        /// @notice The block number associated with the checkpoint.
        uint48 blockNumber;
        /// @notice The block hash for the referenced block.
        bytes32 blockHash;
        /// @notice The state root for the referenced block.
        bytes32 stateRoot;
    }

    // ---------------------------------------------------------------
    // Events
    // ---------------------------------------------------------------

    /// @notice Emitted when a checkpoint is saved
    /// @param blockNumber The block number
    /// @param blockHash The block hash
    /// @param stateRoot The state root
    event CheckpointSaved(uint48 indexed blockNumber, bytes32 blockHash, bytes32 stateRoot);

    // ---------------------------------------------------------------
    // External Functions
    // ---------------------------------------------------------------

    /// @notice Saves a checkpoint
    /// @param _checkpoint The checkpoint data to persist
    function saveCheckpoint(Checkpoint calldata _checkpoint) external;

    /// @notice Gets a checkpoint by its block number
    /// @param _blockNumber The block number associated with the checkpoint
    /// @return _ The checkpoint
    function getCheckpoint(uint48 _blockNumber) external view returns (Checkpoint memory);
}
          

contracts/shared/signal/ISignalService.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "./ICheckpointStore.sol";

/// @title ISignalService
/// @notice The SignalService contract serves as a secure cross-chain message
/// passing system. It defines methods for sending and verifying signals with
/// merkle proofs. The trust assumption is that the target chain has secure
/// access to the source chain's state root: on L1, the checkpoints the Inbox
/// saves; on L2, the checkpoints the anchor transaction saves before Etna and
/// the EIP-4788 roots the block headers commit to from Etna on. With this,
/// verifying a signal is reduced to simply verifying a merkle proof.
/// @custom:security-contact security@taiko.xyz
interface ISignalService is ICheckpointStore {
    /// @dev DEPRECATED
    /// @dev Caching is no longer supported
    enum CacheOption {
        CACHE_NOTHING,
        CACHE_SIGNAL_ROOT,
        CACHE_STATE_ROOT,
        CACHE_BOTH
    }

    struct HopProof {
        /// @notice This hop's destination chain ID. If there is a next hop, this ID is the next
        /// hop's source chain ID.
        uint64 chainId;
        /// @notice Source block number for checkpoint proofs, or L2 timestamp for Etna L2 proofs.
        /// @dev Checkpoint proofs use a block at or after the signal was sent. Etna L2 proofs use
        /// the timestamp of the L2 block that recorded the L1 anchor state root.
        uint64 blockId;
        /// @notice The source-chain state root authenticated by the checkpoint or L2 oracle.
        /// @dev Must match the root resolved for blockId.
        bytes32 rootHash;
        /// @notice Options to cache either the state roots or signal roots of middle-hops to the
        /// current chain.
        /// @dev DEPRECATED - this value will be ignored
        CacheOption cacheOption;
        /// @notice The remote signal service's nonempty account proof against rootHash.
        bytes[] accountProof;
        /// @notice The signal service's storage proof.
        bytes[] storageProof;
    }

    /// @notice Emitted when a signal is sent.
    /// @param app The address that initiated the signal.
    /// @param signal The signal (message) that was sent.
    /// @param slot The location in storage where this signal is stored.
    /// @param value The value of the signal.
    event SignalSent(address app, bytes32 signal, bytes32 slot, bytes32 value);

    /// @notice Send a signal (message) by setting the storage slot to the same value as the signal
    /// itself.
    /// @param _signal The signal (message) to send.
    /// @return slot_ The location in storage where this signal is stored.
    function sendSignal(bytes32 _signal) external returns (bytes32 slot_);

    /// @notice Checks whether a signal has been received on the target chain and caches the result if successful.
    /// @param _chainId The identifier for the source chain from which the
    /// signal originated.
    /// @param _app The address that initiated the signal.
    /// @param _signal The signal (message) to send.
    /// @param _proof Merkle proof that the signal was persisted on the
    /// source chain. If this proof is empty, the signal must already have been proven and
    /// cached as received.
    /// @return numCacheOps_ The number of newly cached items.
    function proveSignalReceived(
        uint64 _chainId,
        address _app,
        bytes32 _signal,
        bytes calldata _proof
    )
        external
        returns (uint256 numCacheOps_);

    /// @notice Verifies if a signal has been received on the target chain.
    /// This is the "readonly" version of proveSignalReceived.
    /// @param _chainId The identifier for the source chain from which the
    /// signal originated.
    /// @param _app The address that initiated the signal.
    /// @param _signal The signal (message) to send.
    /// @param _proof Merkle proof that the signal was persisted on the
    /// source chain. If this proof is empty, the signal must already have been proven and
    /// cached as received.
    function verifySignalReceived(
        uint64 _chainId,
        address _app,
        bytes32 _signal,
        bytes calldata _proof
    )
        external
        view;

    /// @notice Verifies if a particular signal has already been sent.
    /// @param _app The address that initiated the signal.
    /// @param _signal The signal (message) that was sent.
    /// @return true if the signal has been sent, otherwise false.
    function isSignalSent(address _app, bytes32 _signal) external view returns (bool);

    /// @notice Verifies if a particular signal has already been sent.
    /// @param _signalSlot The location in storage where this signal is stored.
    function isSignalSent(bytes32 _signalSlot) external view returns (bool);
}
          

node_modules/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./OwnableUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
    address private _pendingOwner;

    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

    function __Ownable2Step_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable2Step_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        return _pendingOwner;
    }

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}
          

node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}
          

node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}
          

node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}
          

node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}
          

node_modules/@openzeppelin/contracts/interfaces/IERC1967.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 *
 * _Available since v4.8.3._
 */
interface IERC1967 {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}
          

node_modules/@openzeppelin/contracts/interfaces/draft-IERC1822.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822Proxiable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}
          

node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeacon.sol";
import "../../interfaces/IERC1967.sol";
import "../../interfaces/draft-IERC1822.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 */
abstract contract ERC1967Upgrade is IERC1967 {
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            Address.isContract(IBeacon(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        }
    }
}
          

node_modules/@openzeppelin/contracts/proxy/beacon/IBeacon.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}
          

node_modules/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../../interfaces/draft-IERC1822.sol";
import "../ERC1967/ERC1967Upgrade.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }

    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeTo(address newImplementation) public virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;
}
          

node_modules/@openzeppelin/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}
          

node_modules/@openzeppelin/contracts/utils/StorageSlot.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}
          

node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
          

Compiler Settings

{"viaIR":false,"remappings":["openzeppelin/=node_modules/@openzeppelin/","@openzeppelin/=node_modules/@openzeppelin/","@openzeppelin-upgrades/contracts/=node_modules/@openzeppelin/contracts-upgradeable/","@risc0/contracts/=node_modules/risc0-ethereum/contracts/src/","@solady/=node_modules/solady/","solady/src/=node_modules/solady/src/","solady/utils/=node_modules/solady/src/utils/","solady/auth/=node_modules/solady/src/auth/","@optimism/=node_modules/optimism/","@sp1-contracts/=node_modules/sp1-contracts/contracts/src/","forge-std/=node_modules/forge-std/","@p256-verifier/contracts/=node_modules/p256-verifier/src/","@eth-fabric/urc/=node_modules/urc/src/","@automata-network/on-chain-pccs/=node_modules/@automata-network/on-chain-pccs/src/","@automata-network/automata-dcap-attestation/=node_modules/@automata-network/automata-dcap-attestation/","risc0/=node_modules/risc0-ethereum/contracts/src/","ds-test/=node_modules/ds-test/","src/=contracts/","test/=test/","script/=script/","optimism/=node_modules/optimism/","p256-verifier/=node_modules/p256-verifier/","risc0-ethereum/=node_modules/risc0-ethereum/","sp1-contracts/=node_modules/sp1-contracts/","urc/=node_modules/urc/"],"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"libraries":{},"evmVersion":"osaka"}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"tuple","name":"_config","internalType":"struct IEtnaInbox.Config","components":[{"type":"address","name":"proofVerifier","internalType":"address"},{"type":"address","name":"signalService","internalType":"address"},{"type":"address","name":"stakingRegistry","internalType":"address"},{"type":"uint64","name":"l2ChainId","internalType":"uint64"},{"type":"uint64","name":"maxBatchBlocks","internalType":"uint64"},{"type":"uint64","name":"forcedInclusionFeeInGwei","internalType":"uint64"},{"type":"uint64","name":"forcedInclusionFeeDoubleThreshold","internalType":"uint64"},{"type":"address","name":"protocolFeeRecipient","internalType":"address"},{"type":"address","name":"originWriter","internalType":"address"},{"type":"address","name":"unzenInbox","internalType":"address"},{"type":"uint48","name":"etnaForkTime","internalType":"uint48"}]}]},{"type":"error","name":"ACCESS_DENIED","inputs":[]},{"type":"error","name":"AlreadySettled","inputs":[]},{"type":"error","name":"AuthorizationExpired","inputs":[]},{"type":"error","name":"BatchTooLarge","inputs":[]},{"type":"error","name":"BeforeEtnaForkTime","inputs":[]},{"type":"error","name":"CheckpointMismatch","inputs":[]},{"type":"error","name":"CheckpointOffGrid","inputs":[]},{"type":"error","name":"ETH_TRANSFER_FAILED","inputs":[]},{"type":"error","name":"EtherNotAccepted","inputs":[]},{"type":"error","name":"ExclusionsNotSorted","inputs":[]},{"type":"error","name":"FUNC_NOT_IMPLEMENTED","inputs":[]},{"type":"error","name":"FiIndexOutOfRange","inputs":[]},{"type":"error","name":"FiToClearNotSorted","inputs":[]},{"type":"error","name":"ForcedInclusionFeeDoubleThresholdZero","inputs":[]},{"type":"error","name":"ForcedInclusionFeeZero","inputs":[]},{"type":"error","name":"ForcedInclusionHeadMismatch","inputs":[]},{"type":"error","name":"ForcedTransactionTooLarge","inputs":[]},{"type":"error","name":"ForeignGeneration","inputs":[]},{"type":"error","name":"FrontierLeafMismatch","inputs":[]},{"type":"error","name":"GenerationMismatch","inputs":[]},{"type":"error","name":"INVALID_PAUSE_STATUS","inputs":[]},{"type":"error","name":"InsufficientFee","inputs":[]},{"type":"error","name":"InvalidBlobCount","inputs":[]},{"type":"error","name":"InvalidCommitteeConfig","inputs":[]},{"type":"error","name":"InvalidEpochLength","inputs":[]},{"type":"error","name":"InvalidForcedInclusionDelay","inputs":[]},{"type":"error","name":"InvalidForcedInclusionHead","inputs":[]},{"type":"error","name":"InvalidGenesis","inputs":[]},{"type":"error","name":"InvalidGenesisCutoff","inputs":[]},{"type":"error","name":"InvalidMaxAnchorAge","inputs":[]},{"type":"error","name":"InvalidMaxBatchBlocks","inputs":[]},{"type":"error","name":"InvalidRange","inputs":[]},{"type":"error","name":"InvalidRules","inputs":[]},{"type":"error","name":"InvalidScheduleTime","inputs":[]},{"type":"error","name":"InvalidStart","inputs":[]},{"type":"error","name":"InvalidStop","inputs":[]},{"type":"error","name":"InvalidSwitchConfig","inputs":[]},{"type":"error","name":"LeafCountMismatch","inputs":[]},{"type":"error","name":"MissingOrigin","inputs":[]},{"type":"error","name":"NotInitialized","inputs":[]},{"type":"error","name":"OffGrid","inputs":[]},{"type":"error","name":"OriginAlreadyWritten","inputs":[]},{"type":"error","name":"REENTRANT_CALL","inputs":[]},{"type":"error","name":"RecoveryNonceMismatch","inputs":[]},{"type":"error","name":"ReferenceBlockUnavailable","inputs":[]},{"type":"error","name":"RegistryLocked","inputs":[]},{"type":"error","name":"RegistryMismatch","inputs":[]},{"type":"error","name":"RulesLocked","inputs":[]},{"type":"error","name":"StartAlreadyWritten","inputs":[]},{"type":"error","name":"StartCheckpointMismatch","inputs":[]},{"type":"error","name":"StartNotWritten","inputs":[]},{"type":"error","name":"StopLocked","inputs":[]},{"type":"error","name":"UnzenNotFinalized","inputs":[]},{"type":"error","name":"UnzenStartMismatch","inputs":[]},{"type":"error","name":"ValueOverflow","inputs":[]},{"type":"error","name":"ZERO_ADDRESS","inputs":[]},{"type":"error","name":"ZERO_VALUE","inputs":[]},{"type":"error","name":"ZeroCommitteeRecord","inputs":[]},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"EtnaInitialized","inputs":[{"type":"uint256","name":"epochLenL2","internalType":"uint256","indexed":false},{"type":"uint256","name":"genesisCutoff","internalType":"uint256","indexed":false},{"type":"bytes32","name":"committeeRecordHash","internalType":"bytes32","indexed":false},{"type":"bytes32","name":"committeeConfigHash","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"ForcedInclusionSaved","inputs":[{"type":"uint48","name":"index","internalType":"uint48","indexed":true},{"type":"bytes","name":"tx","internalType":"bytes","indexed":false},{"type":"uint256","name":"feeWei","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"Landed","inputs":[{"type":"uint256","name":"parentHeight","internalType":"uint256","indexed":true},{"type":"uint256","name":"checkpointHeight","internalType":"uint256","indexed":true},{"type":"uint256","name":"lastHeight","internalType":"uint256","indexed":true},{"type":"bytes32","name":"cutHash","internalType":"bytes32","indexed":false},{"type":"uint256","name":"activeCommitteeSnapshot","internalType":"uint256","indexed":false},{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferStarted","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"ProtocolFeesSwept","inputs":[{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Recovered","inputs":[{"type":"uint48","name":"newGeneration","internalType":"uint48","indexed":true},{"type":"uint256","name":"checkpointHeight","internalType":"uint256","indexed":false},{"type":"uint256","name":"l1BlockNumber","internalType":"uint256","indexed":false},{"type":"uint256","name":"l1Timestamp","internalType":"uint256","indexed":false},{"type":"tuple[]","name":"exclusions","internalType":"struct IEtnaInbox.Exclusion[]","indexed":false,"components":[{"type":"uint256","name":"bondId","internalType":"uint256"},{"type":"bytes32","name":"entryKey","internalType":"bytes32"}]},{"type":"uint256[]","name":"fiToClear","internalType":"uint256[]","indexed":false}],"anonymous":false},{"type":"event","name":"RecoveryNonceInvalidated","inputs":[{"type":"uint256","name":"oldNonce","internalType":"uint256","indexed":false},{"type":"uint256","name":"newNonce","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RulesScheduleUpdated","inputs":[{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StartWritten","inputs":[{"type":"uint256","name":"height","internalType":"uint256","indexed":false},{"type":"bytes32","name":"blockHash","internalType":"bytes32","indexed":false},{"type":"bytes32","name":"stateRoot","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"GRID_INTERVAL","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"INITIALIZED_STATUS","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_BLOBS","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_FORCED_TX_BYTES","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"VERSION","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"acceptOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"activeCommitteeSnapshot","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"committeeConfigHash","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint48","name":"","internalType":"uint48"}],"name":"etnaForkTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint48","name":"height_","internalType":"uint48"},{"type":"bytes32","name":"blockHash_","internalType":"bytes32"}],"name":"etnaStart","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint48","name":"","internalType":"uint48"}],"name":"forcedInclusionDelay","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"","internalType":"uint64"}],"name":"forcedInclusionFeeDoubleThreshold","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"","internalType":"uint64"}],"name":"forcedInclusionFeeInGwei","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"generationStartHeight","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IEtnaInbox.GenesisRecord","components":[{"type":"uint48","name":"genesisHeight","internalType":"uint48"},{"type":"uint48","name":"l1Block","internalType":"uint48"},{"type":"uint48","name":"epochLenL2","internalType":"uint48"},{"type":"bytes32","name":"genesisBlockHash","internalType":"bytes32"},{"type":"bytes32","name":"genesisStateRoot","internalType":"bytes32"}]}],"name":"genesis","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"genesisCommitteeRecordHash","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint48","name":"","internalType":"uint48"}],"name":"genesisCutoff","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"feeInGwei_","internalType":"uint64"}],"name":"getCurrentForcedInclusionFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IEtnaInbox.ForcedInclusion","components":[{"type":"bytes32","name":"txHash","internalType":"bytes32"},{"type":"uint48","name":"timestamp","internalType":"uint48"},{"type":"uint48","name":"l1Block","internalType":"uint48"}]}],"name":"getForcedInclusion","inputs":[{"type":"uint48","name":"_index","internalType":"uint48"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint48","name":"head_","internalType":"uint48"},{"type":"uint48","name":"tail_","internalType":"uint48"}],"name":"getForcedInclusionState","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct IEtnaInbox.ForcedInclusion[]","components":[{"type":"bytes32","name":"txHash","internalType":"bytes32"},{"type":"uint48","name":"timestamp","internalType":"uint48"},{"type":"uint48","name":"l1Block","internalType":"uint48"}]}],"name":"getForcedInclusions","inputs":[{"type":"uint48","name":"_start","internalType":"uint48"},{"type":"uint48","name":"_maxCount","internalType":"uint48"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"impl","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"inNonReentrant","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"init","inputs":[{"type":"tuple","name":"_params","internalType":"struct IEtnaInbox.InitParams","components":[{"type":"bytes32","name":"genesisBlockHash","internalType":"bytes32"},{"type":"bytes32","name":"genesisStateRoot","internalType":"bytes32"},{"type":"uint256","name":"epochLenL2","internalType":"uint256"},{"type":"uint256","name":"genesisCutoff","internalType":"uint256"},{"type":"bytes32","name":"committeeRecordHash","internalType":"bytes32"},{"type":"tuple","name":"committeeConfig","internalType":"struct IEtnaInbox.CommitteeConfig","components":[{"type":"uint256","name":"vpUnit","internalType":"uint256"},{"type":"uint256","name":"sMin","internalType":"uint256"},{"type":"uint256","name":"nMax","internalType":"uint256"},{"type":"uint256","name":"unsettledLimit","internalType":"uint256"}]},{"type":"uint256","name":"forcedInclusionDelay","internalType":"uint256"},{"type":"uint256","name":"maxAnchorAge","internalType":"uint256"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"invalidateRecoveryNonce","inputs":[{"type":"uint256","name":"_expectedRecoveryNonce","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isInitialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"","internalType":"uint64"}],"name":"l2ChainId","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"land","inputs":[{"type":"tuple","name":"_input","internalType":"struct IEtnaInbox.LandInput","components":[{"type":"uint256","name":"parentHeight","internalType":"uint256"},{"type":"uint256","name":"lastHeight","internalType":"uint256"},{"type":"bytes32","name":"lastBlockHash","internalType":"bytes32"},{"type":"bytes32","name":"lastCometHash","internalType":"bytes32"},{"type":"bytes32","name":"lastValStateHash","internalType":"bytes32"},{"type":"bytes32","name":"lastStateRoot","internalType":"bytes32"},{"type":"uint256","name":"l1ReferenceBlockNumber","internalType":"uint256"},{"type":"uint256","name":"forcedInclusionHead","internalType":"uint256"},{"type":"uint256","name":"activeCommitteeSnapshot","internalType":"uint256"}]},{"type":"bytes32[]","name":"_leaves","internalType":"bytes32[]"},{"type":"bytes","name":"_proof","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IEtnaInbox.Landing","components":[{"type":"uint48","name":"parentHeight","internalType":"uint48"},{"type":"uint48","name":"generation","internalType":"uint48"},{"type":"uint48","name":"head","internalType":"uint48"},{"type":"bytes32","name":"elHash","internalType":"bytes32"},{"type":"bytes32","name":"cometHash","internalType":"bytes32"},{"type":"bytes32","name":"valStateHash","internalType":"bytes32"}]}],"name":"landings","inputs":[{"type":"uint256","name":"_height","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IEtnaInbox.LandedCheckpoint","components":[{"type":"uint48","name":"height","internalType":"uint48"},{"type":"bytes32","name":"blockHash","internalType":"bytes32"}]}],"name":"lastCheckpoint","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint48","name":"","internalType":"uint48"}],"name":"maxAnchorAge","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"","internalType":"uint64"}],"name":"maxBatchBlocks","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"originWriter","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IEtnaInbox.Origin","components":[{"type":"uint256","name":"startHeight","internalType":"uint256"},{"type":"uint256","name":"l1BlockNumber","internalType":"uint256"},{"type":"uint256","name":"l1Timestamp","internalType":"uint256"}]}],"name":"origins","inputs":[{"type":"uint256","name":"_generation","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pendingOwner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"proofVerifier","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"protocolFeeRecipient","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxiableUUID","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recover","inputs":[{"type":"uint48","name":"_expectedGeneration","internalType":"uint48"},{"type":"uint256","name":"_expectedC","internalType":"uint256"},{"type":"uint256","name":"_expectedRecoveryNonce","internalType":"uint256"},{"type":"uint256","name":"_validUntil","internalType":"uint256"},{"type":"tuple[]","name":"_exclusions","internalType":"struct IEtnaInbox.Exclusion[]","components":[{"type":"uint256","name":"bondId","internalType":"uint256"},{"type":"bytes32","name":"entryKey","internalType":"bytes32"}]},{"type":"uint256[]","name":"_fiToClear","internalType":"uint256[]"},{"type":"uint48","name":"_rules","internalType":"uint48"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint48","name":"","internalType":"uint48"}],"name":"recoveryGeneration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"nonce_","internalType":"uint256"}],"name":"recoveryNonce","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"recoverySnapshot","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"resolver","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IEtnaInbox.RulesSchedule","components":[{"type":"uint48","name":"activeRules","internalType":"uint48"},{"type":"uint48","name":"nextRules","internalType":"uint48"},{"type":"uint48","name":"rulesTime","internalType":"uint48"},{"type":"uint48","name":"stopTime","internalType":"uint48"},{"type":"uint48","name":"stopGrid","internalType":"uint48"}]}],"name":"rulesSchedule","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"saveForcedInclusion","inputs":[{"type":"bytes","name":"_tx","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"scheduleRules","inputs":[{"type":"uint48","name":"_rules","internalType":"uint48"},{"type":"uint48","name":"_time","internalType":"uint48"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"scheduleStop","inputs":[{"type":"uint48","name":"_time","internalType":"uint48"},{"type":"uint48","name":"_grid","internalType":"uint48"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOrigin","inputs":[{"type":"uint256","name":"_height","internalType":"uint256"},{"type":"bytes32","name":"_blockHash","internalType":"bytes32"},{"type":"bytes32","name":"_stateRoot","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"signalService","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"stakingRegistry","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"sweepProtocolFees","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"unzenInbox","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"_newImplementation","internalType":"address"},{"type":"bytes","name":"_data","internalType":"bytes"}]}]
              

Contract Creation Code

0x61022060405230608052348015610014575f5ffd5b50604051615902380380615902833981016040819052610033916103fb565b61003b6102c4565b6101208101516101008201516001600160a01b0391821615159116151581148015610076575061014082015165ffffffffffff161515811515145b8015610098575080158061009857506101208201516001600160a01b03163b15155b6100b5576040516315d6b9d560e21b815260040160405180910390fd5b81516001600160a01b03166100dd5760405163538ba4f960e01b815260040160405180910390fd5b60208201516001600160a01b03166101085760405163538ba4f960e01b815260040160405180910390fd5b60408201516001600160a01b03166101335760405163538ba4f960e01b815260040160405180910390fd5b60e08201516001600160a01b031661015e5760405163538ba4f960e01b815260040160405180910390fd5b81606001516001600160401b03165f0361018b5760405163ec73295960e01b815260040160405180910390fd5b600682608001516001600160401b0316101580156101b8575061fffc82608001516001600160401b031611155b6101d5576040516354a94d6d60e01b815260040160405180910390fd5b8160a001516001600160401b03165f0361020257604051630cc930d760e21b815260040160405180910390fd5b8160c001516001600160401b03165f0361022f57604051632fe16a2760e11b815260040160405180910390fd5b5080516001600160a01b0390811660c09081526020830151821660e09081526040840151831661010090815260608501516001600160401b039081166101209081526080870151821661014090815260a088015183166101605294870151909116610180529185015184166101a05284015183166101c0528301519091166101e052015165ffffffffffff16610200526104d8565b5f54610100900460ff161561032f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff9081161461037e575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60405161016081016001600160401b03811182821017156103af57634e487b7160e01b5f52604160045260245ffd5b60405290565b80516001600160a01b03811681146103cb575f5ffd5b919050565b80516001600160401b03811681146103cb575f5ffd5b805165ffffffffffff811681146103cb575f5ffd5b5f61016082840312801561040d575f5ffd5b50610416610380565b61041f836103b5565b815261042d602084016103b5565b602082015261043e604084016103b5565b604082015261044f606084016103d0565b6060820152610460608084016103d0565b608082015261047160a084016103d0565b60a082015261048260c084016103d0565b60c082015261049360e084016103b5565b60e08201526104a561010084016103b5565b6101008201526104b861012084016103b5565b6101208201526104cb61014084016103e6565b6101408201529392505050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051610200516152c461063e5f395f81816106d2015261184b01525f8181610b6b01528181611ba901528181612de50152818161331d015261414401525f8181610c7e01526117be01525f81816109de015261150701525f81816108480152818161162501526120dd01525f81816107e10152818161160401526120bc01525f81816104ae01526131ff01525f8181610d3801528181611a090152818161301c01526135e301525f818161039801528181611a3f01528181611eb4015281816123e801528181612f8b01528181613046015281816136180152818161401e01526140be01525f81816109a901528181611c2f015281816138e9015261424801525f8181610a8d0152611db201525f61042301525f8181610fe9015281816110320152818161119f01528181612814015261285401526152c45ff3fe608060405260043610610386575f3560e01c80636e1ec7db116101d3578063c61b2b45116100fd578063e30533351161009d578063f09e07821161006d578063f09e078214610dfd578063f2fde38b14610e11578063fd3d070314610dfd578063ffa1ad7414610e30575f5ffd5b8063e305333514610d98578063e30c397814610dac578063e63b2ddd14610dc9578063ed894cd314610de8575f5ffd5b8063d32e81a5116100d8578063d32e81a514610cd4578063d6ae3cd514610d27578063d87a150514610d5a578063e2070ff414610d79575f5ffd5b8063c61b2b4514610c6d578063c70a481a14610ca0578063cf4a9bc314610cbf575f5ffd5b80638abf60771161017357806398c5b14e1161014357806398c5b14e14610b265780639fdc8f2014610b45578063a0f2ed0214610b5a578063a7f0b3de14610b8d575f5ffd5b80638abf607714610ac55780638da5cb5b14610ad9578063924d90b514610af657806395806bd814610b09575f5ffd5b806379ba5097116101ae57806379ba509714610a575780637b93389e14610a6b5780637fa417b314610a7f5780638456cb5914610ab1575f5ffd5b80636e1ec7db14610a00578063715018a614610a2457806378e3ee6214610a38575f5ffd5b806337f6ffc4116102b457806352ef3437116102545780635ccc1718116102245780635ccc17181461086a57806362884622146108a057806362d094531461099b57806364df049e146109cd575f5ffd5b806352ef3437146107d05780635680a729146108035780635c975abb146108175780635cc9aa1d14610837575f5ffd5b80633f4ba83a1161028f5780633f4ba83a1461076957806340df98661461077d5780634f1ef286146107a957806352d1902d146107bc575f5ffd5b806337f6ffc414610713578063392e53cd146107275780633a4d119e14610743575f5ffd5b806320d0ac9f1161032a5780632f2f7641116102fa5780632f2f76411461065f5780633075db561461067c57806333c356c3146106c15780633659cfe6146106f4575f5ffd5b806320d0ac9f146104e857806325bd6a3c14610518578063295578981461059b5780632abfe92d1461061d575f5ffd5b806304f3bcec1161036557806304f3bcec146104155780630885878b146104475780631497a7de146104885780631c0fca5c1461049d575f5ffd5b80629d9aa91461038a578063029ed8d4146103d557806303046c3d146103f4575b5f5ffd5b348015610395575f5ffd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103e0575f5ffd5b5061011c545b6040519081526020016103cc565b3480156103ff575f5ffd5b5061041361040e36600461473b565b610e44565b005b348015610420575f5ffd5b507f00000000000000000000000000000000000000000000000000000000000000006103b8565b348015610452575f5ffd5b5061046661046136600461473b565b610f11565b60408051825181526020808401519082015291810151908201526060016103cc565b348015610493575f5ffd5b50610116546103e6565b3480156104a8575f5ffd5b506104d07f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160401b0390911681526020016103cc565b3480156104f3575f5ffd5b506101175465ffffffffffff165b60405165ffffffffffff90911681526020016103cc565b348015610523575f5ffd5b5061058e610532366004614775565b60408051606080820183525f808352602080840182905292840181905265ffffffffffff9485168152610118835283902083519182018452805482526001015480851692820192909252600160301b9091049092169082015290565b6040516103cc9190614790565b3480156105a6575f5ffd5b506105ba6105b536600461473b565b610f6b565b6040516103cc91905f60c08201905065ffffffffffff835116825265ffffffffffff602084015116602083015265ffffffffffff6040840151166040830152606083015160608301526080830151608083015260a083015160a083015292915050565b348015610628575f5ffd5b50610641610110546101115465ffffffffffff90911691565b6040805165ffffffffffff90931683526020830191909152016103cc565b34801561066a575f5ffd5b5061011a5465ffffffffffff16610501565b348015610687575f5ffd5b5060027fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5c60ff16145b60405190151581526020016103cc565b3480156106cc575f5ffd5b506105017f000000000000000000000000000000000000000000000000000000000000000081565b3480156106ff575f5ffd5b5061041361070e3660046147d9565b610fdf565b34801561071e575f5ffd5b506103e66110ac565b348015610732575f5ffd5b506106b16101025460ff1660031490565b34801561074e575f5ffd5b50610757600381565b60405160ff90911681526020016103cc565b348015610774575f5ffd5b506104136110f3565b348015610788575f5ffd5b5061079c6107973660046147f4565b61114e565b6040516103cc919061482b565b6104136107b736600461490b565b611166565b3480156107c7575f5ffd5b506103e6611193565b3480156107db575f5ffd5b506104d07f000000000000000000000000000000000000000000000000000000000000000081565b34801561080e575f5ffd5b506103e6611244565b348015610822575f5ffd5b506106b160c954610100900460ff1660021490565b348015610842575f5ffd5b506104d07f000000000000000000000000000000000000000000000000000000000000000081565b348015610875575f5ffd5b50610119546040805165ffffffffffff8084168252600160301b9093049092166020830152016103cc565b3480156108ab575f5ffd5b506109326040805160a0810182525f80825260208201819052918101829052606081018290526080810191909152506040805160a0810182526101255465ffffffffffff8082168352600160301b820481166020840152600160601b8204811693830193909352600160901b810483166060830152600160c01b9004909116608082015290565b6040516103cc91905f60a08201905065ffffffffffff835116825265ffffffffffff602084015116602083015265ffffffffffff604084015116604083015265ffffffffffff606084015116606083015265ffffffffffff608084015116608083015292915050565b3480156109a6575f5ffd5b507f00000000000000000000000000000000000000000000000000000000000000006103b8565b3480156109d8575f5ffd5b506103b87f000000000000000000000000000000000000000000000000000000000000000081565b348015610a0b575f5ffd5b5061011a54600160301b900465ffffffffffff16610501565b348015610a2f575f5ffd5b50610413611288565b348015610a43575f5ffd5b50610413610a523660046147f4565b611299565b348015610a62575f5ffd5b50610413611434565b348015610a76575f5ffd5b506104136114ab565b348015610a8a575f5ffd5b507f00000000000000000000000000000000000000000000000000000000000000006103b8565b348015610abc575f5ffd5b50610413611538565b348015610ad0575f5ffd5b506103b861158d565b348015610ae4575f5ffd5b506033546001600160a01b03166103b8565b610413610b043660046149f4565b61159b565b348015610b14575f5ffd5b5061010c5465ffffffffffff16610501565b348015610b31575f5ffd5b50610413610b40366004614a32565b6117bc565b348015610b50575f5ffd5b506103e661200081565b348015610b65575f5ffd5b506103b87f000000000000000000000000000000000000000000000000000000000000000081565b348015610b98575f5ffd5b50610c146040805160a0810182525f80825260208201819052918101829052606081018290526080810191909152506040805160a0810182526101105465ffffffffffff8082168352600160301b820481166020840152600160601b909104169181019190915261011154606082015261011254608082015290565b6040516103cc91905f60a08201905065ffffffffffff835116825265ffffffffffff602084015116602083015265ffffffffffff6040840151166040830152606083015160608301526080830151608083015292915050565b348015610c78575f5ffd5b506103b87f000000000000000000000000000000000000000000000000000000000000000081565b348015610cab575f5ffd5b50610413610cba366004614a5b565b61192a565b348015610cca575f5ffd5b5061010d546103e6565b348015610cdf575f5ffd5b506040805180820182525f8082526020918201528151808301835261010e5465ffffffffffff1680825261010f549183019182528351908152905191810191909152016103cc565b348015610d32575f5ffd5b506104d07f000000000000000000000000000000000000000000000000000000000000000081565b348015610d65575f5ffd5b50610413610d74366004614ab5565b611cd5565b348015610d84575f5ffd5b50610413610d93366004614b3e565b611e5c565b348015610da3575f5ffd5b506104d06120b3565b348015610db7575f5ffd5b506065546001600160a01b03166103b8565b348015610dd4575f5ffd5b50610413610de33660046147f4565b612101565b348015610df3575f5ffd5b50610124546103e6565b348015610e08575f5ffd5b506103e6600681565b348015610e1c575f5ffd5b50610413610e2b3660046147d9565b6122b0565b348015610e3b575f5ffd5b50610757600181565b610e4c612321565b610e5461237b565b610e5e60026123c0565b610e666123e6565b6101025460ff16600314610e8d576040516321c4e35760e21b815260040160405180910390fd5b610124548114610eb0576040516305b10fab60e01b815260040160405180910390fd5b5f610124546001610ec19190614c2d565b61012481905560408051848152602081018390529192507fc5b62705b7093fc3a67fd6d728b9f3ea1e0a5c8585a5b48faecd513dac19d35e910160405180910390a150610f0e60016123c0565b50565b610f3260405180606001604052805f81526020015f81526020015f81525090565b505f9081526101226020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b610f736146f3565b505f90815261011d6020908152604091829020825160c081018452815465ffffffffffff8082168352600160301b8204811694830194909452600160601b900490921692820192909252600182015460608201526002820154608082015260039091015460a082015290565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036110305760405162461bcd60e51b815260040161102790614c40565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611062612484565b6001600160a01b0316146110885760405162461bcd60e51b815260040161102790614c8c565b6110918161249f565b604080515f80825260208201909252610f0e918391906124a7565b610111545f9081036110d157604051630456607560e01b815260040160405180910390fd5b5061010c5465ffffffffffff165f908152610122602052604090206001015490565b6110fb612616565b61110f60c9805461ff001916610100179055565b6040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9060200160405180910390a161114c335f612647565b565b606061115d610118848461264f565b90505b92915050565b341561118557604051630dccd20d60e21b815260040160405180910390fd5b61118f828261280a565b5050565b5f306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112325760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401611027565b505f5160206152485f395f51905f5290565b610111545f90810361126957604051630456607560e01b815260040160405180910390fd5b5061010c5465ffffffffffff165f908152610122602052604090205490565b611290612321565b61114c5f6128bf565b6112a1612321565b6112a961237b565b6112b360026123c0565b6112bb6123e6565b6101025460ff166003146112e2576040516321c4e35760e21b815260040160405180910390fd5b6040805160a0810182526101255465ffffffffffff8082168352600160301b80830482166020850152600160601b8304821694840194909452600160901b820481166060840152600160c01b9091048116608083015261011a5491925f9261134e929190041642614c2d565b9050816060015165ffffffffffff165f1461138f57816060015165ffffffffffff16811061138f57604051637c03347b60e11b815260040160405180910390fd5b65ffffffffffff84161515806113ac575065ffffffffffff831615155b1561140957808465ffffffffffff16101580156113d0575065ffffffffffff831615155b80156113ec57506113ea600665ffffffffffff8516614cec565b155b6114095760405163863a78cd60e01b815260040160405180910390fd5b65ffffffffffff808516606084015283166080830152611428826128d8565b505061118f60016123c0565b60655433906001600160a01b031681146114a25760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401611027565b610f0e816128bf565b6114b361237b565b6114bd60026123c0565b6114c56123e6565b60405147808252907fce643ee5bef8191c8f9269e1432c7676cf8a386340a02d63fadc0a659d89c0c09060200160405180910390a161152d6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016826129f5565b5061114c60016123c0565b611540612a00565b60c9805461ff0019166102001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589060200160405180910390a161114c336001612647565b5f611596612484565b905090565b6115a361237b565b6115ad60026123c0565b6115b56123e6565b610111545f036115d857604051630456607560e01b815260040160405180910390fd5b6120008111156115fb5760405163184cb5c360e11b815260040160405180910390fd5b5f6116496101187f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612a32565b611660906001600160401b0316633b9aca00614cff565b9050803410156116825760405162976f7560e21b815260040160405180910390fd5b61011954604080516060810191829052600160301b90920465ffffffffffff16919081906116b39087908790614d16565b604051809103902081526020016116c942612ab3565b65ffffffffffff1681526020016116df43612ab3565b65ffffffffffff9081169091528281165f908152610118602090815260409182902084518155908401516001918201805495909301518416600160301b026001600160601b031990951693169290921792909217909155611741908290614d25565b61011980546bffffffffffff0000000000001916600160301b65ffffffffffff93841602179055604051908216907f64f37d56550590271687b1ab6f206818509443ba5d71fc5426fe1265df7e9991906117a090879087908790614d6b565b60405180910390a26114286117b58334614d8e565b33906129f5565b7f00000000000000000000000000000000000000000000000000000000000000006117e681612adf565b6117ee61237b565b6117f860026123c0565b6118006123e6565b6101025460ff16600314611827576040516321c4e35760e21b815260040160405180910390fd5b61011154156118495760405163f124655760e01b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000065ffffffffffff16421015611891576040516254d92160e51b815260040160405180910390fd5b83158015906118a35750600160301b84105b80156118ae57508215155b80156118b957508115155b6118d657604051630e0d5b9360e21b815260040160405180910390fd5b65ffffffffffff43118015906118f2575065ffffffffffff4211155b61190f5760405163f20577e560e01b815260040160405180910390fd5b61191a848484612b08565b61192460016123c0565b50505050565b5f54600290610100900460ff1615801561194a57505f5460ff8083169116105b6119ad5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401611027565b5f805461ffff191660ff8316176101001790556119c8612321565b6119d06123e6565b6119d982612de3565b5f611aad8360a001604080517445544e415f504152454e545f414e43484f525f563160581b6020808301919091527f00000000000000000000000000000000000000000000000000000000000000006001600160401b0316828401526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016606080840191909152843560808401529084013560a08301529183013560c08201529082013560e08201525f9061010001604051602081830303815290604052805190602001209050919050565b6101028054600360ff1990911617905561010d819055610110805465ffffffffffff60601b1916600160601b60408781013565ffffffffffff8181169390930293909317909355608080880135610116819055610117805465ffffffffffff19166060808c0135808716928317909355875180890189526101208d013587168082526101408e0135909716602091820181905261011a80546001600160601b031916909817600160301b9091021790965561011c8290558751968752948601529484015290820184905292935090917f5089958590f128b86d2e819191c08f40c72f5e4da5ffa61e88fa68d34d6b06d3910160405180910390a17f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611c8f57611be55f85356020870135612b08565b604080516060810182525f8152853560208083019182528701358284019081529251631934171960e31b8152915165ffffffffffff166004830152516024820152905160448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c9a0b8c8906064015f604051808303815f87803b158015611c78575f5ffd5b505af1158015611c8a573d5f5f3e3d5ffd5b505050505b50505f805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b611cdd61237b565b611ce760026123c0565b611cef6123e6565b61010c5461010e5465ffffffffffff91821691165f611d0f888385613116565b90505f611d1e8989898661335b565b90505f7045544e415f4c414e445f435554535f563160781b8565ffffffffffff168b5f01358c602001358c8c604051602001611d5b929190614da1565b60408051601f198184030181528282528051602091820120908301969096528101939093526060830191909152608082015260a081019190915260c0016040516020818303038152906040528051906020012090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166314bcf3dd5f611dec8d878a8761350a565b8a8a6040518563ffffffff1660e01b8152600401611e0d9493929190614dc8565b5f6040518083038186803b158015611e23575f5ffd5b505afa158015611e35573d5f5f3e3d5ffd5b50505050611e468a85878585613749565b5050505050611e5560016123c0565b5050505050565b611e64612321565b611e6c61237b565b611e7660026123c0565b611e7e6123e6565b5f5f611e8c8b8b8b8b613a07565b915091505f611e9a84613bd2565b9050611ea888888888613cc2565b5f5b87811015611f76577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166344bbc44e8a8a84818110611ef357611ef3614de7565b9050604002015f01358b8b85818110611f0e57611f0e614de7565b905060400201602001356040518363ffffffff1660e01b8152600401611f3e929190918252602082015260400190565b5f604051808303815f87803b158015611f55575f5ffd5b505af1158015611f67573d5f5f3e3d5ffd5b50505050806001019050611eaa565b505f5b85811015611fd9577fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4706101185f898985818110611fb857611fb8614de7565b602090810292909201358352508101919091526040015f2055600101611f79565b5061010c805465ffffffffffff191665ffffffffffff8416179055611fff8a6001614c2d565b610124556040805160608101825265ffffffffffff8086168252436020808401828152428587018181529489165f8181526101229094529287902095518655905160018601559251600290940193909355925191927f728633915fa409eff022ab3562552796d2e6a80f3af150352336712e0db486f69261208a928892918e908e908e908e90614e2b565b60405180910390a261209b816128d8565b5050506120a860016123c0565b505050505050505050565b5f6115966101187f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612a32565b612109612321565b61211161237b565b61211b60026123c0565b6121236123e6565b6101025460ff1660031461214a576040516321c4e35760e21b815260040160405180910390fd5b6040805160a0810182526101255465ffffffffffff8082168352600160301b80830482166020850152600160601b8304821694840194909452600160901b820481166060840152600160c01b9091048116608083015261011a5491925f926121b6929190041642614c2d565b9050816040015165ffffffffffff1642106121df57602082015165ffffffffffff16825261220b565b816040015165ffffffffffff16811061220b576040516342df285d60e11b815260040160405180910390fd5b816020015165ffffffffffff168465ffffffffffff16148061224b575060208201516122409065ffffffffffff166001614c2d565b8465ffffffffffff16145b612268576040516319557f1960e31b815260040160405180910390fd5b808365ffffffffffff16101561229157604051634372a06b60e11b815260040160405180910390fd5b65ffffffffffff808516602084015283166040830152611428826128d8565b6122b8612321565b606580546001600160a01b0383166001600160a01b031990911681179091556122e96033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6033546001600160a01b0316331461114c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611027565b60027fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5c60ff160361114c5760405163dfc60d8560e01b815260040160405180910390fd5b807fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5d50565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633075db566040518163ffffffff1660e01b8152600401602060405180830381865afa158015612442573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124669190614ea5565b1561114c576040516378a4e7d960e01b815260040160405180910390fd5b5f5160206152485f395f51905f52546001600160a01b031690565b610f0e612321565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156124df576124da83613e35565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612539575060408051601f3d908101601f1916820190925261253691810190614ec4565b60015b61259c5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401611027565b5f5160206152485f395f51905f52811461260a5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401611027565b506124da838383613ed0565b61262a60c954610100900460ff1660021490565b61114c5760405163bae6e2a960e01b815260040160405180910390fd5b61118f612321565b600183015460609065ffffffffffff80821691600160301b9004811690851682118061268b57508065ffffffffffff168565ffffffffffff1610155b8061269c575065ffffffffffff8416155b156126eb57604080515f80825260208201909252906126e1565b604080516060810182525f80825260208083018290529282015282525f199092019101816126b65790505b5092505050612803565b5f61271065ffffffffffff86166127028885614edb565b65ffffffffffff1690613ef4565b9050806001600160401b0381111561272a5761272a61489f565b60405190808252806020026020018201604052801561277357816020015b604080516060810182525f80825260208083018290529282015282525f199092019101816127485790505b5093505f5b818110156127fe57875f61279465ffffffffffff8a1684614c2d565b815260208082019290925260409081015f2081516060810183528154815260019091015465ffffffffffff80821694830194909452600160301b90049092169082015285518690839081106127eb576127eb614de7565b6020908102919091010152600101612778565b505050505b9392505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036128525760405162461bcd60e51b815260040161102790614c40565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612884612484565b6001600160a01b0316146128aa5760405162461bcd60e51b815260040161102790614c8c565b6128b38261249f565b61118f828260016124a7565b606580546001600160a01b0319169055610f0e81613f08565b8051610125805460208085015160408087015160608089015160808a015165ffffffffffff998a166001600160601b03199098168817600160301b8b881602176bffffffffffffffffffffffff60601b1916600160601b8b86160265ffffffffffff60901b191617600160901b8b8416021765ffffffffffff60c01b1916600160c01b9a82169a909a0299909917909755915165ffffffffffff60c01b60c09890981b9790971665ffffffffffff60901b60909790971b9690961665ffffffffffff60601b9190921b166bffffffffffff00000000000060309390931b9290921690931717919091179190911782527fcbe44daf7dd9e4491937867cfca11dd54f843b24d216ad4644960d41eb153510910160405180910390a150565b61118f82825a613f59565b612a1460c954610100900460ff1660021490565b1561114c5760405163bae6e2a960e01b815260040160405180910390fd5b60018301545f9065ffffffffffff80821691600160301b90041682612a578383614edb565b65ffffffffffff1690505f612a75826001600160401b038816614c2d565b612a88906001600160401b038916614cff565b9050612aa76001600160401b03612aa188821684614ef9565b90613ef4565b98975050505050505050565b5f65ffffffffffff821115612adb5760405163f20577e560e01b815260040160405180910390fd5b5090565b336001600160a01b03821614610f0e576040516395383ea160e01b815260040160405180910390fd5b5f8390506040518060a001604052808265ffffffffffff1681526020014365ffffffffffff1681526020016101105f01600c9054906101000a900465ffffffffffff1665ffffffffffff168152602001848152602001838152506101105f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506020820151815f0160066101000a81548165ffffffffffff021916908365ffffffffffff1602179055506040820151815f01600c6101000a81548165ffffffffffff021916908365ffffffffffff16021790555060608201518160010155608082015181600201559050506040518060600160405280858152602001438152602001428152506101225f5f81526020019081526020015f205f820151815f0155602082015181600101556040820151816002015590505060405180604001604052808265ffffffffffff1681526020018481525061010e5f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff160217905550602082015181600101559050506040518060c001604052808265ffffffffffff1681526020015f65ffffffffffff1681526020015f65ffffffffffff1681526020018481526020015f5f1b81526020015f5f1b81525061011d5f8681526020019081526020015f205f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506020820151815f0160066101000a81548165ffffffffffff021916908365ffffffffffff1602179055506040820151815f01600c6101000a81548165ffffffffffff021916908365ffffffffffff160217905550606082015181600101556080820151816002015560a082015181600301559050507fcbba56cc75163b59c6ab9ee459031c45e1e6519f02eb2a9a25ab226079de9435848484604051612dd5939291909283526020830191909152604082015260600190565b60405180910390a150505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316158135151581148015612e27575060208201351515811515145b612e445760405163156b26df60e31b815260040160405180910390fd5b60808201355f03612e6757604051627bdb0560e71b815260040160405180910390fd5b6003826040013510158015612e85575065ffffffffffff6040830135105b612ea2576040516388ac089760e01b815260040160405180910390fd5b612eae8260a001613f9c565b612ecb576040516337f09fbf60e21b815260040160405180910390fd5b61012082013515801590612eea575065ffffffffffff61012083013511155b612f0757604051635278e92760e11b815260040160405180910390fd5b61048082610140013510158015612f29575065ffffffffffff61014083013511155b612f465760405163086ccfcb60e31b815260040160405180910390fd5b65ffffffffffff4311801590612f62575065ffffffffffff4211155b612f7f5760405163f20577e560e01b815260040160405180910390fd5b306001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663fb0e722b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612fe5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906130099190614f0c565b6001600160a01b03161480156130cf57507f00000000000000000000000000000000000000000000000000000000000000006001600160401b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d6ae3cd56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130a0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906130c49190614f27565b6001600160401b0316145b6130ec57604051632837e25360e21b815260040160405180910390fd5b6130f98260600135614011565b61118f57604051630377d3e160e61b815260040160405180910390fd5b61311e6146f3565b65ffffffffffff8083165f9081526101226020908152604090912054610110548735939288013592168287106131665760405162560ff960e81b815260040160405180910390fd5b8382111580156131765750868411155b80156131855750600160301b83105b6131a25760405163561ce9bb60e01b815260040160405180910390fd5b60066131ae8286614d8e565b6131b89190614cec565b1580156131d8575060066131cc8285614d8e565b6131d69190614cec565b155b6131f55760405163040f9c9360e51b815260040160405180910390fd5b6001600160401b037f0000000000000000000000000000000000000000000000000000000000000000166132298585614d8e565b1115613248576040516305beb17160e11b815260040160405180910390fd5b5f84815261011d60209081526040808320815160c081018352815465ffffffffffff8082168352600160301b8204811695830195909552600160601b9004909316918301919091526001810154606083018190526002820154608084015260039091015460a083015290965090036132d357604051631a04c27960e01b815260040160405180910390fd5b8565ffffffffffff16856020015165ffffffffffff1614806132f457508184145b6133115760405163144eb95560e31b815260040160405180910390fd5b808714801561334857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b156127fe576127fe878660600151614141565b5f84356020860135600160066133718484614d8e565b61337b9190614ef9565b6133859190614d8e565b85146133a457604051630905f48960e11b815260040160405180910390fd5b5f84815261011d6020526040902080546101195465ffffffffffff600160601b9092048216911681146133ea576040516304bc5eb960e31b815260040160405180910390fd5b8386111561349a5760018201546002830154600384015460408051602081018b90529081019390935260608301919091526080820183905260a082015260c00160405160208183030381529060405280519060200120888860016006888b6134529190614d8e565b61345c9190614ef9565b6134669190614d8e565b81811061347557613475614de7565b905060200201351461349a5760405163013ce4cf60e41b815260040160405180910390fd5b8860e0013594508481111580156134c3575061011954600160301b900465ffffffffffff168511155b80156134e157506134d48684614d8e565b6134de8287614d8e565b11155b6134fe5760405163555a9e4b60e11b815260040160405180910390fd5b50505050949350505050565b5f6135b7604051806102e001604052805f81526020015f81526020015f81526020015f6001600160a01b031681526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b715441494b4f5f45544e415f4c414e445f563160701b8152466020808301919091526001600160401b037f000000000000000000000000000000000000000000000000000000000000000016604080840191909152306060808501919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031660808086019190915265ffffffffffff881660a0808701919091528a3560c0808801919091528a84015160e08801528a8301516101008801528a82015161012088015261010d54610140880152948b0135610160870152928a0135610180860152908901356101a08501528801356101c08401528701356101e083015286013561020082018190526136d1906142f1565b6102208201526136df614446565b61024082015260408086015165ffffffffffff1661026083015260e08701356102808301526101008701356102a08301526102c0820184905251613727908290602001614f4d565b604051602081830303815290604052805190602001209150505b949350505050565b5f856020013590505f8660400135905060405180604001604052808365ffffffffffff1681526020018281525061010e5f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506020820151816001015590505086610100013561011c81905550836101186001015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506040518060c001604052808765ffffffffffff1681526020018665ffffffffffff1681526020018565ffffffffffff16815260200182815260200188606001358152602001886080013581525061011d5f8465ffffffffffff1681526020019081526020015f205f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506020820151815f0160066101000a81548165ffffffffffff021916908365ffffffffffff1602179055506040820151815f01600c6101000a81548165ffffffffffff021916908365ffffffffffff160217905550606082015181600101556080820151816002015560a082015181600301559050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c9a0b8c860405180606001604052808565ffffffffffff1681526020018481526020018a60a001358152506040518263ffffffff1660e01b815260040161397d9190815165ffffffffffff168152602080830151908201526040918201519181019190915260600190565b5f604051808303815f87803b158015613994575f5ffd5b505af11580156139a6573d5f5f3e3d5ffd5b5050604080518681526101008b01356020820152600181830152905165ffffffffffff861693508992508a35917ff7e666e906e680fee421976ba5787b16d7baf9e593cb41c64c62fde855c7470e919081900360600190a450505050505050565b610102545f90819060ff16600314613a32576040516321c4e35760e21b815260040160405180910390fd5b610111545f03613a5557604051630456607560e01b815260040160405180910390fd5b61010c5465ffffffffffff9081169087168114613a8557604051634c8ea04160e01b815260040160405180910390fd5b61010e5465ffffffffffff169250858314613ab357604051632db7a22b60e11b815260040160405180910390fd5b61011054600690613acc9065ffffffffffff1688614d8e565b613ad69190614cec565b15613af45760405163775523b360e11b815260040160405180910390fd5b610124548514613b17576040516305b10fab60e01b815260040160405180910390fd5b83421115613b3857604051630f05f5bf60e01b815260040160405180910390fd5b613b53613b4e65ffffffffffff83166001614c2d565b612ab3565b65ffffffffffff81165f908152610122602052604090206001015490925015613b8f57604051630799d92360e51b815260040160405180910390fd5b65ffffffffffff4311801590613bab575065ffffffffffff4211155b613bc85760405163f20577e560e01b815260040160405180910390fd5b5094509492505050565b6040805160a0810182525f80825260208201819052918101829052606081018290526080810191909152506040805160a0810182526101255465ffffffffffff8082168352600160301b820481166020840152600160601b8204811693830193909352600160901b810483166060830152600160c01b90048216608082015290821615613cb0576020810151613c719065ffffffffffff166001614c2d565b8265ffffffffffff1614613c98576040516319557f1960e31b815260040160405180910390fd5b65ffffffffffff821680825260208201525f60408201525b5f606082018190526080820152919050565b60015b83811015613d3457848482818110613cdf57613cdf614de7565b604002919091013590508585613cf6600185614d8e565b818110613d0557613d05614de7565b9050604002015f013510613d2c57604051634c65d6d760e11b815260040160405180910390fd5b600101613cc5565b50805f819003613d445750611924565b60015b81811015613db357838382818110613d6157613d61614de7565b905060200201358484600184613d779190614d8e565b818110613d8657613d86614de7565b9050602002013510613dab576040516304664ebb60e01b815260040160405180910390fd5b600101613d47565b506101195465ffffffffffff1683835f81613dd057613dd0614de7565b9050602002013510158015613e18575061011954600160301b900465ffffffffffff168383613e00600185614d8e565b818110613e0f57613e0f614de7565b90506020020135105b611e55576040516372e5dfb960e01b815260040160405180910390fd5b6001600160a01b0381163b613ea25760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401611027565b5f5160206152485f395f51905f5280546001600160a01b0319166001600160a01b0392909216919091179055565b613ed983614541565b5f82511180613ee55750805b156124da576119248383614580565b5f818311613f02578261115d565b50919050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b815f03613f6557505050565b613f7f83838360405180602001604052805f8152506145a5565b6124da57604051634c67134d60e11b815260040160405180910390fd5b5f606082013560068110801590613fb5575061fffc8111155b8015613fc95750613fc7600682614cec565b155b8015613fda57506333b2e3ca833510155b8015613feb57508235602084013510155b8015613ffa5750604083013515155b801561280357505050611000604090910135111590565b5f438210801561409f57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631f618cd26040518163ffffffff1660e01b8152600401602060405180830381865afa158015614078573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061409c9190614ec4565b15155b801561116057506040516001626ac92560e01b031981525f60048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ff9536db90602401606060405180830381865afa15801561410b573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061412f919061507b565b5165ffffffffffff1682101592915050565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636aa6a01a6040518163ffffffff1660e01b815260040160c060405180830381865afa15801561419e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906141c291906150c8565b9050806040015165ffffffffffff1660016141dd9190614c2d565b815165ffffffffffff16146142055760405163d15b5e5960e01b815260040160405180910390fd5b818160a001511461422957604051636c0a9e4760e01b815260040160405180910390fd5b604051638026b92160e01b815265ffffffffffff841660048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638026b92190602401606060405180830381865afa158015614295573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906142b9919061516b565b90508281602001511480156142d45750610112546040820151145b6119245760405163ebb1dc1760e01b815260040160405180910390fd5b5f43821061431257604051631dd7ce8160e11b815260040160405180910390fd5b5f61431d8343614d8e565b905061010081116143315782409150614425565b611fff81111561435457604051631dd7ce8160e11b815260040160405180910390fd5b5f5f71f90827f1c53a10cb7a02335b1753200029356001600160a01b03168560405160200161438591815260200190565b60408051601f198184030181529082905261439f916151af565b5f60405180830381855afa9150503d805f81146143d7576040519150601f19603f3d011682016040523d82523d5f602084013e6143dc565b606091505b50915091508180156143ef575080516020145b61440c57604051631dd7ce8160e11b815260040160405180910390fd5b808060200190518101906144209190614ec4565b935050505b5f829003613f0257604051631dd7ce8160e11b815260040160405180910390fd5b5f5f5b6006811115801561445a5750804915155b1561446f57614468816151c5565b9050614449565b801580159061447f575060068111155b61449c5760405163a72c89df60e01b815260040160405180910390fd5b5f816001600160401b038111156144b5576144b561489f565b6040519080825280602002602001820160405280156144de578160200160208202803683370190505b5090505f5b828110156145125780498282815181106144ff576144ff614de7565b60209081029190910101526001016144e3565b508060405160200161452491906151dd565b604051602081830303815290604052805190602001209250505090565b61454a81613e35565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a250565b606061115d8383604051806060016040528060278152602001615268602791396145e2565b5f6001600160a01b0385166145cd57604051634c67134d60e11b815260040160405180910390fd5b5f5f835160208501878988f195945050505050565b60605f5f856001600160a01b0316856040516145fe91906151af565b5f60405180830381855af49150503d805f8114614636576040519150601f19603f3d011682016040523d82523d5f602084013e61463b565b606091505b509150915061464c86838387614656565b9695505050505050565b606083156146c45782515f036146bd576001600160a01b0385163b6146bd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611027565b5081613741565b61374183838151156146d95781518083602001fd5b8060405162461bcd60e51b81526004016110279190615212565b6040518060c001604052805f65ffffffffffff1681526020015f65ffffffffffff1681526020015f65ffffffffffff1681526020015f81526020015f81526020015f81525090565b5f6020828403121561474b575f5ffd5b5035919050565b65ffffffffffff81168114610f0e575f5ffd5b803561477081614752565b919050565b5f60208284031215614785575f5ffd5b813561280381614752565b6060810161116082848051825265ffffffffffff602082015116602083015265ffffffffffff60408201511660408301525050565b6001600160a01b0381168114610f0e575f5ffd5b5f602082840312156147e9575f5ffd5b8135612803816147c5565b5f5f60408385031215614805575f5ffd5b823561481081614752565b9150602083013561482081614752565b809150509250929050565b602080825282518282018190525f918401906040840190835b818110156148945761487e8385518051825265ffffffffffff602082015116602083015265ffffffffffff60408201511660408301525050565b6020939093019260609290920191600101614844565b509095945050505050565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156148d5576148d561489f565b60405290565b604051601f8201601f191681016001600160401b03811182821017156149035761490361489f565b604052919050565b5f5f6040838503121561491c575f5ffd5b8235614927816147c5565b915060208301356001600160401b03811115614941575f5ffd5b8301601f81018513614951575f5ffd5b80356001600160401b0381111561496a5761496a61489f565b61497d601f8201601f19166020016148db565b818152866020838501011115614991575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b5f5f83601f8401126149c0575f5ffd5b5081356001600160401b038111156149d6575f5ffd5b6020830191508360208285010111156149ed575f5ffd5b9250929050565b5f5f60208385031215614a05575f5ffd5b82356001600160401b03811115614a1a575f5ffd5b614a26858286016149b0565b90969095509350505050565b5f5f5f60608486031215614a44575f5ffd5b505081359360208301359350604090920135919050565b5f610160828403128015614a6d575f5ffd5b509092915050565b5f5f83601f840112614a85575f5ffd5b5081356001600160401b03811115614a9b575f5ffd5b6020830191508360208260051b85010111156149ed575f5ffd5b5f5f5f5f5f858703610160811215614acb575f5ffd5b610120811215614ad9575f5ffd5b508594506101208601356001600160401b03811115614af6575f5ffd5b614b0288828901614a75565b9095509350506101408601356001600160401b03811115614b21575f5ffd5b614b2d888289016149b0565b969995985093965092949392505050565b5f5f5f5f5f5f5f5f5f60e08a8c031215614b56575f5ffd5b8935614b6181614752565b985060208a0135975060408a0135965060608a0135955060808a01356001600160401b03811115614b90575f5ffd5b8a01601f81018c13614ba0575f5ffd5b80356001600160401b03811115614bb5575f5ffd5b8c60208260061b8401011115614bc9575f5ffd5b6020919091019550935060a08a01356001600160401b03811115614beb575f5ffd5b614bf78c828d01614a75565b9094509250614c0a905060c08b01614765565b90509295985092959850929598565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561116057611160614c19565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b5f52601260045260245ffd5b5f82614cfa57614cfa614cd8565b500690565b808202811582820484141761116057611160614c19565b818382375f9101908152919050565b65ffffffffffff818116838216019081111561116057611160614c19565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b604081525f614d7e604083018587614d43565b9050826020830152949350505050565b8181038181111561116057611160614c19565b5f6001600160fb1b03831115614db5575f5ffd5b8260051b80858437919091019392505050565b848152836020820152606060408201525f61464c606083018486614d43565b634e487b7160e01b5f52603260045260245ffd5b8183525f6001600160fb1b03831115614e12575f5ffd5b8260051b80836020870137939093016020019392505050565b65ffffffffffff88168152602081018790526040810186905260a06060820181905281018490525f8560c08301825b87811015614e8257823582526020808401359083015260409283019290910190600101614e5a565b508381036080850152614e96818688614dfb565b9b9a5050505050505050505050565b5f60208284031215614eb5575f5ffd5b81518015158114612803575f5ffd5b5f60208284031215614ed4575f5ffd5b5051919050565b65ffffffffffff828116828216039081111561116057611160614c19565b5f82614f0757614f07614cd8565b500490565b5f60208284031215614f1c575f5ffd5b8151612803816147c5565b5f60208284031215614f37575f5ffd5b81516001600160401b0381168114612803575f5ffd5b5f6102e0820190508251825260208301516020830152604083015160408301526060830151614f8760608401826001600160a01b03169052565b506080830151614fa260808401826001600160a01b03169052565b5060a083015160a083015260c083015160c083015260e083015160e08301526101008301516101008301526101208301516101208301526101408301516101408301526101608301516101608301526101808301516101808301526101a08301516101a08301526101c08301516101c08301526101e08301516101e08301526102008301516102008301526102208301516102208301526102408301516102408301526102608301516102608301526102808301516102808301526102a08301516102a08301526102c08301516102c083015292915050565b5f606082840312801561508c575f5ffd5b506150956148b3565b82516150a081614752565b815260208301516150b081614752565b60208201526040928301519281019290925250919050565b5f60c08284031280156150d9575f5ffd5b5060405160c081016001600160401b03811182821017156150fc576150fc61489f565b604052825161510a81614752565b8152602083015161511a81614752565b6020820152604083015161512d81614752565b6040820152606083015161514081614752565b6060820152608083015161515381614752565b608082015260a0928301519281019290925250919050565b5f606082840312801561517c575f5ffd5b506151856148b3565b825161519081614752565b8152602083810151908201526040928301519281019290925250919050565b5f82518060208501845e5f920191825250919050565b5f600182016151d6576151d6614c19565b5060010190565b81515f90829060208501835b828110156152075781518452602093840193909101906001016151e9565b509195945050505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f8301168401019150509291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d7b7e2d0fab407ef3e5c354a4e873f1923cd4fddde12f0552c34cd166625d9f164736f6c634300081e0033000000000000000000000000044c2e53e9edddd1353a9d923fa39c1fa821e88e000000000000000000000000b261c6facc0707b674c7491338412fdf44733a4b0000000000000000000000002ec730f0830803a022262e46375e33023fad65e50000000000000000000000000000000000000000000000000000000000028c590000000000000000000000000000000000000000000000000000000000000078000000000000000000000000000000000000000000000000000000000098968000000000000000000000000000000000000000000000000000000000000000320000000000000000000000007777777777777777777777777777777777777777000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed ByteCode

0x608060405260043610610386575f3560e01c80636e1ec7db116101d3578063c61b2b45116100fd578063e30533351161009d578063f09e07821161006d578063f09e078214610dfd578063f2fde38b14610e11578063fd3d070314610dfd578063ffa1ad7414610e30575f5ffd5b8063e305333514610d98578063e30c397814610dac578063e63b2ddd14610dc9578063ed894cd314610de8575f5ffd5b8063d32e81a5116100d8578063d32e81a514610cd4578063d6ae3cd514610d27578063d87a150514610d5a578063e2070ff414610d79575f5ffd5b8063c61b2b4514610c6d578063c70a481a14610ca0578063cf4a9bc314610cbf575f5ffd5b80638abf60771161017357806398c5b14e1161014357806398c5b14e14610b265780639fdc8f2014610b45578063a0f2ed0214610b5a578063a7f0b3de14610b8d575f5ffd5b80638abf607714610ac55780638da5cb5b14610ad9578063924d90b514610af657806395806bd814610b09575f5ffd5b806379ba5097116101ae57806379ba509714610a575780637b93389e14610a6b5780637fa417b314610a7f5780638456cb5914610ab1575f5ffd5b80636e1ec7db14610a00578063715018a614610a2457806378e3ee6214610a38575f5ffd5b806337f6ffc4116102b457806352ef3437116102545780635ccc1718116102245780635ccc17181461086a57806362884622146108a057806362d094531461099b57806364df049e146109cd575f5ffd5b806352ef3437146107d05780635680a729146108035780635c975abb146108175780635cc9aa1d14610837575f5ffd5b80633f4ba83a1161028f5780633f4ba83a1461076957806340df98661461077d5780634f1ef286146107a957806352d1902d146107bc575f5ffd5b806337f6ffc414610713578063392e53cd146107275780633a4d119e14610743575f5ffd5b806320d0ac9f1161032a5780632f2f7641116102fa5780632f2f76411461065f5780633075db561461067c57806333c356c3146106c15780633659cfe6146106f4575f5ffd5b806320d0ac9f146104e857806325bd6a3c14610518578063295578981461059b5780632abfe92d1461061d575f5ffd5b806304f3bcec1161036557806304f3bcec146104155780630885878b146104475780631497a7de146104885780631c0fca5c1461049d575f5ffd5b80629d9aa91461038a578063029ed8d4146103d557806303046c3d146103f4575b5f5ffd5b348015610395575f5ffd5b507f0000000000000000000000002ec730f0830803a022262e46375e33023fad65e55b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103e0575f5ffd5b5061011c545b6040519081526020016103cc565b3480156103ff575f5ffd5b5061041361040e36600461473b565b610e44565b005b348015610420575f5ffd5b507f00000000000000000000000000000000000000000000000000000000000000006103b8565b348015610452575f5ffd5b5061046661046136600461473b565b610f11565b60408051825181526020808401519082015291810151908201526060016103cc565b348015610493575f5ffd5b50610116546103e6565b3480156104a8575f5ffd5b506104d07f000000000000000000000000000000000000000000000000000000000000007881565b6040516001600160401b0390911681526020016103cc565b3480156104f3575f5ffd5b506101175465ffffffffffff165b60405165ffffffffffff90911681526020016103cc565b348015610523575f5ffd5b5061058e610532366004614775565b60408051606080820183525f808352602080840182905292840181905265ffffffffffff9485168152610118835283902083519182018452805482526001015480851692820192909252600160301b9091049092169082015290565b6040516103cc9190614790565b3480156105a6575f5ffd5b506105ba6105b536600461473b565b610f6b565b6040516103cc91905f60c08201905065ffffffffffff835116825265ffffffffffff602084015116602083015265ffffffffffff6040840151166040830152606083015160608301526080830151608083015260a083015160a083015292915050565b348015610628575f5ffd5b50610641610110546101115465ffffffffffff90911691565b6040805165ffffffffffff90931683526020830191909152016103cc565b34801561066a575f5ffd5b5061011a5465ffffffffffff16610501565b348015610687575f5ffd5b5060027fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5c60ff16145b60405190151581526020016103cc565b3480156106cc575f5ffd5b506105017f000000000000000000000000000000000000000000000000000000000000000081565b3480156106ff575f5ffd5b5061041361070e3660046147d9565b610fdf565b34801561071e575f5ffd5b506103e66110ac565b348015610732575f5ffd5b506106b16101025460ff1660031490565b34801561074e575f5ffd5b50610757600381565b60405160ff90911681526020016103cc565b348015610774575f5ffd5b506104136110f3565b348015610788575f5ffd5b5061079c6107973660046147f4565b61114e565b6040516103cc919061482b565b6104136107b736600461490b565b611166565b3480156107c7575f5ffd5b506103e6611193565b3480156107db575f5ffd5b506104d07f000000000000000000000000000000000000000000000000000000000098968081565b34801561080e575f5ffd5b506103e6611244565b348015610822575f5ffd5b506106b160c954610100900460ff1660021490565b348015610842575f5ffd5b506104d07f000000000000000000000000000000000000000000000000000000000000003281565b348015610875575f5ffd5b50610119546040805165ffffffffffff8084168252600160301b9093049092166020830152016103cc565b3480156108ab575f5ffd5b506109326040805160a0810182525f80825260208201819052918101829052606081018290526080810191909152506040805160a0810182526101255465ffffffffffff8082168352600160301b820481166020840152600160601b8204811693830193909352600160901b810483166060830152600160c01b9004909116608082015290565b6040516103cc91905f60a08201905065ffffffffffff835116825265ffffffffffff602084015116602083015265ffffffffffff604084015116604083015265ffffffffffff606084015116606083015265ffffffffffff608084015116608083015292915050565b3480156109a6575f5ffd5b507f000000000000000000000000b261c6facc0707b674c7491338412fdf44733a4b6103b8565b3480156109d8575f5ffd5b506103b87f000000000000000000000000777777777777777777777777777777777777777781565b348015610a0b575f5ffd5b5061011a54600160301b900465ffffffffffff16610501565b348015610a2f575f5ffd5b50610413611288565b348015610a43575f5ffd5b50610413610a523660046147f4565b611299565b348015610a62575f5ffd5b50610413611434565b348015610a76575f5ffd5b506104136114ab565b348015610a8a575f5ffd5b507f000000000000000000000000044c2e53e9edddd1353a9d923fa39c1fa821e88e6103b8565b348015610abc575f5ffd5b50610413611538565b348015610ad0575f5ffd5b506103b861158d565b348015610ae4575f5ffd5b506033546001600160a01b03166103b8565b610413610b043660046149f4565b61159b565b348015610b14575f5ffd5b5061010c5465ffffffffffff16610501565b348015610b31575f5ffd5b50610413610b40366004614a32565b6117bc565b348015610b50575f5ffd5b506103e661200081565b348015610b65575f5ffd5b506103b87f000000000000000000000000000000000000000000000000000000000000000081565b348015610b98575f5ffd5b50610c146040805160a0810182525f80825260208201819052918101829052606081018290526080810191909152506040805160a0810182526101105465ffffffffffff8082168352600160301b820481166020840152600160601b909104169181019190915261011154606082015261011254608082015290565b6040516103cc91905f60a08201905065ffffffffffff835116825265ffffffffffff602084015116602083015265ffffffffffff6040840151166040830152606083015160608301526080830151608083015292915050565b348015610c78575f5ffd5b506103b87f000000000000000000000000000000000000000000000000000000000000000081565b348015610cab575f5ffd5b50610413610cba366004614a5b565b61192a565b348015610cca575f5ffd5b5061010d546103e6565b348015610cdf575f5ffd5b506040805180820182525f8082526020918201528151808301835261010e5465ffffffffffff1680825261010f549183019182528351908152905191810191909152016103cc565b348015610d32575f5ffd5b506104d07f0000000000000000000000000000000000000000000000000000000000028c5981565b348015610d65575f5ffd5b50610413610d74366004614ab5565b611cd5565b348015610d84575f5ffd5b50610413610d93366004614b3e565b611e5c565b348015610da3575f5ffd5b506104d06120b3565b348015610db7575f5ffd5b506065546001600160a01b03166103b8565b348015610dd4575f5ffd5b50610413610de33660046147f4565b612101565b348015610df3575f5ffd5b50610124546103e6565b348015610e08575f5ffd5b506103e6600681565b348015610e1c575f5ffd5b50610413610e2b3660046147d9565b6122b0565b348015610e3b575f5ffd5b50610757600181565b610e4c612321565b610e5461237b565b610e5e60026123c0565b610e666123e6565b6101025460ff16600314610e8d576040516321c4e35760e21b815260040160405180910390fd5b610124548114610eb0576040516305b10fab60e01b815260040160405180910390fd5b5f610124546001610ec19190614c2d565b61012481905560408051848152602081018390529192507fc5b62705b7093fc3a67fd6d728b9f3ea1e0a5c8585a5b48faecd513dac19d35e910160405180910390a150610f0e60016123c0565b50565b610f3260405180606001604052805f81526020015f81526020015f81525090565b505f9081526101226020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b610f736146f3565b505f90815261011d6020908152604091829020825160c081018452815465ffffffffffff8082168352600160301b8204811694830194909452600160601b900490921692820192909252600182015460608201526002820154608082015260039091015460a082015290565b6001600160a01b037f0000000000000000000000002fa4805846c3a81563e4b34c9f91115532aaeec41630036110305760405162461bcd60e51b815260040161102790614c40565b60405180910390fd5b7f0000000000000000000000002fa4805846c3a81563e4b34c9f91115532aaeec46001600160a01b0316611062612484565b6001600160a01b0316146110885760405162461bcd60e51b815260040161102790614c8c565b6110918161249f565b604080515f80825260208201909252610f0e918391906124a7565b610111545f9081036110d157604051630456607560e01b815260040160405180910390fd5b5061010c5465ffffffffffff165f908152610122602052604090206001015490565b6110fb612616565b61110f60c9805461ff001916610100179055565b6040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9060200160405180910390a161114c335f612647565b565b606061115d610118848461264f565b90505b92915050565b341561118557604051630dccd20d60e21b815260040160405180910390fd5b61118f828261280a565b5050565b5f306001600160a01b037f0000000000000000000000002fa4805846c3a81563e4b34c9f91115532aaeec416146112325760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401611027565b505f5160206152485f395f51905f5290565b610111545f90810361126957604051630456607560e01b815260040160405180910390fd5b5061010c5465ffffffffffff165f908152610122602052604090205490565b611290612321565b61114c5f6128bf565b6112a1612321565b6112a961237b565b6112b360026123c0565b6112bb6123e6565b6101025460ff166003146112e2576040516321c4e35760e21b815260040160405180910390fd5b6040805160a0810182526101255465ffffffffffff8082168352600160301b80830482166020850152600160601b8304821694840194909452600160901b820481166060840152600160c01b9091048116608083015261011a5491925f9261134e929190041642614c2d565b9050816060015165ffffffffffff165f1461138f57816060015165ffffffffffff16811061138f57604051637c03347b60e11b815260040160405180910390fd5b65ffffffffffff84161515806113ac575065ffffffffffff831615155b1561140957808465ffffffffffff16101580156113d0575065ffffffffffff831615155b80156113ec57506113ea600665ffffffffffff8516614cec565b155b6114095760405163863a78cd60e01b815260040160405180910390fd5b65ffffffffffff808516606084015283166080830152611428826128d8565b505061118f60016123c0565b60655433906001600160a01b031681146114a25760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401611027565b610f0e816128bf565b6114b361237b565b6114bd60026123c0565b6114c56123e6565b60405147808252907fce643ee5bef8191c8f9269e1432c7676cf8a386340a02d63fadc0a659d89c0c09060200160405180910390a161152d6001600160a01b037f000000000000000000000000777777777777777777777777777777777777777716826129f5565b5061114c60016123c0565b611540612a00565b60c9805461ff0019166102001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589060200160405180910390a161114c336001612647565b5f611596612484565b905090565b6115a361237b565b6115ad60026123c0565b6115b56123e6565b610111545f036115d857604051630456607560e01b815260040160405180910390fd5b6120008111156115fb5760405163184cb5c360e11b815260040160405180910390fd5b5f6116496101187f00000000000000000000000000000000000000000000000000000000009896807f0000000000000000000000000000000000000000000000000000000000000032612a32565b611660906001600160401b0316633b9aca00614cff565b9050803410156116825760405162976f7560e21b815260040160405180910390fd5b61011954604080516060810191829052600160301b90920465ffffffffffff16919081906116b39087908790614d16565b604051809103902081526020016116c942612ab3565b65ffffffffffff1681526020016116df43612ab3565b65ffffffffffff9081169091528281165f908152610118602090815260409182902084518155908401516001918201805495909301518416600160301b026001600160601b031990951693169290921792909217909155611741908290614d25565b61011980546bffffffffffff0000000000001916600160301b65ffffffffffff93841602179055604051908216907f64f37d56550590271687b1ab6f206818509443ba5d71fc5426fe1265df7e9991906117a090879087908790614d6b565b60405180910390a26114286117b58334614d8e565b33906129f5565b7f00000000000000000000000000000000000000000000000000000000000000006117e681612adf565b6117ee61237b565b6117f860026123c0565b6118006123e6565b6101025460ff16600314611827576040516321c4e35760e21b815260040160405180910390fd5b61011154156118495760405163f124655760e01b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000065ffffffffffff16421015611891576040516254d92160e51b815260040160405180910390fd5b83158015906118a35750600160301b84105b80156118ae57508215155b80156118b957508115155b6118d657604051630e0d5b9360e21b815260040160405180910390fd5b65ffffffffffff43118015906118f2575065ffffffffffff4211155b61190f5760405163f20577e560e01b815260040160405180910390fd5b61191a848484612b08565b61192460016123c0565b50505050565b5f54600290610100900460ff1615801561194a57505f5460ff8083169116105b6119ad5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401611027565b5f805461ffff191660ff8316176101001790556119c8612321565b6119d06123e6565b6119d982612de3565b5f611aad8360a001604080517445544e415f504152454e545f414e43484f525f563160581b6020808301919091527f0000000000000000000000000000000000000000000000000000000000028c596001600160401b0316828401526001600160a01b037f0000000000000000000000002ec730f0830803a022262e46375e33023fad65e516606080840191909152843560808401529084013560a08301529183013560c08201529082013560e08201525f9061010001604051602081830303815290604052805190602001209050919050565b6101028054600360ff1990911617905561010d819055610110805465ffffffffffff60601b1916600160601b60408781013565ffffffffffff8181169390930293909317909355608080880135610116819055610117805465ffffffffffff19166060808c0135808716928317909355875180890189526101208d013587168082526101408e0135909716602091820181905261011a80546001600160601b031916909817600160301b9091021790965561011c8290558751968752948601529484015290820184905292935090917f5089958590f128b86d2e819191c08f40c72f5e4da5ffa61e88fa68d34d6b06d3910160405180910390a17f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611c8f57611be55f85356020870135612b08565b604080516060810182525f8152853560208083019182528701358284019081529251631934171960e31b8152915165ffffffffffff166004830152516024820152905160448201527f000000000000000000000000b261c6facc0707b674c7491338412fdf44733a4b6001600160a01b03169063c9a0b8c8906064015f604051808303815f87803b158015611c78575f5ffd5b505af1158015611c8a573d5f5f3e3d5ffd5b505050505b50505f805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b611cdd61237b565b611ce760026123c0565b611cef6123e6565b61010c5461010e5465ffffffffffff91821691165f611d0f888385613116565b90505f611d1e8989898661335b565b90505f7045544e415f4c414e445f435554535f563160781b8565ffffffffffff168b5f01358c602001358c8c604051602001611d5b929190614da1565b60408051601f198184030181528282528051602091820120908301969096528101939093526060830191909152608082015260a081019190915260c0016040516020818303038152906040528051906020012090507f000000000000000000000000044c2e53e9edddd1353a9d923fa39c1fa821e88e6001600160a01b03166314bcf3dd5f611dec8d878a8761350a565b8a8a6040518563ffffffff1660e01b8152600401611e0d9493929190614dc8565b5f6040518083038186803b158015611e23575f5ffd5b505afa158015611e35573d5f5f3e3d5ffd5b50505050611e468a85878585613749565b5050505050611e5560016123c0565b5050505050565b611e64612321565b611e6c61237b565b611e7660026123c0565b611e7e6123e6565b5f5f611e8c8b8b8b8b613a07565b915091505f611e9a84613bd2565b9050611ea888888888613cc2565b5f5b87811015611f76577f0000000000000000000000002ec730f0830803a022262e46375e33023fad65e56001600160a01b03166344bbc44e8a8a84818110611ef357611ef3614de7565b9050604002015f01358b8b85818110611f0e57611f0e614de7565b905060400201602001356040518363ffffffff1660e01b8152600401611f3e929190918252602082015260400190565b5f604051808303815f87803b158015611f55575f5ffd5b505af1158015611f67573d5f5f3e3d5ffd5b50505050806001019050611eaa565b505f5b85811015611fd9577fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4706101185f898985818110611fb857611fb8614de7565b602090810292909201358352508101919091526040015f2055600101611f79565b5061010c805465ffffffffffff191665ffffffffffff8416179055611fff8a6001614c2d565b610124556040805160608101825265ffffffffffff8086168252436020808401828152428587018181529489165f8181526101229094529287902095518655905160018601559251600290940193909355925191927f728633915fa409eff022ab3562552796d2e6a80f3af150352336712e0db486f69261208a928892918e908e908e908e90614e2b565b60405180910390a261209b816128d8565b5050506120a860016123c0565b505050505050505050565b5f6115966101187f00000000000000000000000000000000000000000000000000000000009896807f0000000000000000000000000000000000000000000000000000000000000032612a32565b612109612321565b61211161237b565b61211b60026123c0565b6121236123e6565b6101025460ff1660031461214a576040516321c4e35760e21b815260040160405180910390fd5b6040805160a0810182526101255465ffffffffffff8082168352600160301b80830482166020850152600160601b8304821694840194909452600160901b820481166060840152600160c01b9091048116608083015261011a5491925f926121b6929190041642614c2d565b9050816040015165ffffffffffff1642106121df57602082015165ffffffffffff16825261220b565b816040015165ffffffffffff16811061220b576040516342df285d60e11b815260040160405180910390fd5b816020015165ffffffffffff168465ffffffffffff16148061224b575060208201516122409065ffffffffffff166001614c2d565b8465ffffffffffff16145b612268576040516319557f1960e31b815260040160405180910390fd5b808365ffffffffffff16101561229157604051634372a06b60e11b815260040160405180910390fd5b65ffffffffffff808516602084015283166040830152611428826128d8565b6122b8612321565b606580546001600160a01b0383166001600160a01b031990911681179091556122e96033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6033546001600160a01b0316331461114c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611027565b60027fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5c60ff160361114c5760405163dfc60d8560e01b815260040160405180910390fd5b807fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5d50565b7f0000000000000000000000002ec730f0830803a022262e46375e33023fad65e56001600160a01b0316633075db566040518163ffffffff1660e01b8152600401602060405180830381865afa158015612442573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124669190614ea5565b1561114c576040516378a4e7d960e01b815260040160405180910390fd5b5f5160206152485f395f51905f52546001600160a01b031690565b610f0e612321565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156124df576124da83613e35565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612539575060408051601f3d908101601f1916820190925261253691810190614ec4565b60015b61259c5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401611027565b5f5160206152485f395f51905f52811461260a5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401611027565b506124da838383613ed0565b61262a60c954610100900460ff1660021490565b61114c5760405163bae6e2a960e01b815260040160405180910390fd5b61118f612321565b600183015460609065ffffffffffff80821691600160301b9004811690851682118061268b57508065ffffffffffff168565ffffffffffff1610155b8061269c575065ffffffffffff8416155b156126eb57604080515f80825260208201909252906126e1565b604080516060810182525f80825260208083018290529282015282525f199092019101816126b65790505b5092505050612803565b5f61271065ffffffffffff86166127028885614edb565b65ffffffffffff1690613ef4565b9050806001600160401b0381111561272a5761272a61489f565b60405190808252806020026020018201604052801561277357816020015b604080516060810182525f80825260208083018290529282015282525f199092019101816127485790505b5093505f5b818110156127fe57875f61279465ffffffffffff8a1684614c2d565b815260208082019290925260409081015f2081516060810183528154815260019091015465ffffffffffff80821694830194909452600160301b90049092169082015285518690839081106127eb576127eb614de7565b6020908102919091010152600101612778565b505050505b9392505050565b6001600160a01b037f0000000000000000000000002fa4805846c3a81563e4b34c9f91115532aaeec41630036128525760405162461bcd60e51b815260040161102790614c40565b7f0000000000000000000000002fa4805846c3a81563e4b34c9f91115532aaeec46001600160a01b0316612884612484565b6001600160a01b0316146128aa5760405162461bcd60e51b815260040161102790614c8c565b6128b38261249f565b61118f828260016124a7565b606580546001600160a01b0319169055610f0e81613f08565b8051610125805460208085015160408087015160608089015160808a015165ffffffffffff998a166001600160601b03199098168817600160301b8b881602176bffffffffffffffffffffffff60601b1916600160601b8b86160265ffffffffffff60901b191617600160901b8b8416021765ffffffffffff60c01b1916600160c01b9a82169a909a0299909917909755915165ffffffffffff60c01b60c09890981b9790971665ffffffffffff60901b60909790971b9690961665ffffffffffff60601b9190921b166bffffffffffff00000000000060309390931b9290921690931717919091179190911782527fcbe44daf7dd9e4491937867cfca11dd54f843b24d216ad4644960d41eb153510910160405180910390a150565b61118f82825a613f59565b612a1460c954610100900460ff1660021490565b1561114c5760405163bae6e2a960e01b815260040160405180910390fd5b60018301545f9065ffffffffffff80821691600160301b90041682612a578383614edb565b65ffffffffffff1690505f612a75826001600160401b038816614c2d565b612a88906001600160401b038916614cff565b9050612aa76001600160401b03612aa188821684614ef9565b90613ef4565b98975050505050505050565b5f65ffffffffffff821115612adb5760405163f20577e560e01b815260040160405180910390fd5b5090565b336001600160a01b03821614610f0e576040516395383ea160e01b815260040160405180910390fd5b5f8390506040518060a001604052808265ffffffffffff1681526020014365ffffffffffff1681526020016101105f01600c9054906101000a900465ffffffffffff1665ffffffffffff168152602001848152602001838152506101105f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506020820151815f0160066101000a81548165ffffffffffff021916908365ffffffffffff1602179055506040820151815f01600c6101000a81548165ffffffffffff021916908365ffffffffffff16021790555060608201518160010155608082015181600201559050506040518060600160405280858152602001438152602001428152506101225f5f81526020019081526020015f205f820151815f0155602082015181600101556040820151816002015590505060405180604001604052808265ffffffffffff1681526020018481525061010e5f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff160217905550602082015181600101559050506040518060c001604052808265ffffffffffff1681526020015f65ffffffffffff1681526020015f65ffffffffffff1681526020018481526020015f5f1b81526020015f5f1b81525061011d5f8681526020019081526020015f205f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506020820151815f0160066101000a81548165ffffffffffff021916908365ffffffffffff1602179055506040820151815f01600c6101000a81548165ffffffffffff021916908365ffffffffffff160217905550606082015181600101556080820151816002015560a082015181600301559050507fcbba56cc75163b59c6ab9ee459031c45e1e6519f02eb2a9a25ab226079de9435848484604051612dd5939291909283526020830191909152604082015260600190565b60405180910390a150505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316158135151581148015612e27575060208201351515811515145b612e445760405163156b26df60e31b815260040160405180910390fd5b60808201355f03612e6757604051627bdb0560e71b815260040160405180910390fd5b6003826040013510158015612e85575065ffffffffffff6040830135105b612ea2576040516388ac089760e01b815260040160405180910390fd5b612eae8260a001613f9c565b612ecb576040516337f09fbf60e21b815260040160405180910390fd5b61012082013515801590612eea575065ffffffffffff61012083013511155b612f0757604051635278e92760e11b815260040160405180910390fd5b61048082610140013510158015612f29575065ffffffffffff61014083013511155b612f465760405163086ccfcb60e31b815260040160405180910390fd5b65ffffffffffff4311801590612f62575065ffffffffffff4211155b612f7f5760405163f20577e560e01b815260040160405180910390fd5b306001600160a01b03167f0000000000000000000000002ec730f0830803a022262e46375e33023fad65e56001600160a01b031663fb0e722b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612fe5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906130099190614f0c565b6001600160a01b03161480156130cf57507f0000000000000000000000000000000000000000000000000000000000028c596001600160401b03167f0000000000000000000000002ec730f0830803a022262e46375e33023fad65e56001600160a01b031663d6ae3cd56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130a0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906130c49190614f27565b6001600160401b0316145b6130ec57604051632837e25360e21b815260040160405180910390fd5b6130f98260600135614011565b61118f57604051630377d3e160e61b815260040160405180910390fd5b61311e6146f3565b65ffffffffffff8083165f9081526101226020908152604090912054610110548735939288013592168287106131665760405162560ff960e81b815260040160405180910390fd5b8382111580156131765750868411155b80156131855750600160301b83105b6131a25760405163561ce9bb60e01b815260040160405180910390fd5b60066131ae8286614d8e565b6131b89190614cec565b1580156131d8575060066131cc8285614d8e565b6131d69190614cec565b155b6131f55760405163040f9c9360e51b815260040160405180910390fd5b6001600160401b037f0000000000000000000000000000000000000000000000000000000000000078166132298585614d8e565b1115613248576040516305beb17160e11b815260040160405180910390fd5b5f84815261011d60209081526040808320815160c081018352815465ffffffffffff8082168352600160301b8204811695830195909552600160601b9004909316918301919091526001810154606083018190526002820154608084015260039091015460a083015290965090036132d357604051631a04c27960e01b815260040160405180910390fd5b8565ffffffffffff16856020015165ffffffffffff1614806132f457508184145b6133115760405163144eb95560e31b815260040160405180910390fd5b808714801561334857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b156127fe576127fe878660600151614141565b5f84356020860135600160066133718484614d8e565b61337b9190614ef9565b6133859190614d8e565b85146133a457604051630905f48960e11b815260040160405180910390fd5b5f84815261011d6020526040902080546101195465ffffffffffff600160601b9092048216911681146133ea576040516304bc5eb960e31b815260040160405180910390fd5b8386111561349a5760018201546002830154600384015460408051602081018b90529081019390935260608301919091526080820183905260a082015260c00160405160208183030381529060405280519060200120888860016006888b6134529190614d8e565b61345c9190614ef9565b6134669190614d8e565b81811061347557613475614de7565b905060200201351461349a5760405163013ce4cf60e41b815260040160405180910390fd5b8860e0013594508481111580156134c3575061011954600160301b900465ffffffffffff168511155b80156134e157506134d48684614d8e565b6134de8287614d8e565b11155b6134fe5760405163555a9e4b60e11b815260040160405180910390fd5b50505050949350505050565b5f6135b7604051806102e001604052805f81526020015f81526020015f81526020015f6001600160a01b031681526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b715441494b4f5f45544e415f4c414e445f563160701b8152466020808301919091526001600160401b037f0000000000000000000000000000000000000000000000000000000000028c5916604080840191909152306060808501919091527f0000000000000000000000002ec730f0830803a022262e46375e33023fad65e56001600160a01b031660808086019190915265ffffffffffff881660a0808701919091528a3560c0808801919091528a84015160e08801528a8301516101008801528a82015161012088015261010d54610140880152948b0135610160870152928a0135610180860152908901356101a08501528801356101c08401528701356101e083015286013561020082018190526136d1906142f1565b6102208201526136df614446565b61024082015260408086015165ffffffffffff1661026083015260e08701356102808301526101008701356102a08301526102c0820184905251613727908290602001614f4d565b604051602081830303815290604052805190602001209150505b949350505050565b5f856020013590505f8660400135905060405180604001604052808365ffffffffffff1681526020018281525061010e5f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506020820151816001015590505086610100013561011c81905550836101186001015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506040518060c001604052808765ffffffffffff1681526020018665ffffffffffff1681526020018565ffffffffffff16815260200182815260200188606001358152602001886080013581525061011d5f8465ffffffffffff1681526020019081526020015f205f820151815f015f6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506020820151815f0160066101000a81548165ffffffffffff021916908365ffffffffffff1602179055506040820151815f01600c6101000a81548165ffffffffffff021916908365ffffffffffff160217905550606082015181600101556080820151816002015560a082015181600301559050507f000000000000000000000000b261c6facc0707b674c7491338412fdf44733a4b6001600160a01b031663c9a0b8c860405180606001604052808565ffffffffffff1681526020018481526020018a60a001358152506040518263ffffffff1660e01b815260040161397d9190815165ffffffffffff168152602080830151908201526040918201519181019190915260600190565b5f604051808303815f87803b158015613994575f5ffd5b505af11580156139a6573d5f5f3e3d5ffd5b5050604080518681526101008b01356020820152600181830152905165ffffffffffff861693508992508a35917ff7e666e906e680fee421976ba5787b16d7baf9e593cb41c64c62fde855c7470e919081900360600190a450505050505050565b610102545f90819060ff16600314613a32576040516321c4e35760e21b815260040160405180910390fd5b610111545f03613a5557604051630456607560e01b815260040160405180910390fd5b61010c5465ffffffffffff9081169087168114613a8557604051634c8ea04160e01b815260040160405180910390fd5b61010e5465ffffffffffff169250858314613ab357604051632db7a22b60e11b815260040160405180910390fd5b61011054600690613acc9065ffffffffffff1688614d8e565b613ad69190614cec565b15613af45760405163775523b360e11b815260040160405180910390fd5b610124548514613b17576040516305b10fab60e01b815260040160405180910390fd5b83421115613b3857604051630f05f5bf60e01b815260040160405180910390fd5b613b53613b4e65ffffffffffff83166001614c2d565b612ab3565b65ffffffffffff81165f908152610122602052604090206001015490925015613b8f57604051630799d92360e51b815260040160405180910390fd5b65ffffffffffff4311801590613bab575065ffffffffffff4211155b613bc85760405163f20577e560e01b815260040160405180910390fd5b5094509492505050565b6040805160a0810182525f80825260208201819052918101829052606081018290526080810191909152506040805160a0810182526101255465ffffffffffff8082168352600160301b820481166020840152600160601b8204811693830193909352600160901b810483166060830152600160c01b90048216608082015290821615613cb0576020810151613c719065ffffffffffff166001614c2d565b8265ffffffffffff1614613c98576040516319557f1960e31b815260040160405180910390fd5b65ffffffffffff821680825260208201525f60408201525b5f606082018190526080820152919050565b60015b83811015613d3457848482818110613cdf57613cdf614de7565b604002919091013590508585613cf6600185614d8e565b818110613d0557613d05614de7565b9050604002015f013510613d2c57604051634c65d6d760e11b815260040160405180910390fd5b600101613cc5565b50805f819003613d445750611924565b60015b81811015613db357838382818110613d6157613d61614de7565b905060200201358484600184613d779190614d8e565b818110613d8657613d86614de7565b9050602002013510613dab576040516304664ebb60e01b815260040160405180910390fd5b600101613d47565b506101195465ffffffffffff1683835f81613dd057613dd0614de7565b9050602002013510158015613e18575061011954600160301b900465ffffffffffff168383613e00600185614d8e565b818110613e0f57613e0f614de7565b90506020020135105b611e55576040516372e5dfb960e01b815260040160405180910390fd5b6001600160a01b0381163b613ea25760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401611027565b5f5160206152485f395f51905f5280546001600160a01b0319166001600160a01b0392909216919091179055565b613ed983614541565b5f82511180613ee55750805b156124da576119248383614580565b5f818311613f02578261115d565b50919050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b815f03613f6557505050565b613f7f83838360405180602001604052805f8152506145a5565b6124da57604051634c67134d60e11b815260040160405180910390fd5b5f606082013560068110801590613fb5575061fffc8111155b8015613fc95750613fc7600682614cec565b155b8015613fda57506333b2e3ca833510155b8015613feb57508235602084013510155b8015613ffa5750604083013515155b801561280357505050611000604090910135111590565b5f438210801561409f57507f0000000000000000000000002ec730f0830803a022262e46375e33023fad65e56001600160a01b0316631f618cd26040518163ffffffff1660e01b8152600401602060405180830381865afa158015614078573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061409c9190614ec4565b15155b801561116057506040516001626ac92560e01b031981525f60048201527f0000000000000000000000002ec730f0830803a022262e46375e33023fad65e56001600160a01b03169063ff9536db90602401606060405180830381865afa15801561410b573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061412f919061507b565b5165ffffffffffff1682101592915050565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636aa6a01a6040518163ffffffff1660e01b815260040160c060405180830381865afa15801561419e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906141c291906150c8565b9050806040015165ffffffffffff1660016141dd9190614c2d565b815165ffffffffffff16146142055760405163d15b5e5960e01b815260040160405180910390fd5b818160a001511461422957604051636c0a9e4760e01b815260040160405180910390fd5b604051638026b92160e01b815265ffffffffffff841660048201525f907f000000000000000000000000b261c6facc0707b674c7491338412fdf44733a4b6001600160a01b031690638026b92190602401606060405180830381865afa158015614295573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906142b9919061516b565b90508281602001511480156142d45750610112546040820151145b6119245760405163ebb1dc1760e01b815260040160405180910390fd5b5f43821061431257604051631dd7ce8160e11b815260040160405180910390fd5b5f61431d8343614d8e565b905061010081116143315782409150614425565b611fff81111561435457604051631dd7ce8160e11b815260040160405180910390fd5b5f5f71f90827f1c53a10cb7a02335b1753200029356001600160a01b03168560405160200161438591815260200190565b60408051601f198184030181529082905261439f916151af565b5f60405180830381855afa9150503d805f81146143d7576040519150601f19603f3d011682016040523d82523d5f602084013e6143dc565b606091505b50915091508180156143ef575080516020145b61440c57604051631dd7ce8160e11b815260040160405180910390fd5b808060200190518101906144209190614ec4565b935050505b5f829003613f0257604051631dd7ce8160e11b815260040160405180910390fd5b5f5f5b6006811115801561445a5750804915155b1561446f57614468816151c5565b9050614449565b801580159061447f575060068111155b61449c5760405163a72c89df60e01b815260040160405180910390fd5b5f816001600160401b038111156144b5576144b561489f565b6040519080825280602002602001820160405280156144de578160200160208202803683370190505b5090505f5b828110156145125780498282815181106144ff576144ff614de7565b60209081029190910101526001016144e3565b508060405160200161452491906151dd565b604051602081830303815290604052805190602001209250505090565b61454a81613e35565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a250565b606061115d8383604051806060016040528060278152602001615268602791396145e2565b5f6001600160a01b0385166145cd57604051634c67134d60e11b815260040160405180910390fd5b5f5f835160208501878988f195945050505050565b60605f5f856001600160a01b0316856040516145fe91906151af565b5f60405180830381855af49150503d805f8114614636576040519150601f19603f3d011682016040523d82523d5f602084013e61463b565b606091505b509150915061464c86838387614656565b9695505050505050565b606083156146c45782515f036146bd576001600160a01b0385163b6146bd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611027565b5081613741565b61374183838151156146d95781518083602001fd5b8060405162461bcd60e51b81526004016110279190615212565b6040518060c001604052805f65ffffffffffff1681526020015f65ffffffffffff1681526020015f65ffffffffffff1681526020015f81526020015f81526020015f81525090565b5f6020828403121561474b575f5ffd5b5035919050565b65ffffffffffff81168114610f0e575f5ffd5b803561477081614752565b919050565b5f60208284031215614785575f5ffd5b813561280381614752565b6060810161116082848051825265ffffffffffff602082015116602083015265ffffffffffff60408201511660408301525050565b6001600160a01b0381168114610f0e575f5ffd5b5f602082840312156147e9575f5ffd5b8135612803816147c5565b5f5f60408385031215614805575f5ffd5b823561481081614752565b9150602083013561482081614752565b809150509250929050565b602080825282518282018190525f918401906040840190835b818110156148945761487e8385518051825265ffffffffffff602082015116602083015265ffffffffffff60408201511660408301525050565b6020939093019260609290920191600101614844565b509095945050505050565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156148d5576148d561489f565b60405290565b604051601f8201601f191681016001600160401b03811182821017156149035761490361489f565b604052919050565b5f5f6040838503121561491c575f5ffd5b8235614927816147c5565b915060208301356001600160401b03811115614941575f5ffd5b8301601f81018513614951575f5ffd5b80356001600160401b0381111561496a5761496a61489f565b61497d601f8201601f19166020016148db565b818152866020838501011115614991575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b5f5f83601f8401126149c0575f5ffd5b5081356001600160401b038111156149d6575f5ffd5b6020830191508360208285010111156149ed575f5ffd5b9250929050565b5f5f60208385031215614a05575f5ffd5b82356001600160401b03811115614a1a575f5ffd5b614a26858286016149b0565b90969095509350505050565b5f5f5f60608486031215614a44575f5ffd5b505081359360208301359350604090920135919050565b5f610160828403128015614a6d575f5ffd5b509092915050565b5f5f83601f840112614a85575f5ffd5b5081356001600160401b03811115614a9b575f5ffd5b6020830191508360208260051b85010111156149ed575f5ffd5b5f5f5f5f5f858703610160811215614acb575f5ffd5b610120811215614ad9575f5ffd5b508594506101208601356001600160401b03811115614af6575f5ffd5b614b0288828901614a75565b9095509350506101408601356001600160401b03811115614b21575f5ffd5b614b2d888289016149b0565b969995985093965092949392505050565b5f5f5f5f5f5f5f5f5f60e08a8c031215614b56575f5ffd5b8935614b6181614752565b985060208a0135975060408a0135965060608a0135955060808a01356001600160401b03811115614b90575f5ffd5b8a01601f81018c13614ba0575f5ffd5b80356001600160401b03811115614bb5575f5ffd5b8c60208260061b8401011115614bc9575f5ffd5b6020919091019550935060a08a01356001600160401b03811115614beb575f5ffd5b614bf78c828d01614a75565b9094509250614c0a905060c08b01614765565b90509295985092959850929598565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561116057611160614c19565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b5f52601260045260245ffd5b5f82614cfa57614cfa614cd8565b500690565b808202811582820484141761116057611160614c19565b818382375f9101908152919050565b65ffffffffffff818116838216019081111561116057611160614c19565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b604081525f614d7e604083018587614d43565b9050826020830152949350505050565b8181038181111561116057611160614c19565b5f6001600160fb1b03831115614db5575f5ffd5b8260051b80858437919091019392505050565b848152836020820152606060408201525f61464c606083018486614d43565b634e487b7160e01b5f52603260045260245ffd5b8183525f6001600160fb1b03831115614e12575f5ffd5b8260051b80836020870137939093016020019392505050565b65ffffffffffff88168152602081018790526040810186905260a06060820181905281018490525f8560c08301825b87811015614e8257823582526020808401359083015260409283019290910190600101614e5a565b508381036080850152614e96818688614dfb565b9b9a5050505050505050505050565b5f60208284031215614eb5575f5ffd5b81518015158114612803575f5ffd5b5f60208284031215614ed4575f5ffd5b5051919050565b65ffffffffffff828116828216039081111561116057611160614c19565b5f82614f0757614f07614cd8565b500490565b5f60208284031215614f1c575f5ffd5b8151612803816147c5565b5f60208284031215614f37575f5ffd5b81516001600160401b0381168114612803575f5ffd5b5f6102e0820190508251825260208301516020830152604083015160408301526060830151614f8760608401826001600160a01b03169052565b506080830151614fa260808401826001600160a01b03169052565b5060a083015160a083015260c083015160c083015260e083015160e08301526101008301516101008301526101208301516101208301526101408301516101408301526101608301516101608301526101808301516101808301526101a08301516101a08301526101c08301516101c08301526101e08301516101e08301526102008301516102008301526102208301516102208301526102408301516102408301526102608301516102608301526102808301516102808301526102a08301516102a08301526102c08301516102c083015292915050565b5f606082840312801561508c575f5ffd5b506150956148b3565b82516150a081614752565b815260208301516150b081614752565b60208201526040928301519281019290925250919050565b5f60c08284031280156150d9575f5ffd5b5060405160c081016001600160401b03811182821017156150fc576150fc61489f565b604052825161510a81614752565b8152602083015161511a81614752565b6020820152604083015161512d81614752565b6040820152606083015161514081614752565b6060820152608083015161515381614752565b608082015260a0928301519281019290925250919050565b5f606082840312801561517c575f5ffd5b506151856148b3565b825161519081614752565b8152602083810151908201526040928301519281019290925250919050565b5f82518060208501845e5f920191825250919050565b5f600182016151d6576151d6614c19565b5060010190565b81515f90829060208501835b828110156152075781518452602093840193909101906001016151e9565b509195945050505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f8301168401019150509291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d7b7e2d0fab407ef3e5c354a4e873f1923cd4fddde12f0552c34cd166625d9f164736f6c634300081e0033