Contract 0xb981b29c5190bb12c7236a994649efcb0b36e83b 1

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x8e33a57375b6721af5e0bb4d3b2391f23dec67276acedd1e86840863c153e8ab0x6080604045823072022-01-12 9:49:1116 days 1 hr ago0x54ad8c33e6c7df7a6143d962a44be65ae1d4ab36 IN  Create: PerpetualV10 ETH0.107038353212 ETH
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PerpetualV1

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion, Apache-2.0 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at arbiscan.io on 2022-01-12
*/

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

/*

    Copyright

    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.8.9;
pragma abicoder v2;


/**
 * @title P1TraderConstants
 * @author  
 *
 * @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: @openzeppelin/contracts/utils/Address.sol


// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

/*

    Copyright

    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.

*/




/**
 * @title SafeCast
 * @author  
 *
 * @dev Library for casting uint256 to other types of uint.
 */
library SafeCast {

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     *  overflow (i.e. when the input is greater than largest uint128).
     *
     *  Counterpart to Solidity's `uint128` operator.
     *
     *  Requirements:
     *  - `value` must fit into 128 bits.
     */
    function toUint128(
        uint256 value
    )
        internal
        pure
        returns (uint128)
    {
        require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     *  overflow (i.e. when the input is greater than largest uint120).
     *
     *  Counterpart to Solidity's `uint120` operator.
     *
     *  Requirements:
     *  - `value` must fit into 120 bits.
     */
    function toUint120(
        uint256 value
    )
        internal
        pure
        returns (uint120)
    {
        require(value < 2**120, "SafeCast: value doesn\'t fit in 120 bits");
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     *  overflow (i.e. when the input is greater than largest uint32).
     *
     *  Counterpart to Solidity's `uint32` operator.
     *
     *  Requirements:
     *  - `value` must fit into 32 bits.
     */
    function toUint32(
        uint256 value
    )
        internal
        pure
        returns (uint32)
    {
        require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
        return uint32(value);
    }
}

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


// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

    /**
     * @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 a - b;
    }

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

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

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

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

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

/*

    Copyright

    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.

*/




/**
 * @title SignedMath
 * @author  
 *
 * @dev SignedMath library for doing math with signed integers.
 */
library SignedMath {
    using SafeMath for uint256;

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

    struct Int {
        uint256 value;
        bool isPositive;
    }

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

    /**
     * @dev Returns a new signed integer equal to a signed integer plus an unsigned integer.
     */
    function add(
        Int memory sint,
        uint256 value
    )
        internal
        pure
        returns (Int memory)
    {
        if (sint.isPositive) {
            return Int({
                value: value.add(sint.value),
                isPositive: true
            });
        }
        if (sint.value < value) {
            return Int({
                value: value.sub(sint.value),
                isPositive: true
            });
        }
        return Int({
            value: sint.value.sub(value),
            isPositive: false
        });
    }

    /**
     * @dev Returns a new signed integer equal to a signed integer minus an unsigned integer.
     */
    function sub(
        Int memory sint,
        uint256 value
    )
        internal
        pure
        returns (Int memory)
    {
        if (!sint.isPositive) {
            return Int({
                value: value.add(sint.value),
                isPositive: false
            });
        }
        if (sint.value > value) {
            return Int({
                value: sint.value.sub(value),
                isPositive: true
            });
        }
        return Int({
            value: value.sub(sint.value),
            isPositive: false
        });
    }

    /**
     * @dev Returns a new signed integer equal to a signed integer plus another signed integer.
     */
    function signedAdd(
        Int memory augend,
        Int memory addend
    )
        internal
        pure
        returns (Int memory)
    {
        return addend.isPositive
            ? add(augend, addend.value)
            : sub(augend, addend.value);
    }

    /**
     * @dev Returns a new signed integer equal to a signed integer minus another signed integer.
     */
    function signedSub(
        Int memory minuend,
        Int memory subtrahend
    )
        internal
        pure
        returns (Int memory)
    {
        return subtrahend.isPositive
            ? sub(minuend, subtrahend.value)
            : add(minuend, subtrahend.value);
    }

    /**
     * @dev Returns true if signed integer `a` is greater than signed integer `b`, false otherwise.
     */
    function gt(
        Int memory a,
        Int memory b
    )
        internal
        pure
        returns (bool)
    {
        if (a.isPositive) {
            if (b.isPositive) {
                return a.value > b.value;
            } else {
                // True, unless both values are zero.
                return a.value != 0 || b.value != 0;
            }
        } else {
            if (b.isPositive) {
                return false;
            } else {
                return a.value < b.value;
            }
        }
    }

    /**
     * @dev Returns the minimum of signed integers `a` and `b`.
     */
    function min(
        Int memory a,
        Int memory b
    )
        internal
        pure
        returns (Int memory)
    {
        return gt(b, a) ? a : b;
    }

    /**
     * @dev Returns the maximum of signed integers `a` and `b`.
     */
    function max(
        Int memory a,
        Int memory b
    )
        internal
        pure
        returns (Int memory)
    {
        return gt(a, b) ? a : b;
    }
}

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

/*

    Copyright

    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.

*/



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

    /**
     * @dev Used to represent the signature.
     */
    struct Signature {
        bytes32 r;
        bytes32 s;
        uint8 v;
    }

    /**
     * @dev Used to track the signed position balance values for each symbol.
     */
    struct PositionStruct {
        bool positionIsPositive;
        uint120 position;
    }

    /**
     * @dev Used to track the the signed margin balance for each account.
     */
    struct MarginStruct {
        bool marginIsPositive;
        uint120 margin;
    }

    /**
     * @dev Used to track the signed margin balance and position balance values for each account.
     */
    struct Balance {
        bool marginIsPositive;
        uint120 margin;
        mapping(string => PositionStruct) tokenPosition;
    }

    /**
     * @dev Used by contracts implementing the I_P1Trader interface to return the result of a trade.
     */
    struct TradeResult {
        uint256 fee_maker;
        uint256 fee_taker;
        SignedMath.Int funding_maker;
        SignedMath.Int funding_taker;
        uint256 positionAmount;
        uint256 margin_change;
        bool is_neg_fee;
        bool isBuy; // From taker's perspective.
        bytes32 traderFlags;
    }
}

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

/*

    Copyright

    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.

*/




/**
 * @title I_P1Trader
 * @author  
 *
 * @notice Interface that PerpetualV1 Traders must implement.
 */
interface I_P1Trader {

    /**
     * @notice Returns the result of the trade between the maker and the taker. Expected to be
     *  called by PerpetualV1. Reverts if the trade is disallowed.
     *
     * @param  maker        The address of the passive maker account.
     * @param  taker        The address of the active taker account.
     * @param  data         Arbitrary data passed in to the `trade()` function of PerpetualV1.
     *
     * @return              The result of the trade from the perspective of the taker.
     */
    function trade(
        address maker,
        address taker,
        bytes calldata data
    )
        external
        returns (P1Types.TradeResult memory);
}

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

/*

    Copyright

    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.

*/



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

    uint256 private _STATUS_;

    //constructor () {
    //    _STATUS_ = NOT_ENTERED;
    //}

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

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol


// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// File: @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol


// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;



/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

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

/*

    Copyright

    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.

*/



/**
 * @title Storage
 * @author  
 *
 * @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

/*

    Copyright

    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.

*/




/**
 * @title Adminable
 * @author  
 *
 * @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/v1/impl/P1Storage.sol

/*

    Copyright

    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.

*/






/**
 * @title P1Storage
 * @author  
 *
 * @notice Storage contract. Contains or inherits from all contracts that have ordered storage.
 */
contract P1Storage is
    Adminable,
    ReentrancyGuard
{
    string[] internal _TOKEN_SYMBOL_;

    mapping(address => P1Types.Balance) internal _BALANCES_;

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

    address internal _TOKEN_;
    address internal _SIGNER1_;
    address internal _GATEWAY_;
    address internal _SIGNER0_;
    
}

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

/*

    Copyright

    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.

*/




/**
 * @title P1Operator
 * @author  
 *
 * @notice Contract for setting local operators for an account.
 */
contract P1Operator is
    P1Storage
{
    // ============ Events ============

    event LogSetLocalOperator(
        address indexed sender,
        address operator,
        bool approved
    );

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

    /**
     * @notice Grants or revokes permission for another account to perform certain actions on behalf
     *  of the sender.
     * @dev Emits the LogSetLocalOperator event.
     *
     * @param  operator  The account that is approved or disapproved.
     * @param  approved  True for approval, false for disapproval.
     */
    function setLocalOperator(
        address operator,
        bool approved
    )
        external
    {
        _LOCAL_OPERATORS_[msg.sender][operator] = approved;
        emit LogSetLocalOperator(msg.sender, operator, approved);
    }
}

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

/*

    Copyright

    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.

*/





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

    /**
     * @notice Get the positions of an account, without accounting for changes in the index.
     *
     * @param  account  The address of the account to query the position of.
     * @param  symbol   Trading tokens pair name for short.
     * @return          The position of the account on the symbol.
     */
    function getAccountPosition(
        address account,
        string calldata symbol
    )
        external
        view
        returns (P1Types.PositionStruct memory)
    {
        return _BALANCES_[account].tokenPosition[symbol];
    }

    /**
     * @notice Get the Q value of an account, without accounting for changes in the index.
     *
     * @param  account  The address of the account to query the Qvalue of.
     * @return          The Qvalue of the account.
     */
    function getAccountQvalue(
        address account
    )
        external
        view
        returns (P1Types.MarginStruct memory)
    {
        return P1Types.MarginStruct({
            marginIsPositive: _BALANCES_[account].marginIsPositive,
            margin: _BALANCES_[account].margin
        });
    }

    /**
     * @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 gateway.
     *
     * @return The address of the gateway.
     */
    function getGateway()
        external
        view
        returns (address)
    {
        return _GATEWAY_;
    }

    /**
     * @notice Gets the address of the signer0.
     *
     * @return The address of the signer0.
     */
    function getSigner0()
        external
        view
        returns (address)
    {
        return _SIGNER0_;
    }

    /**
     * @notice Gets the address of the signer1.
     *
     * @return The address of the signer1.
     */
    function getSigner1()
        external
        view
        returns (address)
    {
        return _SIGNER1_;
    }

    /**
     * @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 symbols array.
     *
     * @return Array of trading tokens pair names for short.
     */
    function getSymbolArray()
        external
        view
        returns (string [] memory)
    {
        return _TOKEN_SYMBOL_;
    }

    // ============ 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
            || _LOCAL_OPERATORS_[account][operator];
    }
}

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

/*

    Copyright

    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.

*/






/**
 * @title P1Settlement
 * @author  
 *
 * @notice Contract containing logic for settling funding payments between accounts.
 */
contract P1Settlement is
    P1Storage
{
    using SafeCast for uint256;
    using SignedMath for SignedMath.Int;

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

    uint256 private constant FLAG_MARGIN_IS_POSITIVE = 1 << (8 * 31);
    uint256 private constant FLAG_POSITION_IS_POSITIVE = 1 << (8 * 15);

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

    /**
     * @dev Returns a SignedMath.Int version of the position in balance.
     */
    function getPosition(
        address account,
        string memory token
    )
        internal
        view
        returns (SignedMath.Int memory)
    {
        return SignedMath.Int({
            value: _BALANCES_[account].tokenPosition[token].position,
            isPositive: _BALANCES_[account].tokenPosition[token].positionIsPositive
        });
    }

    /**
     * @dev In-place modify the signed position value of a balance.
     */
    function setPosition(
        address account,
        SignedMath.Int memory newPosition,
        string memory token
    )
        internal
    {
        _BALANCES_[account].tokenPosition[token].position = newPosition.value.toUint120();
        _BALANCES_[account].tokenPosition[token].positionIsPositive = newPosition.isPositive;
    }

    /**
     * @dev In-place add amount to balance.position.
     */
    function addToPosition(
        address account,
        uint256 amount,
        string memory token
    )
        internal
    {
        SignedMath.Int memory signedPosition = getPosition(account, token);
        signedPosition = signedPosition.add(amount);
        setPosition(account, signedPosition, token);
    }


    /**
     * @dev In-place subtract amount from balance.position.
     */
    function subFromPosition(
        address account,
        uint256 amount,
        string memory token
    )
        internal
    {
        SignedMath.Int memory signedPosition = getPosition(account, token);
        signedPosition = signedPosition.sub(amount);
        setPosition(account, signedPosition, token);
    }

    /**
     * @dev Returns a SignedMath.Int version of the margin in balance.
     */
    function getMargin(
        address account
    )
        internal
        view
        returns (SignedMath.Int memory)
    {
        return SignedMath.Int({
            value: _BALANCES_[account].margin,
            isPositive: _BALANCES_[account].marginIsPositive
        });
    }

    /**
     * @dev In-place modify the signed margin value of a balance.
     */
    function setMargin(
        address account,
        SignedMath.Int memory newMargin
    )
        internal
    {
        _BALANCES_[account].margin = newMargin.value.toUint120();
        _BALANCES_[account].marginIsPositive = newMargin.isPositive;
    }

    /**
     * @dev In-place add amount to balance.margin.
     */
    function addToMargin(
        address account,
        uint256 amount
    )
        internal
    {
        SignedMath.Int memory signedMargin = getMargin(account);
        signedMargin = signedMargin.add(amount);
        setMargin(account, signedMargin);
    }

    /**
     * @dev In-place subtract amount from balance.margin.
     */
    function subFromMargin(
        address account,
        uint256 amount
    )
        internal
    {
        SignedMath.Int memory signedMargin = getMargin(account);
        signedMargin = signedMargin.sub(amount);
        setMargin(account, signedMargin);
    }

    /**
     * @dev Returns a compressed bytes32 representation of the balance for logging.
     */
    function toBytes32(
        address account,
        string memory symbol
    )
        internal
        view
        returns (bytes32)
    {
        uint256 result =
            uint256(_BALANCES_[account].tokenPosition[symbol].position)
            | (uint256(_BALANCES_[account].margin) << 128)
            | (_BALANCES_[account].marginIsPositive ? FLAG_MARGIN_IS_POSITIVE : 0)
            | (_BALANCES_[account].tokenPosition[symbol].positionIsPositive ? FLAG_POSITION_IS_POSITIVE : 0);
        return bytes32(result);
    }

    /**
     * @dev Returns a compressed bytes32 representation of the funding & margin for logging.
     */
    function toBytes32_deposit_withdraw(
        address account,
        SignedMath.Int memory funding
    )
        internal
        view
        returns (bytes32)
    {
        uint256 result =
            funding.value
            | (uint256(_BALANCES_[account].margin) << 128)
            | (_BALANCES_[account].marginIsPositive ? FLAG_MARGIN_IS_POSITIVE : 0)
            | (funding.isPositive ? FLAG_POSITION_IS_POSITIVE : 0);
        
        return bytes32(result);
    }

    /**
     * @dev Returns a compressed bytes32 representation of fee for logging.
     */
    function toBytes32_fee(
        uint256 fee,
        bool is_neg_fee
    )
        internal
        pure
        returns (bytes32)
    {
        uint256 result =
            fee
            | (is_neg_fee ? 0 : FLAG_MARGIN_IS_POSITIVE);
        
        return bytes32(result);
    }

    /**
     * @dev Returns a compressed bytes32 representation of funding for logging.
     */
    function toBytes32_funding(
        SignedMath.Int memory funding
    )
        internal
        pure
        returns (bytes32)
    {
        uint256 result =
            funding.value
            | (funding.isPositive ? FLAG_MARGIN_IS_POSITIVE : 0);
        
        return bytes32(result);
    }

}




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

/*

    Copyright

    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.

*/







/**
 * @title P1Trade
 * @author  
 *
 * @notice Contract for settling trades between two accounts. A "trade" in this context may refer
 *  to any approved transfer of balances, as determined by the smart contracts implementing the
 *  I_P1Trader interface and approved as global operators on the PerpetualV1 contract.
 */
contract P1Trade is
    P1TraderConstants,
    P1Settlement
{
    using SignedMath for SignedMath.Int;

    // Bitmasks for the flags field
    bytes32 constant FLAG_MASK_NULL = bytes32(uint256(0));

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

    struct TradeArg {
        uint256 takerIndex;
        uint256 makerIndex;
        string symbol; 
        address trader;
        bytes data;
    }

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

    event LogTrade(
        address indexed maker,
        address indexed taker,
        address trader,
        string symbol,
        bytes32 makerBalance,
        bytes32 takerBalance,
        bytes32 funding_maker,
        bytes32 funding_taker,
        bytes32 fee_maker,
        bytes32 fee_taker,
        uint256 margin_change,
        uint256 positionAmount,
        bool isBuy  //taker or liquidator

    );

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

    /**
     * @notice Submits one or more trades between any number of accounts.
     * @dev Only able to be called by global operators. Emits the LogIndex event, 
     *  one LogAccountSettled event for each account in `accounts`, and the LogTrade event for each trade in `trades`.
     *
     * @param  accounts  The sorted list of accounts that are involved in trades.
     * @param  trades    The list of trades to execute in-order.
     */
    function trade(
        address[] calldata accounts,
        TradeArg[] calldata trades
    )
        external
        nonReentrant
    {
        require(
            msg.sender == _GATEWAY_,
            "function trade: msg.sender is not gateway"
        );
        _verifyAccounts(accounts);

        for (uint256 i = 0; i < trades.length; i++) {
            TradeArg memory tradeArg = trades[i];

            require(
                _GLOBAL_OPERATORS_[tradeArg.trader],
                "trader is not global operator"
            );

            address maker = accounts[tradeArg.makerIndex];
            address taker = accounts[tradeArg.takerIndex];

            P1Types.TradeResult memory tradeResult = I_P1Trader(tradeArg.trader).trade(
                maker,
                taker,
                tradeArg.data
            );

            (
                bool maker_is_neg_fee, 
                bool taker_is_neg_fee
            ) = margin_position(maker, taker, tradeResult, tradeArg.symbol);

            emit LogTrade(
                maker,
                taker,
                tradeArg.trader,
                tradeArg.symbol,
                toBytes32(maker, tradeArg.symbol),
                toBytes32(taker, tradeArg.symbol),
                toBytes32_funding(tradeResult.funding_maker),
                toBytes32_funding(tradeResult.funding_taker),
                toBytes32_fee(tradeResult.fee_maker, maker_is_neg_fee),
                toBytes32_fee(tradeResult.fee_taker, taker_is_neg_fee),
                tradeResult.margin_change,
                tradeResult.positionAmount,
                tradeResult.isBuy
            );
        }
    }

    /**
     * @dev Trader is order.
     *
     */
    function _isOrder(
        bytes32 traderFlags
    )
        private
        pure
        returns (bool)
    {
        return (traderFlags & TRADER_FLAG_ORDERS) != FLAG_MASK_NULL;
    }

    /**
     * @dev Verify that `accounts` contains at least one address and that the contents are unique.
     *  We verify uniqueness by requiring that the array is sorted.
     */
    function _verifyAccounts(
        address[] memory accounts
    )
        private
        pure
    {
        require(
            accounts.length > 0,
            "Accounts must have non-zero length"
        );

        // Check that accounts are unique
        address prevAccount = accounts[0];
        for (uint256 i = 1; i < accounts.length; i++) {
            address account = accounts[i];
            require(
                account > prevAccount,
                "Accounts must be sorted and unique"
            );
            prevAccount = account;
        }
    }

    /**
     * @dev Calculate & update margin & position. avoid stack too deep errors of trade 
     */
    function margin_position(
        address maker, 
        address taker, 
        P1Types.TradeResult memory tradeResult,
        string memory symbol
    )
        private
        returns (bool, bool)
    {
        
        SignedMath.Int memory change_maker = tradeResult.funding_maker;
        SignedMath.Int memory change_taker = tradeResult.funding_taker;
        
        if (taker != maker) {
            if (tradeResult.isBuy) {
                change_taker = change_taker.sub(tradeResult.margin_change);
                change_maker = change_maker.add(tradeResult.margin_change);
                subFromPosition(maker, tradeResult.positionAmount, symbol);
                addToPosition(taker, tradeResult.positionAmount, symbol);
            } else {
                change_taker = change_taker.add(tradeResult.margin_change);
                change_maker = change_maker.sub(tradeResult.margin_change);
                addToPosition(maker, tradeResult.positionAmount, symbol);
                subFromPosition(taker, tradeResult.positionAmount, symbol);
            }
        }
        
        bool maker_is_neg_fee;
        bool taker_is_neg_fee;
        if (_isOrder(tradeResult.traderFlags)) {
            change_taker = change_taker.sub(tradeResult.fee_taker);
            taker_is_neg_fee = false;
            if (tradeResult.is_neg_fee) {
                change_maker = change_maker.add(tradeResult.fee_maker);
                maker_is_neg_fee = true;
            } else {
                change_maker = change_maker.sub(tradeResult.fee_maker);
                maker_is_neg_fee = false;
            }
        } else { //liquidation or deleveraging
            change_maker = change_maker.sub(tradeResult.fee_maker);
            maker_is_neg_fee = false;
            if (tradeResult.is_neg_fee) {
                change_taker = change_taker.add(tradeResult.fee_taker);
                taker_is_neg_fee = true;
            } else {
                change_taker = change_taker.sub(tradeResult.fee_taker);
                taker_is_neg_fee = false;
            }
        }

        //margin
        if (change_maker.isPositive) {
            addToMargin(maker, change_maker.value);
        } else {
            subFromMargin(maker, change_maker.value);
        }
        if (change_taker.isPositive) {
            addToMargin(taker, change_taker.value);
        } else {
            subFromMargin(taker, change_taker.value);
        }
        return (maker_is_neg_fee, taker_is_neg_fee);


    }
}

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

/*

    Copyright

    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.

*/








/**
 * @title P1Margin
 * @author  
 *
 * @notice Contract for withdrawing and depositing.
 */
contract P1Margin is
    P1Settlement,
    P1Getters
{
    using SafeMath for uint256;
    using SignedMath for SignedMath.Int;

    uint256 constant internal DECIMAL_ADJ = 10 ** (18 - 6); //Ethernet 1/3

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

    event LogDeposit(
        address indexed account,
        uint256 amount,
        bytes32 balance
    );

    event LogWithdraw(
        address indexed account,
        address destination,
        uint256 amount,
        bytes32 balance
    );

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

    /**
     * @notice Deposit some amount of margin tokens from the msg.sender into an account.
     * @dev Emits LogIndex, LogAccountSettled, and LogDeposit events.
     *
     * @param  account  The account for which to credit the deposit.
     * @param  amount   the amount of tokens to deposit.
     */
    function deposit(
        address account,
        uint256 amount
    )
        external
        nonReentrant
    {
        SafeERC20.safeTransferFrom(
            IERC20(_TOKEN_),
            msg.sender,
            address(this),
            amount
        );
        
        //addToMargin(account, amount);
        addToMargin(account, amount.mul(DECIMAL_ADJ));  //Ethernet 2/3

        emit LogDeposit(
            account,
            amount,
            toBytes32_deposit_withdraw(account, SignedMath.Int({value:0, isPositive:false}))
        );
    }

    /**
     * @notice Withdraw some amount of margin tokens from an account to a destination address.
     * @dev Emits LogWithdraw event. 
     *
     * @param  funding      The funding of the account
     * @param  amount       The amount of tokens to withdraw.
     * @param  destination  The address to which the tokens are transferred.
     * @param  timestamp    The timestamp of the withdraw apply
     * @param  signer0      Signer0 signature
     * @param  signer1      Signer1 signature
     */
    function withdraw(
        SignedMath.Int calldata funding,
        address account,
        address destination,
        uint256 amount,
        uint256 timestamp,
        P1Types.Signature calldata signer0,
        P1Types.Signature calldata signer1
    )
        external
        nonReentrant
    {
        require(
            hasAccountPermissions(account, msg.sender),
            "withdraw sender does not have permission to withdraw"
        );

        //check duplication
        bytes32 wd_hash = _getApplyHash(account, destination, amount, timestamp);
        require(
            !_WD_DONE_[wd_hash],
            "withdraw duplicate"
        );

        //check signature
        wd_hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", wd_hash));
        require(
            _SIGNER0_ == ecrecover(wd_hash, signer0.v, signer0.r, signer0.s),
            "withdraw invalid signer0"
        );
        require(
            _SIGNER1_ == ecrecover(wd_hash, signer1.v, signer1.r, signer1.s),
            "withdraw invalid signer1"
        );

        _WD_DONE_[wd_hash] = true;

        SafeERC20.safeTransfer(
            IERC20(_TOKEN_),
            destination,
            amount
        );
        
        SignedMath.Int memory signedChange = funding.sub(amount.mul(DECIMAL_ADJ)); //Ethernet 3/3
        //SignedMath.Int memory signedChange = funding.sub(amount);

        if (signedChange.isPositive) {
            addToMargin(account, signedChange.value);
        }  else {
            subFromMargin(account, signedChange.value);
        }
        
        bytes32 margin_funding = toBytes32_deposit_withdraw(account, funding);
        emit LogWithdraw(
            account,
            destination,
            amount,
            margin_funding
        );
    }

    /**
     * @dev Returns the hash of an withdraw apply.
     */
    function _getApplyHash(
        address account, 
        address destination, 
        uint256 amount,
        uint256 timestamp
    )
        private
        pure
        returns (bytes32)
    {
        return keccak256(abi.encodePacked(account, destination, amount, timestamp));
    }

}

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

/*

    Copyright

    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.

*/






/**
 * @title P1Admin
 * @author  
 *
 * @notice Contract allowing the Admin address to set certain parameters.
 */
contract P1Admin is
    P1Storage
{
    // ============ Events ============

    event LogSetGlobalOperator(
        address operator,
        bool approved
    );

    event LogSetGateway(
        address gateway_address
    );

    event LogSetSigner0(
        address signer0_address
    );

    event LogSetSigner1(
        address signer1_address
    );

    event LogSetToken(
        address token_address
    );

    event LogSetTokenSymbolInitial(string [] token_symbol);

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

    /**
     * @notice Add or remove a Global Operator address.
     * @dev Must be called by the PerpetualV1 admin. Emits the LogSetGlobalOperator event.
     *
     * @param  operator  The address for which to enable or disable global operator privileges.
     * @param  approved  True if approved, false if disapproved.
     */
    function setGlobalOperator(
        address operator,
        bool approved
    )
        external
        onlyAdmin
        nonReentrant
    {
        _GLOBAL_OPERATORS_[operator] = approved;
        emit LogSetGlobalOperator(operator, approved);
    }

    /**
     * @notice Sets gateway address.
     * @dev Must be called by the PerpetualV1 admin. Emits the LogSetGateway event.
     *
     * @param  gateway_address  The address of gateway.
     */
    function setGateway(
        address gateway_address
    )
        external
        onlyAdmin
        nonReentrant
    {
        _GATEWAY_ = gateway_address;
        emit LogSetGateway(gateway_address);
    }

    /**
     * @notice Sets signer0 address.
     * @dev Must be called by the PerpetualV1 admin. Emits the LogSetSigner0 event.
     *
     * @param  signer0_address  The address of signer0.
     */
    function setSigner0(
        address signer0_address
    )
        external
        onlyAdmin
        nonReentrant
    {
        _SIGNER0_ = signer0_address;
        emit LogSetSigner0(signer0_address);
    }

    /**
     * @notice Sets signer1 address.
     * @dev Must be called by the PerpetualV1 admin. Emits the LogSetSigner1 event.
     *
     * @param  signer1_address  The address of signer1.
     */
    function setSigner1(
        address signer1_address
    )
        external
        onlyAdmin
        nonReentrant
    {
        _SIGNER1_ = signer1_address;
        emit LogSetSigner1(signer1_address);
    }

    /**
     * @notice Sets a new token contract.
     * @dev Must be called by the PerpetualV1 admin. Emits the LogSetToken event.
     *
     * @param  token_address  The address of the token smart contract.
     */
    function setToken(
        address token_address
    )
        external
        onlyAdmin
        nonReentrant
    {
        IERC20(token_address).totalSupply();
        _TOKEN_ = token_address;
        emit LogSetToken(token_address);
    }

    /**
     * @notice Initialize symbols array for adding new symbols.
     * @dev Must be called by the PerpetualV1 admin. Emits the LogSetTokenSymbolInitial event.
     *
     * @param  symbol_array  array of trading tokens pair names for short.
     */
    function setTokenSymbolInitial(
        string[] calldata symbol_array
    )
        external
        onlyAdmin
        nonReentrant
    {
        _TOKEN_SYMBOL_ = new string[](symbol_array.length);
        for (uint256 i = 0; i < symbol_array.length; i++) {
            _TOKEN_SYMBOL_[i] = symbol_array[i];
        }
        emit LogSetTokenSymbolInitial(_TOKEN_SYMBOL_);
    }
    
}

// File: contracts/protocol/v1/PerpetualV1.sol

/*

    Copyright

    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.

*/










/**
 * @title PerpetualV1
 * @author  
 *
 * @notice A market for a perpetual contract, a financial derivative which may be traded on margin
 *  and which aims to closely track the spot price of an underlying asset. The underlying asset is
 *  specified via the price oracle which reports its spot price. Tethering of the perpetual market
 *  price is supported by a funding oracle which governs funding payments between longs and shorts.
 * @dev Main perpetual market implementation contract that inherits from other contracts.
 */
contract PerpetualV1 is
    P1Settlement,
    P1Admin,
    P1Getters,
    P1Margin,
    P1Operator,
    P1Trade
{
    // Non-colliding storage slot.
    bytes32 internal constant PERPETUAL_V1_INITIALIZE_SLOT =
    bytes32(uint256(keccak256(" .PerpetualV1.initialize")) - 1);

    /**
     * @dev Once-only initializer function that replaces the constructor since this contract is
     *  proxied. Uses a non-colliding storage slot to store if this version has been initialized.
     * @dev Can only be called once and can only be called by the admin of this contract.
     *
     * @param  token          The address of the token to use for margin-deposits.
     */
    function initializeV1(
        address token
    )
        external
        onlyAdmin
        nonReentrant
    {
        // only allow initialization once
        require(
            Storage.load(PERPETUAL_V1_INITIALIZE_SLOT) == 0x0,
            "PerpetualV1 already initialized"
        );
        Storage.store(PERPETUAL_V1_INITIALIZE_SLOT, bytes32(uint256(1)));

        _TOKEN_ = token;
    }
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"balance","type":"bytes32"}],"name":"LogDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"gateway_address","type":"address"}],"name":"LogSetGateway","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"LogSetGlobalOperator","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"LogSetLocalOperator","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer0_address","type":"address"}],"name":"LogSetSigner0","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer1_address","type":"address"}],"name":"LogSetSigner1","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token_address","type":"address"}],"name":"LogSetToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string[]","name":"token_symbol","type":"string[]"}],"name":"LogSetTokenSymbolInitial","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"address","name":"trader","type":"address"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"bytes32","name":"makerBalance","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"takerBalance","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"funding_maker","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"funding_taker","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"fee_maker","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"fee_taker","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"margin_change","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"positionAmount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isBuy","type":"bool"}],"name":"LogTrade","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"balance","type":"bytes32"}],"name":"LogWithdraw","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"string","name":"symbol","type":"string"}],"name":"getAccountPosition","outputs":[{"components":[{"internalType":"bool","name":"positionIsPositive","type":"bool"},{"internalType":"uint120","name":"position","type":"uint120"}],"internalType":"struct P1Types.PositionStruct","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountQvalue","outputs":[{"components":[{"internalType":"bool","name":"marginIsPositive","type":"bool"},{"internalType":"uint120","name":"margin","type":"uint120"}],"internalType":"struct P1Types.MarginStruct","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGateway","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"getIsGlobalOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"getIsLocalOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSigner0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSigner1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSymbolArray","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"hasAccountPermissions","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"initializeV1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"gateway_address","type":"address"}],"name":"setGateway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setGlobalOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setLocalOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer0_address","type":"address"}],"name":"setSigner0","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer1_address","type":"address"}],"name":"setSigner1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_address","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"symbol_array","type":"string[]"}],"name":"setTokenSymbolInitial","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"components":[{"internalType":"uint256","name":"takerIndex","type":"uint256"},{"internalType":"uint256","name":"makerIndex","type":"uint256"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"trader","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct P1Trade.TradeArg[]","name":"trades","type":"tuple[]"}],"name":"trade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bool","name":"isPositive","type":"bool"}],"internalType":"struct SignedMath.Int","name":"funding","type":"tuple"},{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"components":[{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"internalType":"struct P1Types.Signature","name":"signer0","type":"tuple"},{"components":[{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"internalType":"struct P1Types.Signature","name":"signer1","type":"tuple"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50613556806100206000396000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c80636e9960c3116100d85780639cd0e3aa1161008c578063b4959e7211610066578063b4959e721461038f578063b53aeb2e146103a2578063e2f32f24146103b357600080fd5b80639cd0e3aa146102fb5780639f036e7614610369578063a3dcc98c1461037c57600080fd5b80638052887e116100bd5780638052887e146102c057806384ea2862146102d557806390646b4a146102e857600080fd5b80636e9960c3146102985780637c121925146102a057600080fd5b80633a031bf01161013a57806346d256c51161011457806346d256c51461025f57806347e7ef241461027257806355f798581461028557600080fd5b80633a031bf01461022857806342bf3cc11461023b578063467d896d1461024c57600080fd5b80631b9a9f9e1161016b5780631b9a9f9e146101dd57806328b7bede146101f05780632fec7c571461021557600080fd5b8063052f72d714610187578063144fa6d7146101c8575b600080fd5b6101b36101953660046129eb565b6001600160a01b031660009081526003602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6101db6101d63660046129eb565b6103c4565b005b6101db6101eb3660046129eb565b610572565b6006546001600160a01b03165b6040516001600160a01b0390911681526020016101bf565b6101db610223366004612a1e565b610726565b6101b3610236366004612aa2565b610bef565b6008546001600160a01b03166101fd565b6101db61025a3660046129eb565b610c1f565b6101db61026d366004612ae3565b610d47565b6101db610280366004612b1a565b610e72565b6101db610293366004612b90565b610f6b565b6101fd61112c565b6102b36102ae366004612bd2565b61115b565b6040516101bf9190612c55565b6102c86111e0565b6040516101bf9190612cf5565b6101b36102e3366004612aa2565b6112b9565b6101db6102f63660046129eb565b611305565b6102b36103093660046129eb565b60408051808201825260008082526020918201819052825180840184526001600160a01b039490941680825260028084529382205460ff81161515865291529181526101009091046effffffffffffffffffffffffffffff169082015290565b6101db6103773660046129eb565b61142c565b6101db61038a366004612d75565b611554565b6101db61039d366004612ae3565b6118f9565b6007546001600160a01b03166101fd565b6009546001600160a01b03166101fd565b6103cc61112c565b6001600160a01b0316336001600160a01b0316146104315760405162461bcd60e51b815260206004820152601e60248201527f41646d696e61626c653a2063616c6c6572206973206e6f742061646d696e000060448201526064015b60405180910390fd5b60001960005414156104855760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b600019600081905550806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104c757600080fd5b505afa1580156104db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ff9190612de1565b50600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f5b5f639eae4eb0789b53a218b67fe7238987c2ae8e6669f57eb56b267d025d7e906020015b60405180910390a1506001600055565b61057a61112c565b6001600160a01b0316336001600160a01b0316146105da5760405162461bcd60e51b815260206004820152601e60248201527f41646d696e61626c653a2063616c6c6572206973206e6f742061646d696e00006044820152606401610428565b600019600054141561062e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b60001960005561066661066260017fde8dcb0f1d5785b367cec7041f5f0e8b02e6f60b9cadc2ca1d77c1c4f47a453d612e29565b5490565b156106b35760405162461bcd60e51b815260206004820152601f60248201527f50657270657475616c563120616c726561647920696e697469616c697a6564006044820152606401610428565b6106e76106e160017fde8dcb0f1d5785b367cec7041f5f0e8b02e6f60b9cadc2ca1d77c1c4f47a453d612e29565b60019055565b600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03929092169190911790556001600055565b600019600054141561077a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b60001960005561078a86336112b9565b6107fc5760405162461bcd60e51b815260206004820152603460248201527f77697468647261772073656e64657220646f6573206e6f74206861766520706560448201527f726d697373696f6e20746f2077697468647261770000000000000000000000006064820152608401610428565b60408051606088811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081166020808501919091529189901b166034830152604882018790526068808301879052835180840390910181526088909201909252805191012060009060008181526005602052604090205490915060ff16156108c75760405162461bcd60e51b815260206004820152601260248201527f7769746864726177206475706c696361746500000000000000000000000000006044820152606401610428565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052605c016040516020818303038152906040528051906020012090506001818460400160208101906109289190612e40565b604080516000815260208181018084529490945260ff909216908201528535606082015290850135608082015260a0016020604051602081039080840390855afa15801561097a573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001516009546001600160a01b039081169116149050610a015760405162461bcd60e51b815260206004820152601860248201527f776974686472617720696e76616c6964207369676e65723000000000000000006044820152606401610428565b600181610a146060850160408601612e40565b604080516000815260208181018084529490945260ff909216908201528435606082015290840135608082015260a0016020604051602081039080840390855afa158015610a66573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001516007546001600160a01b039081169116149050610aed5760405162461bcd60e51b815260206004820152601860248201527f776974686472617720696e76616c6964207369676e65723100000000000000006044820152606401610428565b6000818152600560205260409020805460ff19166001179055600654610b1d906001600160a01b03168787611969565b6000610b46610b318764e8d4a51000611a35565b610b40368c90038c018c612edf565b90611a41565b9050806020015115610b6557610b60888260000151611af6565b610b73565b610b73888260000151611b77565b6000610b8d89610b88368d90038d018d612edf565b611bec565b604080516001600160a01b038b81168252602082018b90529181018390529192508a16907f74348e8cb927b5536fe550310d0cdf05914498fcb04ad61b99c29e3899b0bce99060600160405180910390a2505060016000555050505050505050565b6001600160a01b0380831660009081526004602090815260408083209385168352929052205460ff165b92915050565b610c2761112c565b6001600160a01b0316336001600160a01b031614610c875760405162461bcd60e51b815260206004820152601e60248201527f41646d696e61626c653a2063616c6c6572206973206e6f742061646d696e00006044820152606401610428565b6000196000541415610cdb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b600019600055600780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f1efccef3d830d9c9b8edb7cc63b73a1a0826f6261ad8148fa2745b6d39e6508c90602001610562565b610d4f61112c565b6001600160a01b0316336001600160a01b031614610daf5760405162461bcd60e51b815260206004820152601e60248201527f41646d696e61626c653a2063616c6c6572206973206e6f742061646d696e00006044820152606401610428565b6000196000541415610e035760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b60001960009081556001600160a01b03831680825260036020908152604092839020805460ff19168515159081179091558351928352908201527feaeee7699e70e6b31ac89ec999ef6936b97ac1e364f0e1fcf584772372caa0d391015b60405180910390a150506001600055565b6000196000541415610ec65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b600019600055600654610ee4906001600160a01b0316333084611cae565b610efc82610ef78364e8d4a51000611a35565b611af6565b816001600160a01b03167f40a9cb3a9707d3a68091d8ef7ffd4158d01d0b2ad92b1e489abe8312dd54302382610f4a8560405180604001604052806000815260200160001515815250611bec565b6040805192835260208301919091520160405180910390a250506001600055565b610f7361112c565b6001600160a01b0316336001600160a01b031614610fd35760405162461bcd60e51b815260206004820152601e60248201527f41646d696e61626c653a2063616c6c6572206973206e6f742061646d696e00006044820152606401610428565b60001960005414156110275760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b6000196000558067ffffffffffffffff81111561104657611046612e63565b60405190808252806020026020018201604052801561107957816020015b60608152602001906001900390816110645790505b50805161108e91600191602090910190612818565b5060005b818110156110fb578282828181106110ac576110ac612f35565b90506020028101906110be9190612f64565b600183815481106110d1576110d1612f35565b9060005260206000200191906110e8929190612871565b50806110f381612fc9565b915050611092565b507f53a77d496dab9b3c73c8fc49e1f42cfb6ea0a6a78f78873d774bcc5d8c339e1a6001604051610e619190613032565b60006111567fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b919050565b604080518082018252600080825260208083018290526001600160a01b03871682526002905282902091519091600101906111999085908590613159565b908152604080519182900360209081018320838301909252905460ff8116151583526effffffffffffffffffffffffffffff610100909104169082015290505b9392505050565b60606001805480602002602001604051908101604052809291908181526020016000905b828210156112b057838290600052602060002001805461122390612fe4565b80601f016020809104026020016040519081016040528092919081815260200182805461124f90612fe4565b801561129c5780601f106112715761010080835404028352916020019161129c565b820191906000526020600020905b81548152906001019060200180831161127f57829003601f168201915b505050505081526020019060010190611204565b50505050905090565b6000816001600160a01b0316836001600160a01b031614806111d95750506001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b61130d61112c565b6001600160a01b0316336001600160a01b03161461136d5760405162461bcd60e51b815260206004820152601e60248201527f41646d696e61626c653a2063616c6c6572206973206e6f742061646d696e00006044820152606401610428565b60001960005414156113c15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b600019600055600880547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527e8bca8fc36e27fc473fadf0c25b75f6dc8425c426dc186b1728429a6ac8361290602001610562565b61143461112c565b6001600160a01b0316336001600160a01b0316146114945760405162461bcd60e51b815260206004820152601e60248201527f41646d696e61626c653a2063616c6c6572206973206e6f742061646d696e00006044820152606401610428565b60001960005414156114e85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b600019600055600980547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f6bd1d417d1ff553ece78b8df00cd93e2d97be593084069589d012cd8160a770e90602001610562565b60001960005414156115a85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610428565b6000196000556008546001600160a01b0316331461162e5760405162461bcd60e51b815260206004820152602960248201527f66756e6374696f6e2074726164653a206d73672e73656e646572206973206e6f60448201527f74206761746577617900000000000000000000000000000000000000000000006064820152608401610428565b61166a848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611d0592505050565b60005b818110156118ed57600083838381811061168957611689612f35565b905060200281019061169b9190613169565b6116a49061325b565b60608101516001600160a01b031660009081526003602052604090205490915060ff166117135760405162461bcd60e51b815260206004820152601d60248201527f747261646572206973206e6f7420676c6f62616c206f70657261746f720000006044820152606401610428565b60008686836020015181811061172b5761172b612f35565b905060200201602081019061174091906129eb565b905060008787846000015181811061175a5761175a612f35565b905060200201602081019061176f91906129eb565b9050600083606001516001600160a01b031663e7a08801848487608001516040518463ffffffff1660e01b81526004016117ab93929190613303565b61016060405180830381600087803b1580156117c657600080fd5b505af11580156117da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117fe919061339f565b90506000806118138585858960400151611e64565b91509150836001600160a01b0316856001600160a01b03167fe36d4ed0c612b8b6a37918181fe1f97714e2795e8be89b92d25da1801462d206886060015189604001516118648a8c60400151612044565b6118728a8d60400151612044565b61187f8a60400151612176565b61188c8b60600151612176565b8b51611898908c6121b6565b6118a68d602001518c6121b6565b8d60a001518e608001518f60e001516040516118cc9b9a9998979695949392919061343a565b60405180910390a350505050505080806118e590612fc9565b91505061166d565b50506001600055505050565b3360008181526004602090815260408083206001600160a01b03871680855290835292819020805460ff19168615159081179091558151938452918301919091527ffe9fa8ad7dbd5e50cbcd1a903ea64717cb80b02e6b737e74f7e2f070b3e4d15f910160405180910390a25050565b6040516001600160a01b038316602482015260448101829052611a309084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526121f1565b505050565b60006111d982846134a7565b60408051808201909152600080825260208201528260200151611a91576040518060400160405280611a808560000151856122d690919063ffffffff16565b815260006020909101529050610c19565b8251821015611ac3576040805180820190915283518190611ab290856122e2565b815260016020909101529050610c19565b6040518060400160405280611ae58560000151856122e290919063ffffffff16565b815260006020909101529392505050565b6000611b5f836040805180820190915260008082526020820152506040805180820182526001600160a01b03909216600081815260026020818152938220546effffffffffffffffffffffffffffff610100820416865292909152825260ff1615159082015290565b9050611b6b81836122ee565b9050611a308382612371565b6000611be0836040805180820190915260008082526020820152506040805180820182526001600160a01b03909216600081815260026020818152938220546effffffffffffffffffffffffffffff610100820416865292909152825260ff1615159082015290565b9050611b6b8183611a41565b6000808260200151611bff576000611c11565b6f010000000000000000000000000000005b6001600160a01b03851660009081526002602052604090205460ff16611c38576000611c5a565b7f01000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03861660009081526002602052604090205485517effffffffffffffffffffffffffffff0000000000000000000000000000000061010090920460801b9190911617171791505092915050565b6040516001600160a01b0380851660248301528316604482015260648101829052611cff9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016119ae565b50505050565b6000815111611d7c5760405162461bcd60e51b815260206004820152602260248201527f4163636f756e7473206d7573742068617665206e6f6e2d7a65726f206c656e6760448201527f74680000000000000000000000000000000000000000000000000000000000006064820152608401610428565b600081600081518110611d9157611d91612f35565b602002602001015190506000600190505b8251811015611a30576000838281518110611dbf57611dbf612f35565b60200260200101519050826001600160a01b0316816001600160a01b031611611e505760405162461bcd60e51b815260206004820152602260248201527f4163636f756e7473206d75737420626520736f7274656420616e6420756e697160448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610428565b915080611e5c81612fc9565b915050611da2565b6040820151606083015160009182916001600160a01b0387811690891614611f27578560e0015115611ede5760a0860151611ea0908290611a41565b9050611eb98660a00151836122ee90919063ffffffff16565b9150611eca888760800151876123ee565b611ed987876080015187612413565b611f27565b60a0860151611eee9082906122ee565b9050611f078660a0015183611a4190919063ffffffff16565b9150611f1888876080015187612413565b611f27878760800151876123ee565b600080611f3b886101000151600116151590565b15611f90576020880151611f50908490611a41565b9250600090508760c0015115611f78578751611f6d9085906122ee565b935060019150611fdf565b8751611f85908590611a41565b935060009150611fdf565b8751611f9d908590611a41565b9350600091508760c0015115611fc8576020880151611fbd9084906122ee565b925060019050611fdf565b6020880151611fd8908490611a41565b9250600090505b836020015115611ffc57611ff78a8560000151611af6565b61200a565b61200a8a8560000151611b77565b82602001511561202757612022898460000151611af6565b612035565b612035898460000151611b77565b90999098509650505050505050565b6001600160a01b03821660009081526002602052604080822090518291600101906120709085906134c6565b9081526040519081900360200190205460ff1661208e5760006120a0565b6f010000000000000000000000000000005b6001600160a01b03851660009081526002602052604090205460ff166120c75760006120e9565b7f01000000000000000000000000000000000000000000000000000000000000005b6001600160a01b038616600090815260026020526040908190208054915161010090920460801b7effffffffffffffffffffffffffffff0000000000000000000000000000000016916001909101906121439088906134c6565b908152604051908190036020019020546effffffffffffffffffffffffffffff6101009091041617171791505092915050565b60008082602001516121895760006121ab565b7f01000000000000000000000000000000000000000000000000000000000000005b925190921792915050565b600080826121e4577f01000000000000000000000000000000000000000000000000000000000000006121e7565b60005b9093179392505050565b6000612246826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661242b9092919063ffffffff16565b805190915015611a30578080602001905181019061226491906134d8565b611a305760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610428565b60006111d982846134f5565b60006111d98284612e29565b604080518082019091526000808252602082015282602001511561232e576040518060400160405280611ab28560000151856122d690919063ffffffff16565b8251821115612359576040518060400160405280611ab28560000151856122e290919063ffffffff16565b6040805180820190915283518190611ae590856122e2565b805161237c90612442565b6001600160a01b03929092166000908152600260209081526040909120805492909101517fffffffffffffffffffffffffffffffff000000000000000000000000000000009092166101006effffffffffffffffffffffffffffff9094169390930260ff191692909217901515179055565b60006123fa84836124cd565b90506124068184611a41565b9050611cff8482846125ba565b600061241f84836124cd565b905061240681846122ee565b606061243a84846000856126a0565b949350505050565b60006f0100000000000000000000000000000082106124c95760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f32302062697473000000000000000000000000000000000000000000000000006064820152608401610428565b5090565b6040805180820190915260008082526020820152604051806040016040528060026000866001600160a01b03166001600160a01b031681526020019081526020016000206001018460405161252291906134c6565b908152602001604051809103902060000160019054906101000a90046effffffffffffffffffffffffffffff166effffffffffffffffffffffffffffff16815260200160026000866001600160a01b03166001600160a01b031681526020019081526020016000206001018460405161259b91906134c6565b9081526040519081900360200190205460ff1615159052905092915050565b81516125c590612442565b60026000856001600160a01b03166001600160a01b03168152602001908152602001600020600101826040516125fb91906134c6565b90815260408051918290036020908101832080546effffffffffffffffffffffffffffff95909516610100027fffffffffffffffffffffffffffffffff000000000000000000000000000000ff90951694909417909355848301516001600160a01b0387166000908152600290945292206001019061267b9084906134c6565b908152604051908190036020019020805491151560ff19909216919091179055505050565b6060824710156127185760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610428565b843b6127665760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610428565b600080866001600160a01b0316858760405161278291906134c6565b60006040518083038185875af1925050503d80600081146127bf576040519150601f19603f3d011682016040523d82523d6000602084013e6127c4565b606091505b50915091506127d48282866127df565b979650505050505050565b606083156127ee5750816111d9565b8251156127fe5782518084602001fd5b8160405162461bcd60e51b8152600401610428919061350d565b828054828255906000526020600020908101928215612865579160200282015b8281111561286557825180516128559184916020909101906128f1565b5091602001919060010190612838565b506124c9929150612965565b82805461287d90612fe4565b90600052602060002090601f01602090048101928261289f57600085556128e5565b82601f106128b85782800160ff198235161785556128e5565b828001600101855582156128e5579182015b828111156128e55782358255916020019190600101906128ca565b506124c9929150612982565b8280546128fd90612fe4565b90600052602060002090601f01602090048101928261291f57600085556128e5565b82601f1061293857805160ff19168380011785556128e5565b828001600101855582156128e5579182015b828111156128e557825182559160200191906001019061294a565b808211156124c95760006129798282612997565b50600101612965565b5b808211156124c95760008155600101612983565b5080546129a390612fe4565b6000825580601f106129b3575050565b601f0160209004906000526020600020908101906129d19190612982565b50565b80356001600160a01b038116811461115657600080fd5b6000602082840312156129fd57600080fd5b6111d9826129d4565b600060608284031215612a1857600080fd5b50919050565b6000806000806000806000878903610180811215612a3b57600080fd5b6040811215612a4957600080fd5b50879650612a59604089016129d4565b9550612a67606089016129d4565b94506080880135935060a08801359250612a848960c08a01612a06565b9150612a94896101208a01612a06565b905092959891949750929550565b60008060408385031215612ab557600080fd5b612abe836129d4565b9150612acc602084016129d4565b90509250929050565b80151581146129d157600080fd5b60008060408385031215612af657600080fd5b612aff836129d4565b91506020830135612b0f81612ad5565b809150509250929050565b60008060408385031215612b2d57600080fd5b612b36836129d4565b946020939093013593505050565b60008083601f840112612b5657600080fd5b50813567ffffffffffffffff811115612b6e57600080fd5b6020830191508360208260051b8501011115612b8957600080fd5b9250929050565b60008060208385031215612ba357600080fd5b823567ffffffffffffffff811115612bba57600080fd5b612bc685828601612b44565b90969095509350505050565b600080600060408486031215612be757600080fd5b612bf0846129d4565b9250602084013567ffffffffffffffff80821115612c0d57600080fd5b818601915086601f830112612c2157600080fd5b813581811115612c3057600080fd5b876020828501011115612c4257600080fd5b6020830194508093505050509250925092565b8151151581526020808301516effffffffffffffffffffffffffffff169082015260408101610c19565b60005b83811015612c9a578181015183820152602001612c82565b83811115611cff5750506000910152565b60008151808452612cc3816020860160208601612c7f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612d68577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452612d56858351612cab565b94509285019290850190600101612d1c565b5092979650505050505050565b60008060008060408587031215612d8b57600080fd5b843567ffffffffffffffff80821115612da357600080fd5b612daf88838901612b44565b90965094506020870135915080821115612dc857600080fd5b50612dd587828801612b44565b95989497509550505050565b600060208284031215612df357600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015612e3b57612e3b612dfa565b500390565b600060208284031215612e5257600080fd5b813560ff811681146111d957600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160a0810167ffffffffffffffff81118282101715612eb557612eb5612e63565b60405290565b604051610120810167ffffffffffffffff81118282101715612eb557612eb5612e63565b600060408284031215612ef157600080fd5b6040516040810181811067ffffffffffffffff82111715612f1457612f14612e63565b604052823581526020830135612f2981612ad5565b60208201529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612f9957600080fd5b83018035915067ffffffffffffffff821115612fb457600080fd5b602001915036819003821315612b8957600080fd5b6000600019821415612fdd57612fdd612dfa565b5060010190565b600181811c90821680612ff857607f821691505b60208210811415612a18577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000602080830181845280855480835260408601915060408160051b87010192506000878152848120815b8381101561314b578886037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc001855281548390600181811c90808316806130a557607f831692505b8b83108114156130dc577f4e487b710000000000000000000000000000000000000000000000000000000088526022600452602488fd5b828b5260208b018180156130f7576001811461310857613132565b60ff19861682528d82019650613132565b6000898152602090208a5b8681101561312c57815484820152908501908f01613113565b83019750505b50949a5050978a0197949094019350505060010161305d565b509398975050505050505050565b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6183360301811261319d57600080fd5b9190910192915050565b600067ffffffffffffffff808411156131c2576131c2612e63565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561320857613208612e63565b8160405280935085815286868601111561322157600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261324c57600080fd5b6111d9838335602085016131a7565b600060a0823603121561326d57600080fd5b613275612e92565b8235815260208301356020820152604083013567ffffffffffffffff8082111561329e57600080fd5b9084019036601f8301126132b157600080fd5b6132c0368335602085016131a7565b60408401526132d1606086016129d4565b606084015260808501359150808211156132ea57600080fd5b506132f73682860161323b565b60808301525092915050565b60006001600160a01b0380861683528085166020840152506060604083015261332f6060830184612cab565b95945050505050565b805161115681612ad5565b60006040828403121561335557600080fd5b6040516040810181811067ffffffffffffffff8211171561337857613378612e63565b806040525080915082518152602083015161339281612ad5565b6020919091015292915050565b600061016082840312156133b257600080fd5b6133ba612ebb565b82518152602083015160208201526133d58460408501613343565b60408201526133e78460808501613343565b606082015260c0830151608082015260e083015160a082015261010061340e818501613338565b60c08301526134206101208501613338565b60e083015261014084015181830152508091505092915050565b60006101606001600160a01b038e16835280602084015261345d8184018e612cab565b604084019c909c5250506060810198909852608088019690965260a087019490945260c086019290925260e085015261010084015261012083015215156101409091015292915050565b60008160001904831182151516156134c1576134c1612dfa565b500290565b6000825161319d818460208701612c7f565b6000602082840312156134ea57600080fd5b81516111d981612ad5565b6000821982111561350857613508612dfa565b500190565b6020815260006111d96020830184612cab56fea2646970667358221220a7aef8f25e5141e7b73a37943250410c3fdbbd90ee6eabdde4aaf0b2bf35c45364736f6c63430008090033

Deployed ByteCode Sourcemap

70780:1104:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;43762:178;;;;;;:::i;:::-;-1:-1:-1;;;;;43904:28:0;43875:4;43904:28;;;:18;:28;;;;;;;;;43762:178;;;;571:14:1;;564:22;546:41;;534:2;519:18;43762:178:0;;;;;;;;68646:251;;;;;;:::i;:::-;;:::i;:::-;;71469:412;;;;;;:::i;:::-;;:::i;44854:125::-;44964:7;;-1:-1:-1;;;;;44964:7:0;44854:125;;;-1:-1:-1;;;;;762:55:1;;;744:74;;732:2;717:18;44854:125:0;598:226:1;62939:1855:0;;;;;;:::i;:::-;;:::i;43240:211::-;;;;;;:::i;:::-;;:::i;44067:121::-;44171:9;;-1:-1:-1;;;;;44171:9:0;44067:121;;68197:217;;;;;;:::i;:::-;;:::i;66858:263::-;;;;;;:::i;:::-;;:::i;61834:580::-;;;;;;:::i;:::-;;:::i;69168:390::-;;;;;;:::i;:::-;;:::i;37783:159::-;;;:::i;42054:247::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;45115:139::-;;;:::i;:::-;;;;;;;:::i;45647:248::-;;;;;;:::i;:::-;;:::i;67335:217::-;;;;;;:::i;:::-;;:::i;42555:320::-;;;;;;:::i;:::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;42716:151:0;;;;;;;-1:-1:-1;;;;;42770:19:0;;;;;;;:10;:19;;;;;;:36;;;;42716:151;;;;42829:19;;;;;42770:36;42829:26;;;;;42716:151;;;;;42555:320;67766:217;;;;;;:::i;:::-;;:::i;54725:1718::-;;;;;;:::i;:::-;;:::i;40628:243::-;;;;;;:::i;:::-;;:::i;44563:121::-;44667:9;;-1:-1:-1;;;;;44667:9:0;44563:121;;44315;44419:9;;-1:-1:-1;;;;;44419:9:0;44315:121;;68646:251;37628:10;:8;:10::i;:::-;-1:-1:-1;;;;;37614:24:0;:10;-1:-1:-1;;;;;37614:24:0;;37592:104;;;;-1:-1:-1;;;37592:104:0;;7664:2:1;37592:104:0;;;7646:21:1;7703:2;7683:18;;;7676:30;7742:32;7722:18;;;7715:60;7792:18;;37592:104:0;;;;;;;;;-1:-1:-1;;27828:8:0::1;;:19;;27820:63;;;::::0;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0::1;::::0;::::1;8005:21:1::0;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0::1;7821:355:1::0;27820:63:0::1;-1:-1:-1::0;;27894:8:0::1;:18;;;;68785:13:::2;-1:-1:-1::0;;;;;68778:33:0::2;;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;68824:7:0::2;:23:::0;;;::::2;-1:-1:-1::0;;;;;68824:23:0;::::2;::::0;;::::2;::::0;;;68863:26:::2;::::0;744:74:1;;;68863:26:0::2;::::0;732:2:1;717:18;68863:26:0::2;;;;;;;;-1:-1:-1::0;27611:1:0::1;27935:8;:22:::0;68646:251::o;71469:412::-;37628:10;:8;:10::i;:::-;-1:-1:-1;;;;;37614:24:0;:10;-1:-1:-1;;;;;37614:24:0;;37592:104;;;;-1:-1:-1;;;37592:104:0;;7664:2:1;37592:104:0;;;7646:21:1;7703:2;7683:18;;;7676:30;7742:32;7722:18;;;7715:60;7792:18;;37592:104:0;7462:354:1;37592:104:0;-1:-1:-1;;27828:8:0::1;;:19;;27820:63;;;::::0;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0::1;::::0;::::1;8005:21:1::0;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0::1;7821:355:1::0;27820:63:0::1;-1:-1:-1::0;;27894:8:0::1;:18:::0;71662:42:::2;71012:50;71061:1;71020:37;71012:50;:::i;:::-;35980:11:::0;;35734:299;71662:42:::2;:49:::0;71640:130:::2;;;::::0;-1:-1:-1;;;71640:130:0;;8891:2:1;71640:130:0::2;::::0;::::2;8873:21:1::0;8930:2;8910:18;;;8903:30;8969:33;8949:18;;;8942:61;9020:18;;71640:130:0::2;8689:355:1::0;71640:130:0::2;71781:64;71012:50;71061:1;71020:37;71012:50;:::i;:::-;71841:1;36317:19:::0;;36122:232;71781:64:::2;71858:7;:15:::0;;;::::2;-1:-1:-1::0;;;;;71858:15:0;;;::::2;::::0;;;::::2;::::0;;-1:-1:-1;;27935:22:0;71469:412::o;62939:1855::-;-1:-1:-1;;27828:8:0;;:19;;27820:63;;;;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0;;;8005:21:1;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0;7821:355:1;27820:63:0;-1:-1:-1;;27894:8:0;:18;63283:42:::1;63305:7:::0;63314:10:::1;63283:21;:42::i;:::-;63261:144;;;::::0;-1:-1:-1;;;63261:144:0;;9251:2:1;63261:144:0::1;::::0;::::1;9233:21:1::0;9290:2;9270:18;;;9263:30;9329:34;9309:18;;;9302:62;9400:22;9380:18;;;9373:50;9440:19;;63261:144:0::1;9049:416:1::0;63261:144:0::1;65104:57:::0;;;24243:2:1;24239:15;;;24148:66;24235:24;;;65104:57:0;;;;24223:37:1;;;;24294:15;;;;24290:24;24276:12;;;24269:46;24331:12;;;24324:28;;;24368:12;;;;24361:28;;;65104:57:0;;;;;;;;;;24405:13:1;;;;65104:57:0;;;65094:68;;;;;63447:15:::1;::::0;63553:18:::1;::::0;;;:9:::1;:18;::::0;;;;;63447:72;;-1:-1:-1;63553:18:0::1;;63552:19;63530:87;;;::::0;-1:-1:-1;;;63530:87:0;;9672:2:1;63530:87:0::1;::::0;::::1;9654:21:1::0;9711:2;9691:18;;;9684:30;9750:20;9730:18;;;9723:48;9788:18;;63530:87:0::1;9470:342:1::0;63530:87:0::1;63677:61;::::0;10059:66:1;63677:61:0::1;::::0;::::1;10047:79:1::0;10142:12;;;10135:28;;;10179:12;;63677:61:0::1;;;;;;;;;;;;63667:72;;;;;;63657:82;;63785:51;63795:7;63804;:9;;;;;;;;;;:::i;:::-;63785:51;::::0;;63815:9:::1;63785:51:::0;;63826:9:::1;63785:51:::0;;::::1;::::0;;;10703:25:1;;;;10776:4;10764:17;;;10744:18;;;10737:45;63815:9:0;::::1;10798:18:1::0;;;10791:34;63826:9:0;;::::1;;10841:18:1::0;;;10834:34;10675:19;;63785:51:0::1;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;63785:51:0::1;::::0;;;;63772:9:::1;::::0;-1:-1:-1;;;;;63772:9:0;;::::1;:64:::0;::::1;;::::0;-1:-1:-1;63750:138:0::1;;;::::0;-1:-1:-1;;;63750:138:0;;11081:2:1;63750:138:0::1;::::0;::::1;11063:21:1::0;11120:2;11100:18;;;11093:30;11159:26;11139:18;;;11132:54;11203:18;;63750:138:0::1;10879:348:1::0;63750:138:0::1;63934:51;63944:7:::0;63953:9:::1;::::0;;;::::1;::::0;::::1;;:::i;:::-;63934:51;::::0;;63964:9:::1;63934:51:::0;;63975:9:::1;63934:51:::0;;::::1;::::0;;;10703:25:1;;;;10776:4;10764:17;;;10744:18;;;10737:45;63964:9:0;::::1;10798:18:1::0;;;10791:34;63975:9:0;;::::1;;10841:18:1::0;;;10834:34;10675:19;;63934:51:0::1;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;63934:51:0::1;::::0;;;;63921:9:::1;::::0;-1:-1:-1;;;;;63921:9:0;;::::1;:64:::0;::::1;;::::0;-1:-1:-1;63899:138:0::1;;;::::0;-1:-1:-1;;;63899:138:0;;11434:2:1;63899:138:0::1;::::0;::::1;11416:21:1::0;11473:2;11453:18;;;11446:30;11512:26;11492:18;;;11485:54;11556:18;;63899:138:0::1;11232:348:1::0;63899:138:0::1;64050:18;::::0;;;:9:::1;:18;::::0;;;;:25;;-1:-1:-1;;64050:25:0::1;64071:4;64050:25;::::0;;64132:7:::1;::::0;64088:110:::1;::::0;-1:-1:-1;;;;;64132:7:0::1;64155:11:::0;64181:6;64088:22:::1;:110::i;:::-;64219:34;64256:36;64268:23;:6:::0;61127:14:::1;64268:10;:23::i;:::-;64256:11;;::::0;;::::1;::::0;::::1;:7:::0;:11:::1;:::i;:::-;::::0;::::1;:36::i;:::-;64219:73;;64393:12;:23;;;64389:172;;;64433:40;64445:7;64454:12;:18;;;64433:11;:40::i;:::-;64389:172;;;64507:42;64521:7;64530:12;:18;;;64507:13;:42::i;:::-;64581:22;64606:44;64633:7:::0;64606:44:::1;;::::0;;::::1;::::0;::::1;64642:7:::0;64606:44:::1;:::i;:::-;:26;:44::i;:::-;64666:120;::::0;;-1:-1:-1;;;;;13075:55:1;;;13057:74;;13162:2;13147:18;;13140:34;;;13190:18;;;13183:34;;;64581:69:0;;-1:-1:-1;64666:120:0;::::1;::::0;::::1;::::0;13045:2:1;13030:18;64666:120:0::1;;;;;;;-1:-1:-1::0;;27611:1:0;27935:8;:22;-1:-1:-1;;;;;;;;62939:1855:0:o;43240:211::-;-1:-1:-1;;;;;43407:26:0;;;43378:4;43407:26;;;:17;:26;;;;;;;;:36;;;;;;;;;;;;43240:211;;;;;:::o;68197:217::-;37628:10;:8;:10::i;:::-;-1:-1:-1;;;;;37614:24:0;:10;-1:-1:-1;;;;;37614:24:0;;37592:104;;;;-1:-1:-1;;;37592:104:0;;7664:2:1;37592:104:0;;;7646:21:1;7703:2;7683:18;;;7676:30;7742:32;7722:18;;;7715:60;7792:18;;37592:104:0;7462:354:1;37592:104:0;-1:-1:-1;;27828:8:0::1;;:19;;27820:63;;;::::0;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0::1;::::0;::::1;8005:21:1::0;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0::1;7821:355:1::0;27820:63:0::1;-1:-1:-1::0;;27894:8:0::1;:18:::0;68333:9:::2;:27:::0;;;::::2;-1:-1:-1::0;;;;;68333:27:0;::::2;::::0;;::::2;::::0;;;68376:30:::2;::::0;744:74:1;;;68376:30:0::2;::::0;732:2:1;717:18;68376:30:0::2;598:226:1::0;66858:263:0;37628:10;:8;:10::i;:::-;-1:-1:-1;;;;;37614:24:0;:10;-1:-1:-1;;;;;37614:24:0;;37592:104;;;;-1:-1:-1;;;37592:104:0;;7664:2:1;37592:104:0;;;7646:21:1;7703:2;7683:18;;;7676:30;7742:32;7722:18;;;7715:60;7792:18;;37592:104:0;7462:354:1;37592:104:0;-1:-1:-1;;27828:8:0::1;;:19;;27820:63;;;::::0;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0::1;::::0;::::1;8005:21:1::0;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0::1;7821:355:1::0;27820:63:0::1;-1:-1:-1::0;;27894:8:0::1;:18:::0;;;-1:-1:-1;;;;;67018:28:0;::::2;::::0;;;:18:::2;:28;::::0;;;;;;;;:39;;-1:-1:-1;;67018:39:0::2;::::0;::::2;;::::0;;::::2;::::0;;;67073:40;;13396:74:1;;;13486:18;;;13479:50;67073:40:0::2;::::0;13369:18:1;67073:40:0::2;;;;;;;;-1:-1:-1::0;;27611:1:0::1;27935:8;:22:::0;66858:263::o;61834:580::-;-1:-1:-1;;27828:8:0;;:19;;27820:63;;;;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0;;;8005:21:1;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0;7821:355:1;27820:63:0;-1:-1:-1;;27894:8:0;:18;62013:7:::1;::::0;61965:141:::1;::::0;-1:-1:-1;;;;;62013:7:0::1;62036:10;62069:4;62089:6:::0;61965:26:::1;:141::i;:::-;62168:45;62180:7:::0;62189:23:::1;:6:::0;61127:14:::1;62189:10;:23::i;:::-;62168:11;:45::i;:::-;62272:7;-1:-1:-1::0;;;;;62247:159:0::1;;62294:6;62315:80;62342:7;62351:43;;;;;;;;62373:1;62351:43;;;;62387:5;62351:43;;;;::::0;62315:26:::1;:80::i;:::-;62247:159;::::0;;13714:25:1;;;13770:2;13755:18;;13748:34;;;;13687:18;62247:159:0::1;;;;;;;-1:-1:-1::0;;27611:1:0;27935:8;:22;61834:580::o;69168:390::-;37628:10;:8;:10::i;:::-;-1:-1:-1;;;;;37614:24:0;:10;-1:-1:-1;;;;;37614:24:0;;37592:104;;;;-1:-1:-1;;;37592:104:0;;7664:2:1;37592:104:0;;;7646:21:1;7703:2;7683:18;;;7676:30;7742:32;7722:18;;;7715:60;7792:18;;37592:104:0;7462:354:1;37592:104:0;-1:-1:-1;;27828:8:0::1;;:19;;27820:63;;;::::0;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0::1;::::0;::::1;8005:21:1::0;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0::1;7821:355:1::0;27820:63:0::1;-1:-1:-1::0;;27894:8:0::1;:18:::0;69352:12;69339:33:::2;::::0;::::2;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;69322:50:0;;::::2;::::0;:14:::2;::::0;:50:::2;::::0;;::::2;::::0;::::2;:::i;:::-;;69388:9;69383:112;69403:23:::0;;::::2;69383:112;;;69468:12;;69481:1;69468:15;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;69448:14;69463:1;69448:17;;;;;;;;:::i;:::-;;;;;;;;:35;;;;;;;:::i;:::-;-1:-1:-1::0;69428:3:0;::::2;::::0;::::2;:::i;:::-;;;;69383:112;;;;69510:40;69535:14;69510:40;;;;;;:::i;37783:159::-:0;37851:7;37907:24;37328:66;35980:11;;35734:299;37907:24;37899:33;37783:159;-1:-1:-1;37783:159:0:o;42054:247::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;42252:19:0;;;;:10;:19;;;;;:41;;-1:-1:-1;;42252:33:0;;;:41;;42286:6;;;;42252:41;:::i;:::-;;;;;;;;;;;;;;;;;42245:48;;;;;;;;;;;;;;;;;;;;;;;;;42252:41;-1:-1:-1;42054:247:0;;;;;;:::o;45115:139::-;45191:16;45232:14;45225:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;45115:139;:::o;45647:248::-;45786:4;45826:8;-1:-1:-1;;;;;45815:19:0;:7;-1:-1:-1;;;;;45815:19:0;;:72;;;-1:-1:-1;;;;;;;45851:26:0;;;;;;;:17;:26;;;;;;;;:36;;;;;;;;;;;;;;;45647:248::o;67335:217::-;37628:10;:8;:10::i;:::-;-1:-1:-1;;;;;37614:24:0;:10;-1:-1:-1;;;;;37614:24:0;;37592:104;;;;-1:-1:-1;;;37592:104:0;;7664:2:1;37592:104:0;;;7646:21:1;7703:2;7683:18;;;7676:30;7742:32;7722:18;;;7715:60;7792:18;;37592:104:0;7462:354:1;37592:104:0;-1:-1:-1;;27828:8:0::1;;:19;;27820:63;;;::::0;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0::1;::::0;::::1;8005:21:1::0;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0::1;7821:355:1::0;27820:63:0::1;-1:-1:-1::0;;27894:8:0::1;:18:::0;67471:9:::2;:27:::0;;;::::2;-1:-1:-1::0;;;;;67471:27:0;::::2;::::0;;::::2;::::0;;;67514:30:::2;::::0;744:74:1;;;67514:30:0::2;::::0;732:2:1;717:18;67514:30:0::2;598:226:1::0;67766:217:0;37628:10;:8;:10::i;:::-;-1:-1:-1;;;;;37614:24:0;:10;-1:-1:-1;;;;;37614:24:0;;37592:104;;;;-1:-1:-1;;;37592:104:0;;7664:2:1;37592:104:0;;;7646:21:1;7703:2;7683:18;;;7676:30;7742:32;7722:18;;;7715:60;7792:18;;37592:104:0;7462:354:1;37592:104:0;-1:-1:-1;;27828:8:0::1;;:19;;27820:63;;;::::0;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0::1;::::0;::::1;8005:21:1::0;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0::1;7821:355:1::0;27820:63:0::1;-1:-1:-1::0;;27894:8:0::1;:18:::0;67902:9:::2;:27:::0;;;::::2;-1:-1:-1::0;;;;;67902:27:0;::::2;::::0;;::::2;::::0;;;67945:30:::2;::::0;744:74:1;;;67945:30:0::2;::::0;732:2:1;717:18;67945:30:0::2;598:226:1::0;54725:1718:0;-1:-1:-1;;27828:8:0;;:19;;27820:63;;;;-1:-1:-1;;;27820:63:0;;8023:2:1;27820:63:0;;;8005:21:1;8062:2;8042:18;;;8035:30;8101:33;8081:18;;;8074:61;8152:18;;27820:63:0;7821:355:1;27820:63:0;-1:-1:-1;;27894:8:0;:18;54914:9:::1;::::0;-1:-1:-1;;;;;54914:9:0::1;54900:10;:23;54878:114;;;::::0;-1:-1:-1;;;54878:114:0;;18004:2:1;54878:114:0::1;::::0;::::1;17986:21:1::0;18043:2;18023:18;;;18016:30;18082:34;18062:18;;;18055:62;18153:11;18133:18;;;18126:39;18182:19;;54878:114:0::1;17802:405:1::0;54878:114:0::1;55003:25;55019:8;;55003:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;55003:15:0::1;::::0;-1:-1:-1;;;55003:25:0:i:1;:::-;55046:9;55041:1395;55061:17:::0;;::::1;55041:1395;;;55100:24;55127:6;;55134:1;55127:9;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;55100:36;;;:::i;:::-;55198:15;::::0;::::1;::::0;-1:-1:-1;;;;;55179:35:0::1;;::::0;;;:18:::1;:35;::::0;;;;;55100:36;;-1:-1:-1;55179:35:0::1;;55153:126;;;::::0;-1:-1:-1;;;55153:126:0;;20712:2:1;55153:126:0::1;::::0;::::1;20694:21:1::0;20751:2;20731:18;;;20724:30;20790:31;20770:18;;;20763:59;20839:18;;55153:126:0::1;20510:353:1::0;55153:126:0::1;55296:13;55312:8;;55321;:19;;;55312:29;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;55296:45;;55356:13;55372:8;;55381;:19;;;55372:29;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;55356:45;;55418:38;55470:8;:15;;;-1:-1:-1::0;;;;;55459:33:0::1;;55511:5;55535;55559:8;:13;;;55459:128;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;55418:169;;55623:21;55664::::0;55703:59:::1;55719:5;55726;55733:11;55746:8;:15;;;55703;:59::i;:::-;55604:158;;;;55835:5;-1:-1:-1::0;;;;;55784:640:0::1;55811:5;-1:-1:-1::0;;;;;55784:640:0::1;;55859:8;:15;;;55893:8;:15;;;55927:33;55937:5;55944:8;:15;;;55927:9;:33::i;:::-;55979;55989:5;55996:8;:15;;;55979:9;:33::i;:::-;56031:44;56049:11;:25;;;56031:17;:44::i;:::-;56094;56112:11;:25;;;56094:17;:44::i;:::-;56171:21:::0;;56157:54:::1;::::0;56194:16;56157:13:::1;:54::i;:::-;56230;56244:11;:21;;;56267:16;56230:13;:54::i;:::-;56303:11;:25;;;56347:11;:26;;;56392:11;:17;;;55784:640;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;55085:1351;;;;;;55080:3;;;;;:::i;:::-;;;;55041:1395;;;-1:-1:-1::0;;27611:1:0;27935:8;:22;-1:-1:-1;;;54725:1718:0:o;40628:243::-;40764:10;40746:29;;;;:17;:29;;;;;;;;-1:-1:-1;;;;;40746:39:0;;;;;;;;;;;;:50;;-1:-1:-1;;40746:50:0;;;;;;;;;;40812:51;;13396:74:1;;;13486:18;;;13479:50;;;;40812:51:0;;13369:18:1;40812:51:0;;;;;;;40628:243;;:::o;31565:211::-;31709:58;;-1:-1:-1;;;;;24621:55:1;;31709:58:0;;;24603:74:1;24693:18;;;24686:34;;;31682:86:0;;31702:5;;31732:23;;24576:18:1;;31709:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31682:19;:86::i;:::-;31565:211;;;:::o;15272:98::-;15330:7;15357:5;15361:1;15357;:5;:::i;20520:593::-;-1:-1:-1;;;;;;;;;;;;;;;;;20673:4:0;:15;;;20668:159;;20712:103;;;;;;;;20742:21;20752:4;:10;;;20742:5;:9;;:21;;;;:::i;:::-;20712:103;;20794:5;20712:103;;;;;20705:110;-1:-1:-1;20705:110:0;;20668:159;20841:10;;:18;-1:-1:-1;20837:160:0;;;20883:102;;;;;;;;;20913:10;;20883:102;;20913:21;;20928:5;20913:14;:21::i;:::-;20883:102;;20965:4;20883:102;;;;;20876:109;-1:-1:-1;20876:109:0;;20837:160;21014:91;;;;;;;;21040:21;21050:4;:10;;;21040:5;:9;;:21;;;;:::i;:::-;21014:91;;21088:5;21014:91;;;;;21007:98;20520:593;-1:-1:-1;;;20520:593:0:o;49619:269::-;49732:34;49769:18;49779:7;-1:-1:-1;;;;;;;;;;;;;;;;;;49040:138:0;;;;;;;;-1:-1:-1;;;;;49077:19:0;;;-1:-1:-1;49077:19:0;;;:10;:19;;;;;;;:26;;;;;;49040:138;;49130:19;;;;;;:36;;49040:138;;;;;;;48892:294;49769:18;49732:55;-1:-1:-1;49813:24:0;49732:55;49830:6;49813:16;:24::i;:::-;49798:39;;49848:32;49858:7;49867:12;49848:9;:32::i;49973:271::-;50088:34;50125:18;50135:7;-1:-1:-1;;;;;;;;;;;;;;;;;;49040:138:0;;;;;;;;-1:-1:-1;;;;;49077:19:0;;;-1:-1:-1;49077:19:0;;;:10;:19;;;;;;;:26;;;;;;49040:138;;49130:19;;;;;;:36;;49040:138;;;;;;;48892:294;50125:18;50088:55;-1:-1:-1;50169:24:0;50088:55;50186:6;50169:16;:24::i;51017:490::-;51176:7;51201:14;51405:7;:18;;;:50;;51454:1;51405:50;;;46999:13;51405:50;-1:-1:-1;;;;;51321:19:0;;;;;;:10;:19;;;;;:36;;;:66;;51386:1;51321:66;;;46926:13;51321:66;-1:-1:-1;;;;;51269:19:0;;;;;;:10;:19;;;;;:26;51231:13;;51261:42;51269:26;;;;51300:3;51261:42;;;;;51231:73;:157;:225;;-1:-1:-1;;51017:490:0;;;;:::o;31784:248::-;31955:68;;-1:-1:-1;;;;;25245:15:1;;;31955:68:0;;;25227:34:1;25297:15;;25277:18;;;25270:43;25329:18;;;25322:34;;;31928:96:0;;31948:5;;31978:27;;25139:18:1;;31955:68:0;24964:398:1;31928:96:0;31784:248;;;;:::o;56895:595::-;57050:1;57032:8;:15;:19;57010:103;;;;-1:-1:-1;;;57010:103:0;;25569:2:1;57010:103:0;;;25551:21:1;25608:2;25588:18;;;25581:30;25647:34;25627:18;;;25620:62;25718:4;25698:18;;;25691:32;25740:19;;57010:103:0;25367:398:1;57010:103:0;57169:19;57191:8;57200:1;57191:11;;;;;;;;:::i;:::-;;;;;;;57169:33;;57218:9;57230:1;57218:13;;57213:270;57237:8;:15;57233:1;:19;57213:270;;;57274:15;57292:8;57301:1;57292:11;;;;;;;;:::i;:::-;;;;;;;57274:29;;57354:11;-1:-1:-1;;;;;57344:21:0;:7;-1:-1:-1;;;;;57344:21:0;;57318:117;;;;-1:-1:-1;;;57318:117:0;;25972:2:1;57318:117:0;;;25954:21:1;26011:2;25991:18;;;25984:30;26050:34;26030:18;;;26023:62;26121:4;26101:18;;;26094:32;26143:19;;57318:117:0;25770:398:1;57318:117:0;57464:7;-1:-1:-1;57254:3:0;;;;:::i;:::-;;;;57213:270;;57605:2570;57877:25;;;;57950;;;;57802:4;;;;-1:-1:-1;;;;;58000:14:0;;;;;;;57996:719;;58035:11;:17;;;58031:673;;;58105:25;;;;58088:43;;:12;;:16;:43::i;:::-;58073:58;;58165:43;58182:11;:25;;;58165:12;:16;;:43;;;;:::i;:::-;58150:58;;58227;58243:5;58250:11;:26;;;58278:6;58227:15;:58::i;:::-;58304:56;58318:5;58325:11;:26;;;58353:6;58304:13;:56::i;:::-;58031:673;;;58433:25;;;;58416:43;;:12;;:16;:43::i;:::-;58401:58;;58493:43;58510:11;:25;;;58493:12;:16;;:43;;;;:::i;:::-;58478:58;;58555:56;58569:5;58576:11;:26;;;58604:6;58555:13;:56::i;:::-;58630:58;58646:5;58653:11;:26;;;58681:6;58630:15;:58::i;:::-;58735:21;58767;58803:33;58812:11;:23;;;959:1;56641:32;56640:52;;;56507:193;58803:33;58799:937;;;58885:21;;;;58868:39;;:12;;:16;:39::i;:::-;58853:54;;58941:5;58922:24;;58965:11;:22;;;58961:297;;;59040:21;;59023:39;;:12;;:16;:39::i;:::-;59008:54;;59100:4;59081:23;;58799:937;;58961:297;59177:21;;59160:39;;:12;;:16;:39::i;:::-;59145:54;;59237:5;59218:24;;58799:937;;;59352:21;;59335:39;;:12;;:16;:39::i;:::-;59320:54;;59408:5;59389:24;;59432:11;:22;;;59428:297;;;59507:21;;;;59490:39;;:12;;:16;:39::i;:::-;59475:54;;59567:4;59548:23;;59428:297;;;59644:21;;;;59627:39;;:12;;:16;:39::i;:::-;59612:54;;59704:5;59685:24;;59428:297;59770:12;:23;;;59766:167;;;59810:38;59822:5;59829:12;:18;;;59810:11;:38::i;:::-;59766:167;;;59881:40;59895:5;59902:12;:18;;;59881:13;:40::i;:::-;59947:12;:23;;;59943:167;;;59987:38;59999:5;60006:12;:18;;;59987:11;:38::i;:::-;59943:167;;;60058:40;60072:5;60079:12;:18;;;60058:13;:40::i;:::-;60128:16;;;;-1:-1:-1;57605:2570:0;-1:-1:-1;;;;;;;57605:2570:0:o;50355:542::-;-1:-1:-1;;;;;50763:19:0;;50488:7;50763:19;;;:10;:19;;;;;;:41;;50488:7;;50763:33;;;:41;;50797:6;;50763:41;:::i;:::-;;;;;;;;;;;;;;:60;;;:92;;50854:1;50763:92;;;46999:13;50763:92;-1:-1:-1;;;;;50679:19:0;;;;;;:10;:19;;;;;:36;;;:66;;50744:1;50679:66;;;46926:13;50679:66;-1:-1:-1;;;;;50627:19:0;;;;;;:10;:19;;;;;;;:26;;50551:41;;50627:26;;;;50658:3;50619:42;;;;50627:26;50551:33;;;;:41;;50585:6;;50551:41;:::i;:::-;;;;;;;;;;;;;;:50;;;;;;;50543:119;:203;:313;;-1:-1:-1;;50355:542:0;;;;:::o;52012:309::-;52136:7;52161:14;52221:7;:18;;;:48;;52268:1;52221:48;;;46926:13;52221:48;52191:13;;:79;;;;;-1:-1:-1;;52012:309:0:o;51610:295::-;51738:7;51763:14;51813:10;:40;;46926:13;51813:40;;;51826:1;51813:40;51793:61;;;;51610:295;-1:-1:-1;;;51610:295:0:o;34138:716::-;34562:23;34588:69;34616:4;34588:69;;;;;;;;;;;;;;;;;34596:5;-1:-1:-1;;;;;34588:27:0;;;:69;;;;;:::i;:::-;34672:17;;34562:95;;-1:-1:-1;34672:21:0;34668:179;;34769:10;34758:30;;;;;;;;;;;;:::i;:::-;34750:85;;;;-1:-1:-1;;;34750:85:0;;26906:2:1;34750:85:0;;;26888:21:1;26945:2;26925:18;;;26918:30;26984:34;26964:18;;;26957:62;27055:12;27035:18;;;27028:40;27085:19;;34750:85:0;26704:406:1;14534:98:0;14592:7;14619:5;14623:1;14619;:5;:::i;14915:98::-;14973:7;15000:5;15004:1;15000;:5;:::i;19808:591::-;-1:-1:-1;;;;;;;;;;;;;;;;;19960:4:0;:15;;;19956:157;;;19999:102;;;;;;;;20029:21;20039:4;:10;;;20029:5;:9;;:21;;;;:::i;19956:157::-;20127:10;;:18;-1:-1:-1;20123:160:0;;;20169:102;;;;;;;;20199:21;20209:4;:10;;;20199:5;:9;;:21;;;;:::i;20123:160::-;20300:91;;;;;;;;;20326:10;;20300:91;;20326:21;;20341:5;20326:14;:21::i;49279:262::-;49436:15;;:27;;:25;:27::i;:::-;-1:-1:-1;;;;;49407:19:0;;;;;;;;:10;:19;;;;;;;;:56;;49513:20;;;;;49474:59;;;;49407:56;;;;;;;;;-1:-1:-1;;49474:59:0;;;;;;;;;;;49279:262::o;48465:329::-;48612:36;48651:27;48663:7;48672:5;48651:11;:27::i;:::-;48612:66;-1:-1:-1;48706:26:0;48612:66;48725:6;48706:18;:26::i;:::-;48689:43;;48743;48755:7;48764:14;48780:5;48743:11;:43::i;48049:327::-;48194:36;48233:27;48245:7;48254:5;48233:11;:27::i;:::-;48194:66;-1:-1:-1;48288:26:0;48194:66;48307:6;48288:18;:26::i;4753:229::-;4890:12;4922:52;4944:6;4952:4;4958:1;4961:12;4922:21;:52::i;:::-;4915:59;4753:229;-1:-1:-1;;;;4753:229:0:o;10903:232::-;11003:7;11044:6;11036:5;:14;11028:67;;;;-1:-1:-1;;;11028:67:0;;27450:2:1;11028:67:0;;;27432:21:1;27489:2;27469:18;;;27462:30;27528:34;27508:18;;;27501:62;27599:9;27579:18;;;27572:37;27626:19;;11028:67:0;27248:403:1;11028:67:0;-1:-1:-1;11121:5:0;10903:232::o;47156:372::-;-1:-1:-1;;;;;;;;;;;;;;;;;47336:184:0;;;;;;;;47373:10;:19;47384:7;-1:-1:-1;;;;;47373:19:0;-1:-1:-1;;;;;47373:19:0;;;;;;;;;;;;:33;;47407:5;47373:40;;;;;;:::i;:::-;;;;;;;;;;;;;:49;;;;;;;;;;;;47336:184;;;;;;47449:10;:19;47460:7;-1:-1:-1;;;;;47449:19:0;-1:-1:-1;;;;;47449:19:0;;;;;;;;;;;;:33;;47483:5;47449:40;;;;;;:::i;:::-;;;;;;;;;;;;;;:59;;;47336:184;;;;47329:191;-1:-1:-1;47156:372:0;;;;:::o;47623:346::-;47837:17;;:29;;:27;:29::i;:::-;47785:10;:19;47796:7;-1:-1:-1;;;;;47785:19:0;-1:-1:-1;;;;;47785:19:0;;;;;;;;;;;;:33;;47819:5;47785:40;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:81;;;;;;;;;;;;;;;;;;;;47939:22;;;;-1:-1:-1;;;;;47877:19:0;;47785:49;47877:19;;;:10;:19;;;;;47785:49;47877:33;;:40;;47911:5;;47877:40;:::i;:::-;;;;;;;;;;;;;;:84;;;;;-1:-1:-1;;47877:84:0;;;;;;;;;-1:-1:-1;;;47623:346:0:o;5873:510::-;6043:12;6101:5;6076:21;:30;;6068:81;;;;-1:-1:-1;;;6068:81:0;;27858:2:1;6068:81:0;;;27840:21:1;27897:2;27877:18;;;27870:30;27936:34;27916:18;;;27909:62;28007:8;27987:18;;;27980:36;28033:19;;6068:81:0;27656:402:1;6068:81:0;2270:20;;6160:60;;;;-1:-1:-1;;;6160:60:0;;28265:2:1;6160:60:0;;;28247:21:1;28304:2;28284:18;;;28277:30;28343:31;28323:18;;;28316:59;28392:18;;6160:60:0;28063:353:1;6160:60:0;6234:12;6248:23;6275:6;-1:-1:-1;;;;;6275:11:0;6294:5;6301:4;6275:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6233:73;;;;6324:51;6341:7;6350:10;6362:12;6324:16;:51::i;:::-;6317:58;5873:510;-1:-1:-1;;;;;;;5873:510:0:o;8559:712::-;8709:12;8738:7;8734:530;;;-1:-1:-1;8769:10:0;8762:17;;8734:530;8883:17;;:21;8879:374;;9081:10;9075:17;9142:15;9129:10;9125:2;9121:19;9114:44;8879:374;9224:12;9217:20;;-1:-1:-1;;;9217:20:0;;;;;;;;:::i;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::o;14:196:1:-;82:20;;-1:-1:-1;;;;;131:54:1;;121:65;;111:93;;200:1;197;190:12;215:186;274:6;327:2;315:9;306:7;302:23;298:32;295:52;;;343:1;340;333:12;295:52;366:29;385:9;366:29;:::i;829:157::-;891:5;936:2;927:6;922:3;918:16;914:25;911:45;;;952:1;949;942:12;911:45;-1:-1:-1;974:6:1;829:157;-1:-1:-1;829:157:1:o;991:796::-;1182:6;1190;1198;1206;1214;1222;1230;1274:9;1265:7;1261:23;1304:3;1300:2;1296:12;1293:32;;;1321:1;1318;1311:12;1293:32;1345:2;1341;1337:11;1334:31;;;1361:1;1358;1351:12;1334:31;;1384:9;1374:19;;1412:38;1446:2;1435:9;1431:18;1412:38;:::i;:::-;1402:48;;1469:38;1503:2;1492:9;1488:18;1469:38;:::i;:::-;1459:48;;1554:3;1543:9;1539:19;1526:33;1516:43;;1606:3;1595:9;1591:19;1578:33;1568:43;;1630:66;1688:7;1682:3;1671:9;1667:19;1630:66;:::i;:::-;1620:76;;1715:66;1773:7;1767:3;1756:9;1752:19;1715:66;:::i;:::-;1705:76;;991:796;;;;;;;;;;:::o;1792:260::-;1860:6;1868;1921:2;1909:9;1900:7;1896:23;1892:32;1889:52;;;1937:1;1934;1927:12;1889:52;1960:29;1979:9;1960:29;:::i;:::-;1950:39;;2008:38;2042:2;2031:9;2027:18;2008:38;:::i;:::-;1998:48;;1792:260;;;;;:::o;2057:118::-;2143:5;2136:13;2129:21;2122:5;2119:32;2109:60;;2165:1;2162;2155:12;2180:315;2245:6;2253;2306:2;2294:9;2285:7;2281:23;2277:32;2274:52;;;2322:1;2319;2312:12;2274:52;2345:29;2364:9;2345:29;:::i;:::-;2335:39;;2424:2;2413:9;2409:18;2396:32;2437:28;2459:5;2437:28;:::i;:::-;2484:5;2474:15;;;2180:315;;;;;:::o;2500:254::-;2568:6;2576;2629:2;2617:9;2608:7;2604:23;2600:32;2597:52;;;2645:1;2642;2635:12;2597:52;2668:29;2687:9;2668:29;:::i;:::-;2658:39;2744:2;2729:18;;;;2716:32;;-1:-1:-1;;;2500:254:1:o;2759:375::-;2830:8;2840:6;2894:3;2887:4;2879:6;2875:17;2871:27;2861:55;;2912:1;2909;2902:12;2861:55;-1:-1:-1;2935:20:1;;2978:18;2967:30;;2964:50;;;3010:1;3007;3000:12;2964:50;3047:4;3039:6;3035:17;3023:29;;3107:3;3100:4;3090:6;3087:1;3083:14;3075:6;3071:27;3067:38;3064:47;3061:67;;;3124:1;3121;3114:12;3061:67;2759:375;;;;;:::o;3139:457::-;3237:6;3245;3298:2;3286:9;3277:7;3273:23;3269:32;3266:52;;;3314:1;3311;3304:12;3266:52;3354:9;3341:23;3387:18;3379:6;3376:30;3373:50;;;3419:1;3416;3409:12;3373:50;3458:78;3528:7;3519:6;3508:9;3504:22;3458:78;:::i;:::-;3555:8;;3432:104;;-1:-1:-1;3139:457:1;-1:-1:-1;;;;3139:457:1:o;3601:666::-;3681:6;3689;3697;3750:2;3738:9;3729:7;3725:23;3721:32;3718:52;;;3766:1;3763;3756:12;3718:52;3789:29;3808:9;3789:29;:::i;:::-;3779:39;;3869:2;3858:9;3854:18;3841:32;3892:18;3933:2;3925:6;3922:14;3919:34;;;3949:1;3946;3939:12;3919:34;3987:6;3976:9;3972:22;3962:32;;4032:7;4025:4;4021:2;4017:13;4013:27;4003:55;;4054:1;4051;4044:12;4003:55;4094:2;4081:16;4120:2;4112:6;4109:14;4106:34;;;4136:1;4133;4126:12;4106:34;4181:7;4176:2;4167:6;4163:2;4159:15;4155:24;4152:37;4149:57;;;4202:1;4199;4192:12;4149:57;4233:2;4229;4225:11;4215:21;;4255:6;4245:16;;;;;3601:666;;;;;:::o;4487:265::-;4366:12;;4359:20;4352:28;4340:41;;4434:4;4423:16;;;4417:23;4442:32;4413:62;4397:14;;;4390:86;4683:2;4668:18;;4695:51;4272:210;4922:258;4994:1;5004:113;5018:6;5015:1;5012:13;5004:113;;;5094:11;;;5088:18;5075:11;;;5068:39;5040:2;5033:10;5004:113;;;5135:6;5132:1;5129:13;5126:48;;;-1:-1:-1;;5170:1:1;5152:16;;5145:27;4922:258::o;5185:317::-;5227:3;5265:5;5259:12;5292:6;5287:3;5280:19;5308:63;5364:6;5357:4;5352:3;5348:14;5341:4;5334:5;5330:16;5308:63;:::i;:::-;5416:2;5404:15;5421:66;5400:88;5391:98;;;;5491:4;5387:109;;5185:317;-1:-1:-1;;5185:317:1:o;5507:862::-;5669:4;5698:2;5738;5727:9;5723:18;5768:2;5757:9;5750:21;5791:6;5826;5820:13;5857:6;5849;5842:22;5895:2;5884:9;5880:18;5873:25;;5957:2;5947:6;5944:1;5940:14;5929:9;5925:30;5921:39;5907:53;;5995:2;5987:6;5983:15;6016:1;6026:314;6040:6;6037:1;6034:13;6026:314;;;6129:66;6117:9;6109:6;6105:22;6101:95;6096:3;6089:108;6220:40;6253:6;6244;6238:13;6220:40;:::i;:::-;6210:50;-1:-1:-1;6318:12:1;;;;6283:15;;;;6062:1;6055:9;6026:314;;;-1:-1:-1;6357:6:1;;5507:862;-1:-1:-1;;;;;;;5507:862:1:o;6640:817::-;6790:6;6798;6806;6814;6867:2;6855:9;6846:7;6842:23;6838:32;6835:52;;;6883:1;6880;6873:12;6835:52;6923:9;6910:23;6952:18;6993:2;6985:6;6982:14;6979:34;;;7009:1;7006;6999:12;6979:34;7048:78;7118:7;7109:6;7098:9;7094:22;7048:78;:::i;:::-;7145:8;;-1:-1:-1;7022:104:1;-1:-1:-1;7233:2:1;7218:18;;7205:32;;-1:-1:-1;7249:16:1;;;7246:36;;;7278:1;7275;7268:12;7246:36;;7317:80;7389:7;7378:8;7367:9;7363:24;7317:80;:::i;:::-;6640:817;;;;-1:-1:-1;7416:8:1;-1:-1:-1;;;;6640:817:1:o;8181:184::-;8251:6;8304:2;8292:9;8283:7;8279:23;8275:32;8272:52;;;8320:1;8317;8310:12;8272:52;-1:-1:-1;8343:16:1;;8181:184;-1:-1:-1;8181:184:1:o;8370:::-;8422:77;8419:1;8412:88;8519:4;8516:1;8509:15;8543:4;8540:1;8533:15;8559:125;8599:4;8627:1;8624;8621:8;8618:34;;;8632:18;;:::i;:::-;-1:-1:-1;8669:9:1;;8559:125::o;10202:269::-;10259:6;10312:2;10300:9;10291:7;10287:23;10283:32;10280:52;;;10328:1;10325;10318:12;10280:52;10367:9;10354:23;10417:4;10410:5;10406:16;10399:5;10396:27;10386:55;;10437:1;10434;10427:12;11585:184;11637:77;11634:1;11627:88;11734:4;11731:1;11724:15;11758:4;11755:1;11748:15;11774:248;11841:2;11835:9;11883:4;11871:17;;11918:18;11903:34;;11939:22;;;11900:62;11897:88;;;11965:18;;:::i;:::-;12001:2;11994:22;11774:248;:::o;12027:255::-;12099:2;12093:9;12141:6;12129:19;;12178:18;12163:34;;12199:22;;;12160:62;12157:88;;;12225:18;;:::i;12287:563::-;12366:6;12419:2;12407:9;12398:7;12394:23;12390:32;12387:52;;;12435:1;12432;12425:12;12387:52;12468:2;12462:9;12510:2;12502:6;12498:15;12579:6;12567:10;12564:22;12543:18;12531:10;12528:34;12525:62;12522:88;;;12590:18;;:::i;:::-;12626:2;12619:22;12665:23;;12650:39;;12739:2;12724:18;;12711:32;12752:28;12711:32;12752:28;:::i;:::-;12808:2;12796:15;;12789:30;12800:6;12287:563;-1:-1:-1;;;12287:563:1:o;13793:184::-;13845:77;13842:1;13835:88;13942:4;13939:1;13932:15;13966:4;13963:1;13956:15;13982:581;14060:4;14066:6;14126:11;14113:25;14216:66;14205:8;14189:14;14185:29;14181:102;14161:18;14157:127;14147:155;;14298:1;14295;14288:12;14147:155;14325:33;;14377:20;;;-1:-1:-1;14420:18:1;14409:30;;14406:50;;;14452:1;14449;14442:12;14406:50;14485:4;14473:17;;-1:-1:-1;14516:14:1;14512:27;;;14502:38;;14499:58;;;14553:1;14550;14543:12;14568:195;14607:3;-1:-1:-1;;14631:5:1;14628:77;14625:103;;;14708:18;;:::i;:::-;-1:-1:-1;14755:1:1;14744:13;;14568:195::o;14904:437::-;14983:1;14979:12;;;;15026;;;15047:61;;15101:4;15093:6;15089:17;15079:27;;15047:61;15154:2;15146:6;15143:14;15123:18;15120:38;15117:218;;;15191:77;15188:1;15181:88;15292:4;15289:1;15282:15;15320:4;15317:1;15310:15;15346:2173;15502:4;15531:2;15571;15560:9;15556:18;15601:2;15590:9;15583:21;15624:6;15659;15653:13;15690:6;15682;15675:22;15728:2;15717:9;15713:18;15706:25;;15790:2;15780:6;15777:1;15773:14;15762:9;15758:30;15754:39;15740:53;;15812:1;15833:6;15829:2;15822:18;15877:2;15873;15863:17;15898:2;15909:1581;15923:6;15920:1;15917:13;15909:1581;;;15988:22;;;16012:66;15984:95;15972:108;;16136:13;;16104:2;;16203:1;16229:18;;;;16286;;;;16317:105;;16403:4;16393:8;16389:19;16377:31;;16317:105;16474:2;16464:8;16461:16;16441:18;16438:40;16435:242;;;16520:77;16516:2;16509:89;16625:4;16622:1;16615:15;16658:4;16654:2;16647:16;16435:242;4854:19;;;4906:4;4897:14;;16786:18;16817:174;;;;17009:1;17004:380;;;;16779:605;;16817:174;-1:-1:-1;;16860:9:1;16856:82;16849:5;16842:97;16974:2;16967:5;16963:14;16956:21;;16817:174;;17004:380;14851:1;14844:14;;;14888:4;14875:18;;17119:2;17138:193;17154:8;17149:3;17146:17;17138:193;;;17250:14;;17233:15;;;17226:39;17297:16;;;;17173:12;;17138:193;;;17355:15;;;-1:-1:-1;;16779:605:1;-1:-1:-1;17407:3:1;;-1:-1:-1;;17468:12:1;;;;17433:15;;;;;-1:-1:-1;;;15945:1:1;15938:9;15909:1581;;;-1:-1:-1;17507:6:1;;15346:2173;-1:-1:-1;;;;;;;;15346:2173:1:o;17524:273::-;17709:6;17701;17696:3;17683:33;17665:3;17735:16;;17760:13;;;17735:16;17524:273;-1:-1:-1;17524:273:1:o;18212:384::-;18306:4;18364:11;18351:25;18454:66;18443:8;18427:14;18423:29;18419:102;18399:18;18395:127;18385:155;;18536:1;18533;18526:12;18385:155;18557:33;;;;;18212:384;-1:-1:-1;;18212:384:1:o;18601:691::-;18666:5;18696:18;18737:2;18729:6;18726:14;18723:40;;;18743:18;;:::i;:::-;18877:2;18871:9;18943:2;18931:15;;18782:66;18927:24;;;18953:2;18923:33;18919:42;18907:55;;;18977:18;;;18997:22;;;18974:46;18971:72;;;19023:18;;:::i;:::-;19063:10;19059:2;19052:22;19092:6;19083:15;;19122:6;19114;19107:22;19162:3;19153:6;19148:3;19144:16;19141:25;19138:45;;;19179:1;19176;19169:12;19138:45;19229:6;19224:3;19217:4;19209:6;19205:17;19192:44;19284:1;19277:4;19268:6;19260;19256:19;19252:30;19245:41;;;;18601:691;;;;;:::o;19297:221::-;19339:5;19392:3;19385:4;19377:6;19373:17;19369:27;19359:55;;19410:1;19407;19400:12;19359:55;19432:80;19508:3;19499:6;19486:20;19479:4;19471:6;19467:17;19432:80;:::i;19523:982::-;19627:9;19686:4;19678:5;19662:14;19658:26;19654:37;19651:57;;;19704:1;19701;19694:12;19651:57;19732:17;;:::i;:::-;19787:5;19774:19;19765:7;19758:36;19852:2;19845:5;19841:14;19828:28;19823:2;19814:7;19810:16;19803:54;19904:2;19897:5;19893:14;19880:28;19927:18;19968:2;19960:6;19957:14;19954:34;;;19984:1;19981;19974:12;19954:34;20007:18;;;;20063:14;20056:4;20048:13;;20044:34;20034:62;;20092:1;20089;20082:12;20034:62;20130:81;20196:14;20191:2;20178:16;20173:2;20169;20165:11;20130:81;:::i;:::-;20125:2;20116:7;20112:16;20105:107;20246:34;20276:2;20269:5;20265:14;20246:34;:::i;:::-;20241:2;20232:7;20228:16;20221:60;20330:3;20323:5;20319:15;20306:29;20290:45;;20360:2;20350:8;20347:16;20344:36;;;20376:1;20373;20366:12;20344:36;;20415:54;20454:14;20443:8;20436:5;20432:20;20415:54;:::i;:::-;20409:3;20396:17;;20389:81;-1:-1:-1;20400:7:1;19523:982;-1:-1:-1;;19523:982:1:o;20868:439::-;21034:4;-1:-1:-1;;;;;21144:2:1;21136:6;21132:15;21121:9;21114:34;21196:2;21188:6;21184:15;21179:2;21168:9;21164:18;21157:43;;21236:2;21231;21220:9;21216:18;21209:30;21256:45;21297:2;21286:9;21282:18;21274:6;21256:45;:::i;:::-;21248:53;20868:439;-1:-1:-1;;;;;20868:439:1:o;21312:132::-;21388:13;;21410:28;21388:13;21410:28;:::i;21449:539::-;21510:5;21558:4;21546:9;21541:3;21537:19;21533:30;21530:50;;;21576:1;21573;21566:12;21530:50;21609:4;21603:11;21653:4;21645:6;21641:17;21724:6;21712:10;21709:22;21688:18;21676:10;21673:34;21670:62;21667:88;;;21735:18;;:::i;:::-;21777:10;21771:4;21764:24;;21806:6;21797:15;;21842:9;21836:16;21828:6;21821:32;21898:2;21887:9;21883:18;21877:25;21911:30;21933:7;21911:30;:::i;:::-;21969:2;21957:15;;;;21950:32;21449:539;;-1:-1:-1;;21449:539:1:o;21993:902::-;22092:6;22145:3;22133:9;22124:7;22120:23;22116:33;22113:53;;;22162:1;22159;22152:12;22113:53;22188:22;;:::i;:::-;22239:9;22233:16;22226:5;22219:31;22303:2;22292:9;22288:18;22282:25;22277:2;22270:5;22266:14;22259:49;22340:61;22393:7;22388:2;22377:9;22373:18;22340:61;:::i;:::-;22335:2;22328:5;22324:14;22317:85;22436:62;22490:7;22484:3;22473:9;22469:19;22436:62;:::i;:::-;22429:4;22422:5;22418:16;22411:88;22553:3;22542:9;22538:19;22532:26;22526:3;22519:5;22515:15;22508:51;22614:3;22603:9;22599:19;22593:26;22586:4;22579:5;22575:16;22568:52;22639:3;22675:46;22717:2;22706:9;22702:18;22675:46;:::i;:::-;22669:3;22662:5;22658:15;22651:71;22755:50;22797:6;22786:9;22782:22;22755:50;:::i;:::-;22749:3;22742:5;22738:15;22731:75;22859:3;22848:9;22844:19;22838:26;22833:2;22826:5;22822:14;22815:50;;22884:5;22874:15;;;21993:902;;;;:::o;22900:1020::-;23287:4;23316:3;-1:-1:-1;;;;;23350:6:1;23346:55;23335:9;23328:74;23438:2;23433;23422:9;23418:18;23411:30;23458:45;23499:2;23488:9;23484:18;23476:6;23458:45;:::i;:::-;23534:2;23519:18;;23512:34;;;;-1:-1:-1;;23577:2:1;23562:18;;23555:34;;;;23620:3;23605:19;;23598:35;;;;23664:3;23649:19;;23642:35;;;;23708:3;23693:19;;23686:35;;;;23752:3;23737:19;;23730:35;23796:3;23781:19;;23774:35;23840:3;23825:19;;23818:35;23897:15;23890:23;23884:3;23869:19;;;23862:52;23450:53;22900:1020;-1:-1:-1;;22900:1020:1:o;24731:228::-;24771:7;24897:1;-1:-1:-1;;24825:74:1;24822:1;24819:81;24814:1;24807:9;24800:17;24796:105;24793:131;;;24904:18;;:::i;:::-;-1:-1:-1;24944:9:1;;24731:228::o;26173:276::-;26304:3;26342:6;26336:13;26358:53;26404:6;26399:3;26392:4;26384:6;26380:17;26358:53;:::i;26454:245::-;26521:6;26574:2;26562:9;26553:7;26549:23;26545:32;26542:52;;;26590:1;26587;26580:12;26542:52;26622:9;26616:16;26641:28;26663:5;26641:28;:::i;27115:128::-;27155:3;27186:1;27182:6;27179:1;27176:13;27173:39;;;27192:18;;:::i;:::-;-1:-1:-1;27228:9:1;;27115:128::o;28700:220::-;28849:2;28838:9;28831:21;28812:4;28869:45;28910:2;28899:9;28895:18;28887:6;28869:45;:::i

Swarm Source

ipfs://a7aef8f25e5141e7b73a37943250410c3fdbbd90ee6eabdde4aaf0b2bf35c453
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.