ETH Price: $3,489.42 (-1.04%)
Gas: 12 Gwei

Contract

0x5D3c0F4cA5EE99f8E8F59Ff9A5fAb04F6a7e007f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x60806040122837672021-04-21 13:17:441148 days ago1619011064IN
 Create: TransitionDisputer
0 ETH0.24945004138

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

Contract Source Code Verified (Exact Match)

Contract Name:
TransitionDisputer

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion, MIT license
File 1 of 11 : TransitionDisputer.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/math/SafeMath.sol";

import {DataTypes as dt} from "./libraries/DataTypes.sol";
import "./libraries/MerkleTree.sol";
import "./libraries/Transitions.sol";
import "./TransitionEvaluator.sol";
import "./Registry.sol";

contract TransitionDisputer {
    // state root of empty strategy set and empty account set
    bytes32 public constant INIT_TRANSITION_STATE_ROOT =
        bytes32(0xcf277fb80a82478460e8988570b718f1e083ceb76f7e271a1a1497e5975f53ae);

    using SafeMath for uint256;

    TransitionEvaluator transitionEvaluator;

    constructor(TransitionEvaluator _transitionEvaluator) {
        transitionEvaluator = _transitionEvaluator;
    }

    /**********************
     * External Functions *
     **********************/

    /**
     * @notice Dispute a transition.
     *
     * @param _prevTransitionProof The inclusion proof of the transition immediately before the disputed transition.
     * @param _invalidTransitionProof The inclusion proof of the disputed transition.
     * @param _accountProof The inclusion proof of the account involved.
     * @param _strategyProof The inclusion proof of the strategy involved.
     * @param _prevTransitionBlock The block containing the previous transition.
     * @param _invalidTransitionBlock The block containing the disputed transition.
     * @param _registry The address of the Registry contract.
     *
     * @return reason of the transition being determined as invalid
     */
    function disputeTransition(
        dt.TransitionProof calldata _prevTransitionProof,
        dt.TransitionProof calldata _invalidTransitionProof,
        dt.AccountProof calldata _accountProof,
        dt.StrategyProof calldata _strategyProof,
        dt.Block calldata _prevTransitionBlock,
        dt.Block calldata _invalidTransitionBlock,
        Registry _registry
    ) external returns (string memory) {
        if (_invalidTransitionProof.blockId == 0 && _invalidTransitionProof.index == 0) {
            require(_invalidInitTransition(_invalidTransitionProof, _invalidTransitionBlock), "no fraud detected");
            return "invalid init transition";
        }

        // ------ #1: verify sequential transitions
        // First verify that the transitions are sequential and in their respective block root hashes.
        _verifySequentialTransitions(
            _prevTransitionProof,
            _invalidTransitionProof,
            _prevTransitionBlock,
            _invalidTransitionBlock
        );

        // ------ #2: decode transitions to get post- and pre-StateRoot, and ids of account and strategy
        (bool ok, bytes32 preStateRoot, bytes32 postStateRoot, uint32 accountId, uint32 strategyId) =
            _getStateRootsAndIds(_prevTransitionProof.transition, _invalidTransitionProof.transition);
        // If not success something went wrong with the decoding...
        if (!ok) {
            // revert the block if it has an incorrectly encoded transition!
            return "invalid encoding";
        }

        // ------ #3: verify transition stateRoot == hash(accountStateRoot, strategyStateRoot)
        // The account and strategy stateRoots must always be given irrespective of what is being disputed.
        require(
            _checkTwoTreeStateRoot(preStateRoot, _accountProof.stateRoot, _strategyProof.stateRoot),
            "Failed combined two-tree stateRoot verification check"
        );

        // ------ #4: verify account and strategy inclusion
        if (accountId > 0) {
            _verifyProofInclusion(
                _accountProof.stateRoot,
                keccak256(_getAccountInfoBytes(_accountProof.value)),
                _accountProof.index,
                _accountProof.siblings
            );
        }
        if (strategyId > 0) {
            _verifyProofInclusion(
                _strategyProof.stateRoot,
                keccak256(_getStrategyInfoBytes(_strategyProof.value)),
                _strategyProof.index,
                _strategyProof.siblings
            );
        }

        // ------ #5: verify deposit account id mapping
        uint8 transitionType = Transitions.extractTransitionType(_invalidTransitionProof.transition);
        if (transitionType == Transitions.TRANSITION_TYPE_DEPOSIT) {
            DataTypes.DepositTransition memory transition =
                Transitions.decodeDepositTransition(_invalidTransitionProof.transition);
            if (_accountProof.value.account == transition.account && _accountProof.value.accountId != accountId) {
                // same account address with different id
                return "invalid account id";
            }
        }

        // ------ #6: verify transition account and strategy indexes
        if (accountId > 0) {
            require(_accountProof.index == accountId, "Supplied account index is incorrect");
        }
        if (strategyId > 0) {
            require(_strategyProof.index == strategyId, "Supplied strategy index is incorrect");
        }

        // ------ #7: evaluate transition and verify new state root
        // split function to address "stack too deep" compiler error
        return
            _evaluateInvalidTransition(
                _invalidTransitionProof.transition,
                _accountProof,
                _strategyProof,
                postStateRoot,
                _registry
            );
    }

    /*********************
     * Private Functions *
     *********************/

    /**
     * @notice Evaluate a disputed transition
     * @dev This was split from the disputeTransition function to address "stack too deep" compiler error
     *
     * @param _invalidTransition The disputed transition.
     * @param _accountProof The inclusion proof of the account involved.
     * @param _strategyProof The inclusion proof of the strategy involved.
     * @param _postStateRoot State root of the disputed transition.
     * @param _registry The address of the Registry contract.
     */
    function _evaluateInvalidTransition(
        bytes calldata _invalidTransition,
        dt.AccountProof calldata _accountProof,
        dt.StrategyProof calldata _strategyProof,
        bytes32 _postStateRoot,
        Registry _registry
    ) private returns (string memory) {
        // Apply the transaction and verify the state root after that.
        bool ok;
        bytes memory returnData;
        // Make the external call
        (ok, returnData) = address(transitionEvaluator).call(
            abi.encodeWithSelector(
                transitionEvaluator.evaluateTransition.selector,
                _invalidTransition,
                _accountProof.value,
                _strategyProof.value,
                _registry
            )
        );
        // Check if it was successful. If not, we've got to revert.
        if (!ok) {
            return "failed to evaluate";
        }
        // It was successful so let's decode the outputs to get the new leaf nodes we'll have to insert
        bytes32[2] memory outputs = abi.decode((returnData), (bytes32[2]));

        // Check if the combined new stateRoots of account and strategy Merkle trees is incorrect.
        ok = _updateAndVerify(_postStateRoot, outputs, _accountProof, _strategyProof);
        if (!ok) {
            // revert the block because we found an invalid post state root
            return "invalid post-state root";
        }

        revert("No fraud detected");
    }

    /**
     * @notice Get state roots, account id, and strategy id of the disputed transition.
     *
     * @param _preStateTransition transition immediately before the disputed transition
     * @param _invalidTransition the disputed transition
     */
    function _getStateRootsAndIds(bytes memory _preStateTransition, bytes memory _invalidTransition)
        private
        returns (
            bool,
            bytes32,
            bytes32,
            uint32,
            uint32
        )
    {
        bool success;
        bytes memory returnData;
        bytes32 preStateRoot;
        bytes32 postStateRoot;
        uint32 accountId;
        uint32 strategyId;

        // First decode the prestate root
        (success, returnData) = address(transitionEvaluator).call(
            abi.encodeWithSelector(transitionEvaluator.getTransitionStateRootAndAccessIds.selector, _preStateTransition)
        );

        // Make sure the call was successful
        require(success, "If the preStateRoot is invalid, then prove that invalid instead");
        (preStateRoot, , ) = abi.decode((returnData), (bytes32, uint32, uint32));

        // Now that we have the prestateRoot, let's decode the postState
        (success, returnData) = address(transitionEvaluator).call(
            abi.encodeWithSelector(TransitionEvaluator.getTransitionStateRootAndAccessIds.selector, _invalidTransition)
        );

        // If the call was successful let's decode!
        if (success) {
            (postStateRoot, accountId, strategyId) = abi.decode((returnData), (bytes32, uint32, uint32));
        }
        return (success, preStateRoot, postStateRoot, accountId, strategyId);
    }

    /**
     * @notice Evaluate if the init transition of the first block is invalid
     *
     * @param _initTransitionProof The inclusion proof of the disputed initial transition.
     * @param _firstBlock The first rollup block
     */
    function _invalidInitTransition(dt.TransitionProof calldata _initTransitionProof, dt.Block calldata _firstBlock)
        private
        returns (bool)
    {
        require(_checkTransitionInclusion(_initTransitionProof, _firstBlock), "transition not included in block");
        (bool success, bytes memory returnData) =
            address(transitionEvaluator).call(
                abi.encodeWithSelector(
                    TransitionEvaluator.getTransitionStateRootAndAccessIds.selector,
                    _initTransitionProof.transition
                )
            );
        if (!success) {
            return true; // transition is invalid
        }
        (bytes32 postStateRoot, , ) = abi.decode((returnData), (bytes32, uint32, uint32));

        // Transition is invalid if stateRoot not match the expected init root
        // It's OK that other fields of the transition are incorrect.
        return postStateRoot != INIT_TRANSITION_STATE_ROOT;
    }

    /**
     * @notice Get the bytes value for this account.
     *
     * @param _accountInfo Account info
     */
    function _getAccountInfoBytes(dt.AccountInfo memory _accountInfo) private pure returns (bytes memory) {
        // If it's an empty storage slot, return 32 bytes of zeros (empty value)
        if (
            _accountInfo.account == address(0) &&
            _accountInfo.accountId == 0 &&
            _accountInfo.idleAssets.length == 0 &&
            _accountInfo.stTokens.length == 0 &&
            _accountInfo.timestamp == 0
        ) {
            return abi.encodePacked(uint256(0));
        }
        // Here we don't use `abi.encode([struct])` because it's not clear
        // how to generate that encoding client-side.
        return
            abi.encode(
                _accountInfo.account,
                _accountInfo.accountId,
                _accountInfo.idleAssets,
                _accountInfo.stTokens,
                _accountInfo.timestamp
            );
    }

    /**
     * @notice Get the bytes value for this strategy.
     * @param _strategyInfo Strategy info
     */
    function _getStrategyInfoBytes(dt.StrategyInfo memory _strategyInfo) private pure returns (bytes memory) {
        // If it's an empty storage slot, return 32 bytes of zeros (empty value)
        if (
            _strategyInfo.assetId == 0 &&
            _strategyInfo.assetBalance == 0 &&
            _strategyInfo.stTokenSupply == 0 &&
            _strategyInfo.pendingCommitAmount == 0 &&
            _strategyInfo.pendingUncommitAmount == 0
        ) {
            return abi.encodePacked(uint256(0));
        }
        // Here we don't use `abi.encode([struct])` because it's not clear
        // how to generate that encoding client-side.
        return
            abi.encode(
                _strategyInfo.assetId,
                _strategyInfo.assetBalance,
                _strategyInfo.stTokenSupply,
                _strategyInfo.pendingCommitAmount,
                _strategyInfo.pendingUncommitAmount
            );
    }

    /**
     * @notice Verifies that two transitions were included one after another.
     * @dev This is used to make sure we are comparing the correct prestate & poststate.
     */
    function _verifySequentialTransitions(
        dt.TransitionProof calldata _tp0,
        dt.TransitionProof calldata _tp1,
        dt.Block calldata _prevTransitionBlock,
        dt.Block calldata _invalidTransitionBlock
    ) private pure returns (bool) {
        // Start by checking if they are in the same block
        if (_tp0.blockId == _tp1.blockId) {
            // If the blocknumber is the same, check that tp0 precedes tp1
            require(_tp0.index + 1 == _tp1.index, "Transitions must be sequential");
            require(_tp1.index < _invalidTransitionBlock.blockSize, "_tp1 outside block range");
        } else {
            // If not in the same block, check that:
            // 0) the blocks are one after another
            require(_tp0.blockId + 1 == _tp1.blockId, "Blocks must be sequential or equal");

            // 1) the index of tp0 is the last in its block
            require(_tp0.index == _prevTransitionBlock.blockSize - 1, "_tp0 must be last in its block");

            // 2) the index of tp1 is the first in its block
            require(_tp1.index == 0, "_tp1 must be first in its block");
        }

        // Verify inclusion
        require(_checkTransitionInclusion(_tp0, _prevTransitionBlock), "_tp0 must be included in its block");
        require(_checkTransitionInclusion(_tp1, _invalidTransitionBlock), "_tp1 must be included in its block");

        return true;
    }

    /**
     * @notice Check to see if a transition is included in the block.
     */
    function _checkTransitionInclusion(dt.TransitionProof memory _tp, dt.Block memory _block)
        private
        pure
        returns (bool)
    {
        bytes32 rootHash = _block.rootHash;
        bytes32 leafHash = keccak256(_tp.transition);
        return MerkleTree.verify(rootHash, leafHash, _tp.index, _tp.siblings);
    }

    /**
     * @notice Check if the combined stateRoot of the two Merkle trees (account, strategy) matches the stateRoot.
     */
    function _checkTwoTreeStateRoot(
        bytes32 _stateRoot,
        bytes32 _accountStateRoot,
        bytes32 _strategyStateRoot
    ) private pure returns (bool) {
        bytes32 newStateRoot = keccak256(abi.encodePacked(_accountStateRoot, _strategyStateRoot));
        return (_stateRoot == newStateRoot);
    }

    /**
     * @notice Check if an account or strategy proof is included in the state root.
     */
    function _verifyProofInclusion(
        bytes32 _stateRoot,
        bytes32 _leafHash,
        uint32 _index,
        bytes32[] memory _siblings
    ) private pure {
        bool ok = MerkleTree.verify(_stateRoot, _leafHash, _index, _siblings);
        require(ok, "Failed proof inclusion verification check");
    }

    /**
     * @notice Update the account and strategy Merkle trees with their new leaf nodes and check validity.
     */
    function _updateAndVerify(
        bytes32 _stateRoot,
        bytes32[2] memory _leafHashes,
        dt.AccountProof memory _accountProof,
        dt.StrategyProof memory _strategyProof
    ) private pure returns (bool) {
        if (_leafHashes[0] == bytes32(0) && _leafHashes[1] == bytes32(0)) {
            return false;
        }

        // If there is an account update, compute its new Merkle tree root.
        bytes32 accountStateRoot = _accountProof.stateRoot;
        if (_leafHashes[0] != bytes32(0)) {
            accountStateRoot = MerkleTree.computeRoot(_leafHashes[0], _accountProof.index, _accountProof.siblings);
        }

        // If there is a strategy update, compute its new Merkle tree root.
        bytes32 strategyStateRoot = _strategyProof.stateRoot;
        if (_leafHashes[1] != bytes32(0)) {
            strategyStateRoot = MerkleTree.computeRoot(_leafHashes[1], _strategyProof.index, _strategyProof.siblings);
        }

        return _checkTwoTreeStateRoot(_stateRoot, accountStateRoot, strategyStateRoot);
    }
}

File 2 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

File 3 of 11 : ECDSA.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // Check the signature length
        if (signature.length != 65) {
            revert("ECDSA: invalid signature length");
        }

        // Divide the signature in r, s and v variables
        bytes32 r;
        bytes32 s;
        uint8 v;

        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }

        return recover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
        require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * replicates the behavior of the
     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
     * JSON-RPC method.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }
}

File 4 of 11 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 5 of 11 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 6 of 11 : Registry.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";

contract Registry is Ownable {
    // Map asset addresses to indexes.
    mapping(address => uint32) public assetAddressToIndex;
    mapping(uint32 => address) public assetIndexToAddress;
    uint32 numAssets = 0;

    // Valid strategies.
    mapping(address => uint32) public strategyAddressToIndex;
    mapping(uint32 => address) public strategyIndexToAddress;
    uint32 numStrategies = 0;

    event AssetRegistered(address asset, uint32 assetId);
    event StrategyRegistered(address strategy, uint32 strategyId);
    event StrategyUpdated(address previousStrategy, address newStrategy, uint32 strategyId);

    /**
     * @notice Register a asset
     * @param _asset The asset token address;
     */
    function registerAsset(address _asset) external onlyOwner {
        require(_asset != address(0), "Invalid asset");
        require(assetAddressToIndex[_asset] == 0, "Asset already registered");

        // Register asset with an index >= 1 (zero is reserved).
        numAssets++;
        assetAddressToIndex[_asset] = numAssets;
        assetIndexToAddress[numAssets] = _asset;

        emit AssetRegistered(_asset, numAssets);
    }

    /**
     * @notice Register a strategy
     * @param _strategy The strategy contract address;
     */
    function registerStrategy(address _strategy) external onlyOwner {
        require(_strategy != address(0), "Invalid strategy");
        require(strategyAddressToIndex[_strategy] == 0, "Strategy already registered");

        // Register strategy with an index >= 1 (zero is reserved).
        numStrategies++;
        strategyAddressToIndex[_strategy] = numStrategies;
        strategyIndexToAddress[numStrategies] = _strategy;

        emit StrategyRegistered(_strategy, numStrategies);
    }

    /**
     * @notice Update the address of an existing strategy
     * @param _strategy The strategy contract address;
     * @param _strategyId The strategy ID;
     */
    function updateStrategy(address _strategy, uint32 _strategyId) external onlyOwner {
        require(_strategy != address(0), "Invalid strategy");
        require(strategyIndexToAddress[_strategyId] != address(0), "Strategy doesn't exist");

        address previousStrategy = strategyIndexToAddress[_strategyId];
        strategyAddressToIndex[previousStrategy] = 0;
        strategyAddressToIndex[_strategy] = _strategyId;
        strategyIndexToAddress[_strategyId] = _strategy;

        emit StrategyUpdated(previousStrategy, _strategy, _strategyId);
    }
}

File 7 of 11 : TransitionEvaluator.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/cryptography/ECDSA.sol";

/* Internal Imports */
import "./libraries/DataTypes.sol";
import "./libraries/Transitions.sol";
import "./Registry.sol";
import "./strategies/interfaces/IStrategy.sol";

contract TransitionEvaluator {
    using SafeMath for uint256;

    /**********************
     * External Functions *
     **********************/

    /**
     * @notice Evaluate a transition.
     *
     * @param _transition The disputed transition.
     * @param _accountInfo The involved account from the previous transition.
     * @param _strategyInfo The involved strategy from the previous transition.
     * @param _registry The address of the Registry contract.
     * @return hashes of account and strategy after applying the transition.
     */
    function evaluateTransition(
        bytes calldata _transition,
        DataTypes.AccountInfo calldata _accountInfo,
        DataTypes.StrategyInfo calldata _strategyInfo,
        Registry _registry
    ) external view returns (bytes32[2] memory) {
        // Extract the transition type
        uint8 transitionType = Transitions.extractTransitionType(_transition);
        bytes32[2] memory outputs;
        DataTypes.AccountInfo memory updatedAccountInfo;
        DataTypes.StrategyInfo memory updatedStrategyInfo;
        // Apply the transition and record the resulting storage slots
        if (transitionType == Transitions.TRANSITION_TYPE_DEPOSIT) {
            DataTypes.DepositTransition memory deposit = Transitions.decodeDepositTransition(_transition);
            updatedAccountInfo = _applyDepositTransition(deposit, _accountInfo);
            outputs[0] = _getAccountInfoHash(updatedAccountInfo);
        } else if (transitionType == Transitions.TRANSITION_TYPE_WITHDRAW) {
            DataTypes.WithdrawTransition memory withdraw = Transitions.decodeWithdrawTransition(_transition);
            updatedAccountInfo = _applyWithdrawTransition(withdraw, _accountInfo);
            outputs[0] = _getAccountInfoHash(updatedAccountInfo);
        } else if (transitionType == Transitions.TRANSITION_TYPE_COMMIT) {
            DataTypes.CommitTransition memory commit = Transitions.decodeCommitTransition(_transition);
            (updatedAccountInfo, updatedStrategyInfo) = _applyCommitTransition(
                commit,
                _accountInfo,
                _strategyInfo,
                _registry
            );
            outputs[0] = _getAccountInfoHash(updatedAccountInfo);
            outputs[1] = _getStrategyInfoHash(updatedStrategyInfo);
        } else if (transitionType == Transitions.TRANSITION_TYPE_UNCOMMIT) {
            DataTypes.UncommitTransition memory uncommit = Transitions.decodeUncommitTransition(_transition);
            (updatedAccountInfo, updatedStrategyInfo) = _applyUncommitTransition(uncommit, _accountInfo, _strategyInfo);
            outputs[0] = _getAccountInfoHash(updatedAccountInfo);
            outputs[1] = _getStrategyInfoHash(updatedStrategyInfo);
        } else if (transitionType == Transitions.TRANSITION_TYPE_SYNC_COMMITMENT) {
            DataTypes.CommitmentSyncTransition memory commitmentSync =
                Transitions.decodeCommitmentSyncTransition(_transition);
            updatedStrategyInfo = _applyCommitmentSyncTransition(commitmentSync, _strategyInfo);
            outputs[1] = _getStrategyInfoHash(updatedStrategyInfo);
        } else if (transitionType == Transitions.TRANSITION_TYPE_SYNC_BALANCE) {
            DataTypes.BalanceSyncTransition memory balanceSync = Transitions.decodeBalanceSyncTransition(_transition);
            updatedStrategyInfo = _applyBalanceSyncTransition(balanceSync, _strategyInfo);
            outputs[1] = _getStrategyInfoHash(updatedStrategyInfo);
        } else {
            revert("Transition type not recognized");
        }
        return outputs;
    }

    /**
     * @notice Return the (stateRoot, accountId, strategyId) for this transition.
     */
    function getTransitionStateRootAndAccessIds(bytes calldata _rawTransition)
        external
        pure
        returns (
            bytes32,
            uint32,
            uint32
        )
    {
        // Initialize memory rawTransition
        bytes memory rawTransition = _rawTransition;
        // Initialize stateRoot and account and strategy IDs.
        bytes32 stateRoot;
        uint32 accountId;
        uint32 strategyId;
        uint8 transitionType = Transitions.extractTransitionType(rawTransition);
        if (transitionType == Transitions.TRANSITION_TYPE_DEPOSIT) {
            DataTypes.DepositTransition memory transition = Transitions.decodeDepositTransition(rawTransition);
            stateRoot = transition.stateRoot;
            accountId = transition.accountId;
        } else if (transitionType == Transitions.TRANSITION_TYPE_WITHDRAW) {
            DataTypes.WithdrawTransition memory transition = Transitions.decodeWithdrawTransition(rawTransition);
            stateRoot = transition.stateRoot;
            accountId = transition.accountId;
        } else if (transitionType == Transitions.TRANSITION_TYPE_COMMIT) {
            DataTypes.CommitTransition memory transition = Transitions.decodeCommitTransition(rawTransition);
            stateRoot = transition.stateRoot;
            accountId = transition.accountId;
            strategyId = transition.strategyId;
        } else if (transitionType == Transitions.TRANSITION_TYPE_UNCOMMIT) {
            DataTypes.UncommitTransition memory transition = Transitions.decodeUncommitTransition(rawTransition);
            stateRoot = transition.stateRoot;
            accountId = transition.accountId;
            strategyId = transition.strategyId;
        } else if (transitionType == Transitions.TRANSITION_TYPE_SYNC_COMMITMENT) {
            DataTypes.CommitmentSyncTransition memory transition =
                Transitions.decodeCommitmentSyncTransition(rawTransition);
            stateRoot = transition.stateRoot;
            strategyId = transition.strategyId;
        } else if (transitionType == Transitions.TRANSITION_TYPE_SYNC_BALANCE) {
            DataTypes.BalanceSyncTransition memory transition = Transitions.decodeBalanceSyncTransition(rawTransition);
            stateRoot = transition.stateRoot;
            strategyId = transition.strategyId;
        } else if (transitionType == Transitions.TRANSITION_TYPE_INIT) {
            DataTypes.InitTransition memory transition = Transitions.decodeInitTransition(rawTransition);
            stateRoot = transition.stateRoot;
        } else {
            revert("Transition type not recognized");
        }
        return (stateRoot, accountId, strategyId);
    }

    /*********************
     * Private Functions *
     *********************/

    /**
     * @notice Apply a DepositTransition.
     *
     * @param _transition The disputed transition.
     * @param _accountInfo The involved account from the previous transition.
     * @return new account info after apply the disputed transition
     */
    function _applyDepositTransition(
        DataTypes.DepositTransition memory _transition,
        DataTypes.AccountInfo memory _accountInfo
    ) private pure returns (DataTypes.AccountInfo memory) {
        if (_accountInfo.account == address(0)) {
            // first time deposit of this account
            require(_accountInfo.accountId == 0, "empty account id must be zero");
            require(_accountInfo.idleAssets.length == 0, "empty account idleAssets must be empty");
            require(_accountInfo.stTokens.length == 0, "empty account stTokens must be empty");
            require(_accountInfo.timestamp == 0, "empty account timestamp must be zero");
            _accountInfo.account = _transition.account;
            _accountInfo.accountId = _transition.accountId;
        } else {
            require(_accountInfo.account == _transition.account, "account address not match");
            require(_accountInfo.accountId == _transition.accountId, "account id not match");
        }
        if (_transition.assetId >= _accountInfo.idleAssets.length) {
            uint256[] memory idleAssets = new uint256[](_transition.assetId + 1);
            for (uint256 i = 0; i < _accountInfo.idleAssets.length; i++) {
                idleAssets[i] = _accountInfo.idleAssets[i];
            }
            _accountInfo.idleAssets = idleAssets;
        }
        _accountInfo.idleAssets[_transition.assetId] = _accountInfo.idleAssets[_transition.assetId].add(
            _transition.amount
        );

        return _accountInfo;
    }

    /**
     * @notice Apply a WithdrawTransition.
     *
     * @param _transition The disputed transition.
     * @param _accountInfo The involved account from the previous transition.
     * @return new account info after apply the disputed transition
     */
    function _applyWithdrawTransition(
        DataTypes.WithdrawTransition memory _transition,
        DataTypes.AccountInfo memory _accountInfo
    ) private pure returns (DataTypes.AccountInfo memory) {
        bytes32 txHash =
            keccak256(
                abi.encodePacked(
                    _transition.transitionType,
                    _transition.account,
                    _transition.assetId,
                    _transition.amount,
                    _transition.timestamp
                )
            );
        bytes32 prefixedHash = ECDSA.toEthSignedMessageHash(txHash);
        require(
            ECDSA.recover(prefixedHash, _transition.signature) == _accountInfo.account,
            "Withdraw signature is invalid"
        );

        require(_accountInfo.accountId == _transition.accountId, "account id not match");
        require(_accountInfo.timestamp < _transition.timestamp, "timestamp should monotonically increasing");
        _accountInfo.timestamp = _transition.timestamp;

        _accountInfo.idleAssets[_transition.assetId] = _accountInfo.idleAssets[_transition.assetId].sub(
            _transition.amount
        );

        return _accountInfo;
    }

    /**
     * @notice Apply a CommitTransition.
     *
     * @param _transition The disputed transition.
     * @param _accountInfo The involved account from the previous transition.
     * @param _strategyInfo The involved strategy from the previous transition.
     * @return new account and strategy info after apply the disputed transition
     */
    function _applyCommitTransition(
        DataTypes.CommitTransition memory _transition,
        DataTypes.AccountInfo memory _accountInfo,
        DataTypes.StrategyInfo memory _strategyInfo,
        Registry _registry
    ) private view returns (DataTypes.AccountInfo memory, DataTypes.StrategyInfo memory) {
        bytes32 txHash =
            keccak256(
                abi.encodePacked(
                    _transition.transitionType,
                    _transition.strategyId,
                    _transition.assetAmount,
                    _transition.timestamp
                )
            );
        bytes32 prefixedHash = ECDSA.toEthSignedMessageHash(txHash);
        require(
            ECDSA.recover(prefixedHash, _transition.signature) == _accountInfo.account,
            "Commit signature is invalid"
        );

        uint256 newStToken;
        if (_strategyInfo.assetBalance == 0 || _strategyInfo.stTokenSupply == 0) {
            require(_strategyInfo.stTokenSupply == 0, "empty strategy stTokenSupply must be zero");
            require(_strategyInfo.pendingCommitAmount == 0, "empty strategy pendingCommitAmount must be zero");
            if (_strategyInfo.assetId == 0) {
                // first time commit of new strategy
                require(_strategyInfo.pendingUncommitAmount == 0, "new strategy pendingUncommitAmount must be zero");
                address strategyAddr = _registry.strategyIndexToAddress(_transition.strategyId);
                address assetAddr = IStrategy(strategyAddr).getAssetAddress();
                _strategyInfo.assetId = _registry.assetAddressToIndex(assetAddr);
            }
            newStToken = _transition.assetAmount;
        } else {
            newStToken = _transition.assetAmount.mul(_strategyInfo.stTokenSupply).div(_strategyInfo.assetBalance);
        }

        _accountInfo.idleAssets[_strategyInfo.assetId] = _accountInfo.idleAssets[_strategyInfo.assetId].sub(
            _transition.assetAmount
        );

        if (_transition.strategyId >= _accountInfo.stTokens.length) {
            uint256[] memory stTokens = new uint256[](_transition.strategyId + 1);
            for (uint256 i = 0; i < _accountInfo.stTokens.length; i++) {
                stTokens[i] = _accountInfo.stTokens[i];
            }
            _accountInfo.stTokens = stTokens;
        }
        _accountInfo.stTokens[_transition.strategyId] = _accountInfo.stTokens[_transition.strategyId].add(newStToken);
        require(_accountInfo.accountId == _transition.accountId, "account id not match");
        require(_accountInfo.timestamp < _transition.timestamp, "timestamp should monotonically increasing");
        _accountInfo.timestamp = _transition.timestamp;

        _strategyInfo.stTokenSupply = _strategyInfo.stTokenSupply.add(newStToken);
        _strategyInfo.assetBalance = _strategyInfo.assetBalance.add(_transition.assetAmount);
        _strategyInfo.pendingCommitAmount = _strategyInfo.pendingCommitAmount.add(_transition.assetAmount);

        return (_accountInfo, _strategyInfo);
    }

    /**
     * @notice Apply a UncommitTransition.
     *
     * @param _transition The disputed transition.
     * @param _accountInfo The involved account from the previous transition.
     * @param _strategyInfo The involved strategy from the previous transition.
     * @return new account and strategy info after apply the disputed transition
     */
    function _applyUncommitTransition(
        DataTypes.UncommitTransition memory _transition,
        DataTypes.AccountInfo memory _accountInfo,
        DataTypes.StrategyInfo memory _strategyInfo
    ) private pure returns (DataTypes.AccountInfo memory, DataTypes.StrategyInfo memory) {
        bytes32 txHash =
            keccak256(
                abi.encodePacked(
                    _transition.transitionType,
                    _transition.strategyId,
                    _transition.stTokenAmount,
                    _transition.timestamp
                )
            );
        bytes32 prefixedHash = ECDSA.toEthSignedMessageHash(txHash);
        require(
            ECDSA.recover(prefixedHash, _transition.signature) == _accountInfo.account,
            "Uncommit signature is invalid"
        );

        uint256 newIdleAsset =
            _transition.stTokenAmount.mul(_strategyInfo.assetBalance).div(_strategyInfo.stTokenSupply);

        _accountInfo.idleAssets[_strategyInfo.assetId] = _accountInfo.idleAssets[_strategyInfo.assetId].add(
            newIdleAsset
        );
        _accountInfo.stTokens[_transition.strategyId] = _accountInfo.stTokens[_transition.strategyId].sub(
            _transition.stTokenAmount
        );
        require(_accountInfo.accountId == _transition.accountId, "account id not match");
        require(_accountInfo.timestamp < _transition.timestamp, "timestamp should monotonically increasing");
        _accountInfo.timestamp = _transition.timestamp;

        _strategyInfo.stTokenSupply = _strategyInfo.stTokenSupply.sub(_transition.stTokenAmount);
        _strategyInfo.assetBalance = _strategyInfo.assetBalance.sub(newIdleAsset);
        _strategyInfo.pendingUncommitAmount = _strategyInfo.pendingUncommitAmount.add(newIdleAsset);

        return (_accountInfo, _strategyInfo);
    }

    /**
     * @notice Apply a CommitmentSyncTransition.
     *
     * @param _transition The disputed transition.
     * @param _strategyInfo The involved strategy from the previous transition.
     * @return new strategy info after apply the disputed transition
     */
    function _applyCommitmentSyncTransition(
        DataTypes.CommitmentSyncTransition memory _transition,
        DataTypes.StrategyInfo memory _strategyInfo
    ) private pure returns (DataTypes.StrategyInfo memory) {
        require(
            _transition.pendingCommitAmount == _strategyInfo.pendingCommitAmount,
            "pending commitment amount not match"
        );
        require(
            _transition.pendingUncommitAmount == _strategyInfo.pendingUncommitAmount,
            "pending uncommitment amount not match"
        );
        _strategyInfo.pendingCommitAmount = 0;
        _strategyInfo.pendingUncommitAmount = 0;

        return _strategyInfo;
    }

    /**
     * @notice Apply a BalanceSyncTransition.
     *
     * @param _transition The disputed transition.
     * @param _strategyInfo The involved strategy from the previous transition.
     * @return new strategy info after apply the disputed transition
     */
    function _applyBalanceSyncTransition(
        DataTypes.BalanceSyncTransition memory _transition,
        DataTypes.StrategyInfo memory _strategyInfo
    ) private pure returns (DataTypes.StrategyInfo memory) {
        if (_transition.newAssetDelta >= 0) {
            uint256 delta = uint256(_transition.newAssetDelta);
            _strategyInfo.assetBalance = _strategyInfo.assetBalance.add(delta);
        } else {
            uint256 delta = uint256(-_transition.newAssetDelta);
            _strategyInfo.assetBalance = _strategyInfo.assetBalance.sub(delta);
        }
        return _strategyInfo;
    }

    /**
     * @notice Get the hash of the AccountInfo.
     * @param _accountInfo Account info
     */
    function _getAccountInfoHash(DataTypes.AccountInfo memory _accountInfo) private pure returns (bytes32) {
        // Here we don't use `abi.encode([struct])` because it's not clear
        // how to generate that encoding client-side.
        return
            keccak256(
                abi.encode(
                    _accountInfo.account,
                    _accountInfo.accountId,
                    _accountInfo.idleAssets,
                    _accountInfo.stTokens,
                    _accountInfo.timestamp
                )
            );
    }

    /**
     * Get the hash of the StrategyInfo.
     */
    /**
     * @notice Get the hash of the StrategyInfo.
     * @param _strategyInfo Strategy info
     */
    function _getStrategyInfoHash(DataTypes.StrategyInfo memory _strategyInfo) private pure returns (bytes32) {
        // Here we don't use `abi.encode([struct])` because it's not clear
        // how to generate that encoding client-side.
        return
            keccak256(
                abi.encode(
                    _strategyInfo.assetId,
                    _strategyInfo.assetBalance,
                    _strategyInfo.stTokenSupply,
                    _strategyInfo.pendingCommitAmount,
                    _strategyInfo.pendingUncommitAmount
                )
            );
    }
}

File 8 of 11 : DataTypes.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

library DataTypes {
    struct Block {
        bytes32 rootHash;
        bytes32 intentHash; // hash of L2-to-L1 commitment sync transitions
        uint128 blockTime; // blockNum when this rollup block is committed
        uint128 blockSize; // number of transitions in the block
    }

    struct InitTransition {
        uint8 transitionType;
        bytes32 stateRoot;
    }

    struct DepositTransition {
        uint8 transitionType;
        bytes32 stateRoot;
        address account; // must provide L1 address for "pending deposit" handling
        uint32 accountId; // needed for transition evaluation in case of dispute
        uint32 assetId;
        uint256 amount;
    }

    struct WithdrawTransition {
        uint8 transitionType;
        bytes32 stateRoot;
        address account; // must provide L1 target address for "pending withdraw" handling
        uint32 accountId;
        uint32 assetId;
        uint256 amount;
        uint64 timestamp; // Unix epoch (msec, UTC)
        bytes signature;
    }

    struct CommitTransition {
        uint8 transitionType;
        bytes32 stateRoot;
        uint32 accountId;
        uint32 strategyId;
        uint256 assetAmount;
        uint64 timestamp; // Unix epoch (msec, UTC)
        bytes signature;
    }

    struct UncommitTransition {
        uint8 transitionType;
        bytes32 stateRoot;
        uint32 accountId;
        uint32 strategyId;
        uint256 stTokenAmount;
        uint64 timestamp; // Unix epoch (msec, UTC)
        bytes signature;
    }

    struct BalanceSyncTransition {
        uint8 transitionType;
        bytes32 stateRoot;
        uint32 strategyId;
        int256 newAssetDelta;
    }

    struct CommitmentSyncTransition {
        uint8 transitionType;
        bytes32 stateRoot;
        uint32 strategyId;
        uint256 pendingCommitAmount;
        uint256 pendingUncommitAmount;
    }

    struct AccountInfo {
        address account;
        uint32 accountId; // mapping only on L2 must be part of stateRoot
        uint256[] idleAssets; // indexed by assetId
        uint256[] stTokens; // indexed by strategyId
        uint64 timestamp; // Unix epoch (msec, UTC)
    }

    struct StrategyInfo {
        uint32 assetId;
        uint256 assetBalance;
        uint256 stTokenSupply;
        uint256 pendingCommitAmount;
        uint256 pendingUncommitAmount;
    }

    struct TransitionProof {
        bytes transition;
        uint256 blockId;
        uint32 index;
        bytes32[] siblings;
    }

    // Even when the disputed transition only affects an account without not a strategy
    // (e.g. deposit), or only affects a strategy without an account (e.g. syncBalance),
    // both AccountProof and StrategyProof must be sent to at least give the root hashes
    // of the two separate Merkle trees (account and strategy).
    // Each transition stateRoot = hash(accountStateRoot, strategyStateRoot).
    struct AccountProof {
        bytes32 stateRoot; // for the account Merkle tree
        AccountInfo value;
        uint32 index;
        bytes32[] siblings;
    }

    struct StrategyProof {
        bytes32 stateRoot; // for the strategy Merkle tree
        StrategyInfo value;
        uint32 index;
        bytes32[] siblings;
    }
}

File 9 of 11 : MerkleTree.sol
// SPDX-License-Identifier: MIT
/*
(The MIT License)

Copyright 2020 Optimism

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

pragma solidity >0.5.0 <0.8.0;

/**
 * @title MerkleTree
 * @author River Keefer
 */
library MerkleTree {
    /**********************
     * Internal Functions *
     **********************/

    /**
     * Calculates a merkle root for a list of 32-byte leaf hashes.  WARNING: If the number
     * of leaves passed in is not a power of two, it pads out the tree with zero hashes.
     * If you do not know the original length of elements for the tree you are verifying,
     * then this may allow empty leaves past _elements.length to pass a verification check down the line.
     * @param _elements Array of hashes from which to generate a merkle root.
     * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).
     */
    function getMerkleRoot(bytes32[] memory _elements) internal pure returns (bytes32) {
        require(_elements.length > 0, "MerkleTree: Must provide at least one leaf hash.");

        if (_elements.length == 1) {
            return _elements[0];
        }

        uint256[32] memory defaults =
            [
                0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,
                0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,
                0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,
                0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,
                0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,
                0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,
                0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,
                0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,
                0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,
                0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,
                0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,
                0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,
                0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,
                0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,
                0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,
                0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10,
                0x776a31db34a1a0a7caaf862cffdfff1789297ffadc380bd3d39281d340abd3ad,
                0xe2e7610b87a5fdf3a72ebe271287d923ab990eefac64b6e59d79f8b7e08c46e3,
                0x504364a5c6858bf98fff714ab5be9de19ed31a976860efbd0e772a2efe23e2e0,
                0x4f05f4acb83f5b65168d9fef89d56d4d77b8944015e6b1eed81b0238e2d0dba3,
                0x44a6d974c75b07423e1d6d33f481916fdd45830aea11b6347e700cd8b9f0767c,
                0xedf260291f734ddac396a956127dde4c34c0cfb8d8052f88ac139658ccf2d507,
                0x6075c657a105351e7f0fce53bc320113324a522e8fd52dc878c762551e01a46e,
                0x6ca6a3f763a9395f7da16014725ca7ee17e4815c0ff8119bf33f273dee11833b,
                0x1c25ef10ffeb3c7d08aa707d17286e0b0d3cbcb50f1bd3b6523b63ba3b52dd0f,
                0xfffc43bd08273ccf135fd3cacbeef055418e09eb728d727c4d5d5c556cdea7e3,
                0xc5ab8111456b1f28f3c7a0a604b4553ce905cb019c463ee159137af83c350b22,
                0x0ff273fcbf4ae0f2bd88d6cf319ff4004f8d7dca70d4ced4e74d2c74139739e6,
                0x7fa06ba11241ddd5efdc65d4e39c9f6991b74fd4b81b62230808216c876f827c,
                0x7e275adf313a996c7e2950cac67caba02a5ff925ebf9906b58949f3e77aec5b9,
                0x8f6162fa308d2b3a15dc33cffac85f13ab349173121645aedf00f471663108be,
                0x78ccaaab73373552f207a63599de54d7d8d0c1805f86ce7da15818d09f4cff62
            ];

        // Reserve memory space for our hashes.
        bytes memory buf = new bytes(64);

        // We'll need to keep track of left and right siblings.
        bytes32 leftSibling;
        bytes32 rightSibling;

        // Number of non-empty nodes at the current depth.
        uint256 rowSize = _elements.length;

        // Current depth, counting from 0 at the leaves
        uint256 depth = 0;

        // Common sub-expressions
        uint256 halfRowSize; // rowSize / 2
        bool rowSizeIsOdd; // rowSize % 2 == 1

        while (rowSize > 1) {
            halfRowSize = rowSize / 2;
            rowSizeIsOdd = rowSize % 2 == 1;

            for (uint256 i = 0; i < halfRowSize; i++) {
                leftSibling = _elements[(2 * i)];
                rightSibling = _elements[(2 * i) + 1];
                assembly {
                    mstore(add(buf, 32), leftSibling)
                    mstore(add(buf, 64), rightSibling)
                }

                _elements[i] = keccak256(buf);
            }

            if (rowSizeIsOdd) {
                leftSibling = _elements[rowSize - 1];
                rightSibling = bytes32(defaults[depth]);
                assembly {
                    mstore(add(buf, 32), leftSibling)
                    mstore(add(buf, 64), rightSibling)
                }

                _elements[halfRowSize] = keccak256(buf);
            }

            rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);
            depth++;
        }

        return _elements[0];
    }

    /**
     * Verifies a merkle branch for the given leaf hash.  Assumes the original length
     * of leaves generated is a known, correct input, and does not return true for indices
     * extending past that index (even if _siblings would be otherwise valid.)
     * @param _root The Merkle root to verify against.
     * @param _leaf The leaf hash to verify inclusion of.
     * @param _index The index in the tree of this leaf.
     * @param _siblings Array of sibling nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
     * @return Whether or not the merkle branch and leaf passes verification.
     */
    function verify(
        bytes32 _root,
        bytes32 _leaf,
        uint256 _index,
        bytes32[] memory _siblings
    ) internal pure returns (bool) {
        return (_root == computeRoot(_leaf, _index, _siblings));
    }

    /**
     * Compute the root of a merkle branch for the given leaf hash.  Assumes the original length
     * of leaves generated is a known, correct input, and does not return true for indices
     * extending past that index (even if _siblings would be otherwise valid.)
     * @param _leaf The leaf hash to verify inclusion of.
     * @param _index The index in the tree of this leaf.
     * @param _siblings Array of sibling nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
     * @return The new merkle root.
     */
    function computeRoot(
        bytes32 _leaf,
        uint256 _index,
        bytes32[] memory _siblings
    ) internal pure returns (bytes32) {
        bytes32 computedRoot = _leaf;

        for (uint256 i = 0; i < _siblings.length; i++) {
            if ((_index & 1) == 1) {
                computedRoot = keccak256(abi.encodePacked(_siblings[i], computedRoot));
            } else {
                computedRoot = keccak256(abi.encodePacked(computedRoot, _siblings[i]));
            }
            _index >>= 1;
        }

        return computedRoot;
    }
}

File 10 of 11 : Transitions.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;

import "../libraries/DataTypes.sol";

library Transitions {
    // Transition Types
    uint8 public constant TRANSITION_TYPE_INVALID = 0;
    uint8 public constant TRANSITION_TYPE_DEPOSIT = 1;
    uint8 public constant TRANSITION_TYPE_WITHDRAW = 2;
    uint8 public constant TRANSITION_TYPE_COMMIT = 3;
    uint8 public constant TRANSITION_TYPE_UNCOMMIT = 4;
    uint8 public constant TRANSITION_TYPE_SYNC_COMMITMENT = 5;
    uint8 public constant TRANSITION_TYPE_SYNC_BALANCE = 6;
    uint8 public constant TRANSITION_TYPE_INIT = 7;

    function extractTransitionType(bytes memory _bytes) internal pure returns (uint8) {
        uint8 transitionType;
        assembly {
            transitionType := mload(add(_bytes, 0x20))
        }
        return transitionType;
    }

    function decodeDepositTransition(bytes memory _rawBytes)
        internal
        pure
        returns (DataTypes.DepositTransition memory)
    {
        (uint8 transitionType, bytes32 stateRoot, address account, uint32 accountId, uint32 assetId, uint256 amount) =
            abi.decode((_rawBytes), (uint8, bytes32, address, uint32, uint32, uint256));
        DataTypes.DepositTransition memory transition =
            DataTypes.DepositTransition(transitionType, stateRoot, account, accountId, assetId, amount);
        return transition;
    }

    function decodeWithdrawTransition(bytes memory _rawBytes)
        internal
        pure
        returns (DataTypes.WithdrawTransition memory)
    {
        (
            uint8 transitionType,
            bytes32 stateRoot,
            address account,
            uint32 accountId,
            uint32 assetId,
            uint256 amount,
            uint64 timestamp,
            bytes memory signature
        ) = abi.decode((_rawBytes), (uint8, bytes32, address, uint32, uint32, uint256, uint64, bytes));
        DataTypes.WithdrawTransition memory transition =
            DataTypes.WithdrawTransition(
                transitionType,
                stateRoot,
                account,
                accountId,
                assetId,
                amount,
                timestamp,
                signature
            );
        return transition;
    }

    function decodeCommitTransition(bytes memory _rawBytes) internal pure returns (DataTypes.CommitTransition memory) {
        (
            uint8 transitionType,
            bytes32 stateRoot,
            uint32 accountId,
            uint32 strategyId,
            uint256 assetAmount,
            uint64 timestamp,
            bytes memory signature
        ) = abi.decode((_rawBytes), (uint8, bytes32, uint32, uint32, uint256, uint64, bytes));
        DataTypes.CommitTransition memory transition =
            DataTypes.CommitTransition(
                transitionType,
                stateRoot,
                accountId,
                strategyId,
                assetAmount,
                timestamp,
                signature
            );
        return transition;
    }

    function decodeUncommitTransition(bytes memory _rawBytes)
        internal
        pure
        returns (DataTypes.UncommitTransition memory)
    {
        (
            uint8 transitionType,
            bytes32 stateRoot,
            uint32 accountId,
            uint32 strategyId,
            uint256 stTokenAmount,
            uint64 timestamp,
            bytes memory signature
        ) = abi.decode((_rawBytes), (uint8, bytes32, uint32, uint32, uint256, uint64, bytes));
        DataTypes.UncommitTransition memory transition =
            DataTypes.UncommitTransition(
                transitionType,
                stateRoot,
                accountId,
                strategyId,
                stTokenAmount,
                timestamp,
                signature
            );
        return transition;
    }

    function decodeCommitmentSyncTransition(bytes memory _rawBytes)
        internal
        pure
        returns (DataTypes.CommitmentSyncTransition memory)
    {
        (
            uint8 transitionType,
            bytes32 stateRoot,
            uint32 strategyId,
            uint256 pendingCommitAmount,
            uint256 pendingUncommitAmount
        ) = abi.decode((_rawBytes), (uint8, bytes32, uint32, uint256, uint256));
        DataTypes.CommitmentSyncTransition memory transition =
            DataTypes.CommitmentSyncTransition(
                transitionType,
                stateRoot,
                strategyId,
                pendingCommitAmount,
                pendingUncommitAmount
            );
        return transition;
    }

    function decodeBalanceSyncTransition(bytes memory _rawBytes)
        internal
        pure
        returns (DataTypes.BalanceSyncTransition memory)
    {
        (uint8 transitionType, bytes32 stateRoot, uint32 strategyId, int256 newAssetDelta) =
            abi.decode((_rawBytes), (uint8, bytes32, uint32, int256));
        DataTypes.BalanceSyncTransition memory transition =
            DataTypes.BalanceSyncTransition(transitionType, stateRoot, strategyId, newAssetDelta);
        return transition;
    }

    function decodeInitTransition(bytes memory _rawBytes) internal pure returns (DataTypes.InitTransition memory) {
        (uint8 transitionType, bytes32 stateRoot) = abi.decode((_rawBytes), (uint8, bytes32));
        DataTypes.InitTransition memory transition = DataTypes.InitTransition(transitionType, stateRoot);
        return transition;
    }
}

File 11 of 11 : IStrategy.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @title Interface for DeFi strategies
 *
 * @notice Strategy provides abstraction for a DeFi strategy. A single type of asset token can be committed to or
 * uncommitted from a strategy per instructions from L2. Periodically, the yield is reflected in the asset balance and
 * synced back to L2.
 */
interface IStrategy {
    event Committed(uint256 commitAmount);

    event UnCommitted(uint256 uncommitAmount);

    event ControllerChanged(address previousController, address newController);

    /**
     * @dev Returns the address of the asset token.
     */
    function getAssetAddress() external view returns (address);

    /**
     * @dev Harvests protocol tokens and update the asset balance.
     */
    function harvest() external;

    /**
     * @dev Returns the asset balance. May sync with the protocol to update the balance.
     */
    function syncBalance() external returns (uint256);

    /**
     * @dev Commits to strategy per instructions from L2.
     *
     * @param commitAmount The aggregated asset amount to commit.
     */
    function aggregateCommit(uint256 commitAmount) external;

    /**
     * @dev Uncommits from strategy per instructions from L2.
     *
     * @param uncommitAmount The aggregated asset amount to uncommit.
     */
    function aggregateUncommit(uint256 uncommitAmount) external;
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract TransitionEvaluator","name":"_transitionEvaluator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"INIT_TRANSITION_STATE_ROOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"transition","type":"bytes"},{"internalType":"uint256","name":"blockId","type":"uint256"},{"internalType":"uint32","name":"index","type":"uint32"},{"internalType":"bytes32[]","name":"siblings","type":"bytes32[]"}],"internalType":"struct DataTypes.TransitionProof","name":"_prevTransitionProof","type":"tuple"},{"components":[{"internalType":"bytes","name":"transition","type":"bytes"},{"internalType":"uint256","name":"blockId","type":"uint256"},{"internalType":"uint32","name":"index","type":"uint32"},{"internalType":"bytes32[]","name":"siblings","type":"bytes32[]"}],"internalType":"struct DataTypes.TransitionProof","name":"_invalidTransitionProof","type":"tuple"},{"components":[{"internalType":"bytes32","name":"stateRoot","type":"bytes32"},{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint32","name":"accountId","type":"uint32"},{"internalType":"uint256[]","name":"idleAssets","type":"uint256[]"},{"internalType":"uint256[]","name":"stTokens","type":"uint256[]"},{"internalType":"uint64","name":"timestamp","type":"uint64"}],"internalType":"struct DataTypes.AccountInfo","name":"value","type":"tuple"},{"internalType":"uint32","name":"index","type":"uint32"},{"internalType":"bytes32[]","name":"siblings","type":"bytes32[]"}],"internalType":"struct DataTypes.AccountProof","name":"_accountProof","type":"tuple"},{"components":[{"internalType":"bytes32","name":"stateRoot","type":"bytes32"},{"components":[{"internalType":"uint32","name":"assetId","type":"uint32"},{"internalType":"uint256","name":"assetBalance","type":"uint256"},{"internalType":"uint256","name":"stTokenSupply","type":"uint256"},{"internalType":"uint256","name":"pendingCommitAmount","type":"uint256"},{"internalType":"uint256","name":"pendingUncommitAmount","type":"uint256"}],"internalType":"struct DataTypes.StrategyInfo","name":"value","type":"tuple"},{"internalType":"uint32","name":"index","type":"uint32"},{"internalType":"bytes32[]","name":"siblings","type":"bytes32[]"}],"internalType":"struct DataTypes.StrategyProof","name":"_strategyProof","type":"tuple"},{"components":[{"internalType":"bytes32","name":"rootHash","type":"bytes32"},{"internalType":"bytes32","name":"intentHash","type":"bytes32"},{"internalType":"uint128","name":"blockTime","type":"uint128"},{"internalType":"uint128","name":"blockSize","type":"uint128"}],"internalType":"struct DataTypes.Block","name":"_prevTransitionBlock","type":"tuple"},{"components":[{"internalType":"bytes32","name":"rootHash","type":"bytes32"},{"internalType":"bytes32","name":"intentHash","type":"bytes32"},{"internalType":"uint128","name":"blockTime","type":"uint128"},{"internalType":"uint128","name":"blockSize","type":"uint128"}],"internalType":"struct DataTypes.Block","name":"_invalidTransitionBlock","type":"tuple"},{"internalType":"contract Registry","name":"_registry","type":"address"}],"name":"disputeTransition","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051611fe1380380611fe183398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b611f50806100916000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063092dff581461003b5780639937b9c714610064575b600080fd5b61004e6100493660046113c8565b610079565b60405161005b91906117ef565b60405180910390f35b61006c610521565b60405161005b91906116a4565b606060208701351580156100a0575061009860608801604089016114c1565b63ffffffff16155b1561010e576100af8784610545565b6100d45760405162461bcd60e51b81526004016100cb90611839565b60405180910390fd5b5060408051808201909152601781527f696e76616c696420696e6974207472616e736974696f6e0000000000000000006020820152610516565b61011a88888686610691565b506000808080806101bb61012e8e80611c5e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d80600001906101819190611c5e565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061086992505050565b945094509450945094508461020c576040518060400160405280601081526020017f696e76616c696420656e636f64696e670000000000000000000000000000000081525095505050505050610516565b610219848c358c35610a50565b6102355760405162461bcd60e51b81526004016100cb90611aa5565b63ffffffff8216156102c5576102c58b3561026461025660208f018f611ca3565b61025f90611d42565b610a8a565b805190602001208d604001602081019061027e91906114c1565b8e806060019061028e9190611c10565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610b5092505050565b63ffffffff811615610315576103158a356102f06102eb368e90038e0160208f016113ad565b610b8a565b805160209091012061030860e08e0160c08f016114c1565b61028e60e08f018f611c10565b600061035e6103248e80611c5e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c0e92505050565b905060ff81166001141561046b5760006103b561037b8f80611c5e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c1592505050565b60408101519091506001600160a01b03166103d360208f018f611ca3565b6103e1906020810190611260565b6001600160a01b0316148015610420575063ffffffff841661040660208f018f611ca3565b6104179060408101906020016114c1565b63ffffffff1614155b15610469576040518060400160405280601281526020017f696e76616c6964206163636f756e742069640000000000000000000000000000815250975050505050505050610516565b505b63ffffffff8316156104b15763ffffffff831661048e60608e0160408f016114c1565b63ffffffff16146104b15760405162461bcd60e51b81526004016100cb90611870565b63ffffffff8216156104f75763ffffffff82166104d460e08d0160c08e016114c1565b63ffffffff16146104f75760405162461bcd60e51b81526004016100cb90611ba1565b61050d6105048e80611c5e565b8e8e888d610c8c565b96505050505050505b979650505050505050565b7fcf277fb80a82478460e8988570b718f1e083ceb76f7e271a1a1497e5975f53ae81565b600061056761055384611e59565b61056236859003850185611343565b610e36565b6105835760405162461bcd60e51b81526004016100cb90611958565b6000805481906001600160a01b031663bc983cfd60e01b6105a48780611c5e565b6040516024016105b592919061170a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516105f39190611688565b6000604051808303816000865af19150503d8060008114610630576040519150601f19603f3d011682016040523d82523d6000602084013e610635565b606091505b50915091508161064a5760019250505061068b565b6000818060200190518101906106609190611301565b50507fcf277fb80a82478460e8988570b718f1e083ceb76f7e271a1a1497e5975f53ae141593505050505b92915050565b6000836020013585602001351415610749576106b360608501604086016114c1565b63ffffffff166106c960608701604088016114c1565b60010163ffffffff16146106ef5760405162461bcd60e51b81526004016100cb906118b3565b6106ff60808301606084016114a7565b6fffffffffffffffffffffffffffffffff1661072160608601604087016114c1565b63ffffffff16106107445760405162461bcd60e51b81526004016100cb906118ea565b6107fe565b83602001358560200135600101146107735760405162461bcd60e51b81526004016100cb90611b5f565b600161078560808501606086016114a7565b036fffffffffffffffffffffffffffffffff166107a860608701604088016114c1565b63ffffffff16146107cb5760405162461bcd60e51b81526004016100cb90611921565b6107db60608501604086016114c1565b63ffffffff16156107fe5760405162461bcd60e51b81526004016100cb906119ea565b61081961080a86611e59565b61056236869003860186611343565b6108355760405162461bcd60e51b81526004016100cb90611a21565b61084161055385611e59565b61085d5760405162461bcd60e51b81526004016100cb90611a63565b5060015b949350505050565b600080600080600080606060008060008060008054906101000a90046001600160a01b03166001600160a01b031663bc983cfd60e01b8e6040516024016108b091906117ef565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516108ee9190611688565b6000604051808303816000865af19150503d806000811461092b576040519150601f19603f3d011682016040523d82523d6000602084013e610930565b606091505b509096509450856109535760405162461bcd60e51b81526004016100cb90611b02565b848060200190518101906109679190611301565b50506000546040519195506001600160a01b03169063bc983cfd60e01b90610993908f906024016117ef565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516109d19190611688565b6000604051808303816000865af19150503d8060008114610a0e576040519150601f19603f3d011682016040523d82523d6000602084013e610a13565b606091505b5090965094508515610a3b5784806020019051810190610a339190611301565b919450925090505b949c929b509099509750919550909350505050565b6000808383604051602001610a6692919061167a565b60408051601f19818403018152919052805160209091012085149150509392505050565b80516060906001600160a01b0316158015610aad5750602082015163ffffffff16155b8015610abc5750604082015151155b8015610acb5750606082015151155b8015610ae35750608082015167ffffffffffffffff16155b15610b10576000604051602001610afa91906116a4565b6040516020818303038152906040529050610b4b565b8151602080840151604080860151606087015160808801519251610b39969592939192016116ad565b60405160208183030381529060405290505b919050565b6000610b6485858563ffffffff1685610e73565b905080610b835760405162461bcd60e51b81526004016100cb9061198d565b5050505050565b805160609063ffffffff16158015610ba457506020820151155b8015610bb257506040820151155b8015610bc057506060820151155b8015610bce57506080820151155b15610be5576000604051602001610afa91906116a4565b8151602080840151604080860151606087015160808801519251610b3996959293919201611be5565b6020015190565b610c1d610fbb565b60008060008060008087806020019051810190610c3a91906114dd565b6040805160c08101825260ff909716875260208701959095526001600160a01b039093169385019390935263ffffffff9081166060850152909116608083015260a08201529650505050505050919050565b600080546060919082906001600160a01b0316630edf3e1360e11b8a8a610cb660208c018c611ca3565b8a60200189604051602401610ccf95949392919061171e565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610d0d9190611688565b6000604051808303816000865af19150503d8060008114610d4a576040519150601f19603f3d011682016040523d82523d6000602084013e610d4f565b606091505b50909250905081610d99576040518060400160405280601281526020017f6661696c656420746f206576616c75617465000000000000000000000000000081525092505050610e2c565b600081806020019051810190610daf9190611283565b9050610dcd8682610dbf8b611d4e565b610dc88b611de6565b610e8b565b925082610e14576040518060400160405280601781526020017f696e76616c696420706f73742d737461746520726f6f740000000000000000008152509350505050610e2c565b60405162461bcd60e51b81526004016100cb90611802565b9695505050505050565b6000808260000151905060008460000151805190602001209050610e6a8282876040015163ffffffff168860600151610e73565b95945050505050565b6000610e80848484610efe565b909414949350505050565b8251600090158015610e9f57506020840151155b15610eac57506000610861565b8251845115610ed957610ed68560005b6020020151856040015163ffffffff168660600151610efe565b90505b8251602086015115610ef357610ef0866001610ebc565b90505b610516878383610a50565b600083815b8351811015610fb2578460011660011415610f6157838181518110610f2457fe5b6020026020010151826040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209150610fa6565b81848281518110610f6e57fe5b602002602001015160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012091505b600194851c9401610f03565b50949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b8035610b4b81611ef0565b600082601f83011261100b578081fd5b8135602061102061101b83611cdc565b611cb8565b828152818101908583018385028701840188101561103c578586fd5b855b8581101561105a5781358452928401929084019060010161103e565b5090979650505050505050565b600082601f830112611077578081fd5b813567ffffffffffffffff81111561108b57fe5b61109e601f8201601f1916602001611cb8565b8181528460208386010111156110b2578283fd5b816020850160208301379081016020019190915292915050565b600060a082840312156110dd578081fd5b60405160a0810167ffffffffffffffff82821081831117156110fb57fe5b8160405282935061110b85610ff0565b83526111196020860161123d565b6020840152604085013591508082111561113257600080fd5b61113e86838701610ffb565b6040840152606085013591508082111561115757600080fd5b5061116485828601610ffb565b60608301525061117660808401611248565b60808201525092915050565b600060808284031215611193578081fd5b50919050565b600060a082840312156111aa578081fd5b60405160a0810181811067ffffffffffffffff821117156111c757fe5b60405290508082356111d881611f08565b80825250602083013560208201526040830135604082015260608301356060820152608083013560808201525092915050565b60006101008284031215611193578081fd5b80356fffffffffffffffffffffffffffffffff81168114610b4b57600080fd5b8035610b4b81611f08565b803567ffffffffffffffff81168114610b4b57600080fd5b600060208284031215611271578081fd5b813561127c81611ef0565b9392505050565b600060408284031215611294578081fd5b82601f8301126112a2578081fd5b6040516040810181811067ffffffffffffffff821117156112bf57fe5b80604052508083856040860111156112d5578384fd5b835b60028110156112f65781518352602092830192909101906001016112d7565b509195945050505050565b600080600060608486031215611315578182fd5b83519250602084015161132781611f08565b604085015190925061133881611f08565b809150509250925092565b600060808284031215611354578081fd5b6040516080810181811067ffffffffffffffff8211171561137157fe5b806040525082358152602083013560208201526113906040840161121d565b60408201526113a16060840161121d565b60608201529392505050565b600060a082840312156113be578081fd5b61127c8383611199565b60008060008060008060006101a0888a0312156113e3578485fd5b873567ffffffffffffffff808211156113fa578687fd5b6114068b838c01611182565b985060208a013591508082111561141b578687fd5b6114278b838c01611182565b975060408a013591508082111561143c578687fd5b6114488b838c01611182565b965060608a013591508082111561145d578485fd5b5061146a8a828b0161120b565b94505061147a8960808a01611182565b925061148a896101008a01611182565b91506114996101808901610ff0565b905092959891949750929550565b6000602082840312156114b8578081fd5b61127c8261121d565b6000602082840312156114d2578081fd5b813561127c81611f08565b60008060008060008060c087890312156114f5578384fd5b865160ff81168114611505578485fd5b60208801516040890151919750955061151d81611ef0565b606088015190945061152e81611f08565b608088015190935061153f81611f08565b8092505060a087015190509295509295509295565b60008284527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115611585578081fd5b6020830280836020870137939093016020019283525090919050565b6000815180845260208085019450808401835b838110156115d0578151875295820195908201906001016115b4565b509495945050505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b6000815180845261161d816020860160208601611ec0565b601f01601f19169290920160200192915050565b6001600160a01b03169052565b803561164981611f08565b63ffffffff168252602081810135908301526040808201359083015260608082013590830152608090810135910152565b918252602082015260400190565b6000825161169a818460208701611ec0565b9190910192915050565b90815260200190565b60006001600160a01b038716825263ffffffff8616602083015260a060408301526116db60a08301866115a1565b82810360608401526116ed81866115a1565b91505067ffffffffffffffff831660808301529695505050505050565b6000602082526108616020830184866115db565b6000610100808352611733818401888a6115db565b90508281036020840152853561174881611ef0565b6001600160a01b03168152602086013561176181611f08565b63ffffffff1660208201526117796040870187611cfa565b60a0604084015261178e60a084018284611554565b91505061179e6060880188611cfa565b83830360608501526117b1838284611554565b9250505067ffffffffffffffff6117ca60808901611248565b16608083015280925050506117e2604083018561163e565b610e2c60e0830184611631565b60006020825261127c6020830184611605565b60208082526011908201527f4e6f206672617564206465746563746564000000000000000000000000000000604082015260600190565b60208082526011908201527f6e6f206672617564206465746563746564000000000000000000000000000000604082015260600190565b60208082526023908201527f537570706c696564206163636f756e7420696e64657820697320696e636f72726040820152621958dd60ea1b606082015260800190565b6020808252601e908201527f5472616e736974696f6e73206d7573742062652073657175656e7469616c0000604082015260600190565b60208082526018908201527f5f747031206f75747369646520626c6f636b2072616e67650000000000000000604082015260600190565b6020808252601e908201527f5f747030206d757374206265206c61737420696e2069747320626c6f636b0000604082015260600190565b6020808252818101527f7472616e736974696f6e206e6f7420696e636c7564656420696e20626c6f636b604082015260600190565b60208082526029908201527f4661696c65642070726f6f6620696e636c7573696f6e2076657269666963617460408201527f696f6e20636865636b0000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f5f747031206d75737420626520666972737420696e2069747320626c6f636b00604082015260600190565b60208082526022908201527f5f747030206d75737420626520696e636c7564656420696e2069747320626c6f604082015261636b60f01b606082015260800190565b60208082526022908201527f5f747031206d75737420626520696e636c7564656420696e2069747320626c6f604082015261636b60f01b606082015260800190565b60208082526035908201527f4661696c656420636f6d62696e65642074776f2d74726565207374617465526f60408201527f6f7420766572696669636174696f6e20636865636b0000000000000000000000606082015260800190565b6020808252603f908201527f496620746865207072655374617465526f6f7420697320696e76616c69642c2060408201527f7468656e2070726f7665207468617420696e76616c696420696e737465616400606082015260800190565b60208082526022908201527f426c6f636b73206d7573742062652073657175656e7469616c206f7220657175604082015261185b60f21b606082015260800190565b60208082526024908201527f537570706c69656420737472617465677920696e64657820697320696e636f726040820152631c9958dd60e21b606082015260800190565b63ffffffff959095168552602085019390935260408401919091526060830152608082015260a00190565b6000808335601e19843603018112611c26578283fd5b83018035915067ffffffffffffffff821115611c40578283fd5b6020908101925081023603821315611c5757600080fd5b9250929050565b6000808335601e19843603018112611c74578283fd5b83018035915067ffffffffffffffff821115611c8e578283fd5b602001915036819003821315611c5757600080fd5b60008235609e1983360301811261169a578182fd5b60405181810167ffffffffffffffff81118282101715611cd457fe5b604052919050565b600067ffffffffffffffff821115611cf057fe5b5060209081020190565b6000808335601e19843603018112611d10578283fd5b830160208101925035905067ffffffffffffffff811115611d3057600080fd5b602081023603831315611c5757600080fd5b600061068b36836110cc565b600060808236031215611d5f578081fd5b6040516080810167ffffffffffffffff8282108183111715611d7d57fe5b81604052843583526020850135915080821115611d98578384fd5b611da4368387016110cc565b6020840152611db56040860161123d565b60408401526060850135915080821115611dcd578384fd5b50611dda36828601610ffb565b60608301525092915050565b60006101008236031215611df8578081fd5b6040516080810167ffffffffffffffff8282108183111715611e1657fe5b8160405284358352611e2b3660208701611199565b602084015260c08501359150611e4082611f08565b81604084015260e0850135915080821115611dcd578384fd5b600060808236031215611e6a578081fd5b6040516080810167ffffffffffffffff8282108183111715611e8857fe5b816040528435915080821115611e9c578384fd5b611ea836838701611067565b835260208501356020840152611db56040860161123d565b60005b83811015611edb578181015183820152602001611ec3565b83811115611eea576000848401525b50505050565b6001600160a01b0381168114611f0557600080fd5b50565b63ffffffff81168114611f0557600080fdfea26469706673582212202317ea197f3c44461a4e3c78411814f1de3acd0148c17e52608ed958c71d12d564736f6c634300070600330000000000000000000000000762d31185b1675a441008aba3eea22e1b381cb5

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063092dff581461003b5780639937b9c714610064575b600080fd5b61004e6100493660046113c8565b610079565b60405161005b91906117ef565b60405180910390f35b61006c610521565b60405161005b91906116a4565b606060208701351580156100a0575061009860608801604089016114c1565b63ffffffff16155b1561010e576100af8784610545565b6100d45760405162461bcd60e51b81526004016100cb90611839565b60405180910390fd5b5060408051808201909152601781527f696e76616c696420696e6974207472616e736974696f6e0000000000000000006020820152610516565b61011a88888686610691565b506000808080806101bb61012e8e80611c5e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d80600001906101819190611c5e565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061086992505050565b945094509450945094508461020c576040518060400160405280601081526020017f696e76616c696420656e636f64696e670000000000000000000000000000000081525095505050505050610516565b610219848c358c35610a50565b6102355760405162461bcd60e51b81526004016100cb90611aa5565b63ffffffff8216156102c5576102c58b3561026461025660208f018f611ca3565b61025f90611d42565b610a8a565b805190602001208d604001602081019061027e91906114c1565b8e806060019061028e9190611c10565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610b5092505050565b63ffffffff811615610315576103158a356102f06102eb368e90038e0160208f016113ad565b610b8a565b805160209091012061030860e08e0160c08f016114c1565b61028e60e08f018f611c10565b600061035e6103248e80611c5e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c0e92505050565b905060ff81166001141561046b5760006103b561037b8f80611c5e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c1592505050565b60408101519091506001600160a01b03166103d360208f018f611ca3565b6103e1906020810190611260565b6001600160a01b0316148015610420575063ffffffff841661040660208f018f611ca3565b6104179060408101906020016114c1565b63ffffffff1614155b15610469576040518060400160405280601281526020017f696e76616c6964206163636f756e742069640000000000000000000000000000815250975050505050505050610516565b505b63ffffffff8316156104b15763ffffffff831661048e60608e0160408f016114c1565b63ffffffff16146104b15760405162461bcd60e51b81526004016100cb90611870565b63ffffffff8216156104f75763ffffffff82166104d460e08d0160c08e016114c1565b63ffffffff16146104f75760405162461bcd60e51b81526004016100cb90611ba1565b61050d6105048e80611c5e565b8e8e888d610c8c565b96505050505050505b979650505050505050565b7fcf277fb80a82478460e8988570b718f1e083ceb76f7e271a1a1497e5975f53ae81565b600061056761055384611e59565b61056236859003850185611343565b610e36565b6105835760405162461bcd60e51b81526004016100cb90611958565b6000805481906001600160a01b031663bc983cfd60e01b6105a48780611c5e565b6040516024016105b592919061170a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516105f39190611688565b6000604051808303816000865af19150503d8060008114610630576040519150601f19603f3d011682016040523d82523d6000602084013e610635565b606091505b50915091508161064a5760019250505061068b565b6000818060200190518101906106609190611301565b50507fcf277fb80a82478460e8988570b718f1e083ceb76f7e271a1a1497e5975f53ae141593505050505b92915050565b6000836020013585602001351415610749576106b360608501604086016114c1565b63ffffffff166106c960608701604088016114c1565b60010163ffffffff16146106ef5760405162461bcd60e51b81526004016100cb906118b3565b6106ff60808301606084016114a7565b6fffffffffffffffffffffffffffffffff1661072160608601604087016114c1565b63ffffffff16106107445760405162461bcd60e51b81526004016100cb906118ea565b6107fe565b83602001358560200135600101146107735760405162461bcd60e51b81526004016100cb90611b5f565b600161078560808501606086016114a7565b036fffffffffffffffffffffffffffffffff166107a860608701604088016114c1565b63ffffffff16146107cb5760405162461bcd60e51b81526004016100cb90611921565b6107db60608501604086016114c1565b63ffffffff16156107fe5760405162461bcd60e51b81526004016100cb906119ea565b61081961080a86611e59565b61056236869003860186611343565b6108355760405162461bcd60e51b81526004016100cb90611a21565b61084161055385611e59565b61085d5760405162461bcd60e51b81526004016100cb90611a63565b5060015b949350505050565b600080600080600080606060008060008060008054906101000a90046001600160a01b03166001600160a01b031663bc983cfd60e01b8e6040516024016108b091906117ef565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516108ee9190611688565b6000604051808303816000865af19150503d806000811461092b576040519150601f19603f3d011682016040523d82523d6000602084013e610930565b606091505b509096509450856109535760405162461bcd60e51b81526004016100cb90611b02565b848060200190518101906109679190611301565b50506000546040519195506001600160a01b03169063bc983cfd60e01b90610993908f906024016117ef565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516109d19190611688565b6000604051808303816000865af19150503d8060008114610a0e576040519150601f19603f3d011682016040523d82523d6000602084013e610a13565b606091505b5090965094508515610a3b5784806020019051810190610a339190611301565b919450925090505b949c929b509099509750919550909350505050565b6000808383604051602001610a6692919061167a565b60408051601f19818403018152919052805160209091012085149150509392505050565b80516060906001600160a01b0316158015610aad5750602082015163ffffffff16155b8015610abc5750604082015151155b8015610acb5750606082015151155b8015610ae35750608082015167ffffffffffffffff16155b15610b10576000604051602001610afa91906116a4565b6040516020818303038152906040529050610b4b565b8151602080840151604080860151606087015160808801519251610b39969592939192016116ad565b60405160208183030381529060405290505b919050565b6000610b6485858563ffffffff1685610e73565b905080610b835760405162461bcd60e51b81526004016100cb9061198d565b5050505050565b805160609063ffffffff16158015610ba457506020820151155b8015610bb257506040820151155b8015610bc057506060820151155b8015610bce57506080820151155b15610be5576000604051602001610afa91906116a4565b8151602080840151604080860151606087015160808801519251610b3996959293919201611be5565b6020015190565b610c1d610fbb565b60008060008060008087806020019051810190610c3a91906114dd565b6040805160c08101825260ff909716875260208701959095526001600160a01b039093169385019390935263ffffffff9081166060850152909116608083015260a08201529650505050505050919050565b600080546060919082906001600160a01b0316630edf3e1360e11b8a8a610cb660208c018c611ca3565b8a60200189604051602401610ccf95949392919061171e565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610d0d9190611688565b6000604051808303816000865af19150503d8060008114610d4a576040519150601f19603f3d011682016040523d82523d6000602084013e610d4f565b606091505b50909250905081610d99576040518060400160405280601281526020017f6661696c656420746f206576616c75617465000000000000000000000000000081525092505050610e2c565b600081806020019051810190610daf9190611283565b9050610dcd8682610dbf8b611d4e565b610dc88b611de6565b610e8b565b925082610e14576040518060400160405280601781526020017f696e76616c696420706f73742d737461746520726f6f740000000000000000008152509350505050610e2c565b60405162461bcd60e51b81526004016100cb90611802565b9695505050505050565b6000808260000151905060008460000151805190602001209050610e6a8282876040015163ffffffff168860600151610e73565b95945050505050565b6000610e80848484610efe565b909414949350505050565b8251600090158015610e9f57506020840151155b15610eac57506000610861565b8251845115610ed957610ed68560005b6020020151856040015163ffffffff168660600151610efe565b90505b8251602086015115610ef357610ef0866001610ebc565b90505b610516878383610a50565b600083815b8351811015610fb2578460011660011415610f6157838181518110610f2457fe5b6020026020010151826040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209150610fa6565b81848281518110610f6e57fe5b602002602001015160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012091505b600194851c9401610f03565b50949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b8035610b4b81611ef0565b600082601f83011261100b578081fd5b8135602061102061101b83611cdc565b611cb8565b828152818101908583018385028701840188101561103c578586fd5b855b8581101561105a5781358452928401929084019060010161103e565b5090979650505050505050565b600082601f830112611077578081fd5b813567ffffffffffffffff81111561108b57fe5b61109e601f8201601f1916602001611cb8565b8181528460208386010111156110b2578283fd5b816020850160208301379081016020019190915292915050565b600060a082840312156110dd578081fd5b60405160a0810167ffffffffffffffff82821081831117156110fb57fe5b8160405282935061110b85610ff0565b83526111196020860161123d565b6020840152604085013591508082111561113257600080fd5b61113e86838701610ffb565b6040840152606085013591508082111561115757600080fd5b5061116485828601610ffb565b60608301525061117660808401611248565b60808201525092915050565b600060808284031215611193578081fd5b50919050565b600060a082840312156111aa578081fd5b60405160a0810181811067ffffffffffffffff821117156111c757fe5b60405290508082356111d881611f08565b80825250602083013560208201526040830135604082015260608301356060820152608083013560808201525092915050565b60006101008284031215611193578081fd5b80356fffffffffffffffffffffffffffffffff81168114610b4b57600080fd5b8035610b4b81611f08565b803567ffffffffffffffff81168114610b4b57600080fd5b600060208284031215611271578081fd5b813561127c81611ef0565b9392505050565b600060408284031215611294578081fd5b82601f8301126112a2578081fd5b6040516040810181811067ffffffffffffffff821117156112bf57fe5b80604052508083856040860111156112d5578384fd5b835b60028110156112f65781518352602092830192909101906001016112d7565b509195945050505050565b600080600060608486031215611315578182fd5b83519250602084015161132781611f08565b604085015190925061133881611f08565b809150509250925092565b600060808284031215611354578081fd5b6040516080810181811067ffffffffffffffff8211171561137157fe5b806040525082358152602083013560208201526113906040840161121d565b60408201526113a16060840161121d565b60608201529392505050565b600060a082840312156113be578081fd5b61127c8383611199565b60008060008060008060006101a0888a0312156113e3578485fd5b873567ffffffffffffffff808211156113fa578687fd5b6114068b838c01611182565b985060208a013591508082111561141b578687fd5b6114278b838c01611182565b975060408a013591508082111561143c578687fd5b6114488b838c01611182565b965060608a013591508082111561145d578485fd5b5061146a8a828b0161120b565b94505061147a8960808a01611182565b925061148a896101008a01611182565b91506114996101808901610ff0565b905092959891949750929550565b6000602082840312156114b8578081fd5b61127c8261121d565b6000602082840312156114d2578081fd5b813561127c81611f08565b60008060008060008060c087890312156114f5578384fd5b865160ff81168114611505578485fd5b60208801516040890151919750955061151d81611ef0565b606088015190945061152e81611f08565b608088015190935061153f81611f08565b8092505060a087015190509295509295509295565b60008284527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115611585578081fd5b6020830280836020870137939093016020019283525090919050565b6000815180845260208085019450808401835b838110156115d0578151875295820195908201906001016115b4565b509495945050505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b6000815180845261161d816020860160208601611ec0565b601f01601f19169290920160200192915050565b6001600160a01b03169052565b803561164981611f08565b63ffffffff168252602081810135908301526040808201359083015260608082013590830152608090810135910152565b918252602082015260400190565b6000825161169a818460208701611ec0565b9190910192915050565b90815260200190565b60006001600160a01b038716825263ffffffff8616602083015260a060408301526116db60a08301866115a1565b82810360608401526116ed81866115a1565b91505067ffffffffffffffff831660808301529695505050505050565b6000602082526108616020830184866115db565b6000610100808352611733818401888a6115db565b90508281036020840152853561174881611ef0565b6001600160a01b03168152602086013561176181611f08565b63ffffffff1660208201526117796040870187611cfa565b60a0604084015261178e60a084018284611554565b91505061179e6060880188611cfa565b83830360608501526117b1838284611554565b9250505067ffffffffffffffff6117ca60808901611248565b16608083015280925050506117e2604083018561163e565b610e2c60e0830184611631565b60006020825261127c6020830184611605565b60208082526011908201527f4e6f206672617564206465746563746564000000000000000000000000000000604082015260600190565b60208082526011908201527f6e6f206672617564206465746563746564000000000000000000000000000000604082015260600190565b60208082526023908201527f537570706c696564206163636f756e7420696e64657820697320696e636f72726040820152621958dd60ea1b606082015260800190565b6020808252601e908201527f5472616e736974696f6e73206d7573742062652073657175656e7469616c0000604082015260600190565b60208082526018908201527f5f747031206f75747369646520626c6f636b2072616e67650000000000000000604082015260600190565b6020808252601e908201527f5f747030206d757374206265206c61737420696e2069747320626c6f636b0000604082015260600190565b6020808252818101527f7472616e736974696f6e206e6f7420696e636c7564656420696e20626c6f636b604082015260600190565b60208082526029908201527f4661696c65642070726f6f6620696e636c7573696f6e2076657269666963617460408201527f696f6e20636865636b0000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f5f747031206d75737420626520666972737420696e2069747320626c6f636b00604082015260600190565b60208082526022908201527f5f747030206d75737420626520696e636c7564656420696e2069747320626c6f604082015261636b60f01b606082015260800190565b60208082526022908201527f5f747031206d75737420626520696e636c7564656420696e2069747320626c6f604082015261636b60f01b606082015260800190565b60208082526035908201527f4661696c656420636f6d62696e65642074776f2d74726565207374617465526f60408201527f6f7420766572696669636174696f6e20636865636b0000000000000000000000606082015260800190565b6020808252603f908201527f496620746865207072655374617465526f6f7420697320696e76616c69642c2060408201527f7468656e2070726f7665207468617420696e76616c696420696e737465616400606082015260800190565b60208082526022908201527f426c6f636b73206d7573742062652073657175656e7469616c206f7220657175604082015261185b60f21b606082015260800190565b60208082526024908201527f537570706c69656420737472617465677920696e64657820697320696e636f726040820152631c9958dd60e21b606082015260800190565b63ffffffff959095168552602085019390935260408401919091526060830152608082015260a00190565b6000808335601e19843603018112611c26578283fd5b83018035915067ffffffffffffffff821115611c40578283fd5b6020908101925081023603821315611c5757600080fd5b9250929050565b6000808335601e19843603018112611c74578283fd5b83018035915067ffffffffffffffff821115611c8e578283fd5b602001915036819003821315611c5757600080fd5b60008235609e1983360301811261169a578182fd5b60405181810167ffffffffffffffff81118282101715611cd457fe5b604052919050565b600067ffffffffffffffff821115611cf057fe5b5060209081020190565b6000808335601e19843603018112611d10578283fd5b830160208101925035905067ffffffffffffffff811115611d3057600080fd5b602081023603831315611c5757600080fd5b600061068b36836110cc565b600060808236031215611d5f578081fd5b6040516080810167ffffffffffffffff8282108183111715611d7d57fe5b81604052843583526020850135915080821115611d98578384fd5b611da4368387016110cc565b6020840152611db56040860161123d565b60408401526060850135915080821115611dcd578384fd5b50611dda36828601610ffb565b60608301525092915050565b60006101008236031215611df8578081fd5b6040516080810167ffffffffffffffff8282108183111715611e1657fe5b8160405284358352611e2b3660208701611199565b602084015260c08501359150611e4082611f08565b81604084015260e0850135915080821115611dcd578384fd5b600060808236031215611e6a578081fd5b6040516080810167ffffffffffffffff8282108183111715611e8857fe5b816040528435915080821115611e9c578384fd5b611ea836838701611067565b835260208501356020840152611db56040860161123d565b60005b83811015611edb578181015183820152602001611ec3565b83811115611eea576000848401525b50505050565b6001600160a01b0381168114611f0557600080fd5b50565b63ffffffff81168114611f0557600080fdfea26469706673582212202317ea197f3c44461a4e3c78411814f1de3acd0148c17e52608ed958c71d12d564736f6c63430007060033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000762d31185b1675a441008aba3eea22e1b381cb5

-----Decoded View---------------
Arg [0] : _transitionEvaluator (address): 0x0762d31185B1675A441008aBA3Eea22E1b381CB5

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000762d31185b1675a441008aba3eea22e1b381cb5


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
[ Download: CSV Export  ]

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