ETH Price: $2,645.46 (-3.76%)

Contract

0xaC14B70adBf42bedE4E4c7Ef67E8CB618b0D4506
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
P1Orders

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion, Apache-2.0 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-08-19
*/

/*

    Copyright 2020 dYdX Trading Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

*/

pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;

// File: @openzeppelin/contracts/math/SafeMath.sol

/**
 * @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, 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) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @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) {
        // 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 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message 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.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts 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) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message 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.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// File: contracts/protocol/v1/traders/P1TraderConstants.sol

/**
 * @title P1TraderConstants
 * @author dYdX
 *
 * @notice Constants for traderFlags set by contracts implementing the I_P1Trader interface.
 */
contract P1TraderConstants {
    bytes32 constant internal TRADER_FLAG_ORDERS = bytes32(uint256(1));
    bytes32 constant internal TRADER_FLAG_LIQUIDATION = bytes32(uint256(2));
    bytes32 constant internal TRADER_FLAG_DELEVERAGING = bytes32(uint256(4));
}

// File: contracts/protocol/lib/BaseMath.sol

/**
 * @title BaseMath
 * @author dYdX
 *
 * @dev Arithmetic for fixed-point numbers with 18 decimals of precision.
 */
library BaseMath {
    using SafeMath for uint256;

    // The number One in the BaseMath system.
    uint256 constant internal BASE = 10 ** 18;

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function base()
        internal
        pure
        returns (uint256)
    {
        return BASE;
    }

    /**
     * @dev Multiplies a value by a base value (result is rounded down).
     */
    function baseMul(
        uint256 value,
        uint256 baseValue
    )
        internal
        pure
        returns (uint256)
    {
        return value.mul(baseValue).div(BASE);
    }

    /**
     * @dev Multiplies a value by a base value (result is rounded down).
     *  Intended as an alternaltive to baseMul to prevent overflow, when `value` is known
     *  to be divisible by `BASE`.
     */
    function baseDivMul(
        uint256 value,
        uint256 baseValue
    )
        internal
        pure
        returns (uint256)
    {
        return value.div(BASE).mul(baseValue);
    }

    /**
     * @dev Multiplies a value by a base value (result is rounded up).
     */
    function baseMulRoundUp(
        uint256 value,
        uint256 baseValue
    )
        internal
        pure
        returns (uint256)
    {
        if (value == 0 || baseValue == 0) {
            return 0;
        }
        return value.mul(baseValue).sub(1).div(BASE).add(1);
    }

    /**
     * @dev Divide a value by a base value (result is rounded down).
     */
    function baseDiv(
        uint256 value,
        uint256 baseValue
    )
        internal
        pure
        returns (uint256)
    {
        return value.mul(BASE).div(baseValue);
    }

    /**
     * @dev Returns a base value representing the reciprocal of another base value (result is
     *  rounded down).
     */
    function baseReciprocal(
        uint256 baseValue
    )
        internal
        pure
        returns (uint256)
    {
        return baseDiv(BASE, baseValue);
    }
}

// File: contracts/protocol/lib/TypedSignature.sol

/**
 * @title TypedSignature
 * @author dYdX
 *
 * @dev Library to unparse typed signatures.
 */
library TypedSignature {

    // ============ Constants ============

    bytes32 constant private FILE = "TypedSignature";

    // Prepended message with the length of the signed hash in decimal.
    bytes constant private PREPEND_DEC = "\x19Ethereum Signed Message:\n32";

    // Prepended message with the length of the signed hash in hexadecimal.
    bytes constant private PREPEND_HEX = "\x19Ethereum Signed Message:\n\x20";

    // Number of bytes in a typed signature.
    uint256 constant private NUM_SIGNATURE_BYTES = 66;

    // ============ Enums ============

    // Different RPC providers may implement signing methods differently, so we allow different
    // signature types depending on the string prepended to a hash before it was signed.
    enum SignatureType {
        NoPrepend,   // No string was prepended.
        Decimal,     // PREPEND_DEC was prepended.
        Hexadecimal, // PREPEND_HEX was prepended.
        Invalid      // Not a valid type. Used for bound-checking.
    }

    // ============ Structs ============

    struct Signature {
        bytes32 r;
        bytes32 s;
        bytes2 vType;
    }

    // ============ Functions ============

    /**
     * @dev Gives the address of the signer of a hash. Also allows for the commonly prepended string
     *  of '\x19Ethereum Signed Message:\n' + message.length
     *
     * @param  hash       Hash that was signed (does not include prepended message).
     * @param  signature  Type and ECDSA signature with structure: {32:r}{32:s}{1:v}{1:type}
     * @return            Address of the signer of the hash.
     */
    function recover(
        bytes32 hash,
        Signature memory signature
    )
        internal
        pure
        returns (address)
    {
        SignatureType sigType = SignatureType(uint8(bytes1(signature.vType << 8)));

        bytes32 signedHash;
        if (sigType == SignatureType.NoPrepend) {
            signedHash = hash;
        } else if (sigType == SignatureType.Decimal) {
            signedHash = keccak256(abi.encodePacked(PREPEND_DEC, hash));
        } else {
            assert(sigType == SignatureType.Hexadecimal);
            signedHash = keccak256(abi.encodePacked(PREPEND_HEX, hash));
        }

        return ecrecover(
            signedHash,
            uint8(bytes1(signature.vType)),
            signature.r,
            signature.s
        );
    }
}

// File: contracts/protocol/lib/Storage.sol

/**
 * @title Storage
 * @author dYdX
 *
 * @dev Storage library for reading/writing storage at a low level.
 */
library Storage {

    /**
     * @dev Performs an SLOAD and returns the data in the slot.
     */
    function load(
        bytes32 slot
    )
        internal
        view
        returns (bytes32)
    {
        bytes32 result;
        /* solium-disable-next-line security/no-inline-assembly */
        assembly {
            result := sload(slot)
        }
        return result;
    }

    /**
     * @dev Performs an SSTORE to save the value to the slot.
     */
    function store(
        bytes32 slot,
        bytes32 value
    )
        internal
    {
        /* solium-disable-next-line security/no-inline-assembly */
        assembly {
            sstore(slot, value)
        }
    }
}

// File: contracts/protocol/lib/Adminable.sol

/**
 * @title Adminable
 * @author dYdX
 *
 * @dev EIP-1967 Proxy Admin contract.
 */
contract Adminable {
    /**
     * @dev Storage slot with the admin of the contract.
     *  This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
     */
    bytes32 internal constant ADMIN_SLOT =
    0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
    * @dev Modifier to check whether the `msg.sender` is the admin.
    *  If it is, it will run the function. Otherwise, it will revert.
    */
    modifier onlyAdmin() {
        require(
            msg.sender == getAdmin(),
            "Adminable: caller is not admin"
        );
        _;
    }

    /**
     * @return The EIP-1967 proxy admin
     */
    function getAdmin()
        public
        view
        returns (address)
    {
        return address(uint160(uint256(Storage.load(ADMIN_SLOT))));
    }
}

// File: contracts/protocol/lib/ReentrancyGuard.sol

/**
 * @title ReentrancyGuard
 * @author dYdX
 *
 * @dev Updated ReentrancyGuard library designed to be used with Proxy Contracts.
 */
contract ReentrancyGuard {
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = uint256(int256(-1));

    uint256 private _STATUS_;

    constructor () internal {
        _STATUS_ = NOT_ENTERED;
    }

    modifier nonReentrant() {
        require(_STATUS_ != ENTERED, "ReentrancyGuard: reentrant call");
        _STATUS_ = ENTERED;
        _;
        _STATUS_ = NOT_ENTERED;
    }
}

// File: contracts/protocol/v1/lib/P1Types.sol

/**
 * @title P1Types
 * @author dYdX
 *
 * @dev Library for common types used in PerpetualV1 contracts.
 */
library P1Types {
    // ============ Structs ============

    /**
     * @dev Used to represent the global index and each account's cached index.
     *  Used to settle funding paymennts on a per-account basis.
     */
    struct Index {
        uint32 timestamp;
        bool isPositive;
        uint128 value;
    }

    /**
     * @dev Used to track the signed margin balance and position balance values for each account.
     */
    struct Balance {
        bool marginIsPositive;
        bool positionIsPositive;
        uint120 margin;
        uint120 position;
    }

    /**
     * @dev Used to cache commonly-used variables that are relatively gas-intensive to obtain.
     */
    struct Context {
        uint256 price;
        uint256 minCollateral;
        Index index;
    }

    /**
     * @dev Used by contracts implementing the I_P1Trader interface to return the result of a trade.
     */
    struct TradeResult {
        uint256 marginAmount;
        uint256 positionAmount;
        bool isBuy; // From taker's perspective.
        bytes32 traderFlags;
    }
}

// File: contracts/protocol/v1/impl/P1Storage.sol

/**
 * @title P1Storage
 * @author dYdX
 *
 * @notice Storage contract. Contains or inherits from all contracts that have ordered storage.
 */
contract P1Storage is
    Adminable,
    ReentrancyGuard
{
    mapping(address => P1Types.Balance) internal _BALANCES_;
    mapping(address => P1Types.Index) internal _LOCAL_INDEXES_;

    mapping(address => bool) internal _GLOBAL_OPERATORS_;
    mapping(address => mapping(address => bool)) internal _LOCAL_OPERATORS_;

    address internal _TOKEN_;
    address internal _ORACLE_;
    address internal _FUNDER_;

    P1Types.Index internal _GLOBAL_INDEX_;
    uint256 internal _MIN_COLLATERAL_;

    bool internal _FINAL_SETTLEMENT_ENABLED_;
    uint256 internal _FINAL_SETTLEMENT_PRICE_;
}

// File: contracts/protocol/v1/intf/I_P1Oracle.sol

/**
 * @title I_P1Oracle
 * @author dYdX
 *
 * @notice Interface that PerpetualV1 Price Oracles must implement.
 */
interface I_P1Oracle {

    /**
     * @notice Returns the price of the underlying asset relative to the margin token.
     *
     * @return The price as a fixed-point number with 18 decimals.
     */
    function getPrice()
        external
        view
        returns (uint256);
}

// File: contracts/protocol/v1/impl/P1Getters.sol

/**
 * @title P1Getters
 * @author dYdX
 *
 * @notice Contract for read-only getters.
 */
contract P1Getters is
    P1Storage
{
    // ============ Account Getters ============

    /**
     * @notice Get the balance of an account, without accounting for changes in the index.
     *
     * @param  account  The address of the account to query the balances of.
     * @return          The balances of the account.
     */
    function getAccountBalance(
        address account
    )
        external
        view
        returns (P1Types.Balance memory)
    {
        return _BALANCES_[account];
    }

    /**
     * @notice Gets the most recently cached index of an account.
     *
     * @param  account  The address of the account to query the index of.
     * @return          The index of the account.
     */
    function getAccountIndex(
        address account
    )
        external
        view
        returns (P1Types.Index memory)
    {
        return _LOCAL_INDEXES_[account];
    }

    /**
     * @notice Gets the local operator status of an operator for a particular account.
     *
     * @param  account   The account to query the operator for.
     * @param  operator  The address of the operator to query the status of.
     * @return           True if the operator is a local operator of the account, false otherwise.
     */
    function getIsLocalOperator(
        address account,
        address operator
    )
        external
        view
        returns (bool)
    {
        return _LOCAL_OPERATORS_[account][operator];
    }

    // ============ Global Getters ============

    /**
     * @notice Gets the global operator status of an address.
     *
     * @param  operator  The address of the operator to query the status of.
     * @return           True if the address is a global operator, false otherwise.
     */
    function getIsGlobalOperator(
        address operator
    )
        external
        view
        returns (bool)
    {
        return _GLOBAL_OPERATORS_[operator];
    }

    /**
     * @notice Gets the address of the ERC20 margin contract used for margin deposits.
     *
     * @return The address of the ERC20 token.
     */
    function getTokenContract()
        external
        view
        returns (address)
    {
        return _TOKEN_;
    }

    /**
     * @notice Gets the current address of the price oracle contract.
     *
     * @return The address of the price oracle contract.
     */
    function getOracleContract()
        external
        view
        returns (address)
    {
        return _ORACLE_;
    }

    /**
     * @notice Gets the current address of the funder contract.
     *
     * @return The address of the funder contract.
     */
    function getFunderContract()
        external
        view
        returns (address)
    {
        return _FUNDER_;
    }

    /**
     * @notice Gets the most recently cached global index.
     *
     * @return The most recently cached global index.
     */
    function getGlobalIndex()
        external
        view
        returns (P1Types.Index memory)
    {
        return _GLOBAL_INDEX_;
    }

    /**
     * @notice Gets minimum collateralization ratio of the protocol.
     *
     * @return The minimum-acceptable collateralization ratio, returned as a fixed-point number with
     *  18 decimals of precision.
     */
    function getMinCollateral()
        external
        view
        returns (uint256)
    {
        return _MIN_COLLATERAL_;
    }

    /**
     * @notice Gets the status of whether final-settlement was initiated by the Admin.
     *
     * @return True if final-settlement was enabled, false otherwise.
     */
    function getFinalSettlementEnabled()
        external
        view
        returns (bool)
    {
        return _FINAL_SETTLEMENT_ENABLED_;
    }

    // ============ Authorized External Getters ============

    /**
     * @notice Gets the price returned by the oracle.
     * @dev Only able to be called by global operators.
     *
     * @return The price returned by the current price oracle.
     */
    function getOraclePrice()
        external
        view
        returns (uint256)
    {
        require(
            _GLOBAL_OPERATORS_[msg.sender],
            "Oracle price requester not global operator"
        );
        return I_P1Oracle(_ORACLE_).getPrice();
    }

    // ============ Public Getters ============

    /**
     * @notice Gets whether an address has permissions to operate an account.
     *
     * @param  account   The account to query.
     * @param  operator  The address to query.
     * @return           True if the operator has permission to operate the account,
     *                   and false otherwise.
     */
    function hasAccountPermissions(
        address account,
        address operator
    )
        public
        view
        returns (bool)
    {
        return account == operator
            || _GLOBAL_OPERATORS_[operator]
            || _LOCAL_OPERATORS_[account][operator];
    }
}

// File: contracts/protocol/v1/traders/P1Orders.sol

/**
 * @title P1Orders
 * @author dYdX
 *
 * @notice Contract allowing trading between accounts using cryptographically signed messages.
 */
contract P1Orders is
    P1TraderConstants
{
    using BaseMath for uint256;
    using SafeMath for uint256;

    // ============ Constants ============

    // EIP191 header for EIP712 prefix
    bytes2 constant private EIP191_HEADER = 0x1901;

    // EIP712 Domain Name value
    string constant private EIP712_DOMAIN_NAME = "P1Orders";

    // EIP712 Domain Version value
    string constant private EIP712_DOMAIN_VERSION = "1.0";

    // Hash of the EIP712 Domain Separator Schema
    /* solium-disable-next-line indentation */
    bytes32 constant private EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(
        "EIP712Domain(",
        "string name,",
        "string version,",
        "uint256 chainId,",
        "address verifyingContract",
        ")"
    ));

    // Hash of the EIP712 LimitOrder struct
    /* solium-disable-next-line indentation */
    bytes32 constant private EIP712_ORDER_STRUCT_SCHEMA_HASH = keccak256(abi.encodePacked(
        "Order(",
        "bytes32 flags,",
        "uint256 amount,",
        "uint256 limitPrice,",
        "uint256 triggerPrice,",
        "uint256 limitFee,",
        "address maker,",
        "address taker,",
        "uint256 expiration",
        ")"
    ));

    // Bitmasks for the flags field
    bytes32 constant FLAG_MASK_NULL = bytes32(uint256(0));
    bytes32 constant FLAG_MASK_IS_BUY = bytes32(uint256(1));
    bytes32 constant FLAG_MASK_IS_DECREASE_ONLY = bytes32(uint256(1 << 1));
    bytes32 constant FLAG_MASK_IS_NEGATIVE_LIMIT_FEE = bytes32(uint256(1 << 2));

    // ============ Enums ============

    enum OrderStatus {
        Open,
        Approved,
        Canceled
    }

    // ============ Structs ============

    struct Order {
        bytes32 flags;
        uint256 amount;
        uint256 limitPrice;
        uint256 triggerPrice;
        uint256 limitFee;
        address maker;
        address taker;
        uint256 expiration;
    }

    struct Fill {
        uint256 amount;
        uint256 price;
        uint256 fee;
        bool isNegativeFee;
    }

    struct TradeData {
        Order order;
        Fill fill;
        TypedSignature.Signature signature;
    }

    struct OrderQueryOutput {
        OrderStatus status;
        uint256 filledAmount;
    }

    // ============ Events ============

    event LogOrderCanceled(
        address indexed maker,
        bytes32 orderHash
    );

    event LogOrderApproved(
        address indexed maker,
        bytes32 orderHash
    );

    event LogOrderFilled(
        bytes32 orderHash,
        bytes32 flags,
        uint256 triggerPrice,
        Fill fill
    );

    // ============ Immutable Storage ============

    // address of the perpetual contract
    address public _PERPETUAL_V1_;

    // Hash of the EIP712 Domain Separator data
    bytes32 public _EIP712_DOMAIN_HASH_;

    // ============ Mutable Storage ============

    // order hash => filled amount (in position amount)
    mapping (bytes32 => uint256) public _FILLED_AMOUNT_;

    // order hash => status
    mapping (bytes32 => OrderStatus) public _STATUS_;

    // ============ Constructor ============

    constructor (
        address perpetualV1,
        uint256 chainId
    )
        public
    {
        _PERPETUAL_V1_ = perpetualV1;

        /* solium-disable-next-line indentation */
        _EIP712_DOMAIN_HASH_ = keccak256(abi.encode(
            EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,
            keccak256(bytes(EIP712_DOMAIN_NAME)),
            keccak256(bytes(EIP712_DOMAIN_VERSION)),
            chainId,
            address(this)
        ));
    }

    // ============ External Functions ============

    /**
     * @notice Allows an account to take an order cryptographically signed by a different account.
     * @dev Emits the LogOrderFilled event.
     *
     * @param  sender  The address that called the trade() function on PerpetualV1.
     * @param  maker   The maker of the order.
     * @param  taker   The taker of the order.
     * @param  price   The current oracle price of the underlying asset.
     * @param  data    A struct of type TradeData.
     * @return         The assets to be traded and traderFlags that indicate that a trade occurred.
     */
    function trade(
        address sender,
        address maker,
        address taker,
        uint256 price,
        bytes calldata data,
        bytes32 /* traderFlags */
    )
        external
        returns (P1Types.TradeResult memory)
    {
        address perpetual = _PERPETUAL_V1_;

        require(
            msg.sender == perpetual,
            "msg.sender must be PerpetualV1"
        );

        if (taker != sender) {
            require(
                P1Getters(perpetual).hasAccountPermissions(taker, sender),
                "Sender does not have permissions for the taker"
            );
        }

        TradeData memory tradeData = abi.decode(data, (TradeData));
        bytes32 orderHash = _getOrderHash(tradeData.order);

        // validations
        _verifyOrderStateAndSignature(
            tradeData,
            orderHash
        );
        _verifyOrderRequest(
            tradeData,
            maker,
            taker,
            perpetual,
            price
        );

        // set _FILLED_AMOUNT_
        uint256 oldFilledAmount = _FILLED_AMOUNT_[orderHash];
        uint256 newFilledAmount = oldFilledAmount.add(tradeData.fill.amount);
        require(
            newFilledAmount <= tradeData.order.amount,
            "Cannot overfill order"
        );
        _FILLED_AMOUNT_[orderHash] = newFilledAmount;

        emit LogOrderFilled(
            orderHash,
            tradeData.order.flags,
            tradeData.order.triggerPrice,
            tradeData.fill
        );

        // Order fee is denoted as a percentage of execution price.
        // Convert into an amount per unit position.
        uint256 fee = tradeData.fill.fee.baseMul(tradeData.fill.price);

        // `isBuyOrder` is from the maker's perspective.
        bool isBuyOrder = _isBuy(tradeData.order);
        uint256 marginPerPosition = (isBuyOrder == tradeData.fill.isNegativeFee)
            ? tradeData.fill.price.sub(fee)
            : tradeData.fill.price.add(fee);

        return P1Types.TradeResult({
            marginAmount: tradeData.fill.amount.baseMul(marginPerPosition),
            positionAmount: tradeData.fill.amount,
            isBuy: !isBuyOrder,
            traderFlags: TRADER_FLAG_ORDERS
        });
    }

    /**
     * @notice On-chain approves an order.
     * @dev Emits the LogOrderApproved event.
     *
     * @param  order  The order that will be approved.
     */
    function approveOrder(
        Order calldata order
    )
        external
    {
        require(
            msg.sender == order.maker,
            "Order cannot be approved by non-maker"
        );
        bytes32 orderHash = _getOrderHash(order);
        require(
            _STATUS_[orderHash] != OrderStatus.Canceled,
            "Canceled order cannot be approved"
        );
        _STATUS_[orderHash] = OrderStatus.Approved;
        emit LogOrderApproved(msg.sender, orderHash);
    }

    /**
     * @notice On-chain cancels an order.
     * @dev Emits the LogOrderCanceled event.
     *
     * @param  order  The order that will be permanently canceled.
     */
    function cancelOrder(
        Order calldata order
    )
        external
    {
        require(
            msg.sender == order.maker,
            "Order cannot be canceled by non-maker"
        );
        bytes32 orderHash = _getOrderHash(order);
        _STATUS_[orderHash] = OrderStatus.Canceled;
        emit LogOrderCanceled(msg.sender, orderHash);
    }

    // ============ Getter Functions ============

    /**
     * @notice Gets the status (open/approved/canceled) and filled amount of each order in a list.
     *
     * @param  orderHashes  A list of the hashes of the orders to check.
     * @return              A list of OrderQueryOutput structs containing the status and filled
     *                      amount of each order.
     */
    function getOrdersStatus(
        bytes32[] calldata orderHashes
    )
        external
        view
        returns (OrderQueryOutput[] memory)
    {
        OrderQueryOutput[] memory result = new OrderQueryOutput[](orderHashes.length);
        for (uint256 i = 0; i < orderHashes.length; i++) {
            bytes32 orderHash = orderHashes[i];
            result[i] = OrderQueryOutput({
                status: _STATUS_[orderHash],
                filledAmount: _FILLED_AMOUNT_[orderHash]
            });
        }
        return result;
    }

    // ============ Helper Functions ============

    function _verifyOrderStateAndSignature(
        TradeData memory tradeData,
        bytes32 orderHash
    )
        private
        view
    {
        OrderStatus orderStatus = _STATUS_[orderHash];

        if (orderStatus == OrderStatus.Open) {
            require(
                tradeData.order.maker == TypedSignature.recover(orderHash, tradeData.signature),
                "Order has an invalid signature"
            );
        } else {
            require(
                orderStatus != OrderStatus.Canceled,
                "Order was already canceled"
            );
            assert(orderStatus == OrderStatus.Approved);
        }
    }

    function _verifyOrderRequest(
        TradeData memory tradeData,
        address maker,
        address taker,
        address perpetual,
        uint256 price
    )
        private
        view
    {
        require(
            tradeData.order.maker == maker,
            "Order maker does not match maker"
        );
        require(
            tradeData.order.taker == taker || tradeData.order.taker == address(0),
            "Order taker does not match taker"
        );
        require(
            tradeData.order.expiration >= block.timestamp || tradeData.order.expiration == 0,
            "Order has expired"
        );

        // `isBuyOrder` is from the maker's perspective.
        bool isBuyOrder = _isBuy(tradeData.order);
        bool validPrice = isBuyOrder
            ? tradeData.fill.price <= tradeData.order.limitPrice
            : tradeData.fill.price >= tradeData.order.limitPrice;
        require(
            validPrice,
            "Fill price is invalid"
        );

        bool validFee = _isNegativeLimitFee(tradeData.order)
            ? tradeData.fill.isNegativeFee && tradeData.fill.fee >= tradeData.order.limitFee
            : tradeData.fill.isNegativeFee || tradeData.fill.fee <= tradeData.order.limitFee;
        require(
            validFee,
            "Fill fee is invalid"
        );

        if (tradeData.order.triggerPrice != 0) {
            bool validTriggerPrice = isBuyOrder
                ? tradeData.order.triggerPrice <= price
                : tradeData.order.triggerPrice >= price;
            require(
                validTriggerPrice,
                "Trigger price has not been reached"
            );
        }

        if (_isDecreaseOnly(tradeData.order)) {
            P1Types.Balance memory balance = P1Getters(perpetual).getAccountBalance(maker);
            require(
                isBuyOrder != balance.positionIsPositive
                && tradeData.fill.amount <= balance.position,
                "Fill does not decrease position"
            );
        }
    }

    /**
     * @dev Returns the EIP712 hash of an order.
     */
    function _getOrderHash(
        Order memory order
    )
        private
        view
        returns (bytes32)
    {
        // compute the overall signed struct hash
        /* solium-disable-next-line indentation */
        bytes32 structHash = keccak256(abi.encode(
            EIP712_ORDER_STRUCT_SCHEMA_HASH,
            order
        ));

        // compute eip712 compliant hash
        /* solium-disable-next-line indentation */
        return keccak256(abi.encodePacked(
            EIP191_HEADER,
            _EIP712_DOMAIN_HASH_,
            structHash
        ));
    }

    function _isBuy(
        Order memory order
    )
        private
        pure
        returns (bool)
    {
        return (order.flags & FLAG_MASK_IS_BUY) != FLAG_MASK_NULL;
    }

    function _isDecreaseOnly(
        Order memory order
    )
        private
        pure
        returns (bool)
    {
        return (order.flags & FLAG_MASK_IS_DECREASE_ONLY) != FLAG_MASK_NULL;
    }

    function _isNegativeLimitFee(
        Order memory order
    )
        private
        pure
        returns (bool)
    {
        return (order.flags & FLAG_MASK_IS_NEGATIVE_LIMIT_FEE) != FLAG_MASK_NULL;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"perpetualV1","type":"address"},{"internalType":"uint256","name":"chainId","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"LogOrderApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"LogOrderCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"flags","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"triggerPrice","type":"uint256"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"bool","name":"isNegativeFee","type":"bool"}],"indexed":false,"internalType":"struct P1Orders.Fill","name":"fill","type":"tuple"}],"name":"LogOrderFilled","type":"event"},{"constant":true,"inputs":[],"name":"_EIP712_DOMAIN_HASH_","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"_FILLED_AMOUNT_","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_PERPETUAL_V1_","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"_STATUS_","outputs":[{"internalType":"enum P1Orders.OrderStatus","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"components":[{"internalType":"bytes32","name":"flags","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"limitPrice","type":"uint256"},{"internalType":"uint256","name":"triggerPrice","type":"uint256"},{"internalType":"uint256","name":"limitFee","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"internalType":"struct P1Orders.Order","name":"order","type":"tuple"}],"name":"approveOrder","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"components":[{"internalType":"bytes32","name":"flags","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"limitPrice","type":"uint256"},{"internalType":"uint256","name":"triggerPrice","type":"uint256"},{"internalType":"uint256","name":"limitFee","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"internalType":"struct P1Orders.Order","name":"order","type":"tuple"}],"name":"cancelOrder","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32[]","name":"orderHashes","type":"bytes32[]"}],"name":"getOrdersStatus","outputs":[{"components":[{"internalType":"enum P1Orders.OrderStatus","name":"status","type":"uint8"},{"internalType":"uint256","name":"filledAmount","type":"uint256"}],"internalType":"struct P1Orders.OrderQueryOutput[]","name":"","type":"tuple[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"trade","outputs":[{"components":[{"internalType":"uint256","name":"marginAmount","type":"uint256"},{"internalType":"uint256","name":"positionAmount","type":"uint256"},{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"bytes32","name":"traderFlags","type":"bytes32"}],"internalType":"struct P1Types.TradeResult","name":"","type":"tuple"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200271a3803806200271a833981016040819052620000349162000145565b600080546001600160a01b0319166001600160a01b0384161790556040516200006090602001620002aa565b60408051601f1981840301815282825280516020918201208383018352600884526750314f726465727360c01b938201939093528151808301835260038152620312e360ec1b9082015290516200010192917fa158a5339131788e3aca6a19d29e24b109bb548949d45296cd531bbe8e7565d1917fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b3918691309101620002f8565b60405160208183030381529060405280519060200120600181905550505062000394565b805162000132816200036f565b92915050565b8051620001328162000389565b600080604083850312156200015957600080fd5b600062000167858562000125565b92505060206200017a8582860162000138565b9150509250929050565b6200018f8162000353565b82525050565b6200018f8162000360565b6000620001af600c836200034e565b6b1cdd1c9a5b99c81b985b594b60a21b8152600c0192915050565b6000620001d96019836200034e565b7f6164647265737320766572696679696e67436f6e747261637400000000000000815260190192915050565b6000620002146010836200034e565b6f1d5a5b9d0c8d4d8818da185a5b92590b60821b815260100192915050565b6000620002426001836200034e565b602960f81b815260010192915050565b600062000261600f836200034e565b6e1cdd1c9a5b99c81d995c9cda5bdb8b608a1b8152600f0192915050565b60006200028e600d836200034e565b6c08a92a06e626488dedac2d2dc5609b1b8152600d0192915050565b6000620002b7826200027f565b9150620002c482620001a0565b9150620002d18262000252565b9150620002de8262000205565b9150620002eb82620001ca565b9150620001328262000233565b60a0810162000308828862000195565b62000317602083018762000195565b62000326604083018662000195565b62000335606083018562000195565b62000344608083018462000184565b9695505050505050565b919050565b6000620001328262000363565b90565b6001600160a01b031690565b6200037a8162000353565b81146200038657600080fd5b50565b6200037a8162000360565b61237680620003a46000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80639ea070711161005b5780639ea07071146100fe578063aacc263e1461011e578063c7dc03f91461013e578063d4bec8eb1461014657610088565b80635c457f291461008d5780637946c890146100b6578063867f1690146100cb578063970c2ba1146100de575b600080fd5b6100a061009b36600461150c565b61015b565b6040516100ad9190612006565b60405180910390f35b6100c96100c4366004611548565b61016d565b005b6100c96100d9366004611548565b610261565b6100f16100ec366004611407565b610377565b6040516100ad91906121d2565b61011161010c36600461150c565b610677565b6040516100ad91906120a3565b61013161012c3660046114ac565b61068c565b6040516100ad9190611ff5565b6100a061075f565b61014e610765565b6040516100ad9190611fcc565b60026020526000908152604090205481565b61017d60c0820160a083016113e1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101d05760405162461bcd60e51b81526004016101c790612172565b60405180910390fd5b60006101e96101e436849003840184611567565b610781565b6000818152600360205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660021790555190915033907f4117a4c82505f7102c183e1fb9daa8f8e06d56d6af04479fc417fa8c0490289390610255908490612006565b60405180910390a25050565b61027160c0820160a083016113e1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102bb5760405162461bcd60e51b81526004016101c790612112565b60006102cf6101e436849003840184611567565b9050600260008281526003602052604090205460ff1660028111156102f057fe5b141561030e5760405162461bcd60e51b81526004016101c790612192565b6000818152600360205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555133907fbd06df5febc1b0cd2e8ba37a6bb524ae77524c4aa2dc5e0f5ac64f5d11a50b1b90610255908490612006565b61037f610f8d565b60005473ffffffffffffffffffffffffffffffffffffffff163381146103b75760405162461bcd60e51b81526004016101c7906121c2565b8873ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16146104aa576040517f84ea286200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216906384ea28629061043e908a908d90600401611fda565b60206040518083038186803b15801561045657600080fd5b505afa15801561046a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061048e91908101906114ee565b6104aa5760405162461bcd60e51b81526004016101c7906120c2565b6104b2610fb4565b6104be85870187611586565b905060006104cf8260000151610781565b90506104db8282610845565b6104e8828b8b868c610915565b6000818152600260209081526040822054908401515190919061051290839063ffffffff610c4d16565b84516020015190915081111561053a5760405162461bcd60e51b81526004016101c7906121a2565b600083815260026020908152604091829020839055855180516060909101519187015192517f5760b5a80923536b02524ebe3b1f92cc973195ac25559c60564e8db9e02d15ad9361059093889392909190612014565b60405180910390a160006105bd856020015160200151866020015160400151610c7990919063ffffffff16565b905060006105ce8660000151610ca3565b905060008660200151606001511515821515146106025760208088015101516105fd908463ffffffff610c4d16565b61061a565b602080880151015161061a908463ffffffff610cac16565b90506040518060800160405280610642838a6020015160000151610c7990919063ffffffff16565b815260209889015151988101989098529115604088015250600160609096019590955250929c9b505050505050505050505050565b60036020526000908152604090205460ff1681565b606080838390506040519080825280602002602001820160405280156106cc57816020015b6106b9610fe6565b8152602001906001900390816106b15790505b50905060005b838110156107555760008585838181106106e857fe5b604080518082018252602092830294909401356000818152600390935291205490935082915060ff16600281111561071c57fe5b8152600083815260026020908152604090912054910152835184908490811061074157fe5b6020908102919091010152506001016106d2565b5090505b92915050565b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60008060405160200161079390611f5e565b60405160208183030381529060405280519060200120836040516020016107bb929190612052565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290528051602091820120600154909350610826927f190100000000000000000000000000000000000000000000000000000000000092859101611f05565b604051602081830303815290604052805190602001209150505b919050565b60008181526003602052604081205460ff169081600281111561086457fe5b14156108cf57610878828460400151610cee565b73ffffffffffffffffffffffffffffffffffffffff16836000015160a0015173ffffffffffffffffffffffffffffffffffffffff16146108ca5760405162461bcd60e51b81526004016101c790612142565b610910565b60028160028111156108dd57fe5b14156108fb5760405162461bcd60e51b81526004016101c790612122565b600181600281111561090957fe5b1461091057fe5b505050565b8373ffffffffffffffffffffffffffffffffffffffff16856000015160a0015173ffffffffffffffffffffffffffffffffffffffff16146109685760405162461bcd60e51b81526004016101c7906120f2565b8273ffffffffffffffffffffffffffffffffffffffff16856000015160c0015173ffffffffffffffffffffffffffffffffffffffff1614806109c35750845160c0015173ffffffffffffffffffffffffffffffffffffffff16155b6109df5760405162461bcd60e51b81526004016101c7906121b2565b845160e00151421115806109f65750845160e00151155b610a125760405162461bcd60e51b81526004016101c790612152565b6000610a218660000151610ca3565b9050600081610a3f5786516040015160208089015101511015610a50565b865160400151602080890151015111155b905080610a6f5760405162461bcd60e51b81526004016101c790612182565b6000610a7e8860000151610e9c565b610aa85787602001516060015180610aa3575087516080015160208901516040015111155b610aca565b8760200151606001518015610aca575087516080015160208901516040015110155b905080610ae95760405162461bcd60e51b81526004016101c7906120d2565b87516060015115610b3457600083610b0957885160600151851115610b13565b8851606001518510155b905080610b325760405162461bcd60e51b81526004016101c790612162565b505b8751610b3f90610ea5565b15610c4357610b4c610f8d565b6040517f93423e9c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8716906393423e9c90610b9e908b90600401611fcc565b60806040518083038186803b158015610bb657600080fd5b505afa158015610bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bee919081019061152a565b90508060200151151584151514158015610c25575080606001516effffffffffffffffffffffffffffff1689602001516000015111155b610c415760405162461bcd60e51b81526004016101c7906120e2565b505b5050505050505050565b600082820183811015610c725760405162461bcd60e51b81526004016101c790612102565b9392505050565b6000610c72670de0b6b3a7640000610c97858563ffffffff610eae16565b9063ffffffff610ee816565b51600116151590565b6000610c7283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f2a565b6040810151600090819060f01c60ff166003811115610d0957fe5b9050600080826003811115610d1a57fe5b1415610d27575083610e16565b6001826003811115610d3557fe5b1415610da0576040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a33320000000081525085604051602001610d83929190611f3c565b604051602081830303815290604052805190602001209050610e16565b6002826003811115610dae57fe5b14610db557fe5b6040518060400160405280601b81526020017f19457468657265756d205369676e6564204d6573736167653a0a20000000000081525085604051602001610dfd929190611f3c565b6040516020818303038152906040528051906020012090505b600181856040015160f81c8660000151876020015160405160008152602001604052604051610e48949392919061206e565b6020604051602081039080840390855afa158015610e6a573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519695505050505050565b51600416151590565b51600216151590565b600082610ebd57506000610759565b82820282848281610eca57fe5b0414610c725760405162461bcd60e51b81526004016101c790612132565b6000610c7283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f56565b60008184841115610f4e5760405162461bcd60e51b81526004016101c791906120b1565b505050900390565b60008183610f775760405162461bcd60e51b81526004016101c791906120b1565b506000838581610f8357fe5b0495945050505050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6040518060600160405280610fc7610ffd565b8152602001610fd4611071565b8152602001610fe161109b565b905290565b604080518082019091526000808252602082015290565b6040518061010001604052806000801916815260200160008152602001600081526020016000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b60405180608001604052806000815260200160008152602001600081526020016000151581525090565b604080516060810182526000808252602082018190529181019190915290565b8035610759816122fb565b60008083601f8401126110d857600080fd5b50813567ffffffffffffffff8111156110f057600080fd5b60208301915083602082028301111561110857600080fd5b9250929050565b80356107598161230f565b80516107598161230f565b803561075981612318565b803561075981612321565b60008083601f84011261114d57600080fd5b50813567ffffffffffffffff81111561116557600080fd5b60208301915083600182028301111561110857600080fd5b60006080828403121561118f57600080fd5b61119960806121e0565b905060006111a7848461111a565b82525060206111b88484830161111a565b60208301525060406111cc848285016113d6565b60408301525060606111e0848285016113d6565b60608301525092915050565b6000608082840312156111fe57600080fd5b61120860806121e0565b905060006112168484611130565b825250602061122784848301611130565b602083015250604061123b84828501611130565b60408301525060606111e08482850161110f565b6000610100828403121561126257600080fd5b50919050565b6000610100828403121561127b57600080fd5b6112866101006121e0565b905060006112948484611130565b82525060206112a584848301611130565b60208301525060406112b984828501611130565b60408301525060606112cd84828501611130565b60608301525060806112e184828501611130565b60808301525060a06112f5848285016110bb565b60a08301525060c0611309848285016110bb565b60c08301525060e061131d84828501611130565b60e08301525092915050565b60006060828403121561133b57600080fd5b61134560606121e0565b905060006113538484611130565b825250602061136484848301611130565b602083015250604061137884828501611125565b60408301525092915050565b60006101e0828403121561139757600080fd5b6113a160606121e0565b905060006113af8484611268565b8252506101006113c1848483016111ec565b60208301525061018061137884828501611329565b80516107598161232a565b6000602082840312156113f357600080fd5b60006113ff84846110bb565b949350505050565b600080600080600080600060c0888a03121561142257600080fd5b600061142e8a8a6110bb565b975050602061143f8a828b016110bb565b96505060406114508a828b016110bb565b95505060606114618a828b01611130565b945050608088013567ffffffffffffffff81111561147e57600080fd5b61148a8a828b0161113b565b935093505060a061149d8a828b01611130565b91505092959891949750929550565b600080602083850312156114bf57600080fd5b823567ffffffffffffffff8111156114d657600080fd5b6114e2858286016110c6565b92509250509250929050565b60006020828403121561150057600080fd5b60006113ff848461111a565b60006020828403121561151e57600080fd5b60006113ff8484611130565b60006080828403121561153c57600080fd5b60006113ff848461117d565b6000610100828403121561155b57600080fd5b60006113ff848461124f565b6000610100828403121561157a57600080fd5b60006113ff8484611268565b60006101e0828403121561159957600080fd5b60006113ff8484611384565b60006115b18383611df7565b505060400190565b6115c28161221a565b82525050565b60006115d38261220d565b6115dd8185612211565b93506115e883612207565b8060005b8381101561161657815161160088826115a5565b975061160b83612207565b9250506001016115ec565b509495945050505050565b6115c281612225565b6115c26116368261222a565b61224f565b6115c28161224f565b6115c26116368261224f565b600061165b8261220d565b6116658185610840565b935061167581856020860161229a565b9290920192915050565b6115c28161228f565b60006116938261220d565b61169d8185612211565b93506116ad81856020860161229a565b6116b6816122c6565b9093019392505050565b60006116cd602e83612211565b7f53656e64657220646f6573206e6f742068617665207065726d697373696f6e7381527f20666f72207468652074616b6572000000000000000000000000000000000000602082015260400192915050565b600061172c601383612211565b7f46696c6c2066656520697320696e76616c696400000000000000000000000000815260200192915050565b6000611765601f83612211565b7f46696c6c20646f6573206e6f7420646563726561736520706f736974696f6e00815260200192915050565b600061179e600f83610840565b7f75696e7432353620616d6f756e742c00000000000000000000000000000000008152600f0192915050565b60006117d7602083612211565b7f4f72646572206d616b657220646f6573206e6f74206d61746368206d616b6572815260200192915050565b6000611810600683610840565b7f4f72646572280000000000000000000000000000000000000000000000000000815260060192915050565b6000611849601b83612211565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000611882601583610840565b7f75696e74323536207472696767657250726963652c0000000000000000000000815260150192915050565b60006118bb600183610840565b7f2900000000000000000000000000000000000000000000000000000000000000815260010192915050565b60006118f4602583612211565b7f4f726465722063616e6e6f7420626520617070726f766564206279206e6f6e2d81527f6d616b6572000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611953600e83610840565b7f6279746573333220666c6167732c0000000000000000000000000000000000008152600e0192915050565b600061198c601a83612211565b7f4f726465722077617320616c72656164792063616e63656c6564000000000000815260200192915050565b60006119c5602183612211565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81527f7700000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611a24601383610840565b7f75696e74323536206c696d697450726963652c00000000000000000000000000815260130192915050565b6000611a5d600e83610840565b7f616464726573732074616b65722c0000000000000000000000000000000000008152600e0192915050565b6000611a96600e83610840565b7f61646472657373206d616b65722c0000000000000000000000000000000000008152600e0192915050565b6000611acf601e83612211565b7f4f726465722068617320616e20696e76616c6964207369676e61747572650000815260200192915050565b6000611b08601183612211565b7f4f72646572206861732065787069726564000000000000000000000000000000815260200192915050565b6000611b41602283612211565b7f5472696767657220707269636520686173206e6f74206265656e20726561636881527f6564000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611ba0601283610840565b7f75696e743235362065787069726174696f6e0000000000000000000000000000815260120192915050565b6000611bd9602583612211565b7f4f726465722063616e6e6f742062652063616e63656c6564206279206e6f6e2d81527f6d616b6572000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611c38601583612211565b7f46696c6c20707269636520697320696e76616c69640000000000000000000000815260200192915050565b6000611c71602183612211565b7f43616e63656c6564206f726465722063616e6e6f7420626520617070726f766581527f6400000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611cd0601583612211565b7f43616e6e6f74206f76657266696c6c206f726465720000000000000000000000815260200192915050565b6000611d09602083612211565b7f4f726465722074616b657220646f6573206e6f74206d617463682074616b6572815260200192915050565b6000611d42601183610840565b7f75696e74323536206c696d69744665652c000000000000000000000000000000815260110192915050565b6000611d7b601e83612211565b7f6d73672e73656e646572206d7573742062652050657270657475616c56310000815260200192915050565b80516080830190611db8848261163b565b506020820151611dcb602085018261163b565b506040820151611dde604085018261163b565b506060820151611df16060850182611621565b50505050565b80516040830190611e08848261167f565b506020820151611df1602085018261163b565b8051610100830190611e2d848261163b565b506020820151611e40602085018261163b565b506040820151611e53604085018261163b565b506060820151611e66606085018261163b565b506080820151611e79608085018261163b565b5060a0820151611e8c60a08501826115b9565b5060c0820151611e9f60c08501826115b9565b5060e0820151611df160e085018261163b565b80516080830190611ec3848261163b565b506020820151611ed6602085018261163b565b506040820151611ee96040850182611621565b506060820151611df1606085018261163b565b6115c281612289565b6000611f11828661162a565b600282019150611f218285611644565b602082019150611f318284611644565b506020019392505050565b6000611f488285611650565b9150611f548284611644565b5060200192915050565b6000611f6982611803565b9150611f7482611946565b9150611f7f82611791565b9150611f8a82611a17565b9150611f9582611875565b9150611fa082611d35565b9150611fab82611a89565b9150611fb682611a50565b9150611fc182611b93565b9150610759826118ae565b6020810161075982846115b9565b60408101611fe882856115b9565b610c7260208301846115b9565b60208082528101610c7281846115c8565b60208101610759828461163b565b60e08101612022828761163b565b61202f602083018661163b565b61203c604083018561163b565b6120496060830184611da7565b95945050505050565b6101208101612061828561163b565b610c726020830184611e1b565b6080810161207c828761163b565b6120896020830186611efc565b612096604083018561163b565b612049606083018461163b565b60208101610759828461167f565b60208082528101610c728184611688565b60208082528101610759816116c0565b602080825281016107598161171f565b6020808252810161075981611758565b60208082528101610759816117ca565b602080825281016107598161183c565b60208082528101610759816118e7565b602080825281016107598161197f565b60208082528101610759816119b8565b6020808252810161075981611ac2565b6020808252810161075981611afb565b6020808252810161075981611b34565b6020808252810161075981611bcc565b6020808252810161075981611c2b565b6020808252810161075981611c64565b6020808252810161075981611cc3565b6020808252810161075981611cfc565b6020808252810161075981611d6e565b608081016107598284611eb2565b60405181810167ffffffffffffffff811182821017156121ff57600080fd5b604052919050565b60200190565b5190565b90815260200190565b600061075982612270565b151590565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b80610840816122ee565b6effffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b60ff1690565b600061075982612252565b60005b838110156122b557818101518382015260200161229d565b83811115611df15750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b600381106122f857fe5b50565b6123048161221a565b81146122f857600080fd5b61230481612225565b6123048161222a565b6123048161224f565b6123048161225c56fea365627a7a723158207dd790d95f74ea1aa475c135bdee1e39fd1c333e1fa206d15f3d14f20c03ef806c6578706572696d656e74616cf564736f6c634300051000400000000000000000000000001c50c582c7066049c560bca20416b1d9e0dfb0030000000000000000000000000000000000000000000000000000000000000001

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c80639ea070711161005b5780639ea07071146100fe578063aacc263e1461011e578063c7dc03f91461013e578063d4bec8eb1461014657610088565b80635c457f291461008d5780637946c890146100b6578063867f1690146100cb578063970c2ba1146100de575b600080fd5b6100a061009b36600461150c565b61015b565b6040516100ad9190612006565b60405180910390f35b6100c96100c4366004611548565b61016d565b005b6100c96100d9366004611548565b610261565b6100f16100ec366004611407565b610377565b6040516100ad91906121d2565b61011161010c36600461150c565b610677565b6040516100ad91906120a3565b61013161012c3660046114ac565b61068c565b6040516100ad9190611ff5565b6100a061075f565b61014e610765565b6040516100ad9190611fcc565b60026020526000908152604090205481565b61017d60c0820160a083016113e1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101d05760405162461bcd60e51b81526004016101c790612172565b60405180910390fd5b60006101e96101e436849003840184611567565b610781565b6000818152600360205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660021790555190915033907f4117a4c82505f7102c183e1fb9daa8f8e06d56d6af04479fc417fa8c0490289390610255908490612006565b60405180910390a25050565b61027160c0820160a083016113e1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102bb5760405162461bcd60e51b81526004016101c790612112565b60006102cf6101e436849003840184611567565b9050600260008281526003602052604090205460ff1660028111156102f057fe5b141561030e5760405162461bcd60e51b81526004016101c790612192565b6000818152600360205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555133907fbd06df5febc1b0cd2e8ba37a6bb524ae77524c4aa2dc5e0f5ac64f5d11a50b1b90610255908490612006565b61037f610f8d565b60005473ffffffffffffffffffffffffffffffffffffffff163381146103b75760405162461bcd60e51b81526004016101c7906121c2565b8873ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16146104aa576040517f84ea286200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216906384ea28629061043e908a908d90600401611fda565b60206040518083038186803b15801561045657600080fd5b505afa15801561046a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061048e91908101906114ee565b6104aa5760405162461bcd60e51b81526004016101c7906120c2565b6104b2610fb4565b6104be85870187611586565b905060006104cf8260000151610781565b90506104db8282610845565b6104e8828b8b868c610915565b6000818152600260209081526040822054908401515190919061051290839063ffffffff610c4d16565b84516020015190915081111561053a5760405162461bcd60e51b81526004016101c7906121a2565b600083815260026020908152604091829020839055855180516060909101519187015192517f5760b5a80923536b02524ebe3b1f92cc973195ac25559c60564e8db9e02d15ad9361059093889392909190612014565b60405180910390a160006105bd856020015160200151866020015160400151610c7990919063ffffffff16565b905060006105ce8660000151610ca3565b905060008660200151606001511515821515146106025760208088015101516105fd908463ffffffff610c4d16565b61061a565b602080880151015161061a908463ffffffff610cac16565b90506040518060800160405280610642838a6020015160000151610c7990919063ffffffff16565b815260209889015151988101989098529115604088015250600160609096019590955250929c9b505050505050505050505050565b60036020526000908152604090205460ff1681565b606080838390506040519080825280602002602001820160405280156106cc57816020015b6106b9610fe6565b8152602001906001900390816106b15790505b50905060005b838110156107555760008585838181106106e857fe5b604080518082018252602092830294909401356000818152600390935291205490935082915060ff16600281111561071c57fe5b8152600083815260026020908152604090912054910152835184908490811061074157fe5b6020908102919091010152506001016106d2565b5090505b92915050565b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60008060405160200161079390611f5e565b60405160208183030381529060405280519060200120836040516020016107bb929190612052565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290528051602091820120600154909350610826927f190100000000000000000000000000000000000000000000000000000000000092859101611f05565b604051602081830303815290604052805190602001209150505b919050565b60008181526003602052604081205460ff169081600281111561086457fe5b14156108cf57610878828460400151610cee565b73ffffffffffffffffffffffffffffffffffffffff16836000015160a0015173ffffffffffffffffffffffffffffffffffffffff16146108ca5760405162461bcd60e51b81526004016101c790612142565b610910565b60028160028111156108dd57fe5b14156108fb5760405162461bcd60e51b81526004016101c790612122565b600181600281111561090957fe5b1461091057fe5b505050565b8373ffffffffffffffffffffffffffffffffffffffff16856000015160a0015173ffffffffffffffffffffffffffffffffffffffff16146109685760405162461bcd60e51b81526004016101c7906120f2565b8273ffffffffffffffffffffffffffffffffffffffff16856000015160c0015173ffffffffffffffffffffffffffffffffffffffff1614806109c35750845160c0015173ffffffffffffffffffffffffffffffffffffffff16155b6109df5760405162461bcd60e51b81526004016101c7906121b2565b845160e00151421115806109f65750845160e00151155b610a125760405162461bcd60e51b81526004016101c790612152565b6000610a218660000151610ca3565b9050600081610a3f5786516040015160208089015101511015610a50565b865160400151602080890151015111155b905080610a6f5760405162461bcd60e51b81526004016101c790612182565b6000610a7e8860000151610e9c565b610aa85787602001516060015180610aa3575087516080015160208901516040015111155b610aca565b8760200151606001518015610aca575087516080015160208901516040015110155b905080610ae95760405162461bcd60e51b81526004016101c7906120d2565b87516060015115610b3457600083610b0957885160600151851115610b13565b8851606001518510155b905080610b325760405162461bcd60e51b81526004016101c790612162565b505b8751610b3f90610ea5565b15610c4357610b4c610f8d565b6040517f93423e9c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8716906393423e9c90610b9e908b90600401611fcc565b60806040518083038186803b158015610bb657600080fd5b505afa158015610bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bee919081019061152a565b90508060200151151584151514158015610c25575080606001516effffffffffffffffffffffffffffff1689602001516000015111155b610c415760405162461bcd60e51b81526004016101c7906120e2565b505b5050505050505050565b600082820183811015610c725760405162461bcd60e51b81526004016101c790612102565b9392505050565b6000610c72670de0b6b3a7640000610c97858563ffffffff610eae16565b9063ffffffff610ee816565b51600116151590565b6000610c7283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f2a565b6040810151600090819060f01c60ff166003811115610d0957fe5b9050600080826003811115610d1a57fe5b1415610d27575083610e16565b6001826003811115610d3557fe5b1415610da0576040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a33320000000081525085604051602001610d83929190611f3c565b604051602081830303815290604052805190602001209050610e16565b6002826003811115610dae57fe5b14610db557fe5b6040518060400160405280601b81526020017f19457468657265756d205369676e6564204d6573736167653a0a20000000000081525085604051602001610dfd929190611f3c565b6040516020818303038152906040528051906020012090505b600181856040015160f81c8660000151876020015160405160008152602001604052604051610e48949392919061206e565b6020604051602081039080840390855afa158015610e6a573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519695505050505050565b51600416151590565b51600216151590565b600082610ebd57506000610759565b82820282848281610eca57fe5b0414610c725760405162461bcd60e51b81526004016101c790612132565b6000610c7283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f56565b60008184841115610f4e5760405162461bcd60e51b81526004016101c791906120b1565b505050900390565b60008183610f775760405162461bcd60e51b81526004016101c791906120b1565b506000838581610f8357fe5b0495945050505050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6040518060600160405280610fc7610ffd565b8152602001610fd4611071565b8152602001610fe161109b565b905290565b604080518082019091526000808252602082015290565b6040518061010001604052806000801916815260200160008152602001600081526020016000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b60405180608001604052806000815260200160008152602001600081526020016000151581525090565b604080516060810182526000808252602082018190529181019190915290565b8035610759816122fb565b60008083601f8401126110d857600080fd5b50813567ffffffffffffffff8111156110f057600080fd5b60208301915083602082028301111561110857600080fd5b9250929050565b80356107598161230f565b80516107598161230f565b803561075981612318565b803561075981612321565b60008083601f84011261114d57600080fd5b50813567ffffffffffffffff81111561116557600080fd5b60208301915083600182028301111561110857600080fd5b60006080828403121561118f57600080fd5b61119960806121e0565b905060006111a7848461111a565b82525060206111b88484830161111a565b60208301525060406111cc848285016113d6565b60408301525060606111e0848285016113d6565b60608301525092915050565b6000608082840312156111fe57600080fd5b61120860806121e0565b905060006112168484611130565b825250602061122784848301611130565b602083015250604061123b84828501611130565b60408301525060606111e08482850161110f565b6000610100828403121561126257600080fd5b50919050565b6000610100828403121561127b57600080fd5b6112866101006121e0565b905060006112948484611130565b82525060206112a584848301611130565b60208301525060406112b984828501611130565b60408301525060606112cd84828501611130565b60608301525060806112e184828501611130565b60808301525060a06112f5848285016110bb565b60a08301525060c0611309848285016110bb565b60c08301525060e061131d84828501611130565b60e08301525092915050565b60006060828403121561133b57600080fd5b61134560606121e0565b905060006113538484611130565b825250602061136484848301611130565b602083015250604061137884828501611125565b60408301525092915050565b60006101e0828403121561139757600080fd5b6113a160606121e0565b905060006113af8484611268565b8252506101006113c1848483016111ec565b60208301525061018061137884828501611329565b80516107598161232a565b6000602082840312156113f357600080fd5b60006113ff84846110bb565b949350505050565b600080600080600080600060c0888a03121561142257600080fd5b600061142e8a8a6110bb565b975050602061143f8a828b016110bb565b96505060406114508a828b016110bb565b95505060606114618a828b01611130565b945050608088013567ffffffffffffffff81111561147e57600080fd5b61148a8a828b0161113b565b935093505060a061149d8a828b01611130565b91505092959891949750929550565b600080602083850312156114bf57600080fd5b823567ffffffffffffffff8111156114d657600080fd5b6114e2858286016110c6565b92509250509250929050565b60006020828403121561150057600080fd5b60006113ff848461111a565b60006020828403121561151e57600080fd5b60006113ff8484611130565b60006080828403121561153c57600080fd5b60006113ff848461117d565b6000610100828403121561155b57600080fd5b60006113ff848461124f565b6000610100828403121561157a57600080fd5b60006113ff8484611268565b60006101e0828403121561159957600080fd5b60006113ff8484611384565b60006115b18383611df7565b505060400190565b6115c28161221a565b82525050565b60006115d38261220d565b6115dd8185612211565b93506115e883612207565b8060005b8381101561161657815161160088826115a5565b975061160b83612207565b9250506001016115ec565b509495945050505050565b6115c281612225565b6115c26116368261222a565b61224f565b6115c28161224f565b6115c26116368261224f565b600061165b8261220d565b6116658185610840565b935061167581856020860161229a565b9290920192915050565b6115c28161228f565b60006116938261220d565b61169d8185612211565b93506116ad81856020860161229a565b6116b6816122c6565b9093019392505050565b60006116cd602e83612211565b7f53656e64657220646f6573206e6f742068617665207065726d697373696f6e7381527f20666f72207468652074616b6572000000000000000000000000000000000000602082015260400192915050565b600061172c601383612211565b7f46696c6c2066656520697320696e76616c696400000000000000000000000000815260200192915050565b6000611765601f83612211565b7f46696c6c20646f6573206e6f7420646563726561736520706f736974696f6e00815260200192915050565b600061179e600f83610840565b7f75696e7432353620616d6f756e742c00000000000000000000000000000000008152600f0192915050565b60006117d7602083612211565b7f4f72646572206d616b657220646f6573206e6f74206d61746368206d616b6572815260200192915050565b6000611810600683610840565b7f4f72646572280000000000000000000000000000000000000000000000000000815260060192915050565b6000611849601b83612211565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000611882601583610840565b7f75696e74323536207472696767657250726963652c0000000000000000000000815260150192915050565b60006118bb600183610840565b7f2900000000000000000000000000000000000000000000000000000000000000815260010192915050565b60006118f4602583612211565b7f4f726465722063616e6e6f7420626520617070726f766564206279206e6f6e2d81527f6d616b6572000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611953600e83610840565b7f6279746573333220666c6167732c0000000000000000000000000000000000008152600e0192915050565b600061198c601a83612211565b7f4f726465722077617320616c72656164792063616e63656c6564000000000000815260200192915050565b60006119c5602183612211565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81527f7700000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611a24601383610840565b7f75696e74323536206c696d697450726963652c00000000000000000000000000815260130192915050565b6000611a5d600e83610840565b7f616464726573732074616b65722c0000000000000000000000000000000000008152600e0192915050565b6000611a96600e83610840565b7f61646472657373206d616b65722c0000000000000000000000000000000000008152600e0192915050565b6000611acf601e83612211565b7f4f726465722068617320616e20696e76616c6964207369676e61747572650000815260200192915050565b6000611b08601183612211565b7f4f72646572206861732065787069726564000000000000000000000000000000815260200192915050565b6000611b41602283612211565b7f5472696767657220707269636520686173206e6f74206265656e20726561636881527f6564000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611ba0601283610840565b7f75696e743235362065787069726174696f6e0000000000000000000000000000815260120192915050565b6000611bd9602583612211565b7f4f726465722063616e6e6f742062652063616e63656c6564206279206e6f6e2d81527f6d616b6572000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611c38601583612211565b7f46696c6c20707269636520697320696e76616c69640000000000000000000000815260200192915050565b6000611c71602183612211565b7f43616e63656c6564206f726465722063616e6e6f7420626520617070726f766581527f6400000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611cd0601583612211565b7f43616e6e6f74206f76657266696c6c206f726465720000000000000000000000815260200192915050565b6000611d09602083612211565b7f4f726465722074616b657220646f6573206e6f74206d617463682074616b6572815260200192915050565b6000611d42601183610840565b7f75696e74323536206c696d69744665652c000000000000000000000000000000815260110192915050565b6000611d7b601e83612211565b7f6d73672e73656e646572206d7573742062652050657270657475616c56310000815260200192915050565b80516080830190611db8848261163b565b506020820151611dcb602085018261163b565b506040820151611dde604085018261163b565b506060820151611df16060850182611621565b50505050565b80516040830190611e08848261167f565b506020820151611df1602085018261163b565b8051610100830190611e2d848261163b565b506020820151611e40602085018261163b565b506040820151611e53604085018261163b565b506060820151611e66606085018261163b565b506080820151611e79608085018261163b565b5060a0820151611e8c60a08501826115b9565b5060c0820151611e9f60c08501826115b9565b5060e0820151611df160e085018261163b565b80516080830190611ec3848261163b565b506020820151611ed6602085018261163b565b506040820151611ee96040850182611621565b506060820151611df1606085018261163b565b6115c281612289565b6000611f11828661162a565b600282019150611f218285611644565b602082019150611f318284611644565b506020019392505050565b6000611f488285611650565b9150611f548284611644565b5060200192915050565b6000611f6982611803565b9150611f7482611946565b9150611f7f82611791565b9150611f8a82611a17565b9150611f9582611875565b9150611fa082611d35565b9150611fab82611a89565b9150611fb682611a50565b9150611fc182611b93565b9150610759826118ae565b6020810161075982846115b9565b60408101611fe882856115b9565b610c7260208301846115b9565b60208082528101610c7281846115c8565b60208101610759828461163b565b60e08101612022828761163b565b61202f602083018661163b565b61203c604083018561163b565b6120496060830184611da7565b95945050505050565b6101208101612061828561163b565b610c726020830184611e1b565b6080810161207c828761163b565b6120896020830186611efc565b612096604083018561163b565b612049606083018461163b565b60208101610759828461167f565b60208082528101610c728184611688565b60208082528101610759816116c0565b602080825281016107598161171f565b6020808252810161075981611758565b60208082528101610759816117ca565b602080825281016107598161183c565b60208082528101610759816118e7565b602080825281016107598161197f565b60208082528101610759816119b8565b6020808252810161075981611ac2565b6020808252810161075981611afb565b6020808252810161075981611b34565b6020808252810161075981611bcc565b6020808252810161075981611c2b565b6020808252810161075981611c64565b6020808252810161075981611cc3565b6020808252810161075981611cfc565b6020808252810161075981611d6e565b608081016107598284611eb2565b60405181810167ffffffffffffffff811182821017156121ff57600080fd5b604052919050565b60200190565b5190565b90815260200190565b600061075982612270565b151590565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b80610840816122ee565b6effffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b60ff1690565b600061075982612252565b60005b838110156122b557818101518382015260200161229d565b83811115611df15750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b600381106122f857fe5b50565b6123048161221a565b81146122f857600080fd5b61230481612225565b6123048161222a565b6123048161224f565b6123048161225c56fea365627a7a723158207dd790d95f74ea1aa475c135bdee1e39fd1c333e1fa206d15f3d14f20c03ef806c6578706572696d656e74616cf564736f6c63430005100040

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

0000000000000000000000001c50c582c7066049c560bca20416b1d9e0dfb0030000000000000000000000000000000000000000000000000000000000000001

-----Decoded View---------------
Arg [0] : perpetualV1 (address): 0x1c50c582c7066049C560Bca20416b1d9E0dfb003
Arg [1] : chainId (uint256): 1

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000001c50c582c7066049c560bca20416b1d9e0dfb003
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000001


Deployed Bytecode Sourcemap

22130:13089:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22130:13089:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;25210:51;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;29724:372;;;;;;;;;:::i;:::-;;29022:510;;;;;;;;;:::i;26515:2326::-;;;;;;;;;:::i;:::-;;;;;;;;25299:48;;;;;;;;;:::i;:::-;;;;;;;;30505:560;;;;;;;;;:::i;:::-;;;;;;;;25057:35;;;:::i;24970:29::-;;;:::i;:::-;;;;;;;;25210:51;;;;;;;;;;;;;:::o;29724:372::-;29853:11;;;;;;;;;;29839:25;;:10;:25;;;29817:112;;;;-1:-1:-1;;;29817:112:0;;;;;;;;;;;;;;;;;29940:17;29960:20;;;;;;;;29974:5;29960:20;;;:13;:20::i;:::-;29991:19;;;;:8;:19;;;;;;;:42;;;;30013:20;29991:42;;;30049:39;29991:19;;-1:-1:-1;30066:10:0;;30049:39;;;;29991:19;;30049:39;;;;;;;;;;29724:372;;:::o;29022:510::-;29152:11;;;;;;;;;;29138:25;;:10;:25;;;29116:112;;;;-1:-1:-1;;;29116:112:0;;;;;;;;;29239:17;29259:20;;;;;;;;29273:5;29259:20;;;29239:40;-1:-1:-1;29335:20:0;29312:19;;;;:8;:19;;;;;;;;:43;;;;;;;;;;29290:126;;;;-1:-1:-1;;;29290:126:0;;;;;;;;;29427:19;;;;:8;:19;;;;;;;:42;;;;29449:20;29427:42;;;29485:39;29502:10;;29485:39;;;;29427:19;;29485:39;;26515:2326;26736:26;;:::i;:::-;26780:17;26800:14;;;26849:10;:23;;26827:103;;;;-1:-1:-1;;;26827:103:0;;;;;;;;;26956:6;26947:15;;:5;:15;;;26943:213;;27005:57;;;;;:42;;;;;;:57;;27048:5;;27055:6;;27005:57;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;27005:57:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;27005:57:0;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;27005:57:0;;;;;;;;;26979:165;;;;-1:-1:-1;;;26979:165:0;;;;;;;;;27168:26;;:::i;:::-;27197:29;;;;27208:4;27197:29;;;27168:58;;27237:17;27257:30;27271:9;:15;;;27257:13;:30::i;:::-;27237:50;;27324:88;27368:9;27392;27324:29;:88::i;:::-;27423:138;27457:9;27481:5;27501;27521:9;27545:5;27423:19;:138::i;:::-;27606:23;27632:26;;;:15;:26;;;;;;;;27715:14;;;;:21;27632:26;;27606:23;27695:42;;27632:26;;27695:42;:19;:42;:::i;:::-;27789:15;;:22;;;27669:68;;-1:-1:-1;27770:41:0;;;27748:112;;;;-1:-1:-1;;;27748:112:0;;;;;;;;;27871:26;;;;:15;:26;;;;;;;;;:44;;;27986:15;;:21;;28022:28;;;;;28065:14;;;;27933:157;;;;;;27887:9;;27986:21;28022:28;;28065:14;27933:157;;;;;;;;;;28226:11;28240:48;28267:9;:14;;;:20;;;28240:9;:14;;;:18;;;:26;;:48;;;;:::i;:::-;28226:62;;28359:15;28377:23;28384:9;:15;;;28377:6;:23::i;:::-;28359:41;;28411:25;28454:9;:14;;;:28;;;28440:42;;:10;:42;;;28439:134;;28544:14;;;;;:20;;:29;;28569:3;28544:29;:24;:29;:::i;:::-;28439:134;;;28499:14;;;;;:20;;:29;;28524:3;28499:29;:24;:29;:::i;:::-;28411:162;;28593:240;;;;;;;;28642:48;28672:17;28642:9;:14;;;:21;;;:29;;:48;;;;:::i;:::-;28593:240;;;28721:14;;;;:21;28593:240;;;;;;;28764:11;;28593:240;;;;-1:-1:-1;6481:1:0;28593:240;;;;;;;;-1:-1:-1;28586:247:0;;26515:2326;-1:-1:-1;;;;;;;;;;;;26515:2326:0:o;25299:48::-;;;;;;;;;;;;;;;:::o;30505:560::-;30628:25;30671:32;30729:11;;:18;;30706:42;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;-1:-1:-1;30671:77:0;-1:-1:-1;30764:9:0;30759:275;30779:22;;;30759:275;;;30823:17;30843:11;;30855:1;30843:14;;;;;;;30884:138;;;;;;;;30843:14;;;;;;;;;-1:-1:-1;30928:19:0;;;:8;:19;;;;;;30843:14;;-1:-1:-1;30884:138:0;;-1:-1:-1;30928:19:0;;30884:138;;;;;;;;;;30980:26;;;;:15;30884:138;30980:26;;;;;;;;30884:138;;;30872:9;;:6;;30879:1;;30872:9;;;;;;;;;;;;;;;:150;-1:-1:-1;30803:3:0;;30759:275;;;-1:-1:-1;31051:6:0;-1:-1:-1;30505:560:0;;;;;:::o;25057:35::-;;;;:::o;24970:29::-;;;;;;:::o;33978:603::-;34086:7;34214:18;23113:292;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;23113:292:0;;;23103:303;;;;;;34316:5;34245:87;;;;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;34245:87:0;;;;34235:98;;49:4:-1;34235:98:0;;;;34516:20;;34235:98;;-1:-1:-1;34457:115:0;;34488:13;;34235:98;;34457:115;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;34457:115:0;;;34447:126;;;;;;34440:133;;;33978:603;;;;:::o;31126:672::-;31284:23;31310:19;;;:8;:19;;;;;;;;;31346:11;:31;;;;;;;;;31342:449;;;31445:54;31468:9;31479;:19;;;31445:22;:54::i;:::-;31420:79;;:9;:15;;;:21;;;:79;;;31394:171;;;;-1:-1:-1;;;31394:171:0;;;;;;;;;31342:449;;;31639:20;31624:11;:35;;;;;;;;;;31598:123;;;;-1:-1:-1;;;31598:123:0;;;;;;;;;31758:20;31743:11;:35;;;;;;;;;31736:43;;;;31126:672;;;:::o;31806:2096::-;32073:5;32048:30;;:9;:15;;;:21;;;:30;;;32026:112;;;;-1:-1:-1;;;32026:112:0;;;;;;;;;32196:5;32171:30;;:9;:15;;;:21;;;:30;;;:69;;;-1:-1:-1;32205:15:0;;:21;;;:35;;;32171:69;32149:151;;;;-1:-1:-1;;;32149:151:0;;;;;;;;;32333:15;;:26;;;32363:15;-1:-1:-1;32333:45:0;;:80;;-1:-1:-1;32382:15:0;;:26;;;:31;32333:80;32311:147;;;;-1:-1:-1;;;32311:147:0;;;;;;;;;32529:15;32547:23;32554:9;:15;;;32547:6;:23::i;:::-;32529:41;;32581:15;32599:10;:142;;32715:15;;:26;;;32691:14;;;;;:20;;:50;;32599:142;;;32649:15;;:26;;;32625:14;;;;;:20;;:50;;32599:142;32581:160;;32774:10;32752:81;;;;-1:-1:-1;;;32752:81:0;;;;;;;;;32846:13;32862:36;32882:9;:15;;;32862:19;:36::i;:::-;:224;;33008:9;:14;;;:28;;;:78;;;-1:-1:-1;33062:15:0;;:24;;;33040:14;;;;:18;;;:46;;33008:78;32862:224;;;32914:9;:14;;;:28;;;:78;;;;-1:-1:-1;32968:15:0;;:24;;;32946:14;;;;:18;;;:46;;32914:78;32846:240;;33119:8;33097:77;;;;-1:-1:-1;;;33097:77:0;;;;;;;;;33191:15;;:28;;;:33;33187:343;;33241:22;33266:10;:124;;33353:15;;:28;;;:37;-1:-1:-1;33353:37:0;33266:124;;;33296:15;;:28;;;:37;-1:-1:-1;33296:37:0;33266:124;33241:149;;33431:17;33405:113;;;;-1:-1:-1;;;33405:113:0;;;;;;;;;33187:343;;33562:15;;33546:32;;:15;:32::i;:::-;33542:353;;;33595:30;;:::i;:::-;33628:45;;;;;:38;;;;;;:45;;33667:5;;33628:45;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;33628:45:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;33628:45:0;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;33628:45:0;;;;;;;;;33595:78;;33728:7;:26;;;33714:40;;:10;:40;;;;:102;;;;;33800:7;:16;;;33775:41;;:9;:14;;;:21;;;:41;;33714:102;33688:195;;;;-1:-1:-1;;;33688:195:0;;;;;;;;;33542:353;;31806:2096;;;;;;;;:::o;1569:181::-;1627:7;1659:5;;;1683:6;;;;1675:46;;;;-1:-1:-1;;;1675:46:0;;;;;;;;;1741:1;1569:181;-1:-1:-1;;;1569:181:0:o;7291:196::-;7417:7;7449:30;6962:8;7449:20;:5;7459:9;7449:20;:9;:20;:::i;:::-;:24;:30;:24;:30;:::i;34589:188::-;34720:11;23564:1;34720:30;34719:50;;;34589:188::o;2025:136::-;2083:7;2110:43;2114:1;2117;2110:43;;;;;;;;;;;;;;;;;:3;:43::i;10736:809::-;10946:15;;;;10870:7;;;;10933:35;;;;10919:50;;;;;;;;10895:74;-1:-1:-1;10982:18:0;;11015:7;:34;;;;;;;;;11011:365;;;-1:-1:-1;11079:4:0;11011:365;;;11116:21;11105:7;:32;;;;;;;;;11101:275;;;11194:11;;;;;;;;;;;;;;;;;11207:4;11177:35;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;11177:35:0;;;11167:46;;;;;;11154:59;;11101:275;;;11264:25;11253:7;:36;;;;;;;;;11246:44;;;;11345:11;;;;;;;;;;;;;;;;;11358:4;11328:35;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;11328:35:0;;;11318:46;;;;;;11305:59;;11101:275;11395:142;11419:10;11457:9;:15;;;11444:30;;11489:9;:11;;;11515:9;:11;;;11395:142;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;11395:142:0;;;;;;10736:809;-1:-1:-1;;;;;;10736:809:0:o;35000:216::-;35144:11;23718:6;35144:45;35143:65;;;35000:216::o;34785:207::-;34925:11;23636:6;34925:40;34924:60;;;34785:207::o;2941:471::-;2999:7;3244:6;3240:47;;-1:-1:-1;3274:1:0;3267:8;;3240:47;3311:5;;;3315:1;3311;:5;:1;3335:5;;;;;:10;3327:56;;;;-1:-1:-1;;;3327:56:0;;;;;;;;3880:132;3938:7;3965:39;3969:1;3972;3965:39;;;;;;;;;;;;;;;;;:3;:39::i;2498:192::-;2584:7;2620:12;2612:6;;;;2604:29;;;;-1:-1:-1;;;2604:29:0;;;;;;;;;;-1:-1:-1;;;2656:5:0;;;2498:192::o;4542:345::-;4628:7;4730:12;4723:5;4715:28;;;;-1:-1:-1;;;4715:28:0;;;;;;;;;;;4754:9;4770:1;4766;:5;;;;;;;4542:345;-1:-1:-1;;;;;4542:345:0:o;22130:13089::-;;;;;;;;;-1:-1:-1;22130:13089:0;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;-1:-1:-1;22130:13089:0;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;-1:-1:-1;22130:13089:0;;;;;;;;;;;;;;;;;:::o;5:130:-1:-;72:20;;97:33;72:20;97:33;;160:352;;;290:3;283:4;275:6;271:17;267:27;257:2;;308:1;305;298:12;257:2;-1:-1;328:20;;368:18;357:30;;354:2;;;400:1;397;390:12;354:2;434:4;426:6;422:17;410:29;;485:3;477:4;469:6;465:17;455:8;451:32;448:41;445:2;;;502:1;499;492:12;445:2;250:262;;;;;;520:124;584:20;;609:30;584:20;609:30;;651:128;726:13;;744:30;726:13;744:30;;786:128;852:20;;877:32;852:20;877:32;;921:130;988:20;;1013:33;988:20;1013:33;;1072:336;;;1186:3;1179:4;1171:6;1167:17;1163:27;1153:2;;1204:1;1201;1194:12;1153:2;-1:-1;1224:20;;1264:18;1253:30;;1250:2;;;1296:1;1293;1286:12;1250:2;1330:4;1322:6;1318:17;1306:29;;1381:3;1373:4;1365:6;1361:17;1351:8;1347:32;1344:41;1341:2;;;1398:1;1395;1388:12;1445:835;;1569:4;1557:9;1552:3;1548:19;1544:30;1541:2;;;1587:1;1584;1577:12;1541:2;1605:20;1620:4;1605:20;;;1596:29;-1:-1;1687:1;1719:57;1772:3;1752:9;1719:57;;;1694:83;;-1:-1;1852:2;1885:57;1938:3;1914:22;;;1885:57;;;1878:4;1871:5;1867:16;1860:83;1798:156;2006:2;2039:60;2095:3;2086:6;2075:9;2071:22;2039:60;;;2032:4;2025:5;2021:16;2014:86;1964:147;2165:2;2198:60;2254:3;2245:6;2234:9;2230:22;2198:60;;;2191:4;2184:5;2180:16;2173:86;2121:149;1535:745;;;;;2314:755;;2420:4;2408:9;2403:3;2399:19;2395:30;2392:2;;;2438:1;2435;2428:12;2392:2;2456:20;2471:4;2456:20;;;2447:29;-1:-1;2528:1;2560:49;2605:3;2585:9;2560:49;;;2535:75;;-1:-1;2672:2;2705:49;2750:3;2726:22;;;2705:49;;;2698:4;2691:5;2687:16;2680:75;2631:135;2815:2;2848:49;2893:3;2884:6;2873:9;2869:22;2848:49;;;2841:4;2834:5;2830:16;2823:75;2776:133;2968:2;3001:46;3043:3;3034:6;3023:9;3019:22;3001:46;;3106:156;;3214:3;3205:6;3200:3;3196:16;3192:26;3189:2;;;3231:1;3228;3221:12;3189:2;-1:-1;3250:6;3182:80;-1:-1;3182:80;3297:1361;;3404:6;3392:9;3387:3;3383:19;3379:32;3376:2;;;3424:1;3421;3414:12;3376:2;3442:22;3457:6;3442:22;;;3433:31;-1:-1;3515:1;3547:49;3592:3;3572:9;3547:49;;;3522:75;;-1:-1;3660:2;3693:49;3738:3;3714:22;;;3693:49;;;3686:4;3679:5;3675:16;3668:75;3618:136;3810:2;3843:49;3888:3;3879:6;3868:9;3864:22;3843:49;;;3836:4;3829:5;3825:16;3818:75;3764:140;3962:2;3995:49;4040:3;4031:6;4020:9;4016:22;3995:49;;;3988:4;3981:5;3977:16;3970:75;3914:142;4110:3;4144:49;4189:3;4180:6;4169:9;4165:22;4144:49;;;4137:4;4130:5;4126:16;4119:75;4066:139;4256:3;4290:49;4335:3;4326:6;4315:9;4311:22;4290:49;;;4283:4;4276:5;4272:16;4265:75;4215:136;4402:3;4436:49;4481:3;4472:6;4461:9;4457:22;4436:49;;;4429:4;4422:5;4418:16;4411:75;4361:136;4553:3;4587:49;4632:3;4623:6;4612:9;4608:22;4587:49;;;4580:4;4573:5;4569:16;4562:75;4507:141;3370:1288;;;;;6103:602;;6214:4;6202:9;6197:3;6193:19;6189:30;6186:2;;;6232:1;6229;6222:12;6186:2;6250:20;6265:4;6250:20;;;6241:29;-1:-1;6317:1;6349:49;6394:3;6374:9;6349:49;;;6324:75;;-1:-1;6457:2;6490:49;6535:3;6511:22;;;6490:49;;;6483:4;6476:5;6472:16;6465:75;6420:131;6602:2;6635:48;6679:3;6670:6;6659:9;6655:22;6635:48;;;6628:4;6621:5;6617:16;6610:74;6561:134;6180:525;;;;;6744:675;;6855:6;6843:9;6838:3;6834:19;6830:32;6827:2;;;6875:1;6872;6865:12;6827:2;6893:20;6908:4;6893:20;;;6884:29;-1:-1;6964:1;6996:67;7059:3;7039:9;6996:67;;;6971:93;;-1:-1;7125:3;7159:66;7221:3;7197:22;;;7159:66;;;7152:4;7145:5;7141:16;7134:92;7085:152;7292:3;7326:71;7393:3;7384:6;7373:9;7369:22;7326:71;;7426:134;7504:13;;7522:33;7504:13;7522:33;;7704:241;;7808:2;7796:9;7787:7;7783:23;7779:32;7776:2;;;7824:1;7821;7814:12;7776:2;7859:1;7876:53;7921:7;7901:9;7876:53;;;7866:63;7770:175;-1:-1;;;;7770:175;7952:993;;;;;;;;8160:3;8148:9;8139:7;8135:23;8131:33;8128:2;;;8177:1;8174;8167:12;8128:2;8212:1;8229:53;8274:7;8254:9;8229:53;;;8219:63;;8191:97;8319:2;8337:53;8382:7;8373:6;8362:9;8358:22;8337:53;;;8327:63;;8298:98;8427:2;8445:53;8490:7;8481:6;8470:9;8466:22;8445:53;;;8435:63;;8406:98;8535:2;8553:53;8598:7;8589:6;8578:9;8574:22;8553:53;;;8543:63;;8514:98;8671:3;8660:9;8656:19;8643:33;8696:18;8688:6;8685:30;8682:2;;;8728:1;8725;8718:12;8682:2;8756:64;8812:7;8803:6;8792:9;8788:22;8756:64;;;8746:74;;;;8622:204;8857:3;8876:53;8921:7;8912:6;8901:9;8897:22;8876:53;;;8866:63;;8836:99;8122:823;;;;;;;;;;;8952:397;;;9091:2;9079:9;9070:7;9066:23;9062:32;9059:2;;;9107:1;9104;9097:12;9059:2;9142:31;;9193:18;9182:30;;9179:2;;;9225:1;9222;9215:12;9179:2;9253:80;9325:7;9316:6;9305:9;9301:22;9253:80;;;9243:90;;;;9121:218;9053:296;;;;;;9356:257;;9468:2;9456:9;9447:7;9443:23;9439:32;9436:2;;;9484:1;9481;9474:12;9436:2;9519:1;9536:61;9589:7;9569:9;9536:61;;9620:241;;9724:2;9712:9;9703:7;9699:23;9695:32;9692:2;;;9740:1;9737;9730:12;9692:2;9775:1;9792:53;9837:7;9817:9;9792:53;;9868:312;;10007:3;9995:9;9986:7;9982:23;9978:33;9975:2;;;10024:1;10021;10014:12;9975:2;10059:1;10076:88;10156:7;10136:9;10076:88;;10187:290;;10315:3;10303:9;10294:7;10290:23;10286:33;10283:2;;;10332:1;10329;10322:12;10283:2;10367:1;10384:77;10453:7;10433:9;10384:77;;10484:286;;10610:3;10598:9;10589:7;10585:23;10581:33;10578:2;;;10627:1;10624;10617:12;10578:2;10662:1;10679:75;10746:7;10726:9;10679:75;;10777:286;;10903:3;10891:9;10882:7;10878:23;10874:33;10871:2;;;10920:1;10917;10910:12;10871:2;10955:1;10972:75;11039:7;11019:9;10972:75;;11071:293;;11216:108;11320:3;11312:6;11216:108;;;-1:-1;;11353:4;11344:14;;11209:155;11372:103;11445:24;11463:5;11445:24;;;11440:3;11433:37;11427:48;;;11683:922;;11886:83;11963:5;11886:83;;;11982:115;12090:6;12085:3;11982:115;;;11975:122;;12118:85;12197:5;12118:85;;;12223:7;12251:1;12236:347;12261:6;12258:1;12255:13;12236:347;;;12328:6;12322:13;12349:121;12466:3;12451:13;12349:121;;;12342:128;;12487:89;12569:6;12487:89;;;12477:99;-1:-1;;12283:1;12276:9;12236:347;;;-1:-1;12596:3;;11865:740;-1:-1;;;;;11865:740;12613:94;12680:21;12695:5;12680:21;;12714:148;12813:43;12832:23;12849:5;12832:23;;;12813:43;;12869:103;12942:24;12960:5;12942:24;;13099:152;13200:45;13220:24;13238:5;13220:24;;13258:348;;13382:34;13410:5;13382:34;;;13428:88;13509:6;13504:3;13428:88;;;13421:95;;13521:52;13566:6;13561:3;13554:4;13547:5;13543:16;13521:52;;;13585:16;;;;;13362:244;-1:-1;;13362:244;13613:142;13699:50;13743:5;13699:50;;13921:347;;14033:39;14066:5;14033:39;;;14084:71;14148:6;14143:3;14084:71;;;14077:78;;14160:52;14205:6;14200:3;14193:4;14186:5;14182:16;14160:52;;;14233:29;14255:6;14233:29;;;14224:39;;;;14013:255;-1:-1;;;14013:255;14276:383;;14436:67;14500:2;14495:3;14436:67;;;14536:34;14516:55;;14605:16;14600:2;14591:12;;14584:38;14650:2;14641:12;;14422:237;-1:-1;;14422:237;14668:319;;14828:67;14892:2;14887:3;14828:67;;;14928:21;14908:42;;14978:2;14969:12;;14814:173;-1:-1;;14814:173;14996:331;;15156:67;15220:2;15215:3;15156:67;;;15256:33;15236:54;;15318:2;15309:12;;15142:185;-1:-1;;15142:185;15336:351;;15514:85;15596:2;15591:3;15514:85;;;15632:17;15612:38;;15678:2;15669:12;;15500:187;-1:-1;;15500:187;15696:332;;15856:67;15920:2;15915:3;15856:67;;;15956:34;15936:55;;16019:2;16010:12;;15842:186;-1:-1;;15842:186;16037:340;;16215:84;16297:1;16292:3;16215:84;;;16332:8;16312:29;;16369:1;16360:11;;16201:176;-1:-1;;16201:176;16386:327;;16546:67;16610:2;16605:3;16546:67;;;16646:29;16626:50;;16704:2;16695:12;;16532:181;-1:-1;;16532:181;16722:357;;16900:85;16982:2;16977:3;16900:85;;;17018:23;16998:44;;17070:2;17061:12;;16886:193;-1:-1;;16886:193;17088:335;;17266:84;17348:1;17343:3;17266:84;;;17383:3;17363:24;;17415:1;17406:11;;17252:171;-1:-1;;17252:171;17432:374;;17592:67;17656:2;17651:3;17592:67;;;17692:34;17672:55;;17761:7;17756:2;17747:12;;17740:29;17797:2;17788:12;;17578:228;-1:-1;;17578:228;17815:350;;17993:85;18075:2;18070:3;17993:85;;;18111:16;18091:37;;18156:2;18147:12;;17979:186;-1:-1;;17979:186;18174:326;;18334:67;18398:2;18393:3;18334:67;;;18434:28;18414:49;;18491:2;18482:12;;18320:180;-1:-1;;18320:180;18509:370;;18669:67;18733:2;18728:3;18669:67;;;18769:34;18749:55;;18838:3;18833:2;18824:12;;18817:25;18870:2;18861:12;;18655:224;-1:-1;;18655:224;18888:355;;19066:85;19148:2;19143:3;19066:85;;;19184:21;19164:42;;19234:2;19225:12;;19052:191;-1:-1;;19052:191;19252:350;;19430:85;19512:2;19507:3;19430:85;;;19548:16;19528:37;;19593:2;19584:12;;19416:186;-1:-1;;19416:186;19611:350;;19789:85;19871:2;19866:3;19789:85;;;19907:16;19887:37;;19952:2;19943:12;;19775:186;-1:-1;;19775:186;19970:330;;20130:67;20194:2;20189:3;20130:67;;;20230:32;20210:53;;20291:2;20282:12;;20116:184;-1:-1;;20116:184;20309:317;;20469:67;20533:2;20528:3;20469:67;;;20569:19;20549:40;;20617:2;20608:12;;20455:171;-1:-1;;20455:171;20635:371;;20795:67;20859:2;20854:3;20795:67;;;20895:34;20875:55;;20964:4;20959:2;20950:12;;20943:26;20997:2;20988:12;;20781:225;-1:-1;;20781:225;21015:354;;21193:85;21275:2;21270:3;21193:85;;;21311:20;21291:41;;21360:2;21351:12;;21179:190;-1:-1;;21179:190;21378:374;;21538:67;21602:2;21597:3;21538:67;;;21638:34;21618:55;;21707:7;21702:2;21693:12;;21686:29;21743:2;21734:12;;21524:228;-1:-1;;21524:228;21761:321;;21921:67;21985:2;21980:3;21921:67;;;22021:23;22001:44;;22073:2;22064:12;;21907:175;-1:-1;;21907:175;22091:370;;22251:67;22315:2;22310:3;22251:67;;;22351:34;22331:55;;22420:3;22415:2;22406:12;;22399:25;22452:2;22443:12;;22237:224;-1:-1;;22237:224;22470:321;;22630:67;22694:2;22689:3;22630:67;;;22730:23;22710:44;;22782:2;22773:12;;22616:175;-1:-1;;22616:175;22800:332;;22960:67;23024:2;23019:3;22960:67;;;23060:34;23040:55;;23123:2;23114:12;;22946:186;-1:-1;;22946:186;23141:353;;23319:85;23401:2;23396:3;23319:85;;;23437:19;23417:40;;23485:2;23476:12;;23305:189;-1:-1;;23305:189;23503:330;;23663:67;23727:2;23722:3;23663:67;;;23763:32;23743:53;;23824:2;23815:12;;23649:184;-1:-1;;23649:184;23892:777;24091:23;;24023:4;24014:14;;;24120:63;24018:3;24091:23;24120:63;;;24043:146;24263:4;24256:5;24252:16;24246:23;24275:63;24332:4;24327:3;24323:14;24309:12;24275:63;;;24199:145;24416:4;24409:5;24405:16;24399:23;24428:63;24485:4;24480:3;24476:14;24462:12;24428:63;;;24354:143;24579:4;24572:5;24568:16;24562:23;24591:57;24642:4;24637:3;24633:14;24619:12;24591:57;;;24507:147;23996:673;;;;24751:501;24964:23;;24896:4;24887:14;;;24993:76;24891:3;24964:23;24993:76;;;24916:159;25156:4;25149:5;25145:16;25139:23;25168:63;25225:4;25220:3;25216:14;25202:12;25168:63;;25312:1425;25518:23;;25449:6;25440:16;;;25547:63;25444:3;25518:23;25547:63;;;25471:145;25691:4;25684:5;25680:16;25674:23;25703:63;25760:4;25755:3;25751:14;25737:12;25703:63;;;25626:146;25851:4;25844:5;25840:16;25834:23;25863:63;25920:4;25915:3;25911:14;25897:12;25863:63;;;25782:150;26013:4;26006:5;26002:16;25996:23;26025:63;26082:4;26077:3;26073:14;26059:12;26025:63;;;25942:152;26171:4;26164:5;26160:16;26154:23;26183:63;26240:4;26235:3;26231:14;26217:12;26183:63;;;26104:148;26326:4;26319:5;26315:16;26309:23;26338:63;26395:4;26390:3;26386:14;26372:12;26338:63;;;26262:145;26481:4;26474:5;26470:16;26464:23;26493:63;26550:4;26545:3;26541:14;26527:12;26493:63;;;26417:145;26641:4;26634:5;26630:16;26624:23;26653:63;26710:4;26705:3;26701:14;26687:12;26653:63;;26807:810;27030:23;;26956:4;26947:14;;;27059:63;26951:3;27030:23;27059:63;;;26976:152;27211:4;27204:5;27200:16;27194:23;27223:63;27280:4;27275:3;27271:14;27257:12;27223:63;;;27138:154;27366:4;27359:5;27355:16;27349:23;27378:57;27429:4;27424:3;27420:14;27406:12;27378:57;;;27302:139;27521:4;27514:5;27510:16;27504:23;27533:63;27590:4;27585:3;27581:14;27567:12;27533:63;;27854:107;27933:22;27949:5;27933:22;;27968:517;;28141:73;28210:3;28201:6;28141:73;;;28236:1;28231:3;28227:11;28220:18;;28249:75;28320:3;28311:6;28249:75;;;28346:2;28341:3;28337:12;28330:19;;28360:75;28431:3;28422:6;28360:75;;;-1:-1;28457:2;28448:12;;28129:356;-1:-1;;;28129:356;28492:393;;28660:89;28745:3;28736:6;28660:89;;;28653:96;;28760:75;28831:3;28822:6;28760:75;;;-1:-1;28857:2;28848:12;;28641:244;-1:-1;;28641:244;28892:2775;;30000:148;30144:3;30000:148;;;29993:155;;30166:148;30310:3;30166:148;;;30159:155;;30332:148;30476:3;30332:148;;;30325:155;;30498:148;30642:3;30498:148;;;30491:155;;30664:148;30808:3;30664:148;;;30657:155;;30830:148;30974:3;30830:148;;;30823:155;;30996:148;31140:3;30996:148;;;30989:155;;31162:148;31306:3;31162:148;;;31155:155;;31328:148;31472:3;31328:148;;;31321:155;;31494:148;31638:3;31494:148;;31674:213;31792:2;31777:18;;31806:71;31781:9;31850:6;31806:71;;31894:324;32040:2;32025:18;;32054:71;32029:9;32098:6;32054:71;;;32136:72;32204:2;32193:9;32189:18;32180:6;32136:72;;32225:477;32451:2;32465:47;;;32436:18;;32526:166;32436:18;32678:6;32526:166;;32709:213;32827:2;32812:18;;32841:71;32816:9;32885:6;32841:71;;32929:623;33169:3;33154:19;;33184:71;33158:9;33228:6;33184:71;;;33266:72;33334:2;33323:9;33319:18;33310:6;33266:72;;;33349;33417:2;33406:9;33402:18;33393:6;33349:72;;;33432:110;33538:2;33527:9;33523:18;33514:6;33432:110;;;33140:412;;;;;;;;33559:413;33749:3;33734:19;;33764:71;33738:9;33808:6;33764:71;;;33846:116;33958:2;33947:9;33943:18;33934:6;33846:116;;33979:539;34177:3;34162:19;;34192:71;34166:9;34236:6;34192:71;;;34274:68;34338:2;34327:9;34323:18;34314:6;34274:68;;;34353:72;34421:2;34410:9;34406:18;34397:6;34353:72;;;34436;34504:2;34493:9;34489:18;34480:6;34436:72;;34525:239;34656:2;34641:18;;34670:84;34645:9;34727:6;34670:84;;34771:301;34909:2;34923:47;;;34894:18;;34984:78;34894:18;35048:6;34984:78;;35079:407;35270:2;35284:47;;;35255:18;;35345:131;35255:18;35345:131;;35493:407;35684:2;35698:47;;;35669:18;;35759:131;35669:18;35759:131;;35907:407;36098:2;36112:47;;;36083:18;;36173:131;36083:18;36173:131;;36321:407;36512:2;36526:47;;;36497:18;;36587:131;36497:18;36587:131;;36735:407;36926:2;36940:47;;;36911:18;;37001:131;36911:18;37001:131;;37149:407;37340:2;37354:47;;;37325:18;;37415:131;37325:18;37415:131;;37563:407;37754:2;37768:47;;;37739:18;;37829:131;37739:18;37829:131;;37977:407;38168:2;38182:47;;;38153:18;;38243:131;38153:18;38243:131;;38391:407;38582:2;38596:47;;;38567:18;;38657:131;38567:18;38657:131;;38805:407;38996:2;39010:47;;;38981:18;;39071:131;38981:18;39071:131;;39219:407;39410:2;39424:47;;;39395:18;;39485:131;39395:18;39485:131;;39633:407;39824:2;39838:47;;;39809:18;;39899:131;39809:18;39899:131;;40047:407;40238:2;40252:47;;;40223:18;;40313:131;40223:18;40313:131;;40461:407;40652:2;40666:47;;;40637:18;;40727:131;40637:18;40727:131;;40875:407;41066:2;41080:47;;;41051:18;;41141:131;41051:18;41141:131;;41289:407;41480:2;41494:47;;;41465:18;;41555:131;41465:18;41555:131;;41703:407;41894:2;41908:47;;;41879:18;;41969:131;41879:18;41969:131;;42117:326;42291:3;42276:19;;42306:127;42280:9;42406:6;42306:127;;42670:256;42732:2;42726:9;42758:17;;;42833:18;42818:34;;42854:22;;;42815:62;42812:2;;;42890:1;42887;42880:12;42812:2;42906;42899:22;42710:216;;-1:-1;42710:216;42933:180;43086:4;43077:14;;43034:79;43120:166;43252:12;;43223:63;43691:207;43838:19;;;43887:4;43878:14;;43831:67;44385:91;;44447:24;44465:5;44447:24;;44483:85;44549:13;44542:21;;44525:43;44575:144;44647:66;44636:78;;44619:100;44726:72;44788:5;44771:27;44805:136;44882:5;44888:48;44882:5;44888:48;;44948:111;45021:32;45010:44;;44993:66;45066:121;45139:42;45128:54;;45111:76;45273:81;45344:4;45333:16;;45316:38;45361:136;;45453:39;45486:5;45453:39;;45505:268;45570:1;45577:101;45591:6;45588:1;45585:13;45577:101;;;45658:11;;;45652:18;45639:11;;;45632:39;45613:2;45606:10;45577:101;;;45693:6;45690:1;45687:13;45684:2;;;-1:-1;;45758:1;45740:16;;45733:27;45554:219;45942:97;46030:2;46010:14;46026:7;46006:28;;45990:49;46047:106;46131:1;46124:5;46121:12;46111:2;;46137:9;46111:2;46105:48;;46160:117;46229:24;46247:5;46229:24;;;46222:5;46219:35;46209:2;;46268:1;46265;46258:12;46284:111;46350:21;46365:5;46350:21;;46402:115;46470:23;46487:5;46470:23;;46524:117;46593:24;46611:5;46593:24;;46648:117;46717:24;46735:5;46717:24;

Swarm Source

bzzr://7dd790d95f74ea1aa475c135bdee1e39fd1c333e1fa206d15f3d14f20c03ef80

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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