ETH Price: $3,917.25 (+5.93%)

Contract

0x72B166070781a552D7b95a907eF59ca05d3D5a62
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OneStepProver0

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 18 : OneStepProver0.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "../state/Value.sol";
import "../state/Machine.sol";
import "../state/Module.sol";
import "../state/Deserialize.sol";
import "./IOneStepProver.sol";

contract OneStepProver0 is IOneStepProver {
    using MerkleProofLib for MerkleProof;
    using StackFrameLib for StackFrameWindow;
    using ValueLib for Value;
    using ValueStackLib for ValueStack;

    function executeUnreachable(
        Machine memory mach,
        Module memory,
        Instruction calldata,
        bytes calldata
    ) internal pure {
        mach.status = MachineStatus.ERRORED;
    }

    function executeNop(
        Machine memory mach,
        Module memory,
        Instruction calldata,
        bytes calldata
    ) internal pure {
        // :)
    }

    function executeConstPush(
        Machine memory mach,
        Module memory,
        Instruction calldata inst,
        bytes calldata
    ) internal pure {
        uint16 opcode = inst.opcode;
        ValueType ty;
        if (opcode == Instructions.I32_CONST) {
            ty = ValueType.I32;
        } else if (opcode == Instructions.I64_CONST) {
            ty = ValueType.I64;
        } else if (opcode == Instructions.F32_CONST) {
            ty = ValueType.F32;
        } else if (opcode == Instructions.F64_CONST) {
            ty = ValueType.F64;
        } else {
            revert("CONST_PUSH_INVALID_OPCODE");
        }

        mach.valueStack.push(Value({valueType: ty, contents: uint64(inst.argumentData)}));
    }

    function executeDrop(
        Machine memory mach,
        Module memory,
        Instruction calldata,
        bytes calldata
    ) internal pure {
        mach.valueStack.pop();
    }

    function executeSelect(
        Machine memory mach,
        Module memory,
        Instruction calldata,
        bytes calldata
    ) internal pure {
        uint32 selector = mach.valueStack.pop().assumeI32();
        Value memory b = mach.valueStack.pop();
        Value memory a = mach.valueStack.pop();

        if (selector != 0) {
            mach.valueStack.push(a);
        } else {
            mach.valueStack.push(b);
        }
    }

    function executeReturn(
        Machine memory mach,
        Module memory,
        Instruction calldata,
        bytes calldata
    ) internal pure {
        StackFrame memory frame = mach.frameStack.pop();
        if (frame.returnPc.valueType == ValueType.REF_NULL) {
            mach.status = MachineStatus.ERRORED;
            return;
        } else if (frame.returnPc.valueType != ValueType.INTERNAL_REF) {
            revert("INVALID_RETURN_PC_TYPE");
        }
        uint256 data = frame.returnPc.contents;
        uint32 pc = uint32(data);
        uint32 func = uint32(data >> 32);
        uint32 mod = uint32(data >> 64);
        require(data >> 96 == 0, "INVALID_RETURN_PC_DATA");
        mach.functionPc = pc;
        mach.functionIdx = func;
        mach.moduleIdx = mod;
    }

    function createReturnValue(Machine memory mach) internal pure returns (Value memory) {
        uint256 returnData = 0;
        returnData |= mach.functionPc;
        returnData |= uint256(mach.functionIdx) << 32;
        returnData |= uint256(mach.moduleIdx) << 64;
        return Value({valueType: ValueType.INTERNAL_REF, contents: returnData});
    }

    function executeCall(
        Machine memory mach,
        Module memory,
        Instruction calldata inst,
        bytes calldata
    ) internal pure {
        // Push the return pc to the stack
        mach.valueStack.push(createReturnValue(mach));

        // Push caller module info to the stack
        StackFrame memory frame = mach.frameStack.peek();
        mach.valueStack.push(ValueLib.newI32(frame.callerModule));
        mach.valueStack.push(ValueLib.newI32(frame.callerModuleInternals));

        // Jump to the target
        uint32 idx = uint32(inst.argumentData);
        require(idx == inst.argumentData, "BAD_CALL_DATA");
        mach.functionIdx = idx;
        mach.functionPc = 0;
    }

    function executeCrossModuleCall(
        Machine memory mach,
        Module memory mod,
        Instruction calldata inst,
        bytes calldata
    ) internal pure {
        // Push the return pc to the stack
        mach.valueStack.push(createReturnValue(mach));

        // Push caller module info to the stack
        mach.valueStack.push(ValueLib.newI32(mach.moduleIdx));
        mach.valueStack.push(ValueLib.newI32(mod.internalsOffset));

        // Jump to the target
        uint32 func = uint32(inst.argumentData);
        uint32 module = uint32(inst.argumentData >> 32);
        require(inst.argumentData >> 64 == 0, "BAD_CROSS_MODULE_CALL_DATA");
        mach.moduleIdx = module;
        mach.functionIdx = func;
        mach.functionPc = 0;
    }

    function executeCallerModuleInternalCall(
        Machine memory mach,
        Module memory mod,
        Instruction calldata inst,
        bytes calldata
    ) internal pure {
        // Push the return pc to the stack
        mach.valueStack.push(createReturnValue(mach));

        // Push caller module info to the stack
        mach.valueStack.push(ValueLib.newI32(mach.moduleIdx));
        mach.valueStack.push(ValueLib.newI32(mod.internalsOffset));

        StackFrame memory frame = mach.frameStack.peek();
        if (frame.callerModuleInternals == 0) {
            // The caller module has no internals
            mach.status = MachineStatus.ERRORED;
            return;
        }

        // Jump to the target
        uint32 offset = uint32(inst.argumentData);
        require(offset == inst.argumentData, "BAD_CALLER_INTERNAL_CALL_DATA");
        mach.moduleIdx = frame.callerModule;
        mach.functionIdx = frame.callerModuleInternals + offset;
        mach.functionPc = 0;
    }

    function executeCallIndirect(
        Machine memory mach,
        Module memory mod,
        Instruction calldata inst,
        bytes calldata proof
    ) internal pure {
        uint32 funcIdx;
        {
            uint32 elementIdx = mach.valueStack.pop().assumeI32();

            // Prove metadata about the instruction and tables
            bytes32 elemsRoot;
            bytes32 wantedFuncTypeHash;
            uint256 offset = 0;
            {
                uint64 tableIdx;
                uint8 tableType;
                uint64 tableSize;
                MerkleProof memory tableMerkleProof;
                (tableIdx, offset) = Deserialize.u64(proof, offset);
                (wantedFuncTypeHash, offset) = Deserialize.b32(proof, offset);
                (tableType, offset) = Deserialize.u8(proof, offset);
                (tableSize, offset) = Deserialize.u64(proof, offset);
                (elemsRoot, offset) = Deserialize.b32(proof, offset);
                (tableMerkleProof, offset) = Deserialize.merkleProof(proof, offset);

                // Validate the information by recomputing known hashes
                bytes32 recomputed = keccak256(
                    abi.encodePacked("Call indirect:", tableIdx, wantedFuncTypeHash)
                );
                require(recomputed == bytes32(inst.argumentData), "BAD_CALL_INDIRECT_DATA");
                recomputed = tableMerkleProof.computeRootFromTable(
                    tableIdx,
                    tableType,
                    tableSize,
                    elemsRoot
                );
                require(recomputed == mod.tablesMerkleRoot, "BAD_TABLES_ROOT");

                // Check if the table access is out of bounds
                if (elementIdx >= tableSize) {
                    mach.status = MachineStatus.ERRORED;
                    return;
                }
            }

            bytes32 elemFuncTypeHash;
            Value memory functionPointer;
            MerkleProof memory elementMerkleProof;
            (elemFuncTypeHash, offset) = Deserialize.b32(proof, offset);
            (functionPointer, offset) = Deserialize.value(proof, offset);
            (elementMerkleProof, offset) = Deserialize.merkleProof(proof, offset);
            bytes32 recomputedElemRoot = elementMerkleProof.computeRootFromElement(
                elementIdx,
                elemFuncTypeHash,
                functionPointer
            );
            require(recomputedElemRoot == elemsRoot, "BAD_ELEMENTS_ROOT");

            if (elemFuncTypeHash != wantedFuncTypeHash) {
                mach.status = MachineStatus.ERRORED;
                return;
            }

            if (functionPointer.valueType == ValueType.REF_NULL) {
                mach.status = MachineStatus.ERRORED;
                return;
            } else if (functionPointer.valueType == ValueType.FUNC_REF) {
                funcIdx = uint32(functionPointer.contents);
                require(funcIdx == functionPointer.contents, "BAD_FUNC_REF_CONTENTS");
            } else {
                revert("BAD_ELEM_TYPE");
            }
        }

        // Push the return pc to the stack
        mach.valueStack.push(createReturnValue(mach));

        // Push caller module info to the stack
        StackFrame memory frame = mach.frameStack.peek();
        mach.valueStack.push(ValueLib.newI32(frame.callerModule));
        mach.valueStack.push(ValueLib.newI32(frame.callerModuleInternals));

        // Jump to the target
        mach.functionIdx = funcIdx;
        mach.functionPc = 0;
    }

    function executeArbitraryJump(
        Machine memory mach,
        Module memory,
        Instruction calldata inst,
        bytes calldata
    ) internal pure {
        // Jump to target
        uint32 pc = uint32(inst.argumentData);
        require(pc == inst.argumentData, "BAD_CALL_DATA");
        mach.functionPc = pc;
    }

    function executeArbitraryJumpIf(
        Machine memory mach,
        Module memory,
        Instruction calldata inst,
        bytes calldata
    ) internal pure {
        uint32 cond = mach.valueStack.pop().assumeI32();
        if (cond != 0) {
            // Jump to target
            uint32 pc = uint32(inst.argumentData);
            require(pc == inst.argumentData, "BAD_CALL_DATA");
            mach.functionPc = pc;
        }
    }

    function merkleProveGetValue(
        bytes32 merkleRoot,
        uint256 index,
        bytes calldata proof
    ) internal pure returns (Value memory) {
        uint256 offset = 0;
        Value memory proposedVal;
        MerkleProof memory merkle;
        (proposedVal, offset) = Deserialize.value(proof, offset);
        (merkle, offset) = Deserialize.merkleProof(proof, offset);
        bytes32 recomputedRoot = merkle.computeRootFromValue(index, proposedVal);
        require(recomputedRoot == merkleRoot, "WRONG_MERKLE_ROOT");
        return proposedVal;
    }

    function merkleProveSetValue(
        bytes32 merkleRoot,
        uint256 index,
        Value memory newVal,
        bytes calldata proof
    ) internal pure returns (bytes32) {
        Value memory oldVal;
        uint256 offset = 0;
        MerkleProof memory merkle;
        (oldVal, offset) = Deserialize.value(proof, offset);
        (merkle, offset) = Deserialize.merkleProof(proof, offset);
        bytes32 recomputedRoot = merkle.computeRootFromValue(index, oldVal);
        require(recomputedRoot == merkleRoot, "WRONG_MERKLE_ROOT");
        return merkle.computeRootFromValue(index, newVal);
    }

    function executeLocalGet(
        Machine memory mach,
        Module memory,
        Instruction calldata inst,
        bytes calldata proof
    ) internal pure {
        StackFrame memory frame = mach.frameStack.peek();
        Value memory val = merkleProveGetValue(frame.localsMerkleRoot, inst.argumentData, proof);
        mach.valueStack.push(val);
    }

    function executeLocalSet(
        Machine memory mach,
        Module memory,
        Instruction calldata inst,
        bytes calldata proof
    ) internal pure {
        Value memory newVal = mach.valueStack.pop();
        StackFrame memory frame = mach.frameStack.peek();
        frame.localsMerkleRoot = merkleProveSetValue(
            frame.localsMerkleRoot,
            inst.argumentData,
            newVal,
            proof
        );
    }

    function executeGlobalGet(
        Machine memory mach,
        Module memory mod,
        Instruction calldata inst,
        bytes calldata proof
    ) internal pure {
        Value memory val = merkleProveGetValue(mod.globalsMerkleRoot, inst.argumentData, proof);
        mach.valueStack.push(val);
    }

    function executeGlobalSet(
        Machine memory mach,
        Module memory mod,
        Instruction calldata inst,
        bytes calldata proof
    ) internal pure {
        Value memory newVal = mach.valueStack.pop();
        mod.globalsMerkleRoot = merkleProveSetValue(
            mod.globalsMerkleRoot,
            inst.argumentData,
            newVal,
            proof
        );
    }

    function executeInitFrame(
        Machine memory mach,
        Module memory,
        Instruction calldata inst,
        bytes calldata
    ) internal pure {
        Value memory callerModuleInternals = mach.valueStack.pop();
        Value memory callerModule = mach.valueStack.pop();
        Value memory returnPc = mach.valueStack.pop();
        StackFrame memory newFrame = StackFrame({
            returnPc: returnPc,
            localsMerkleRoot: bytes32(inst.argumentData),
            callerModule: callerModule.assumeI32(),
            callerModuleInternals: callerModuleInternals.assumeI32()
        });
        mach.frameStack.push(newFrame);
    }

    function executeMoveInternal(
        Machine memory mach,
        Module memory,
        Instruction calldata inst,
        bytes calldata
    ) internal pure {
        Value memory val;
        if (inst.opcode == Instructions.MOVE_FROM_STACK_TO_INTERNAL) {
            val = mach.valueStack.pop();
            mach.internalStack.push(val);
        } else if (inst.opcode == Instructions.MOVE_FROM_INTERNAL_TO_STACK) {
            val = mach.internalStack.pop();
            mach.valueStack.push(val);
        } else {
            revert("MOVE_INTERNAL_INVALID_OPCODE");
        }
    }

    function executeDup(
        Machine memory mach,
        Module memory,
        Instruction calldata,
        bytes calldata
    ) internal pure {
        Value memory val = mach.valueStack.peek();
        mach.valueStack.push(val);
    }

    function executeOneStep(
        ExecutionContext calldata,
        Machine calldata startMach,
        Module calldata startMod,
        Instruction calldata inst,
        bytes calldata proof
    ) external pure override returns (Machine memory mach, Module memory mod) {
        mach = startMach;
        mod = startMod;

        uint16 opcode = inst.opcode;

        function(Machine memory, Module memory, Instruction calldata, bytes calldata)
            internal
            pure impl;
        if (opcode == Instructions.UNREACHABLE) {
            impl = executeUnreachable;
        } else if (opcode == Instructions.NOP) {
            impl = executeNop;
        } else if (opcode == Instructions.RETURN) {
            impl = executeReturn;
        } else if (opcode == Instructions.CALL) {
            impl = executeCall;
        } else if (opcode == Instructions.CROSS_MODULE_CALL) {
            impl = executeCrossModuleCall;
        } else if (opcode == Instructions.CALLER_MODULE_INTERNAL_CALL) {
            impl = executeCallerModuleInternalCall;
        } else if (opcode == Instructions.CALL_INDIRECT) {
            impl = executeCallIndirect;
        } else if (opcode == Instructions.ARBITRARY_JUMP) {
            impl = executeArbitraryJump;
        } else if (opcode == Instructions.ARBITRARY_JUMP_IF) {
            impl = executeArbitraryJumpIf;
        } else if (opcode == Instructions.LOCAL_GET) {
            impl = executeLocalGet;
        } else if (opcode == Instructions.LOCAL_SET) {
            impl = executeLocalSet;
        } else if (opcode == Instructions.GLOBAL_GET) {
            impl = executeGlobalGet;
        } else if (opcode == Instructions.GLOBAL_SET) {
            impl = executeGlobalSet;
        } else if (opcode == Instructions.INIT_FRAME) {
            impl = executeInitFrame;
        } else if (opcode == Instructions.DROP) {
            impl = executeDrop;
        } else if (opcode == Instructions.SELECT) {
            impl = executeSelect;
        } else if (opcode >= Instructions.I32_CONST && opcode <= Instructions.F64_CONST) {
            impl = executeConstPush;
        } else if (
            opcode == Instructions.MOVE_FROM_STACK_TO_INTERNAL ||
            opcode == Instructions.MOVE_FROM_INTERNAL_TO_STACK
        ) {
            impl = executeMoveInternal;
        } else if (opcode == Instructions.DUP) {
            impl = executeDup;
        } else {
            revert("INVALID_OPCODE");
        }

        impl(mach, mod, inst, proof);
    }
}

File 2 of 18 : IBridge.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
pragma solidity >=0.6.9 <0.9.0;

import "./IOwnable.sol";

interface IBridge {
    /// @dev This is an instruction to offchain readers to inform them where to look
    ///      for sequencer inbox batch data. This is not the type of data (eg. das, brotli encoded, or blob versioned hash)
    ///      and this enum is not used in the state transition function, rather it informs an offchain
    ///      reader where to find the data so that they can supply it to the replay binary
    enum BatchDataLocation {
        /// @notice The data can be found in the transaction call data
        TxInput,
        /// @notice The data can be found in an event emitted during the transaction
        SeparateBatchEvent,
        /// @notice This batch contains no data
        NoData,
        /// @notice The data can be found in the 4844 data blobs on this transaction
        Blob
    }

    struct TimeBounds {
        uint64 minTimestamp;
        uint64 maxTimestamp;
        uint64 minBlockNumber;
        uint64 maxBlockNumber;
    }

    event MessageDelivered(
        uint256 indexed messageIndex,
        bytes32 indexed beforeInboxAcc,
        address inbox,
        uint8 kind,
        address sender,
        bytes32 messageDataHash,
        uint256 baseFeeL1,
        uint64 timestamp
    );

    event BridgeCallTriggered(
        address indexed outbox,
        address indexed to,
        uint256 value,
        bytes data
    );

    event InboxToggle(address indexed inbox, bool enabled);

    event OutboxToggle(address indexed outbox, bool enabled);

    event SequencerInboxUpdated(address newSequencerInbox);

    event RollupUpdated(address rollup);

    function allowedDelayedInboxList(uint256) external returns (address);

    function allowedOutboxList(uint256) external returns (address);

    /// @dev Accumulator for delayed inbox messages; tail represents hash of the current state; each element represents the inclusion of a new message.
    function delayedInboxAccs(uint256) external view returns (bytes32);

    /// @dev Accumulator for sequencer inbox messages; tail represents hash of the current state; each element represents the inclusion of a new message.
    function sequencerInboxAccs(uint256) external view returns (bytes32);

    function rollup() external view returns (IOwnable);

    function sequencerInbox() external view returns (address);

    function activeOutbox() external view returns (address);

    function allowedDelayedInboxes(address inbox) external view returns (bool);

    function allowedOutboxes(address outbox) external view returns (bool);

    function sequencerReportedSubMessageCount() external view returns (uint256);

    function executeCall(
        address to,
        uint256 value,
        bytes calldata data
    ) external returns (bool success, bytes memory returnData);

    function delayedMessageCount() external view returns (uint256);

    function sequencerMessageCount() external view returns (uint256);

    // ---------- onlySequencerInbox functions ----------

    function enqueueSequencerMessage(
        bytes32 dataHash,
        uint256 afterDelayedMessagesRead,
        uint256 prevMessageCount,
        uint256 newMessageCount
    )
        external
        returns (
            uint256 seqMessageIndex,
            bytes32 beforeAcc,
            bytes32 delayedAcc,
            bytes32 acc
        );

    /**
     * @dev Allows the sequencer inbox to submit a delayed message of the batchPostingReport type
     *      This is done through a separate function entrypoint instead of allowing the sequencer inbox
     *      to call `enqueueDelayedMessage` to avoid the gas overhead of an extra SLOAD in either
     *      every delayed inbox or every sequencer inbox call.
     */
    function submitBatchSpendingReport(address batchPoster, bytes32 dataHash)
        external
        returns (uint256 msgNum);

    // ---------- onlyRollupOrOwner functions ----------

    function setSequencerInbox(address _sequencerInbox) external;

    function setDelayedInbox(address inbox, bool enabled) external;

    function setOutbox(address inbox, bool enabled) external;

    function updateRollupAddress(IOwnable _rollup) external;
}

File 3 of 18 : IDelayedMessageProvider.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
pragma solidity >=0.6.9 <0.9.0;

interface IDelayedMessageProvider {
    /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator
    event InboxMessageDelivered(uint256 indexed messageNum, bytes data);

    /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator
    /// same as InboxMessageDelivered but the batch data is available in tx.input
    event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum);
}

File 4 of 18 : IOwnable.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.21 <0.9.0;

interface IOwnable {
    function owner() external view returns (address);
}

File 5 of 18 : ISequencerInbox.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
pragma solidity >=0.6.9 <0.9.0;
pragma experimental ABIEncoderV2;

import "../libraries/IGasRefunder.sol";
import "./IDelayedMessageProvider.sol";
import "./IBridge.sol";

interface ISequencerInbox is IDelayedMessageProvider {
    struct MaxTimeVariation {
        uint256 delayBlocks;
        uint256 futureBlocks;
        uint256 delaySeconds;
        uint256 futureSeconds;
    }

    event SequencerBatchDelivered(
        uint256 indexed batchSequenceNumber,
        bytes32 indexed beforeAcc,
        bytes32 indexed afterAcc,
        bytes32 delayedAcc,
        uint256 afterDelayedMessagesRead,
        IBridge.TimeBounds timeBounds,
        IBridge.BatchDataLocation dataLocation
    );

    event OwnerFunctionCalled(uint256 indexed id);

    /// @dev a separate event that emits batch data when this isn't easily accessible in the tx.input
    event SequencerBatchData(uint256 indexed batchSequenceNumber, bytes data);

    /// @dev a valid keyset was added
    event SetValidKeyset(bytes32 indexed keysetHash, bytes keysetBytes);

    /// @dev a keyset was invalidated
    event InvalidateKeyset(bytes32 indexed keysetHash);

    function totalDelayedMessagesRead() external view returns (uint256);

    function bridge() external view returns (IBridge);

    /// @dev The size of the batch header
    // solhint-disable-next-line func-name-mixedcase
    function HEADER_LENGTH() external view returns (uint256);

    /// @dev If the first batch data byte after the header has this bit set,
    ///      the sequencer inbox has authenticated the data. Currently only used for 4844 blob support.
    ///      See: https://github.com/OffchainLabs/nitro/blob/69de0603abf6f900a4128cab7933df60cad54ded/arbstate/das_reader.go
    // solhint-disable-next-line func-name-mixedcase
    function DATA_AUTHENTICATED_FLAG() external view returns (bytes1);

    /// @dev If the first data byte after the header has this bit set,
    ///      then the batch data is to be found in 4844 data blobs
    ///      See: https://github.com/OffchainLabs/nitro/blob/69de0603abf6f900a4128cab7933df60cad54ded/arbstate/das_reader.go
    // solhint-disable-next-line func-name-mixedcase
    function DATA_BLOB_HEADER_FLAG() external view returns (bytes1);

    /// @dev If the first data byte after the header has this bit set,
    ///      then the batch data is a das message
    ///      See: https://github.com/OffchainLabs/nitro/blob/69de0603abf6f900a4128cab7933df60cad54ded/arbstate/das_reader.go
    // solhint-disable-next-line func-name-mixedcase
    function DAS_MESSAGE_HEADER_FLAG() external view returns (bytes1);

    /// @dev If the first data byte after the header has this bit set,
    ///      then the batch data is a das message that employs a merklesization strategy
    ///      See: https://github.com/OffchainLabs/nitro/blob/69de0603abf6f900a4128cab7933df60cad54ded/arbstate/das_reader.go
    // solhint-disable-next-line func-name-mixedcase
    function TREE_DAS_MESSAGE_HEADER_FLAG() external view returns (bytes1);

    /// @dev If the first data byte after the header has this bit set,
    ///      then the batch data has been brotli compressed
    ///      See: https://github.com/OffchainLabs/nitro/blob/69de0603abf6f900a4128cab7933df60cad54ded/arbstate/das_reader.go
    // solhint-disable-next-line func-name-mixedcase
    function BROTLI_MESSAGE_HEADER_FLAG() external view returns (bytes1);

    /// @dev If the first data byte after the header has this bit set,
    ///      then the batch data uses a zero heavy encoding
    ///      See: https://github.com/OffchainLabs/nitro/blob/69de0603abf6f900a4128cab7933df60cad54ded/arbstate/das_reader.go
    // solhint-disable-next-line func-name-mixedcase
    function ZERO_HEAVY_MESSAGE_HEADER_FLAG() external view returns (bytes1);

    function rollup() external view returns (IOwnable);

    function isBatchPoster(address) external view returns (bool);

    function isSequencer(address) external view returns (bool);

    function maxDataSize() external view returns (uint256);

    /// @notice The batch poster manager has the ability to change the batch poster addresses
    ///         This enables the batch poster to do key rotation
    function batchPosterManager() external view returns (address);

    struct DasKeySetInfo {
        bool isValidKeyset;
        uint64 creationBlock;
    }

    /// @dev returns 4 uint256 to be compatible with older version
    function maxTimeVariation()
        external
        view
        returns (
            uint256 delayBlocks,
            uint256 futureBlocks,
            uint256 delaySeconds,
            uint256 futureSeconds
        );

    function dasKeySetInfo(bytes32) external view returns (bool, uint64);

    /// @notice Remove force inclusion delay after a L1 chainId fork
    function removeDelayAfterFork() external;

    /// @notice Force messages from the delayed inbox to be included in the chain
    ///         Callable by any address, but message can only be force-included after maxTimeVariation.delayBlocks and
    ///         maxTimeVariation.delaySeconds has elapsed. As part of normal behaviour the sequencer will include these
    ///         messages so it's only necessary to call this if the sequencer is down, or not including any delayed messages.
    /// @param _totalDelayedMessagesRead The total number of messages to read up to
    /// @param kind The kind of the last message to be included
    /// @param l1BlockAndTime The l1 block and the l1 timestamp of the last message to be included
    /// @param baseFeeL1 The l1 gas price of the last message to be included
    /// @param sender The sender of the last message to be included
    /// @param messageDataHash The messageDataHash of the last message to be included
    function forceInclusion(
        uint256 _totalDelayedMessagesRead,
        uint8 kind,
        uint64[2] calldata l1BlockAndTime,
        uint256 baseFeeL1,
        address sender,
        bytes32 messageDataHash
    ) external;

    function inboxAccs(uint256 index) external view returns (bytes32);

    function batchCount() external view returns (uint256);

    function isValidKeysetHash(bytes32 ksHash) external view returns (bool);

    /// @notice the creation block is intended to still be available after a keyset is deleted
    function getKeysetCreationBlock(bytes32 ksHash) external view returns (uint256);

    // ---------- BatchPoster functions ----------

    function addSequencerL2BatchFromOrigin(
        uint256 sequenceNumber,
        bytes calldata data,
        uint256 afterDelayedMessagesRead,
        IGasRefunder gasRefunder
    ) external;

    function addSequencerL2BatchFromOrigin(
        uint256 sequenceNumber,
        bytes calldata data,
        uint256 afterDelayedMessagesRead,
        IGasRefunder gasRefunder,
        uint256 prevMessageCount,
        uint256 newMessageCount
    ) external;

    function addSequencerL2Batch(
        uint256 sequenceNumber,
        bytes calldata data,
        uint256 afterDelayedMessagesRead,
        IGasRefunder gasRefunder,
        uint256 prevMessageCount,
        uint256 newMessageCount
    ) external;

    function addSequencerL2BatchFromBlobs(
        uint256 sequenceNumber,
        uint256 afterDelayedMessagesRead,
        IGasRefunder gasRefunder,
        uint256 prevMessageCount,
        uint256 newMessageCount
    ) external;

    // ---------- onlyRollupOrOwner functions ----------

    /**
     * @notice Set max delay for sequencer inbox
     * @param maxTimeVariation_ the maximum time variation parameters
     */
    function setMaxTimeVariation(MaxTimeVariation memory maxTimeVariation_) external;

    /**
     * @notice Updates whether an address is authorized to be a batch poster at the sequencer inbox
     * @param addr the address
     * @param isBatchPoster_ if the specified address should be authorized as a batch poster
     */
    function setIsBatchPoster(address addr, bool isBatchPoster_) external;

    /**
     * @notice Makes Data Availability Service keyset valid
     * @param keysetBytes bytes of the serialized keyset
     */
    function setValidKeyset(bytes calldata keysetBytes) external;

    /**
     * @notice Invalidates a Data Availability Service keyset
     * @param ksHash hash of the keyset
     */
    function invalidateKeysetHash(bytes32 ksHash) external;

    /**
     * @notice Updates whether an address is authorized to be a sequencer.
     * @dev The IsSequencer information is used only off-chain by the nitro node to validate sequencer feed signer.
     * @param addr the address
     * @param isSequencer_ if the specified address should be authorized as a sequencer
     */
    function setIsSequencer(address addr, bool isSequencer_) external;

    /**
     * @notice Updates the batch poster manager, the address which has the ability to rotate batch poster keys
     * @param newBatchPosterManager The new batch poster manager to be set
     */
    function setBatchPosterManager(address newBatchPosterManager) external;

    /// @notice Allows the rollup owner to sync the rollup address
    function updateRollupAddress() external;

    // ---------- initializer ----------

    function initialize(IBridge bridge_, MaxTimeVariation calldata maxTimeVariation_) external;
}

File 6 of 18 : IGasRefunder.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
pragma solidity >=0.6.9 <0.9.0;

interface IGasRefunder {
    function onGasSpent(
        address payable spender,
        uint256 gasUsed,
        uint256 calldataSize
    ) external returns (bool success);
}

File 7 of 18 : IOneStepProver.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "../state/Machine.sol";
import "../state/Module.sol";
import "../state/Instructions.sol";
import "../state/GlobalState.sol";
import "../bridge/ISequencerInbox.sol";
import "../bridge/IBridge.sol";

struct ExecutionContext {
    uint256 maxInboxMessagesRead;
    IBridge bridge;
}

abstract contract IOneStepProver {
    function executeOneStep(
        ExecutionContext memory execCtx,
        Machine calldata mach,
        Module calldata mod,
        Instruction calldata instruction,
        bytes calldata proof
    ) external view virtual returns (Machine memory result, Module memory resultMod);
}

File 8 of 18 : Deserialize.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "./Value.sol";
import "./ValueStack.sol";
import "./Machine.sol";
import "./Instructions.sol";
import "./StackFrame.sol";
import "./MerkleProof.sol";
import "./ModuleMemoryCompact.sol";
import "./Module.sol";
import "./GlobalState.sol";

library Deserialize {
    function u8(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (uint8 ret, uint256 offset)
    {
        offset = startOffset;
        ret = uint8(proof[offset]);
        offset++;
    }

    function u16(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (uint16 ret, uint256 offset)
    {
        offset = startOffset;
        for (uint256 i = 0; i < 16 / 8; i++) {
            ret <<= 8;
            ret |= uint8(proof[offset]);
            offset++;
        }
    }

    function u32(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (uint32 ret, uint256 offset)
    {
        offset = startOffset;
        for (uint256 i = 0; i < 32 / 8; i++) {
            ret <<= 8;
            ret |= uint8(proof[offset]);
            offset++;
        }
    }

    function u64(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (uint64 ret, uint256 offset)
    {
        offset = startOffset;
        for (uint256 i = 0; i < 64 / 8; i++) {
            ret <<= 8;
            ret |= uint8(proof[offset]);
            offset++;
        }
    }

    function u256(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (uint256 ret, uint256 offset)
    {
        offset = startOffset;
        for (uint256 i = 0; i < 256 / 8; i++) {
            ret <<= 8;
            ret |= uint8(proof[offset]);
            offset++;
        }
    }

    function b32(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (bytes32 ret, uint256 offset)
    {
        offset = startOffset;
        uint256 retInt;
        (retInt, offset) = u256(proof, offset);
        ret = bytes32(retInt);
    }

    function value(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (Value memory val, uint256 offset)
    {
        offset = startOffset;
        uint8 typeInt = uint8(proof[offset]);
        offset++;
        require(typeInt <= uint8(ValueLib.maxValueType()), "BAD_VALUE_TYPE");
        uint256 contents;
        (contents, offset) = u256(proof, offset);
        val = Value({valueType: ValueType(typeInt), contents: contents});
    }

    function valueStack(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (ValueStack memory stack, uint256 offset)
    {
        offset = startOffset;
        bytes32 remainingHash;
        (remainingHash, offset) = b32(proof, offset);
        uint256 provedLength;
        (provedLength, offset) = u256(proof, offset);
        Value[] memory proved = new Value[](provedLength);
        for (uint256 i = 0; i < proved.length; i++) {
            (proved[i], offset) = value(proof, offset);
        }
        stack = ValueStack({proved: ValueArray(proved), remainingHash: remainingHash});
    }

    function instruction(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (Instruction memory inst, uint256 offset)
    {
        offset = startOffset;
        uint16 opcode;
        uint256 data;
        (opcode, offset) = u16(proof, offset);
        (data, offset) = u256(proof, offset);
        inst = Instruction({opcode: opcode, argumentData: data});
    }

    function stackFrame(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (StackFrame memory window, uint256 offset)
    {
        offset = startOffset;
        Value memory returnPc;
        bytes32 localsMerkleRoot;
        uint32 callerModule;
        uint32 callerModuleInternals;
        (returnPc, offset) = value(proof, offset);
        (localsMerkleRoot, offset) = b32(proof, offset);
        (callerModule, offset) = u32(proof, offset);
        (callerModuleInternals, offset) = u32(proof, offset);
        window = StackFrame({
            returnPc: returnPc,
            localsMerkleRoot: localsMerkleRoot,
            callerModule: callerModule,
            callerModuleInternals: callerModuleInternals
        });
    }

    function stackFrameWindow(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (StackFrameWindow memory window, uint256 offset)
    {
        offset = startOffset;
        bytes32 remainingHash;
        (remainingHash, offset) = b32(proof, offset);
        StackFrame[] memory proved;
        if (proof[offset] != 0) {
            offset++;
            proved = new StackFrame[](1);
            (proved[0], offset) = stackFrame(proof, offset);
        } else {
            offset++;
            proved = new StackFrame[](0);
        }
        window = StackFrameWindow({proved: proved, remainingHash: remainingHash});
    }

    function moduleMemory(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (ModuleMemory memory mem, uint256 offset)
    {
        offset = startOffset;
        uint64 size;
        uint64 maxSize;
        bytes32 root;
        (size, offset) = u64(proof, offset);
        (maxSize, offset) = u64(proof, offset);
        (root, offset) = b32(proof, offset);
        mem = ModuleMemory({size: size, maxSize: maxSize, merkleRoot: root});
    }

    function module(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (Module memory mod, uint256 offset)
    {
        offset = startOffset;
        bytes32 globalsMerkleRoot;
        ModuleMemory memory mem;
        bytes32 tablesMerkleRoot;
        bytes32 functionsMerkleRoot;
        uint32 internalsOffset;
        (globalsMerkleRoot, offset) = b32(proof, offset);
        (mem, offset) = moduleMemory(proof, offset);
        (tablesMerkleRoot, offset) = b32(proof, offset);
        (functionsMerkleRoot, offset) = b32(proof, offset);
        (internalsOffset, offset) = u32(proof, offset);
        mod = Module({
            globalsMerkleRoot: globalsMerkleRoot,
            moduleMemory: mem,
            tablesMerkleRoot: tablesMerkleRoot,
            functionsMerkleRoot: functionsMerkleRoot,
            internalsOffset: internalsOffset
        });
    }

    function globalState(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (GlobalState memory state, uint256 offset)
    {
        offset = startOffset;

        // using constant ints for array size requires newer solidity
        bytes32[2] memory bytes32Vals;
        uint64[2] memory u64Vals;

        for (uint8 i = 0; i < GlobalStateLib.BYTES32_VALS_NUM; i++) {
            (bytes32Vals[i], offset) = b32(proof, offset);
        }
        for (uint8 i = 0; i < GlobalStateLib.U64_VALS_NUM; i++) {
            (u64Vals[i], offset) = u64(proof, offset);
        }
        state = GlobalState({bytes32Vals: bytes32Vals, u64Vals: u64Vals});
    }

    function machine(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (Machine memory mach, uint256 offset)
    {
        offset = startOffset;
        MachineStatus status;
        {
            uint8 statusU8;
            (statusU8, offset) = u8(proof, offset);
            if (statusU8 == 0) {
                status = MachineStatus.RUNNING;
            } else if (statusU8 == 1) {
                status = MachineStatus.FINISHED;
            } else if (statusU8 == 2) {
                status = MachineStatus.ERRORED;
            } else if (statusU8 == 3) {
                status = MachineStatus.TOO_FAR;
            } else {
                revert("UNKNOWN_MACH_STATUS");
            }
        }
        ValueStack memory values;
        ValueStack memory internalStack;
        bytes32 globalStateHash;
        uint32 moduleIdx;
        uint32 functionIdx;
        uint32 functionPc;
        StackFrameWindow memory frameStack;
        bytes32 modulesRoot;
        (values, offset) = valueStack(proof, offset);
        (internalStack, offset) = valueStack(proof, offset);
        (frameStack, offset) = stackFrameWindow(proof, offset);
        (globalStateHash, offset) = b32(proof, offset);
        (moduleIdx, offset) = u32(proof, offset);
        (functionIdx, offset) = u32(proof, offset);
        (functionPc, offset) = u32(proof, offset);
        (modulesRoot, offset) = b32(proof, offset);
        mach = Machine({
            status: status,
            valueStack: values,
            internalStack: internalStack,
            frameStack: frameStack,
            globalStateHash: globalStateHash,
            moduleIdx: moduleIdx,
            functionIdx: functionIdx,
            functionPc: functionPc,
            modulesRoot: modulesRoot
        });
    }

    function merkleProof(bytes calldata proof, uint256 startOffset)
        internal
        pure
        returns (MerkleProof memory merkle, uint256 offset)
    {
        offset = startOffset;
        uint8 length;
        (length, offset) = u8(proof, offset);
        bytes32[] memory counterparts = new bytes32[](length);
        for (uint8 i = 0; i < length; i++) {
            (counterparts[i], offset) = b32(proof, offset);
        }
        merkle = MerkleProof(counterparts);
    }
}

File 9 of 18 : GlobalState.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

struct GlobalState {
    bytes32[2] bytes32Vals;
    uint64[2] u64Vals;
}

library GlobalStateLib {
    uint16 internal constant BYTES32_VALS_NUM = 2;
    uint16 internal constant U64_VALS_NUM = 2;

    function hash(GlobalState memory state) internal pure returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(
                    "Global state:",
                    state.bytes32Vals[0],
                    state.bytes32Vals[1],
                    state.u64Vals[0],
                    state.u64Vals[1]
                )
            );
    }

    function getBlockHash(GlobalState memory state) internal pure returns (bytes32) {
        return state.bytes32Vals[0];
    }

    function getSendRoot(GlobalState memory state) internal pure returns (bytes32) {
        return state.bytes32Vals[1];
    }

    function getInboxPosition(GlobalState memory state) internal pure returns (uint64) {
        return state.u64Vals[0];
    }

    function getPositionInMessage(GlobalState memory state) internal pure returns (uint64) {
        return state.u64Vals[1];
    }

    function isEmpty(GlobalState calldata state) internal pure returns (bool) {
        return (state.bytes32Vals[0] == bytes32(0) &&
            state.bytes32Vals[1] == bytes32(0) &&
            state.u64Vals[0] == 0 &&
            state.u64Vals[1] == 0);
    }
}

File 10 of 18 : Instructions.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

struct Instruction {
    uint16 opcode;
    uint256 argumentData;
}

library Instructions {
    uint16 internal constant UNREACHABLE = 0x00;
    uint16 internal constant NOP = 0x01;
    uint16 internal constant RETURN = 0x0F;
    uint16 internal constant CALL = 0x10;
    uint16 internal constant CALL_INDIRECT = 0x11;
    uint16 internal constant LOCAL_GET = 0x20;
    uint16 internal constant LOCAL_SET = 0x21;
    uint16 internal constant GLOBAL_GET = 0x23;
    uint16 internal constant GLOBAL_SET = 0x24;

    uint16 internal constant I32_LOAD = 0x28;
    uint16 internal constant I64_LOAD = 0x29;
    uint16 internal constant F32_LOAD = 0x2A;
    uint16 internal constant F64_LOAD = 0x2B;
    uint16 internal constant I32_LOAD8_S = 0x2C;
    uint16 internal constant I32_LOAD8_U = 0x2D;
    uint16 internal constant I32_LOAD16_S = 0x2E;
    uint16 internal constant I32_LOAD16_U = 0x2F;
    uint16 internal constant I64_LOAD8_S = 0x30;
    uint16 internal constant I64_LOAD8_U = 0x31;
    uint16 internal constant I64_LOAD16_S = 0x32;
    uint16 internal constant I64_LOAD16_U = 0x33;
    uint16 internal constant I64_LOAD32_S = 0x34;
    uint16 internal constant I64_LOAD32_U = 0x35;

    uint16 internal constant I32_STORE = 0x36;
    uint16 internal constant I64_STORE = 0x37;
    uint16 internal constant F32_STORE = 0x38;
    uint16 internal constant F64_STORE = 0x39;
    uint16 internal constant I32_STORE8 = 0x3A;
    uint16 internal constant I32_STORE16 = 0x3B;
    uint16 internal constant I64_STORE8 = 0x3C;
    uint16 internal constant I64_STORE16 = 0x3D;
    uint16 internal constant I64_STORE32 = 0x3E;

    uint16 internal constant MEMORY_SIZE = 0x3F;
    uint16 internal constant MEMORY_GROW = 0x40;

    uint16 internal constant DROP = 0x1A;
    uint16 internal constant SELECT = 0x1B;
    uint16 internal constant I32_CONST = 0x41;
    uint16 internal constant I64_CONST = 0x42;
    uint16 internal constant F32_CONST = 0x43;
    uint16 internal constant F64_CONST = 0x44;
    uint16 internal constant I32_EQZ = 0x45;
    uint16 internal constant I32_RELOP_BASE = 0x46;
    uint16 internal constant IRELOP_EQ = 0;
    uint16 internal constant IRELOP_NE = 1;
    uint16 internal constant IRELOP_LT_S = 2;
    uint16 internal constant IRELOP_LT_U = 3;
    uint16 internal constant IRELOP_GT_S = 4;
    uint16 internal constant IRELOP_GT_U = 5;
    uint16 internal constant IRELOP_LE_S = 6;
    uint16 internal constant IRELOP_LE_U = 7;
    uint16 internal constant IRELOP_GE_S = 8;
    uint16 internal constant IRELOP_GE_U = 9;
    uint16 internal constant IRELOP_LAST = IRELOP_GE_U;

    uint16 internal constant I64_EQZ = 0x50;
    uint16 internal constant I64_RELOP_BASE = 0x51;

    uint16 internal constant I32_UNOP_BASE = 0x67;
    uint16 internal constant IUNOP_CLZ = 0;
    uint16 internal constant IUNOP_CTZ = 1;
    uint16 internal constant IUNOP_POPCNT = 2;
    uint16 internal constant IUNOP_LAST = IUNOP_POPCNT;

    uint16 internal constant I32_ADD = 0x6A;
    uint16 internal constant I32_SUB = 0x6B;
    uint16 internal constant I32_MUL = 0x6C;
    uint16 internal constant I32_DIV_S = 0x6D;
    uint16 internal constant I32_DIV_U = 0x6E;
    uint16 internal constant I32_REM_S = 0x6F;
    uint16 internal constant I32_REM_U = 0x70;
    uint16 internal constant I32_AND = 0x71;
    uint16 internal constant I32_OR = 0x72;
    uint16 internal constant I32_XOR = 0x73;
    uint16 internal constant I32_SHL = 0x74;
    uint16 internal constant I32_SHR_S = 0x75;
    uint16 internal constant I32_SHR_U = 0x76;
    uint16 internal constant I32_ROTL = 0x77;
    uint16 internal constant I32_ROTR = 0x78;

    uint16 internal constant I64_UNOP_BASE = 0x79;

    uint16 internal constant I64_ADD = 0x7C;
    uint16 internal constant I64_SUB = 0x7D;
    uint16 internal constant I64_MUL = 0x7E;
    uint16 internal constant I64_DIV_S = 0x7F;
    uint16 internal constant I64_DIV_U = 0x80;
    uint16 internal constant I64_REM_S = 0x81;
    uint16 internal constant I64_REM_U = 0x82;
    uint16 internal constant I64_AND = 0x83;
    uint16 internal constant I64_OR = 0x84;
    uint16 internal constant I64_XOR = 0x85;
    uint16 internal constant I64_SHL = 0x86;
    uint16 internal constant I64_SHR_S = 0x87;
    uint16 internal constant I64_SHR_U = 0x88;
    uint16 internal constant I64_ROTL = 0x89;
    uint16 internal constant I64_ROTR = 0x8A;

    uint16 internal constant I32_WRAP_I64 = 0xA7;
    uint16 internal constant I64_EXTEND_I32_S = 0xAC;
    uint16 internal constant I64_EXTEND_I32_U = 0xAD;

    uint16 internal constant I32_REINTERPRET_F32 = 0xBC;
    uint16 internal constant I64_REINTERPRET_F64 = 0xBD;
    uint16 internal constant F32_REINTERPRET_I32 = 0xBE;
    uint16 internal constant F64_REINTERPRET_I64 = 0xBF;

    uint16 internal constant I32_EXTEND_8S = 0xC0;
    uint16 internal constant I32_EXTEND_16S = 0xC1;
    uint16 internal constant I64_EXTEND_8S = 0xC2;
    uint16 internal constant I64_EXTEND_16S = 0xC3;
    uint16 internal constant I64_EXTEND_32S = 0xC4;

    uint16 internal constant INIT_FRAME = 0x8002;
    uint16 internal constant ARBITRARY_JUMP = 0x8003;
    uint16 internal constant ARBITRARY_JUMP_IF = 0x8004;
    uint16 internal constant MOVE_FROM_STACK_TO_INTERNAL = 0x8005;
    uint16 internal constant MOVE_FROM_INTERNAL_TO_STACK = 0x8006;
    uint16 internal constant DUP = 0x8008;
    uint16 internal constant CROSS_MODULE_CALL = 0x8009;
    uint16 internal constant CALLER_MODULE_INTERNAL_CALL = 0x800A;

    uint16 internal constant GET_GLOBAL_STATE_BYTES32 = 0x8010;
    uint16 internal constant SET_GLOBAL_STATE_BYTES32 = 0x8011;
    uint16 internal constant GET_GLOBAL_STATE_U64 = 0x8012;
    uint16 internal constant SET_GLOBAL_STATE_U64 = 0x8013;

    uint16 internal constant READ_PRE_IMAGE = 0x8020;
    uint16 internal constant READ_INBOX_MESSAGE = 0x8021;
    uint16 internal constant HALT_AND_SET_FINISHED = 0x8022;

    uint256 internal constant INBOX_INDEX_SEQUENCER = 0;
    uint256 internal constant INBOX_INDEX_DELAYED = 1;

    function hash(Instruction memory inst) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("Instruction:", inst.opcode, inst.argumentData));
    }
}

File 11 of 18 : Machine.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "./ValueStack.sol";
import "./Instructions.sol";
import "./StackFrame.sol";

enum MachineStatus {
    RUNNING,
    FINISHED,
    ERRORED,
    TOO_FAR
}

struct Machine {
    MachineStatus status;
    ValueStack valueStack;
    ValueStack internalStack;
    StackFrameWindow frameStack;
    bytes32 globalStateHash;
    uint32 moduleIdx;
    uint32 functionIdx;
    uint32 functionPc;
    bytes32 modulesRoot;
}

library MachineLib {
    using StackFrameLib for StackFrameWindow;
    using ValueStackLib for ValueStack;

    function hash(Machine memory mach) internal pure returns (bytes32) {
        // Warning: the non-running hashes are replicated in Challenge
        if (mach.status == MachineStatus.RUNNING) {
            return
                keccak256(
                    abi.encodePacked(
                        "Machine running:",
                        mach.valueStack.hash(),
                        mach.internalStack.hash(),
                        mach.frameStack.hash(),
                        mach.globalStateHash,
                        mach.moduleIdx,
                        mach.functionIdx,
                        mach.functionPc,
                        mach.modulesRoot
                    )
                );
        } else if (mach.status == MachineStatus.FINISHED) {
            return keccak256(abi.encodePacked("Machine finished:", mach.globalStateHash));
        } else if (mach.status == MachineStatus.ERRORED) {
            return keccak256(abi.encodePacked("Machine errored:"));
        } else if (mach.status == MachineStatus.TOO_FAR) {
            return keccak256(abi.encodePacked("Machine too far:"));
        } else {
            revert("BAD_MACH_STATUS");
        }
    }
}

File 12 of 18 : MerkleProof.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "./Value.sol";
import "./Instructions.sol";
import "./Module.sol";

struct MerkleProof {
    bytes32[] counterparts;
}

library MerkleProofLib {
    using ModuleLib for Module;
    using ValueLib for Value;

    function computeRootFromValue(
        MerkleProof memory proof,
        uint256 index,
        Value memory leaf
    ) internal pure returns (bytes32) {
        return computeRootUnsafe(proof, index, leaf.hash(), "Value merkle tree:");
    }

    function computeRootFromInstruction(
        MerkleProof memory proof,
        uint256 index,
        Instruction memory inst
    ) internal pure returns (bytes32) {
        return computeRootUnsafe(proof, index, Instructions.hash(inst), "Instruction merkle tree:");
    }

    function computeRootFromFunction(
        MerkleProof memory proof,
        uint256 index,
        bytes32 codeRoot
    ) internal pure returns (bytes32) {
        bytes32 h = keccak256(abi.encodePacked("Function:", codeRoot));
        return computeRootUnsafe(proof, index, h, "Function merkle tree:");
    }

    function computeRootFromMemory(
        MerkleProof memory proof,
        uint256 index,
        bytes32 contents
    ) internal pure returns (bytes32) {
        bytes32 h = keccak256(abi.encodePacked("Memory leaf:", contents));
        return computeRootUnsafe(proof, index, h, "Memory merkle tree:");
    }

    function computeRootFromElement(
        MerkleProof memory proof,
        uint256 index,
        bytes32 funcTypeHash,
        Value memory val
    ) internal pure returns (bytes32) {
        bytes32 h = keccak256(abi.encodePacked("Table element:", funcTypeHash, val.hash()));
        return computeRootUnsafe(proof, index, h, "Table element merkle tree:");
    }

    function computeRootFromTable(
        MerkleProof memory proof,
        uint256 index,
        uint8 tableType,
        uint64 tableSize,
        bytes32 elementsRoot
    ) internal pure returns (bytes32) {
        bytes32 h = keccak256(abi.encodePacked("Table:", tableType, tableSize, elementsRoot));
        return computeRootUnsafe(proof, index, h, "Table merkle tree:");
    }

    function computeRootFromModule(
        MerkleProof memory proof,
        uint256 index,
        Module memory mod
    ) internal pure returns (bytes32) {
        return computeRootUnsafe(proof, index, mod.hash(), "Module merkle tree:");
    }

    // WARNING: leafHash must be computed in such a way that it cannot be a non-leaf hash.
    function computeRootUnsafe(
        MerkleProof memory proof,
        uint256 index,
        bytes32 leafHash,
        string memory prefix
    ) internal pure returns (bytes32 h) {
        h = leafHash;
        for (uint256 layer = 0; layer < proof.counterparts.length; layer++) {
            if (index & 1 == 0) {
                h = keccak256(abi.encodePacked(prefix, h, proof.counterparts[layer]));
            } else {
                h = keccak256(abi.encodePacked(prefix, proof.counterparts[layer], h));
            }
            index >>= 1;
        }
    }
}

File 13 of 18 : Module.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "./ModuleMemoryCompact.sol";

struct Module {
    bytes32 globalsMerkleRoot;
    ModuleMemory moduleMemory;
    bytes32 tablesMerkleRoot;
    bytes32 functionsMerkleRoot;
    uint32 internalsOffset;
}

library ModuleLib {
    using ModuleMemoryCompactLib for ModuleMemory;

    function hash(Module memory mod) internal pure returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(
                    "Module:",
                    mod.globalsMerkleRoot,
                    mod.moduleMemory.hash(),
                    mod.tablesMerkleRoot,
                    mod.functionsMerkleRoot,
                    mod.internalsOffset
                )
            );
    }
}

File 14 of 18 : ModuleMemoryCompact.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

struct ModuleMemory {
    uint64 size;
    uint64 maxSize;
    bytes32 merkleRoot;
}

library ModuleMemoryCompactLib {
    function hash(ModuleMemory memory mem) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("Memory:", mem.size, mem.maxSize, mem.merkleRoot));
    }
}

File 15 of 18 : StackFrame.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "./Value.sol";

struct StackFrame {
    Value returnPc;
    bytes32 localsMerkleRoot;
    uint32 callerModule;
    uint32 callerModuleInternals;
}

struct StackFrameWindow {
    StackFrame[] proved;
    bytes32 remainingHash;
}

library StackFrameLib {
    using ValueLib for Value;

    function hash(StackFrame memory frame) internal pure returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(
                    "Stack frame:",
                    frame.returnPc.hash(),
                    frame.localsMerkleRoot,
                    frame.callerModule,
                    frame.callerModuleInternals
                )
            );
    }

    function hash(StackFrameWindow memory window) internal pure returns (bytes32 h) {
        h = window.remainingHash;
        for (uint256 i = 0; i < window.proved.length; i++) {
            h = keccak256(abi.encodePacked("Stack frame stack:", hash(window.proved[i]), h));
        }
    }

    function peek(StackFrameWindow memory window) internal pure returns (StackFrame memory) {
        require(window.proved.length == 1, "BAD_WINDOW_LENGTH");
        return window.proved[0];
    }

    function pop(StackFrameWindow memory window) internal pure returns (StackFrame memory frame) {
        require(window.proved.length == 1, "BAD_WINDOW_LENGTH");
        frame = window.proved[0];
        window.proved = new StackFrame[](0);
    }

    function push(StackFrameWindow memory window, StackFrame memory frame) internal pure {
        StackFrame[] memory newProved = new StackFrame[](window.proved.length + 1);
        for (uint256 i = 0; i < window.proved.length; i++) {
            newProved[i] = window.proved[i];
        }
        newProved[window.proved.length] = frame;
        window.proved = newProved;
    }
}

File 16 of 18 : Value.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

enum ValueType {
    I32,
    I64,
    F32,
    F64,
    REF_NULL,
    FUNC_REF,
    INTERNAL_REF
}

struct Value {
    ValueType valueType;
    uint256 contents;
}

library ValueLib {
    function hash(Value memory val) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("Value:", val.valueType, val.contents));
    }

    function maxValueType() internal pure returns (ValueType) {
        return ValueType.INTERNAL_REF;
    }

    function assumeI32(Value memory val) internal pure returns (uint32) {
        uint256 uintval = uint256(val.contents);
        require(val.valueType == ValueType.I32, "NOT_I32");
        require(uintval < (1 << 32), "BAD_I32");
        return uint32(uintval);
    }

    function assumeI64(Value memory val) internal pure returns (uint64) {
        uint256 uintval = uint256(val.contents);
        require(val.valueType == ValueType.I64, "NOT_I64");
        require(uintval < (1 << 64), "BAD_I64");
        return uint64(uintval);
    }

    function newRefNull() internal pure returns (Value memory) {
        return Value({valueType: ValueType.REF_NULL, contents: 0});
    }

    function newI32(uint32 x) internal pure returns (Value memory) {
        return Value({valueType: ValueType.I32, contents: uint256(x)});
    }

    function newI64(uint64 x) internal pure returns (Value memory) {
        return Value({valueType: ValueType.I64, contents: uint256(x)});
    }

    function newBoolean(bool x) internal pure returns (Value memory) {
        if (x) {
            return newI32(uint32(1));
        } else {
            return newI32(uint32(0));
        }
    }
}

File 17 of 18 : ValueArray.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "./Value.sol";

struct ValueArray {
    Value[] inner;
}

library ValueArrayLib {
    function get(ValueArray memory arr, uint256 index) internal pure returns (Value memory) {
        return arr.inner[index];
    }

    function set(
        ValueArray memory arr,
        uint256 index,
        Value memory val
    ) internal pure {
        arr.inner[index] = val;
    }

    function length(ValueArray memory arr) internal pure returns (uint256) {
        return arr.inner.length;
    }

    function push(ValueArray memory arr, Value memory val) internal pure {
        Value[] memory newInner = new Value[](arr.inner.length + 1);
        for (uint256 i = 0; i < arr.inner.length; i++) {
            newInner[i] = arr.inner[i];
        }
        newInner[arr.inner.length] = val;
        arr.inner = newInner;
    }

    function pop(ValueArray memory arr) internal pure returns (Value memory popped) {
        popped = arr.inner[arr.inner.length - 1];
        Value[] memory newInner = new Value[](arr.inner.length - 1);
        for (uint256 i = 0; i < newInner.length; i++) {
            newInner[i] = arr.inner[i];
        }
        arr.inner = newInner;
    }
}

File 18 of 18 : ValueStack.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "./Value.sol";
import "./ValueArray.sol";

struct ValueStack {
    ValueArray proved;
    bytes32 remainingHash;
}

library ValueStackLib {
    using ValueLib for Value;
    using ValueArrayLib for ValueArray;

    function hash(ValueStack memory stack) internal pure returns (bytes32 h) {
        h = stack.remainingHash;
        uint256 len = stack.proved.length();
        for (uint256 i = 0; i < len; i++) {
            h = keccak256(abi.encodePacked("Value stack:", stack.proved.get(i).hash(), h));
        }
    }

    function peek(ValueStack memory stack) internal pure returns (Value memory) {
        uint256 len = stack.proved.length();
        return stack.proved.get(len - 1);
    }

    function pop(ValueStack memory stack) internal pure returns (Value memory) {
        return stack.proved.pop();
    }

    function push(ValueStack memory stack, Value memory val) internal pure {
        return stack.proved.push(val);
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 100
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"uint256","name":"maxInboxMessagesRead","type":"uint256"},{"internalType":"contract IBridge","name":"bridge","type":"address"}],"internalType":"struct ExecutionContext","name":"","type":"tuple"},{"components":[{"internalType":"enum MachineStatus","name":"status","type":"uint8"},{"components":[{"components":[{"components":[{"internalType":"enum ValueType","name":"valueType","type":"uint8"},{"internalType":"uint256","name":"contents","type":"uint256"}],"internalType":"struct Value[]","name":"inner","type":"tuple[]"}],"internalType":"struct ValueArray","name":"proved","type":"tuple"},{"internalType":"bytes32","name":"remainingHash","type":"bytes32"}],"internalType":"struct ValueStack","name":"valueStack","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"enum ValueType","name":"valueType","type":"uint8"},{"internalType":"uint256","name":"contents","type":"uint256"}],"internalType":"struct Value[]","name":"inner","type":"tuple[]"}],"internalType":"struct ValueArray","name":"proved","type":"tuple"},{"internalType":"bytes32","name":"remainingHash","type":"bytes32"}],"internalType":"struct ValueStack","name":"internalStack","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"enum ValueType","name":"valueType","type":"uint8"},{"internalType":"uint256","name":"contents","type":"uint256"}],"internalType":"struct Value","name":"returnPc","type":"tuple"},{"internalType":"bytes32","name":"localsMerkleRoot","type":"bytes32"},{"internalType":"uint32","name":"callerModule","type":"uint32"},{"internalType":"uint32","name":"callerModuleInternals","type":"uint32"}],"internalType":"struct StackFrame[]","name":"proved","type":"tuple[]"},{"internalType":"bytes32","name":"remainingHash","type":"bytes32"}],"internalType":"struct StackFrameWindow","name":"frameStack","type":"tuple"},{"internalType":"bytes32","name":"globalStateHash","type":"bytes32"},{"internalType":"uint32","name":"moduleIdx","type":"uint32"},{"internalType":"uint32","name":"functionIdx","type":"uint32"},{"internalType":"uint32","name":"functionPc","type":"uint32"},{"internalType":"bytes32","name":"modulesRoot","type":"bytes32"}],"internalType":"struct Machine","name":"startMach","type":"tuple"},{"components":[{"internalType":"bytes32","name":"globalsMerkleRoot","type":"bytes32"},{"components":[{"internalType":"uint64","name":"size","type":"uint64"},{"internalType":"uint64","name":"maxSize","type":"uint64"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"internalType":"struct ModuleMemory","name":"moduleMemory","type":"tuple"},{"internalType":"bytes32","name":"tablesMerkleRoot","type":"bytes32"},{"internalType":"bytes32","name":"functionsMerkleRoot","type":"bytes32"},{"internalType":"uint32","name":"internalsOffset","type":"uint32"}],"internalType":"struct Module","name":"startMod","type":"tuple"},{"components":[{"internalType":"uint16","name":"opcode","type":"uint16"},{"internalType":"uint256","name":"argumentData","type":"uint256"}],"internalType":"struct Instruction","name":"inst","type":"tuple"},{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"executeOneStep","outputs":[{"components":[{"internalType":"enum MachineStatus","name":"status","type":"uint8"},{"components":[{"components":[{"components":[{"internalType":"enum ValueType","name":"valueType","type":"uint8"},{"internalType":"uint256","name":"contents","type":"uint256"}],"internalType":"struct Value[]","name":"inner","type":"tuple[]"}],"internalType":"struct ValueArray","name":"proved","type":"tuple"},{"internalType":"bytes32","name":"remainingHash","type":"bytes32"}],"internalType":"struct ValueStack","name":"valueStack","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"enum ValueType","name":"valueType","type":"uint8"},{"internalType":"uint256","name":"contents","type":"uint256"}],"internalType":"struct Value[]","name":"inner","type":"tuple[]"}],"internalType":"struct ValueArray","name":"proved","type":"tuple"},{"internalType":"bytes32","name":"remainingHash","type":"bytes32"}],"internalType":"struct ValueStack","name":"internalStack","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"enum ValueType","name":"valueType","type":"uint8"},{"internalType":"uint256","name":"contents","type":"uint256"}],"internalType":"struct Value","name":"returnPc","type":"tuple"},{"internalType":"bytes32","name":"localsMerkleRoot","type":"bytes32"},{"internalType":"uint32","name":"callerModule","type":"uint32"},{"internalType":"uint32","name":"callerModuleInternals","type":"uint32"}],"internalType":"struct StackFrame[]","name":"proved","type":"tuple[]"},{"internalType":"bytes32","name":"remainingHash","type":"bytes32"}],"internalType":"struct StackFrameWindow","name":"frameStack","type":"tuple"},{"internalType":"bytes32","name":"globalStateHash","type":"bytes32"},{"internalType":"uint32","name":"moduleIdx","type":"uint32"},{"internalType":"uint32","name":"functionIdx","type":"uint32"},{"internalType":"uint32","name":"functionPc","type":"uint32"},{"internalType":"bytes32","name":"modulesRoot","type":"bytes32"}],"internalType":"struct Machine","name":"mach","type":"tuple"},{"components":[{"internalType":"bytes32","name":"globalsMerkleRoot","type":"bytes32"},{"components":[{"internalType":"uint64","name":"size","type":"uint64"},{"internalType":"uint64","name":"maxSize","type":"uint64"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"internalType":"struct ModuleMemory","name":"moduleMemory","type":"tuple"},{"internalType":"bytes32","name":"tablesMerkleRoot","type":"bytes32"},{"internalType":"bytes32","name":"functionsMerkleRoot","type":"bytes32"},{"internalType":"uint32","name":"internalsOffset","type":"uint32"}],"internalType":"struct Module","name":"mod","type":"tuple"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b50612640806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063da78e7d114610030575b600080fd5b61004361003e366004611bc6565b61005a565b604051610051929190611dd8565b60405180910390f35b610062611a8e565b61006a611b37565b61007387612280565b915061008436879003870187612383565b90506000610095602087018761241a565b9050611b8161ffff82166100ac57506102bd61029f565b61ffff8216600114156100c257506102c861029f565b61ffff8216600f14156100d857506102cf61029f565b61ffff8216601014156100ee57506103fb61029f565b61ffff82166180091415610105575061049561029f565b61ffff821661800a141561011c575061054161029f565b61ffff821660111415610132575061062e61029f565b61ffff821661800314156101495750610a0f61029f565b61ffff821661800414156101605750610a4e61029f565b61ffff8216602014156101765750610aac61029f565b61ffff82166021141561018c5750610aee61029f565b61ffff8216602314156101a25750610b3361029f565b61ffff8216602414156101b85750610b5b61029f565b61ffff821661800214156101cf5750610b8b61029f565b61ffff8216601a14156101e55750610c2861029f565b61ffff8216601b14156101fb5750610c3561029f565b604161ffff8316108015906102155750604461ffff831611155b156102235750610ca461029f565b61ffff8216618005148061023c575061ffff8216618006145b1561024a5750610d9861029f565b61ffff821661800814156102615750610e6b61029f565b60405162461bcd60e51b815260206004820152600e60248201526d494e56414c49445f4f50434f444560901b60448201526064015b60405180910390fd5b6102b084848989898663ffffffff16565b5050965096945050505050565b505060029092525050565b5050505050565b60006102de8660600151610e7a565b9050600481515160068111156102f6576102f6611ca9565b141561031d578560025b9081600381111561031357610313611ca9565b81525050506102c8565b6006815151600681111561033357610333611ca9565b146103795760405162461bcd60e51b8152602060048201526016602482015275494e56414c49445f52455455524e5f50435f5459504560501b6044820152606401610296565b805160209081015190819081901c604082901c606083901c156103d75760405162461bcd60e51b8152602060048201526016602482015275494e56414c49445f52455455524e5f50435f4441544160501b6044820152606401610296565b63ffffffff92831660e08b015290821660c08a01521660a088015250505050505050565b61041261040786610f1a565b602087015190610f7d565b60006104218660600151610f8d565b905061043e6104338260400151610fd9565b602088015190610f7d565b61044e6104338260600151610fd9565b602084013563ffffffff811681146104785760405162461bcd60e51b81526004016102969061243e565b63ffffffff1660c08701525050600060e090940193909352505050565b6104a161040786610f1a565b6104b16104078660a00151610fd9565b6104c16104078560800151610fd9565b6020808401359081901c604082901c1561051d5760405162461bcd60e51b815260206004820152601a60248201527f4241445f43524f53535f4d4f44554c455f43414c4c5f444154410000000000006044820152606401610296565b63ffffffff90811660a08801521660c08601525050600060e0909301929092525050565b61054d61040786610f1a565b61055d6104078660a00151610fd9565b61056d6104078560800151610fd9565b600061057c8660600151610f8d565b9050806060015163ffffffff166000141561059957856002610300565b602084013563ffffffff811681146105f35760405162461bcd60e51b815260206004820152601d60248201527f4241445f43414c4c45525f494e5445524e414c5f43414c4c5f444154410000006044820152606401610296565b604082015163ffffffff1660a0880152606082015161061390829061247b565b63ffffffff1660c08801525050600060e08601525050505050565b600080610646610641886020015161100c565b611031565b90506000806000808060006106676040518060200160405280606081525090565b6106728b8b876110c2565b955093506106818b8b87611129565b90965094506106918b8b87611145565b955092506106a08b8b876110c2565b955091506106af8b8b87611129565b90975094506106bf8b8b8761117b565b6040516d21b0b6361034b73234b932b1ba1d60911b60208201526001600160c01b031960c088901b16602e8201526036810189905290965090915060009060560160408051601f19818403018152919052805160209182012091508d013581146107645760405162461bcd60e51b81526020600482015260166024820152754241445f43414c4c5f494e4449524543545f4441544160501b6044820152606401610296565b61077a826001600160401b03871686868c611255565b90508d6040015181146107c15760405162461bcd60e51b815260206004820152600f60248201526e10905117d51050931154d7d493d3d5608a1b6044820152606401610296565b826001600160401b03168963ffffffff16106107eb57505060028d52506102c89650505050505050565b5050505050600061080c604080518082019091526000808252602082015290565b6040805160208101909152606081526108268a8a86611129565b945092506108358a8a866112f7565b945091506108448a8a8661117b565b9450905060006108618263ffffffff808b1690879087906113f316565b90508681146108a65760405162461bcd60e51b815260206004820152601160248201527010905117d153115351539514d7d493d3d5607a1b6044820152606401610296565b8584146108d6578d60025b908160038111156108c4576108c4611ca9565b815250505050505050505050506102c8565b6004835160068111156108eb576108eb611ca9565b14156108f9578d60026108b1565b60058351600681111561090e5761090e611ca9565b141561096d576020830151985063ffffffff891689146109685760405162461bcd60e51b81526020600482015260156024820152744241445f46554e435f5245465f434f4e54454e545360581b6044820152606401610296565b6109a5565b60405162461bcd60e51b815260206004820152600d60248201526c4241445f454c454d5f5459504560981b6044820152606401610296565b50505050505050506109b961043387610f1a565b60006109c88760600151610f8d565b90506109e56109da8260400151610fd9565b602089015190610f7d565b6109f56109da8260600151610fd9565b5063ffffffff1660c0860152600060e08601525050505050565b602083013563ffffffff81168114610a395760405162461bcd60e51b81526004016102969061243e565b63ffffffff1660e09095019490945250505050565b6000610a60610641876020015161100c565b905063ffffffff811615610aa457602084013563ffffffff81168114610a985760405162461bcd60e51b81526004016102969061243e565b63ffffffff1660e08701525b505050505050565b6000610abb8660600151610f8d565b90506000610ad382602001518660200135868661148d565b6020880151909150610ae59082610f7d565b50505050505050565b6000610afd866020015161100c565b90506000610b0e8760600151610f8d565b9050610b2581602001518660200135848787611525565b602090910152505050505050565b6000610b4985600001518560200135858561148d565b6020870151909150610aa49082610f7d565b6000610b6a866020015161100c565b9050610b8185600001518560200135838686611525565b9094525050505050565b6000610b9a866020015161100c565b90506000610bab876020015161100c565b90506000610bbc886020015161100c565b905060006040518060800160405280838152602001886020013560001b8152602001610be785611031565b63ffffffff168152602001610bfb86611031565b63ffffffff168152509050610c1d818a606001516115bf90919063ffffffff16565b505050505050505050565b610aa4856020015161100c565b6000610c47610641876020015161100c565b90506000610c58876020015161100c565b90506000610c69886020015161100c565b905063ffffffff831615610c8b576020880151610c869082610f7d565b610c9a565b6020880151610c9a9083610f7d565b5050505050505050565b6000610cb3602085018561241a565b9050600061ffff821660411415610ccc57506000610d4f565b61ffff821660421415610ce157506001610d4f565b61ffff821660431415610cf657506002610d4f565b61ffff821660441415610d0b57506003610d4f565b60405162461bcd60e51b8152602060048201526019602482015278434f4e53545f505553485f494e56414c49445f4f50434f444560381b6044820152606401610296565b610ae56040518060400160405280836006811115610d6f57610d6f611ca9565b815260200187602001356001600160401b03168152508860200151610f7d90919063ffffffff16565b6040805180820190915260008082526020820152618005610dbc602086018661241a565b61ffff161415610dea57610dd3866020015161100c565b6040870151909150610de59082610f7d565b610aa4565b618006610dfa602086018661241a565b61ffff161415610e2357610e11866040015161100c565b6020870151909150610de59082610f7d565b60405162461bcd60e51b815260206004820152601c60248201527f4d4f56455f494e5445524e414c5f494e56414c49445f4f50434f4445000000006044820152606401610296565b6000610b4986602001516116a6565b610e82611b8b565b815151600114610ea45760405162461bcd60e51b8152600401610296906124a3565b81518051600090610eb757610eb76124ce565b6020026020010151905060006001600160401b03811115610eda57610eda611f00565b604051908082528060200260200182016040528015610f1357816020015b610f00611b8b565b815260200190600190039081610ef85790505b5090915290565b604080518082018252600080825260209182015260e083015160c084015160a090940151835180850185526006815263ffffffff90921694831b67ffffffff0000000016949094179390921b63ffffffff60401b16929092179181019190915290565b8151610f8990826116db565b5050565b610f95611b8b565b815151600114610fb75760405162461bcd60e51b8152600401610296906124a3565b81518051600090610fca57610fca6124ce565b60200260200101519050919050565b604080518082019091526000808252602082015250604080518082019091526000815263ffffffff909116602082015290565b6040805180820190915260008082526020820152815161102b906117a4565b92915050565b6020810151600090818351600681111561104d5761104d611ca9565b146110845760405162461bcd60e51b81526020600482015260076024820152662727aa2fa4999960c91b6044820152606401610296565b640100000000811061102b5760405162461bcd60e51b81526020600482015260076024820152662120a22fa4999960c91b6044820152606401610296565b600081815b6008811015611120576008836001600160401b0316901b92508585838181106110f2576110f26124ce565b919091013560f81c9390931792508161110a816124e4565b9250508080611118906124e4565b9150506110c7565b50935093915050565b600081816111388686846118ad565b9097909650945050505050565b60008184848281811061115a5761115a6124ce565b919091013560f81c9250819050611170816124e4565b915050935093915050565b604080516020810190915260608152816000611198868684611145565b92509050600060ff82166001600160401b038111156111b9576111b9611f00565b6040519080825280602002602001820160405280156111e2578160200160208202803683370190505b50905060005b8260ff168160ff16101561123957611201888886611129565b838360ff1681518110611216576112166124ce565b602002602001018196508281525050508080611231906124ff565b9150506111e8565b5060405180602001604052808281525093505050935093915050565b604051652a30b136329d60d11b60208201526001600160f81b031960f885901b1660268201526001600160c01b031960c084901b166027820152602f81018290526000908190604f016040516020818303038152906040528051906020012090506112ec878783604051806040016040528060128152602001712a30b136329036b2b935b632903a3932b29d60711b815250611902565b979650505050505050565b6040805180820190915260008082526020820152816000858583818110611320576113206124ce565b919091013560f81c9150829050611336816124e4565b925050611341600690565b600681111561135257611352611ca9565b60ff168160ff1611156113985760405162461bcd60e51b815260206004820152600e60248201526d4241445f56414c55455f5459504560901b6044820152606401610296565b60006113a58787856118ad565b809450819250505060405180604001604052808360ff1660068111156113cd576113cd611ca9565b60068111156113de576113de611ca9565b81526020018281525093505050935093915050565b60008083611400846119d4565b6040516d2a30b136329032b632b6b2b73a1d60911b6020820152602e810192909252604e820152606e016040516020818303038152906040528051906020012090506114838686836040518060400160405280601a81526020017f5461626c6520656c656d656e74206d65726b6c6520747265653a000000000000815250611902565b9695505050505050565b604080518082019091526000808252602082015260006114bd604080518082019091526000808252602082015290565b6040805160208101909152606081526114d78686856112f7565b935091506114e686868561117b565b9350905060006114f7828985611a0e565b90508881146115185760405162461bcd60e51b81526004016102969061251f565b5090979650505050505050565b6000611541604080518082019091526000808252602082015290565b60006115596040518060200160405280606081525090565b6115648686846112f7565b909350915061157486868461117b565b925090506000611585828a86611a0e565b90508981146115a65760405162461bcd60e51b81526004016102969061251f565b6115b1828a8a611a0e565b9a9950505050505050505050565b8151516000906115d090600161254a565b6001600160401b038111156115e7576115e7611f00565b60405190808252806020026020018201604052801561162057816020015b61160d611b8b565b8152602001906001900390816116055790505b50905060005b83515181101561167c578351805182908110611644576116446124ce565b602002602001015182828151811061165e5761165e6124ce565b60200260200101819052508080611674906124e4565b915050611626565b50818184600001515181518110611695576116956124ce565b602090810291909101015290915250565b6040805180820190915260008082526020820152815151516116d46116cc600183612562565b845190611a56565b9392505050565b8151516000906116ec90600161254a565b6001600160401b0381111561170357611703611f00565b60405190808252806020026020018201604052801561174857816020015b60408051808201909152600080825260208201528152602001906001900390816117215790505b50905060005b83515181101561167c57835180518290811061176c5761176c6124ce565b6020026020010151828281518110611786576117866124ce565b6020026020010181905250808061179c906124e4565b91505061174e565b6040805180820190915260008082526020820152815180516117c890600190612562565b815181106117d8576117d86124ce565b60200260200101519050600060018360000151516117f69190612562565b6001600160401b0381111561180d5761180d611f00565b60405190808252806020026020018201604052801561185257816020015b604080518082019091526000808252602082015281526020019060019003908161182b5790505b50905060005b8151811015610f13578351805182908110611875576118756124ce565b602002602001015182828151811061188f5761188f6124ce565b602002602001018190525080806118a5906124e4565b915050611858565b600081815b602081101561112057600883901b92508585838181106118d4576118d46124ce565b919091013560f81c939093179250816118ec816124e4565b92505080806118fa906124e4565b9150506118b2565b8160005b8551518110156119cb576001851661196757828287600001518381518110611930576119306124ce565b602002602001015160405160200161194a93929190612579565b6040516020818303038152906040528051906020012091506119b2565b828660000151828151811061197e5761197e6124ce565b60200260200101518360405160200161199993929190612579565b6040516020818303038152906040528051906020012091505b60019490941c93806119c3816124e4565b915050611906565b50949350505050565b6000816000015182602001516040516020016119f19291906125bf565b604051602081830303815290604052805190602001209050919050565b6000611a4e8484611a1e856119d4565b604051806040016040528060128152602001712b30b63ab29036b2b935b632903a3932b29d60711b815250611902565b949350505050565b60408051808201909152600080825260208201528251805183908110611a7e57611a7e6124ce565b6020026020010151905092915050565b6040805161012081019091528060008152602001611ac360408051606080820183529181019182529081526000602082015290565b8152602001611ae960408051606080820183529181019182529081526000602082015290565b8152602001611b0e604051806040016040528060608152602001600080191681525090565b815260006020820181905260408201819052606082018190526080820181905260a09091015290565b6040805160a0810182526000808252825160608101845281815260208181018390529381019190915290918201905b81526000602082018190526040820181905260609091015290565b611b896125f4565b565b6040805160c0810190915260006080820181815260a08301919091528190611b66565b600060408284031215611bc057600080fd5b50919050565b6000806000806000808688036101a0811215611be157600080fd5b611beb8989611bae565b965060408801356001600160401b0380821115611c0757600080fd5b90890190610120828c031215611c1c57600080fd5b81975060e0605f1984011215611c3157600080fd5b60608a019650611c458b6101408c01611bae565b95506101808a0135925080831115611c5c57600080fd5b828a0192508a601f840112611c7057600080fd5b8235915080821115611c8157600080fd5b50896020828401011115611c9457600080fd5b60208201935080925050509295509295509295565b634e487b7160e01b600052602160045260246000fd5b60048110611ccf57611ccf611ca9565b9052565b805160078110611ce557611ce5611ca9565b8252602090810151910152565b805160408084529051602084830181905281516060860181905260009392820191849160808801905b80841015611d4257611d2e828651611cd3565b938201936001939093019290850190611d1b565b509581015196019590955250919392505050565b8051604080845281518482018190526000926060916020918201918388019190865b82811015611dc1578451611d8d858251611cd3565b80830151858901528781015163ffffffff90811688870152908701511660808501529381019360a090930192600101611d78565b509687015197909601969096525093949350505050565b6000610100808352611ded8184018651611cbf565b602085015161012084810152611e07610220850182611cf2565b9050604086015160ff198086840301610140870152611e268383611cf2565b925060608801519150808684030161016087015250611e458282611d56565b915050608086015161018085015260a0860151611e6b6101a086018263ffffffff169052565b5060c086015163ffffffff81166101c08601525060e086015163ffffffff81166101e0860152509085015161020084015290506116d460208301848051825260208101516001600160401b0380825116602085015280602083015116604085015250604081015160608401525060408101516080830152606081015160a083015263ffffffff60808201511660c08301525050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611f3857611f38611f00565b60405290565b604051602081016001600160401b0381118282101715611f3857611f38611f00565b604051608081016001600160401b0381118282101715611f3857611f38611f00565b60405161012081016001600160401b0381118282101715611f3857611f38611f00565b60405160a081016001600160401b0381118282101715611f3857611f38611f00565b604051606081016001600160401b0381118282101715611f3857611f38611f00565b604051601f8201601f191681016001600160401b038111828210171561201157612011611f00565b604052919050565b80356004811061202857600080fd5b919050565b60006001600160401b0382111561204657612046611f00565b5060051b60200190565b60006040828403121561206257600080fd5b61206a611f16565b905081356007811061207b57600080fd5b808252506020820135602082015292915050565b600060408083850312156120a257600080fd5b6120aa611f16565b915082356001600160401b03808211156120c357600080fd5b818501915060208083880312156120d957600080fd5b6120e1611f3e565b8335838111156120f057600080fd5b80850194505087601f85011261210557600080fd5b8335925061211a6121158461202d565b611fe9565b83815260069390931b8401820192828101908985111561213957600080fd5b948301945b8486101561215f576121508a87612050565b8252948601949083019061213e565b8252508552948501359484019490945250909392505050565b803563ffffffff8116811461202857600080fd5b6000604080838503121561219f57600080fd5b6121a7611f16565b915082356001600160401b038111156121bf57600080fd5b8301601f810185136121d057600080fd5b803560206121e06121158361202d565b82815260a092830284018201928282019190898511156121ff57600080fd5b948301945b848610156122685780868b03121561221c5760008081fd5b612224611f60565b61222e8b88612050565b815287870135858201526060612245818901612178565b8983015261225560808901612178565b9082015283529485019491830191612204565b50808752505080860135818601525050505092915050565b6000610120823603121561229357600080fd5b61229b611f82565b6122a483612019565b815260208301356001600160401b03808211156122c057600080fd5b6122cc3683870161208f565b602084015260408501359150808211156122e557600080fd5b6122f13683870161208f565b6040840152606085013591508082111561230a57600080fd5b506123173682860161218c565b6060830152506080830135608082015261233360a08401612178565b60a082015261234460c08401612178565b60c082015261235560e08401612178565b60e082015261010092830135928101929092525090565b80356001600160401b038116811461202857600080fd5b600081830360e081121561239657600080fd5b61239e611fa5565b833581526060601f19830112156123b457600080fd5b6123bc611fc7565b91506123ca6020850161236c565b82526123d86040850161236c565b6020830152606084013560408301528160208201526080840135604082015260a0840135606082015261240d60c08501612178565b6080820152949350505050565b60006020828403121561242c57600080fd5b813561ffff811681146116d457600080fd5b6020808252600d908201526c4241445f43414c4c5f4441544160981b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600063ffffffff80831681851680830382111561249a5761249a612465565b01949350505050565b6020808252601190820152700848288beae929c889eaebe988a9c8ea89607b1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156124f8576124f8612465565b5060010190565b600060ff821660ff81141561251657612516612465565b60010192915050565b60208082526011908201527015d493d391d7d3515492d31157d493d3d5607a1b604082015260600190565b6000821982111561255d5761255d612465565b500190565b60008282101561257457612574612465565b500390565b6000845160005b8181101561259a5760208188018101518583015201612580565b818111156125a9576000828501525b5091909101928352506020820152604001919050565b652b30b63ab29d60d11b81526000600784106125dd576125dd611ca9565b5060f89290921b6006830152600782015260270190565b634e487b7160e01b600052605160045260246000fdfea2646970667358221220b902a6388a562f04c941d5ce1c3185c91f9ee83e272d461c79a1235e019d1fb464736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063da78e7d114610030575b600080fd5b61004361003e366004611bc6565b61005a565b604051610051929190611dd8565b60405180910390f35b610062611a8e565b61006a611b37565b61007387612280565b915061008436879003870187612383565b90506000610095602087018761241a565b9050611b8161ffff82166100ac57506102bd61029f565b61ffff8216600114156100c257506102c861029f565b61ffff8216600f14156100d857506102cf61029f565b61ffff8216601014156100ee57506103fb61029f565b61ffff82166180091415610105575061049561029f565b61ffff821661800a141561011c575061054161029f565b61ffff821660111415610132575061062e61029f565b61ffff821661800314156101495750610a0f61029f565b61ffff821661800414156101605750610a4e61029f565b61ffff8216602014156101765750610aac61029f565b61ffff82166021141561018c5750610aee61029f565b61ffff8216602314156101a25750610b3361029f565b61ffff8216602414156101b85750610b5b61029f565b61ffff821661800214156101cf5750610b8b61029f565b61ffff8216601a14156101e55750610c2861029f565b61ffff8216601b14156101fb5750610c3561029f565b604161ffff8316108015906102155750604461ffff831611155b156102235750610ca461029f565b61ffff8216618005148061023c575061ffff8216618006145b1561024a5750610d9861029f565b61ffff821661800814156102615750610e6b61029f565b60405162461bcd60e51b815260206004820152600e60248201526d494e56414c49445f4f50434f444560901b60448201526064015b60405180910390fd5b6102b084848989898663ffffffff16565b5050965096945050505050565b505060029092525050565b5050505050565b60006102de8660600151610e7a565b9050600481515160068111156102f6576102f6611ca9565b141561031d578560025b9081600381111561031357610313611ca9565b81525050506102c8565b6006815151600681111561033357610333611ca9565b146103795760405162461bcd60e51b8152602060048201526016602482015275494e56414c49445f52455455524e5f50435f5459504560501b6044820152606401610296565b805160209081015190819081901c604082901c606083901c156103d75760405162461bcd60e51b8152602060048201526016602482015275494e56414c49445f52455455524e5f50435f4441544160501b6044820152606401610296565b63ffffffff92831660e08b015290821660c08a01521660a088015250505050505050565b61041261040786610f1a565b602087015190610f7d565b60006104218660600151610f8d565b905061043e6104338260400151610fd9565b602088015190610f7d565b61044e6104338260600151610fd9565b602084013563ffffffff811681146104785760405162461bcd60e51b81526004016102969061243e565b63ffffffff1660c08701525050600060e090940193909352505050565b6104a161040786610f1a565b6104b16104078660a00151610fd9565b6104c16104078560800151610fd9565b6020808401359081901c604082901c1561051d5760405162461bcd60e51b815260206004820152601a60248201527f4241445f43524f53535f4d4f44554c455f43414c4c5f444154410000000000006044820152606401610296565b63ffffffff90811660a08801521660c08601525050600060e0909301929092525050565b61054d61040786610f1a565b61055d6104078660a00151610fd9565b61056d6104078560800151610fd9565b600061057c8660600151610f8d565b9050806060015163ffffffff166000141561059957856002610300565b602084013563ffffffff811681146105f35760405162461bcd60e51b815260206004820152601d60248201527f4241445f43414c4c45525f494e5445524e414c5f43414c4c5f444154410000006044820152606401610296565b604082015163ffffffff1660a0880152606082015161061390829061247b565b63ffffffff1660c08801525050600060e08601525050505050565b600080610646610641886020015161100c565b611031565b90506000806000808060006106676040518060200160405280606081525090565b6106728b8b876110c2565b955093506106818b8b87611129565b90965094506106918b8b87611145565b955092506106a08b8b876110c2565b955091506106af8b8b87611129565b90975094506106bf8b8b8761117b565b6040516d21b0b6361034b73234b932b1ba1d60911b60208201526001600160c01b031960c088901b16602e8201526036810189905290965090915060009060560160408051601f19818403018152919052805160209182012091508d013581146107645760405162461bcd60e51b81526020600482015260166024820152754241445f43414c4c5f494e4449524543545f4441544160501b6044820152606401610296565b61077a826001600160401b03871686868c611255565b90508d6040015181146107c15760405162461bcd60e51b815260206004820152600f60248201526e10905117d51050931154d7d493d3d5608a1b6044820152606401610296565b826001600160401b03168963ffffffff16106107eb57505060028d52506102c89650505050505050565b5050505050600061080c604080518082019091526000808252602082015290565b6040805160208101909152606081526108268a8a86611129565b945092506108358a8a866112f7565b945091506108448a8a8661117b565b9450905060006108618263ffffffff808b1690879087906113f316565b90508681146108a65760405162461bcd60e51b815260206004820152601160248201527010905117d153115351539514d7d493d3d5607a1b6044820152606401610296565b8584146108d6578d60025b908160038111156108c4576108c4611ca9565b815250505050505050505050506102c8565b6004835160068111156108eb576108eb611ca9565b14156108f9578d60026108b1565b60058351600681111561090e5761090e611ca9565b141561096d576020830151985063ffffffff891689146109685760405162461bcd60e51b81526020600482015260156024820152744241445f46554e435f5245465f434f4e54454e545360581b6044820152606401610296565b6109a5565b60405162461bcd60e51b815260206004820152600d60248201526c4241445f454c454d5f5459504560981b6044820152606401610296565b50505050505050506109b961043387610f1a565b60006109c88760600151610f8d565b90506109e56109da8260400151610fd9565b602089015190610f7d565b6109f56109da8260600151610fd9565b5063ffffffff1660c0860152600060e08601525050505050565b602083013563ffffffff81168114610a395760405162461bcd60e51b81526004016102969061243e565b63ffffffff1660e09095019490945250505050565b6000610a60610641876020015161100c565b905063ffffffff811615610aa457602084013563ffffffff81168114610a985760405162461bcd60e51b81526004016102969061243e565b63ffffffff1660e08701525b505050505050565b6000610abb8660600151610f8d565b90506000610ad382602001518660200135868661148d565b6020880151909150610ae59082610f7d565b50505050505050565b6000610afd866020015161100c565b90506000610b0e8760600151610f8d565b9050610b2581602001518660200135848787611525565b602090910152505050505050565b6000610b4985600001518560200135858561148d565b6020870151909150610aa49082610f7d565b6000610b6a866020015161100c565b9050610b8185600001518560200135838686611525565b9094525050505050565b6000610b9a866020015161100c565b90506000610bab876020015161100c565b90506000610bbc886020015161100c565b905060006040518060800160405280838152602001886020013560001b8152602001610be785611031565b63ffffffff168152602001610bfb86611031565b63ffffffff168152509050610c1d818a606001516115bf90919063ffffffff16565b505050505050505050565b610aa4856020015161100c565b6000610c47610641876020015161100c565b90506000610c58876020015161100c565b90506000610c69886020015161100c565b905063ffffffff831615610c8b576020880151610c869082610f7d565b610c9a565b6020880151610c9a9083610f7d565b5050505050505050565b6000610cb3602085018561241a565b9050600061ffff821660411415610ccc57506000610d4f565b61ffff821660421415610ce157506001610d4f565b61ffff821660431415610cf657506002610d4f565b61ffff821660441415610d0b57506003610d4f565b60405162461bcd60e51b8152602060048201526019602482015278434f4e53545f505553485f494e56414c49445f4f50434f444560381b6044820152606401610296565b610ae56040518060400160405280836006811115610d6f57610d6f611ca9565b815260200187602001356001600160401b03168152508860200151610f7d90919063ffffffff16565b6040805180820190915260008082526020820152618005610dbc602086018661241a565b61ffff161415610dea57610dd3866020015161100c565b6040870151909150610de59082610f7d565b610aa4565b618006610dfa602086018661241a565b61ffff161415610e2357610e11866040015161100c565b6020870151909150610de59082610f7d565b60405162461bcd60e51b815260206004820152601c60248201527f4d4f56455f494e5445524e414c5f494e56414c49445f4f50434f4445000000006044820152606401610296565b6000610b4986602001516116a6565b610e82611b8b565b815151600114610ea45760405162461bcd60e51b8152600401610296906124a3565b81518051600090610eb757610eb76124ce565b6020026020010151905060006001600160401b03811115610eda57610eda611f00565b604051908082528060200260200182016040528015610f1357816020015b610f00611b8b565b815260200190600190039081610ef85790505b5090915290565b604080518082018252600080825260209182015260e083015160c084015160a090940151835180850185526006815263ffffffff90921694831b67ffffffff0000000016949094179390921b63ffffffff60401b16929092179181019190915290565b8151610f8990826116db565b5050565b610f95611b8b565b815151600114610fb75760405162461bcd60e51b8152600401610296906124a3565b81518051600090610fca57610fca6124ce565b60200260200101519050919050565b604080518082019091526000808252602082015250604080518082019091526000815263ffffffff909116602082015290565b6040805180820190915260008082526020820152815161102b906117a4565b92915050565b6020810151600090818351600681111561104d5761104d611ca9565b146110845760405162461bcd60e51b81526020600482015260076024820152662727aa2fa4999960c91b6044820152606401610296565b640100000000811061102b5760405162461bcd60e51b81526020600482015260076024820152662120a22fa4999960c91b6044820152606401610296565b600081815b6008811015611120576008836001600160401b0316901b92508585838181106110f2576110f26124ce565b919091013560f81c9390931792508161110a816124e4565b9250508080611118906124e4565b9150506110c7565b50935093915050565b600081816111388686846118ad565b9097909650945050505050565b60008184848281811061115a5761115a6124ce565b919091013560f81c9250819050611170816124e4565b915050935093915050565b604080516020810190915260608152816000611198868684611145565b92509050600060ff82166001600160401b038111156111b9576111b9611f00565b6040519080825280602002602001820160405280156111e2578160200160208202803683370190505b50905060005b8260ff168160ff16101561123957611201888886611129565b838360ff1681518110611216576112166124ce565b602002602001018196508281525050508080611231906124ff565b9150506111e8565b5060405180602001604052808281525093505050935093915050565b604051652a30b136329d60d11b60208201526001600160f81b031960f885901b1660268201526001600160c01b031960c084901b166027820152602f81018290526000908190604f016040516020818303038152906040528051906020012090506112ec878783604051806040016040528060128152602001712a30b136329036b2b935b632903a3932b29d60711b815250611902565b979650505050505050565b6040805180820190915260008082526020820152816000858583818110611320576113206124ce565b919091013560f81c9150829050611336816124e4565b925050611341600690565b600681111561135257611352611ca9565b60ff168160ff1611156113985760405162461bcd60e51b815260206004820152600e60248201526d4241445f56414c55455f5459504560901b6044820152606401610296565b60006113a58787856118ad565b809450819250505060405180604001604052808360ff1660068111156113cd576113cd611ca9565b60068111156113de576113de611ca9565b81526020018281525093505050935093915050565b60008083611400846119d4565b6040516d2a30b136329032b632b6b2b73a1d60911b6020820152602e810192909252604e820152606e016040516020818303038152906040528051906020012090506114838686836040518060400160405280601a81526020017f5461626c6520656c656d656e74206d65726b6c6520747265653a000000000000815250611902565b9695505050505050565b604080518082019091526000808252602082015260006114bd604080518082019091526000808252602082015290565b6040805160208101909152606081526114d78686856112f7565b935091506114e686868561117b565b9350905060006114f7828985611a0e565b90508881146115185760405162461bcd60e51b81526004016102969061251f565b5090979650505050505050565b6000611541604080518082019091526000808252602082015290565b60006115596040518060200160405280606081525090565b6115648686846112f7565b909350915061157486868461117b565b925090506000611585828a86611a0e565b90508981146115a65760405162461bcd60e51b81526004016102969061251f565b6115b1828a8a611a0e565b9a9950505050505050505050565b8151516000906115d090600161254a565b6001600160401b038111156115e7576115e7611f00565b60405190808252806020026020018201604052801561162057816020015b61160d611b8b565b8152602001906001900390816116055790505b50905060005b83515181101561167c578351805182908110611644576116446124ce565b602002602001015182828151811061165e5761165e6124ce565b60200260200101819052508080611674906124e4565b915050611626565b50818184600001515181518110611695576116956124ce565b602090810291909101015290915250565b6040805180820190915260008082526020820152815151516116d46116cc600183612562565b845190611a56565b9392505050565b8151516000906116ec90600161254a565b6001600160401b0381111561170357611703611f00565b60405190808252806020026020018201604052801561174857816020015b60408051808201909152600080825260208201528152602001906001900390816117215790505b50905060005b83515181101561167c57835180518290811061176c5761176c6124ce565b6020026020010151828281518110611786576117866124ce565b6020026020010181905250808061179c906124e4565b91505061174e565b6040805180820190915260008082526020820152815180516117c890600190612562565b815181106117d8576117d86124ce565b60200260200101519050600060018360000151516117f69190612562565b6001600160401b0381111561180d5761180d611f00565b60405190808252806020026020018201604052801561185257816020015b604080518082019091526000808252602082015281526020019060019003908161182b5790505b50905060005b8151811015610f13578351805182908110611875576118756124ce565b602002602001015182828151811061188f5761188f6124ce565b602002602001018190525080806118a5906124e4565b915050611858565b600081815b602081101561112057600883901b92508585838181106118d4576118d46124ce565b919091013560f81c939093179250816118ec816124e4565b92505080806118fa906124e4565b9150506118b2565b8160005b8551518110156119cb576001851661196757828287600001518381518110611930576119306124ce565b602002602001015160405160200161194a93929190612579565b6040516020818303038152906040528051906020012091506119b2565b828660000151828151811061197e5761197e6124ce565b60200260200101518360405160200161199993929190612579565b6040516020818303038152906040528051906020012091505b60019490941c93806119c3816124e4565b915050611906565b50949350505050565b6000816000015182602001516040516020016119f19291906125bf565b604051602081830303815290604052805190602001209050919050565b6000611a4e8484611a1e856119d4565b604051806040016040528060128152602001712b30b63ab29036b2b935b632903a3932b29d60711b815250611902565b949350505050565b60408051808201909152600080825260208201528251805183908110611a7e57611a7e6124ce565b6020026020010151905092915050565b6040805161012081019091528060008152602001611ac360408051606080820183529181019182529081526000602082015290565b8152602001611ae960408051606080820183529181019182529081526000602082015290565b8152602001611b0e604051806040016040528060608152602001600080191681525090565b815260006020820181905260408201819052606082018190526080820181905260a09091015290565b6040805160a0810182526000808252825160608101845281815260208181018390529381019190915290918201905b81526000602082018190526040820181905260609091015290565b611b896125f4565b565b6040805160c0810190915260006080820181815260a08301919091528190611b66565b600060408284031215611bc057600080fd5b50919050565b6000806000806000808688036101a0811215611be157600080fd5b611beb8989611bae565b965060408801356001600160401b0380821115611c0757600080fd5b90890190610120828c031215611c1c57600080fd5b81975060e0605f1984011215611c3157600080fd5b60608a019650611c458b6101408c01611bae565b95506101808a0135925080831115611c5c57600080fd5b828a0192508a601f840112611c7057600080fd5b8235915080821115611c8157600080fd5b50896020828401011115611c9457600080fd5b60208201935080925050509295509295509295565b634e487b7160e01b600052602160045260246000fd5b60048110611ccf57611ccf611ca9565b9052565b805160078110611ce557611ce5611ca9565b8252602090810151910152565b805160408084529051602084830181905281516060860181905260009392820191849160808801905b80841015611d4257611d2e828651611cd3565b938201936001939093019290850190611d1b565b509581015196019590955250919392505050565b8051604080845281518482018190526000926060916020918201918388019190865b82811015611dc1578451611d8d858251611cd3565b80830151858901528781015163ffffffff90811688870152908701511660808501529381019360a090930192600101611d78565b509687015197909601969096525093949350505050565b6000610100808352611ded8184018651611cbf565b602085015161012084810152611e07610220850182611cf2565b9050604086015160ff198086840301610140870152611e268383611cf2565b925060608801519150808684030161016087015250611e458282611d56565b915050608086015161018085015260a0860151611e6b6101a086018263ffffffff169052565b5060c086015163ffffffff81166101c08601525060e086015163ffffffff81166101e0860152509085015161020084015290506116d460208301848051825260208101516001600160401b0380825116602085015280602083015116604085015250604081015160608401525060408101516080830152606081015160a083015263ffffffff60808201511660c08301525050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611f3857611f38611f00565b60405290565b604051602081016001600160401b0381118282101715611f3857611f38611f00565b604051608081016001600160401b0381118282101715611f3857611f38611f00565b60405161012081016001600160401b0381118282101715611f3857611f38611f00565b60405160a081016001600160401b0381118282101715611f3857611f38611f00565b604051606081016001600160401b0381118282101715611f3857611f38611f00565b604051601f8201601f191681016001600160401b038111828210171561201157612011611f00565b604052919050565b80356004811061202857600080fd5b919050565b60006001600160401b0382111561204657612046611f00565b5060051b60200190565b60006040828403121561206257600080fd5b61206a611f16565b905081356007811061207b57600080fd5b808252506020820135602082015292915050565b600060408083850312156120a257600080fd5b6120aa611f16565b915082356001600160401b03808211156120c357600080fd5b818501915060208083880312156120d957600080fd5b6120e1611f3e565b8335838111156120f057600080fd5b80850194505087601f85011261210557600080fd5b8335925061211a6121158461202d565b611fe9565b83815260069390931b8401820192828101908985111561213957600080fd5b948301945b8486101561215f576121508a87612050565b8252948601949083019061213e565b8252508552948501359484019490945250909392505050565b803563ffffffff8116811461202857600080fd5b6000604080838503121561219f57600080fd5b6121a7611f16565b915082356001600160401b038111156121bf57600080fd5b8301601f810185136121d057600080fd5b803560206121e06121158361202d565b82815260a092830284018201928282019190898511156121ff57600080fd5b948301945b848610156122685780868b03121561221c5760008081fd5b612224611f60565b61222e8b88612050565b815287870135858201526060612245818901612178565b8983015261225560808901612178565b9082015283529485019491830191612204565b50808752505080860135818601525050505092915050565b6000610120823603121561229357600080fd5b61229b611f82565b6122a483612019565b815260208301356001600160401b03808211156122c057600080fd5b6122cc3683870161208f565b602084015260408501359150808211156122e557600080fd5b6122f13683870161208f565b6040840152606085013591508082111561230a57600080fd5b506123173682860161218c565b6060830152506080830135608082015261233360a08401612178565b60a082015261234460c08401612178565b60c082015261235560e08401612178565b60e082015261010092830135928101929092525090565b80356001600160401b038116811461202857600080fd5b600081830360e081121561239657600080fd5b61239e611fa5565b833581526060601f19830112156123b457600080fd5b6123bc611fc7565b91506123ca6020850161236c565b82526123d86040850161236c565b6020830152606084013560408301528160208201526080840135604082015260a0840135606082015261240d60c08501612178565b6080820152949350505050565b60006020828403121561242c57600080fd5b813561ffff811681146116d457600080fd5b6020808252600d908201526c4241445f43414c4c5f4441544160981b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600063ffffffff80831681851680830382111561249a5761249a612465565b01949350505050565b6020808252601190820152700848288beae929c889eaebe988a9c8ea89607b1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156124f8576124f8612465565b5060010190565b600060ff821660ff81141561251657612516612465565b60010192915050565b60208082526011908201527015d493d391d7d3515492d31157d493d3d5607a1b604082015260600190565b6000821982111561255d5761255d612465565b500190565b60008282101561257457612574612465565b500390565b6000845160005b8181101561259a5760208188018101518583015201612580565b818111156125a9576000828501525b5091909101928352506020820152604001919050565b652b30b63ab29d60d11b81526000600784106125dd576125dd611ca9565b5060f89290921b6006830152600782015260270190565b634e487b7160e01b600052605160045260246000fdfea2646970667358221220b902a6388a562f04c941d5ce1c3185c91f9ee83e272d461c79a1235e019d1fb464736f6c63430008090033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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