ETH Price: $2,389.10 (+2.74%)

Contract

0x4d069f267DaAb537c4ff135556F711c0A6538496
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Harvest129155662021-07-28 16:55:381148 days ago1627491338IN
0x4d069f26...0A6538496
0 ETH0.0227965744
Harvest129155622021-07-28 16:54:461148 days ago1627491286IN
0x4d069f26...0A6538496
0 ETH0.0540647844
Harvest129155522021-07-28 16:51:321148 days ago1627491092IN
0x4d069f26...0A6538496
0 ETH0.0610848445
Set Collateral T...129154262021-07-28 16:21:281148 days ago1627489288IN
0x4d069f26...0A6538496
0 ETH0.0022073550
Harvest128689172021-07-21 9:15:131155 days ago1626858913IN
0x4d069f26...0A6538496
0 ETH0.0155081118
Harvest128660152021-07-20 22:09:011156 days ago1626818941IN
0x4d069f26...0A6538496
0 ETH0.012469416
Harvest128383362021-07-16 14:05:241160 days ago1626444324IN
0x4d069f26...0A6538496
0 ETH0.0360648341
Harvest128380902021-07-16 13:10:311160 days ago1626441031IN
0x4d069f26...0A6538496
0 ETH0.030833150
Set Dy Dx128309552021-07-15 10:18:131161 days ago1626344293IN
0x4d069f26...0A6538496
0 ETH0.0016981529
Harvest128309352021-07-15 10:12:401161 days ago1626343960IN
0x4d069f26...0A6538496
0 ETH0.0314375828
Set Dy Dx128309162021-07-15 10:09:091161 days ago1626343749IN
0x4d069f26...0A6538496
0 ETH0.0007140127
Harvest128258152021-07-14 15:03:541162 days ago1626275034IN
0x4d069f26...0A6538496
0 ETH0.0275798546
Harvest128245462021-07-14 10:16:361162 days ago1626257796IN
0x4d069f26...0A6538496
0 ETH0.0290280533
Harvest128121262021-07-12 11:14:201164 days ago1626088460IN
0x4d069f26...0A6538496
0 ETH0.0154305621
Harvest128121202021-07-12 11:13:371164 days ago1626088417IN
0x4d069f26...0A6538496
0 ETH0.0178873220
Harvest128120462021-07-12 10:58:051164 days ago1626087485IN
0x4d069f26...0A6538496
0 ETH0.0220391825.41
Set Rewards128010882021-07-10 17:50:561166 days ago1625939456IN
0x4d069f26...0A6538496
0 ETH0.0006029420
Set Keeper128002692021-07-10 14:54:341166 days ago1625928874IN
0x4d069f26...0A6538496
0 ETH0.0004824616
Harvest128002652021-07-10 14:53:351166 days ago1625928815IN
0x4d069f26...0A6538496
0 ETH0.0114592816
Harvest128002572021-07-10 14:51:441166 days ago1625928704IN
0x4d069f26...0A6538496
0 ETH0.0116450816
0x60806040127818242021-07-07 18:05:051169 days ago1625681105IN
 Contract Creation
0 ETH0.2458032444.7

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xE6c78b85...3a00F5908
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Strategy

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv3 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-07-01
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;

// Global Enums and Structs



struct StrategyParams {
    uint256 performanceFee;
    uint256 activation;
    uint256 debtRatio;
    uint256 rateLimit;
    uint256 lastReport;
    uint256 totalDebt;
    uint256 totalGain;
    uint256 totalLoss;
}

// Part: Account

library Account {
    enum Status {Normal, Liquid, Vapor}
    struct Info {
        address owner; // The address that owns the account
        uint256 number; // A nonce that allows a single address to control many accounts
    }
    struct Storage {
        mapping(uint256 => Types.Par) balances; // Mapping from marketId to principal
        Status status;
    }
}

// Part: Actions

library Actions {
    enum ActionType {
        Deposit, // supply tokens
        Withdraw, // borrow tokens
        Transfer, // transfer balance between accounts
        Buy, // buy an amount of some token (publicly)
        Sell, // sell an amount of some token (publicly)
        Trade, // trade tokens against another account
        Liquidate, // liquidate an undercollateralized or expiring account
        Vaporize, // use excess tokens to zero-out a completely negative account
        Call // send arbitrary data to an address
    }

    enum AccountLayout {OnePrimary, TwoPrimary, PrimaryAndSecondary}

    enum MarketLayout {ZeroMarkets, OneMarket, TwoMarkets}

    struct ActionArgs {
        ActionType actionType;
        uint256 accountId;
        Types.AssetAmount amount;
        uint256 primaryMarketId;
        uint256 secondaryMarketId;
        address otherAddress;
        uint256 otherAccountId;
        bytes data;
    }

    struct DepositArgs {
        Types.AssetAmount amount;
        Account.Info account;
        uint256 market;
        address from;
    }

    struct WithdrawArgs {
        Types.AssetAmount amount;
        Account.Info account;
        uint256 market;
        address to;
    }

    struct TransferArgs {
        Types.AssetAmount amount;
        Account.Info accountOne;
        Account.Info accountTwo;
        uint256 market;
    }

    struct BuyArgs {
        Types.AssetAmount amount;
        Account.Info account;
        uint256 makerMarket;
        uint256 takerMarket;
        address exchangeWrapper;
        bytes orderData;
    }

    struct SellArgs {
        Types.AssetAmount amount;
        Account.Info account;
        uint256 takerMarket;
        uint256 makerMarket;
        address exchangeWrapper;
        bytes orderData;
    }

    struct TradeArgs {
        Types.AssetAmount amount;
        Account.Info takerAccount;
        Account.Info makerAccount;
        uint256 inputMarket;
        uint256 outputMarket;
        address autoTrader;
        bytes tradeData;
    }

    struct LiquidateArgs {
        Types.AssetAmount amount;
        Account.Info solidAccount;
        Account.Info liquidAccount;
        uint256 owedMarket;
        uint256 heldMarket;
    }

    struct VaporizeArgs {
        Types.AssetAmount amount;
        Account.Info solidAccount;
        Account.Info vaporAccount;
        uint256 owedMarket;
        uint256 heldMarket;
    }

    struct CallArgs {
        Account.Info account;
        address callee;
        bytes data;
    }
}

library Decimal {
    struct D256 {
        uint256 value;
    }
}

library Interest {
    struct Rate {
        uint256 value;
    }

    struct Index {
        uint96 borrow;
        uint96 supply;
        uint32 lastUpdate;
    }
}

library Monetary {
    struct Price {
        uint256 value;
    }
    struct Value {
        uint256 value;
    }
}

library Storage {
    // All information necessary for tracking a market
    struct Market {
        // Contract address of the associated ERC20 token
        address token;
        // Total aggregated supply and borrow amount of the entire market
        Types.TotalPar totalPar;
        // Interest index of the market
        Interest.Index index;
        // Contract address of the price oracle for this market
        address priceOracle;
        // Contract address of the interest setter for this market
        address interestSetter;
        // Multiplier on the marginRatio for this market
        Decimal.D256 marginPremium;
        // Multiplier on the liquidationSpread for this market
        Decimal.D256 spreadPremium;
        // Whether additional borrows are allowed for this market
        bool isClosing;
    }

    // The global risk parameters that govern the health and security of the system
    struct RiskParams {
        // Required ratio of over-collateralization
        Decimal.D256 marginRatio;
        // Percentage penalty incurred by liquidated accounts
        Decimal.D256 liquidationSpread;
        // Percentage of the borrower's interest fee that gets passed to the suppliers
        Decimal.D256 earningsRate;
        // The minimum absolute borrow value of an account
        // There must be sufficient incentivize to liquidate undercollateralized accounts
        Monetary.Value minBorrowedValue;
    }

    // The maximum RiskParam values that can be set
    struct RiskLimits {
        uint64 marginRatioMax;
        uint64 liquidationSpreadMax;
        uint64 earningsRateMax;
        uint64 marginPremiumMax;
        uint64 spreadPremiumMax;
        uint128 minBorrowedValueMax;
    }

    // The entire storage state of Solo
    struct State {
        // number of markets
        uint256 numMarkets;
        // marketId => Market
        mapping(uint256 => Market) markets;
        // owner => account number => Account
        mapping(address => mapping(uint256 => Account.Storage)) accounts;
        // Addresses that can control other users accounts
        mapping(address => mapping(address => bool)) operators;
        // Addresses that can control all users accounts
        mapping(address => bool) globalOperators;
        // mutable risk parameters of the system
        RiskParams riskParams;
        // immutable risk limits of the system
        RiskLimits riskLimits;
    }
}

// Part: ICallee

/**
 * @title ICallee
 * @author dYdX
 *
 * Interface that Callees for Solo must implement in order to ingest data.
 */
interface ICallee {
    // ============ Public Functions ============

    /**
     * Allows users to send this contract arbitrary data.
     *
     * @param  sender       The msg.sender to Solo
     * @param  accountInfo  The account from which the data is being sent
     * @param  data         Arbitrary data given by the sender
     */
    function callFunction(
        address sender,
        Account.Info memory accountInfo,
        bytes memory data
    ) external;
}

// Part: ISoloMargin

interface ISoloMargin {
    struct OperatorArg {
        address operator1;
        bool trusted;
    }

    function ownerSetSpreadPremium(uint256 marketId, Decimal.D256 memory spreadPremium) external;

    function getIsGlobalOperator(address operator1) external view returns (bool);

    function getMarketTokenAddress(uint256 marketId) external view returns (address);

    function ownerSetInterestSetter(uint256 marketId, address interestSetter) external;

    function getAccountValues(Account.Info memory account) external view returns (Monetary.Value memory, Monetary.Value memory);        

    function getMarketPriceOracle(uint256 marketId) external view returns (address);

    function getMarketInterestSetter(uint256 marketId) external view returns (address);

    function getMarketSpreadPremium(uint256 marketId) external view returns (Decimal.D256 memory);

    function getNumMarkets() external view returns (uint256);

    function ownerWithdrawUnsupportedTokens(address token, address recipient) external returns (uint256);

    function ownerSetMinBorrowedValue(Monetary.Value memory minBorrowedValue) external;

    function ownerSetLiquidationSpread(Decimal.D256 memory spread) external;

    function ownerSetEarningsRate(Decimal.D256 memory earningsRate) external;

    function getIsLocalOperator(address owner, address operator1) external view returns (bool);

    function getAccountPar(Account.Info memory account, uint256 marketId) external view returns (Types.Par memory);

    function ownerSetMarginPremium(uint256 marketId, Decimal.D256 memory marginPremium) external;

    function getMarginRatio() external view returns (Decimal.D256 memory);

    function getMarketCurrentIndex(uint256 marketId) external view returns (Interest.Index memory);

    function getMarketIsClosing(uint256 marketId) external view returns (bool);

    function getRiskParams() external view returns (Storage.RiskParams memory);

    function getAccountBalances(Account.Info memory account)
        external
        view
        returns (
            address[] memory,
            Types.Par[] memory,
            Types.Wei[] memory
        );

    function renounceOwnership() external;

    function getMinBorrowedValue() external view returns (Monetary.Value memory);

    function setOperators(OperatorArg[] memory args) external;

    function getMarketPrice(uint256 marketId) external view returns (address);

    function owner() external view returns (address);

    function isOwner() external view returns (bool);

    function ownerWithdrawExcessTokens(uint256 marketId, address recipient) external returns (uint256);

    function ownerAddMarket(
        address token,
        address priceOracle,
        address interestSetter,
        Decimal.D256 memory marginPremium,
        Decimal.D256 memory spreadPremium
    ) external;

    function operate(Account.Info[] memory accounts, Actions.ActionArgs[] memory actions) external;

    function getMarketWithInfo(uint256 marketId)
        external
        view
        returns (
            Storage.Market memory,
            Interest.Index memory,
            Monetary.Price memory,
            Interest.Rate memory
        );

    function ownerSetMarginRatio(Decimal.D256 memory ratio) external;

    function getLiquidationSpread() external view returns (Decimal.D256 memory);

    function getAccountWei(Account.Info memory account, uint256 marketId) external view returns (Types.Wei memory);

    function getMarketTotalPar(uint256 marketId) external view returns (Types.TotalPar memory);

    function getLiquidationSpreadForPair(uint256 heldMarketId, uint256 owedMarketId) external view returns (Decimal.D256 memory);       

    function getNumExcessTokens(uint256 marketId) external view returns (Types.Wei memory);

    function getMarketCachedIndex(uint256 marketId) external view returns (Interest.Index memory);

    function getAccountStatus(Account.Info memory account) external view returns (uint8);

    function getEarningsRate() external view returns (Decimal.D256 memory);

    function ownerSetPriceOracle(uint256 marketId, address priceOracle) external;

    function getRiskLimits() external view returns (Storage.RiskLimits memory);

    function getMarket(uint256 marketId) external view returns (Storage.Market memory);

    function ownerSetIsClosing(uint256 marketId, bool isClosing) external;

    function ownerSetGlobalOperator(address operator1, bool approved) external;

    function transferOwnership(address newOwner) external;

    function getAdjustedAccountValues(Account.Info memory account) external view returns (Monetary.Value memory, Monetary.Value memory);
    function getMarketMarginPremium(uint256 marketId) external view returns (Decimal.D256 memory);

    function getMarketInterestRate(uint256 marketId) external view returns (Interest.Rate memory);
}

// Part: IUni

interface IUni{
    function getAmountsOut(
        uint256 amountIn,
        address[] calldata path
    ) external view returns (uint256[] memory amounts);

    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
}

// Part: InterestRateModel

interface InterestRateModel {
    /**
     * @notice Calculates the current borrow interest rate per block
     * @param cash The total amount of cash the market has
     * @param borrows The total amount of borrows the market has outstanding
     * @param reserves The total amount of reserves the market has
     * @return The borrow rate per block (as a percentage, and scaled by 1e18)
     */
    function getBorrowRate(
        uint256 cash,
        uint256 borrows,
        uint256 reserves
    ) external view returns (uint256, uint256);

    /**
     * @notice Calculates the current supply interest rate per block
     * @param cash The total amount of cash the market has
     * @param borrows The total amount of borrows the market has outstanding
     * @param reserves The total amount of reserves the market has
     * @param reserveFactorMantissa The current reserve factor the market has
     * @return The supply rate per block (as a percentage, and scaled by 1e18)
     */
    function getSupplyRate(
        uint256 cash,
        uint256 borrows,
        uint256 reserves,
        uint256 reserveFactorMantissa
    ) external view returns (uint256);
}

// Part: OpenZeppelin/[email protected]/Address

/**
 * @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) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// Part: OpenZeppelin/[email protected]/IERC20

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

// Part: OpenZeppelin/[email protected]/Math

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

// Part: OpenZeppelin/[email protected]/SafeMath

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

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

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

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

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

        return c;
    }

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

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

        return c;
    }

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

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

// Part: Types

library Types {
    enum AssetDenomination {
        Wei, // the amount is denominated in wei
        Par // the amount is denominated in par
    }

    enum AssetReference {
        Delta, // the amount is given as a delta from the current value
        Target // the amount is given as an exact number to end up at
    }

    struct AssetAmount {
        bool sign; // true if positive
        AssetDenomination denomination;
        AssetReference ref;
        uint256 value;
    }

    struct TotalPar {
        uint128 borrow;
        uint128 supply;
    }

    struct Par {
        bool sign; // true if positive
        uint128 value;
    }

    struct Wei {
        bool sign; // true if positive
        uint256 value;
    }
}

// Part: CTokenI

interface CTokenI {
    /*** Market Events ***/

    /**
     * @notice Event emitted when interest is accrued
     */
    event AccrueInterest(uint256 cashPrior, uint256 interestAccumulated, uint256 borrowIndex, uint256 totalBorrows);

    /**
     * @notice Event emitted when tokens are minted
     */
    event Mint(address minter, uint256 mintAmount, uint256 mintTokens);

    /**
     * @notice Event emitted when tokens are redeemed
     */
    event Redeem(address redeemer, uint256 redeemAmount, uint256 redeemTokens);

    /**
     * @notice Event emitted when underlying is borrowed
     */
    event Borrow(address borrower, uint256 borrowAmount, uint256 accountBorrows, uint256 totalBorrows);

    /**
     * @notice Event emitted when a borrow is repaid
     */
    event RepayBorrow(address payer, address borrower, uint256 repayAmount, uint256 accountBorrows, uint256 totalBorrows);

    /**
     * @notice Event emitted when a borrow is liquidated
     */
    event LiquidateBorrow(address liquidator, address borrower, uint256 repayAmount, address cTokenCollateral, uint256 seizeTokens);    

    /*** Admin Events ***/

    /**
     * @notice Event emitted when pendingAdmin is changed
     */
    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);

    /**
     * @notice Event emitted when pendingAdmin is accepted, which means admin is updated
     */
    event NewAdmin(address oldAdmin, address newAdmin);

    /**
     * @notice Event emitted when the reserve factor is changed
     */
    event NewReserveFactor(uint256 oldReserveFactorMantissa, uint256 newReserveFactorMantissa);

    /**
     * @notice Event emitted when the reserves are added
     */
    event ReservesAdded(address benefactor, uint256 addAmount, uint256 newTotalReserves);

    /**
     * @notice Event emitted when the reserves are reduced
     */
    event ReservesReduced(address admin, uint256 reduceAmount, uint256 newTotalReserves);

    /**
     * @notice EIP20 Transfer event
     */
    event Transfer(address indexed from, address indexed to, uint256 amount);

    /**
     * @notice EIP20 Approval event
     */
    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /**
     * @notice Failure event
     */
    event Failure(uint256 error, uint256 info, uint256 detail);

    function transfer(address dst, uint256 amount) external returns (bool);

    function transferFrom(
        address src,
        address dst,
        uint256 amount
    ) external returns (bool);

    function approve(address spender, uint256 amount) external returns (bool);

    function allowance(address owner, address spender) external view returns (uint256);

    function balanceOf(address owner) external view returns (uint256);

    function balanceOfUnderlying(address owner) external returns (uint256);

    function getAccountSnapshot(address account)
        external
        view
        returns (
            uint256,
            uint256,
            uint256,
            uint256
        );

    function borrowRatePerBlock() external view returns (uint256);

    function supplyRatePerBlock() external view returns (uint256);

    function totalBorrowsCurrent() external returns (uint256);

    function borrowBalanceCurrent(address account) external returns (uint256);

    function borrowBalanceStored(address account) external view returns (uint256);

    function exchangeRateCurrent() external returns (uint256);

    function accrualBlockNumber() external view returns (uint256);

    function exchangeRateStored() external view returns (uint256);

    function getCash() external view returns (uint256);

    function accrueInterest() external returns (uint256);

    function interestRateModel() external view returns (InterestRateModel);

    function totalReserves() external view returns (uint256);

    function reserveFactorMantissa() external view returns (uint256);

    function seize(
        address liquidator,
        address borrower,
        uint256 seizeTokens
    ) external returns (uint256);

    function totalBorrows() external view returns (uint256);

    function totalSupply() external view returns (uint256);
}

// Part: DydxFlashloanBase

contract DydxFlashloanBase {
    using SafeMath for uint256;


    function _getAccountInfo() internal view returns (Account.Info memory) {
        return Account.Info({owner: address(this), number: 1});
    }

    function _getWithdrawAction(uint256 marketId, uint256 amount) internal view returns (Actions.ActionArgs memory) {
        return
            Actions.ActionArgs({
                actionType: Actions.ActionType.Withdraw,
                accountId: 0,
                amount: Types.AssetAmount({
                    sign: false,
                    denomination: Types.AssetDenomination.Wei,
                    ref: Types.AssetReference.Delta,
                    value: amount
                }),
                primaryMarketId: marketId,
                secondaryMarketId: 0,
                otherAddress: address(this),
                otherAccountId: 0,
                data: ""
            });
    }

    function _getCallAction(bytes memory data) internal view returns (Actions.ActionArgs memory) {
        return
            Actions.ActionArgs({
                actionType: Actions.ActionType.Call,
                accountId: 0,
                amount: Types.AssetAmount({sign: false, denomination: Types.AssetDenomination.Wei, ref: Types.AssetReference.Delta, value: 0}),
                primaryMarketId: 0,
                secondaryMarketId: 0,
                otherAddress: address(this),
                otherAccountId: 0,
                data: data
            });
    }

    function _getDepositAction(uint256 marketId, uint256 amount) internal view returns (Actions.ActionArgs memory) {
        return
            Actions.ActionArgs({
                actionType: Actions.ActionType.Deposit,
                accountId: 0,
                amount: Types.AssetAmount({
                    sign: true,
                    denomination: Types.AssetDenomination.Wei,
                    ref: Types.AssetReference.Delta,
                    value: amount
                }),
                primaryMarketId: marketId,
                secondaryMarketId: 0,
                otherAddress: address(this),
                otherAccountId: 0,
                data: ""
            });
    }
}

// Part: OpenZeppelin/[email protected]/SafeERC20

/**
 * @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 SafeMath for uint256;
    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'
        // solhint-disable-next-line max-line-length
        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).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _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
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// Part: iearn-finance/[email protected]/VaultAPI

interface VaultAPI is IERC20 {
    function apiVersion() external view returns (string memory);

    function withdraw(uint256 shares, address recipient) external;

    function token() external view returns (address);

    function strategies(address _strategy) external view returns (StrategyParams memory);

    /**
     * View how much the Vault would increase this Strategy's borrow limit,
     * based on its present performance (since its last report). Can be used to
     * determine expectedReturn in your Strategy.
     */
    function creditAvailable() external view returns (uint256);

    /**
     * View how much the Vault would like to pull back from the Strategy,
     * based on its present performance (since its last report). Can be used to
     * determine expectedReturn in your Strategy.
     */
    function debtOutstanding() external view returns (uint256);

    /**
     * View how much the Vault expect this Strategy to return at the current
     * block, based on its present performance (since its last report). Can be
     * used to determine expectedReturn in your Strategy.
     */
    function expectedReturn() external view returns (uint256);

    /**
     * This is the main contact point where the Strategy interacts with the
     * Vault. It is critical that this call is handled as intended by the
     * Strategy. Therefore, this function will be called by BaseStrategy to
     * make sure the integration is correct.
     */
    function report(
        uint256 _gain,
        uint256 _loss,
        uint256 _debtPayment
    ) external returns (uint256);

    /**
     * This function should only be used in the scenario where the Strategy is
     * being retired but no migration of the positions are possible, or in the
     * extreme scenario that the Strategy needs to be put into "Emergency Exit"
     * mode in order for it to exit as quickly as possible. The latter scenario
     * could be for any reason that is considered "critical" that the Strategy
     * exits its position as fast as possible, such as a sudden change in
     * market conditions leading to losses, or an imminent failure in an
     * external dependency.
     */
    function revokeStrategy() external;

    /**
     * View the governance address of the Vault to assert privileged functions
     * can only be called by governance. The Strategy serves the Vault, so it
     * is subject to governance defined by the Vault.
     */
    function governance() external view returns (address);
}

// Part: CErc20I

interface CErc20I is CTokenI {
    function mint(uint256 mintAmount) external returns (uint256);

    function redeem(uint256 redeemTokens) external returns (uint256);

    function redeemUnderlying(uint256 redeemAmount) external returns (uint256);

    function borrow(uint256 borrowAmount) external returns (uint256);

    function repayBorrow(uint256 repayAmount) external returns (uint256);

    function repayBorrowBehalf(address borrower, uint256 repayAmount) external returns (uint256);

    function liquidateBorrow(
        address borrower,
        uint256 repayAmount,
        CTokenI cTokenCollateral
    ) external returns (uint256);

    function underlying() external view returns (address);
}

// Part: ComptrollerI

interface ComptrollerI {
    function enterMarkets(address[] calldata cTokens) external returns (uint256[] memory);

    function exitMarket(address cToken) external returns (uint256);

    /*** Policy Hooks ***/

    function mintAllowed(
        address cToken,
        address minter,
        uint256 mintAmount
    ) external returns (uint256);

    function mintVerify(
        address cToken,
        address minter,
        uint256 mintAmount,
        uint256 mintTokens
    ) external;

    function redeemAllowed(
        address cToken,
        address redeemer,
        uint256 redeemTokens
    ) external returns (uint256);

    function redeemVerify(
        address cToken,
        address redeemer,
        uint256 redeemAmount,
        uint256 redeemTokens
    ) external;

    function borrowAllowed(
        address cToken,
        address borrower,
        uint256 borrowAmount
    ) external returns (uint256);

    function borrowVerify(
        address cToken,
        address borrower,
        uint256 borrowAmount
    ) external;

    function repayBorrowAllowed(
        address cToken,
        address payer,
        address borrower,
        uint256 repayAmount
    ) external returns (uint256);

    function repayBorrowVerify(
        address cToken,
        address payer,
        address borrower,
        uint256 repayAmount,
        uint256 borrowerIndex
    ) external;

    function liquidateBorrowAllowed(
        address cTokenBorrowed,
        address cTokenCollateral,
        address liquidator,
        address borrower,
        uint256 repayAmount
    ) external returns (uint256);

    function liquidateBorrowVerify(
        address cTokenBorrowed,
        address cTokenCollateral,
        address liquidator,
        address borrower,
        uint256 repayAmount,
        uint256 seizeTokens
    ) external;

    function seizeAllowed(
        address cTokenCollateral,
        address cTokenBorrowed,
        address liquidator,
        address borrower,
        uint256 seizeTokens
    ) external returns (uint256);

    function seizeVerify(
        address cTokenCollateral,
        address cTokenBorrowed,
        address liquidator,
        address borrower,
        uint256 seizeTokens
    ) external;

    function transferAllowed(
        address cToken,
        address src,
        address dst,
        uint256 transferTokens
    ) external returns (uint256);

    function transferVerify(
        address cToken,
        address src,
        address dst,
        uint256 transferTokens
    ) external;

    /*** Liquidity/Liquidation Calculations ***/

    function liquidateCalculateSeizeTokens(
        address cTokenBorrowed,
        address cTokenCollateral,
        uint256 repayAmount
    ) external view returns (uint256, uint256);

    function getAccountLiquidity(address account)
        external
        view
        returns (
            uint256,
            uint256,
            uint256
        );

    /***  Comp claims ****/
    function claimComp(address holder) external;

    function claimComp(address holder, CTokenI[] memory cTokens) external;

    function markets(address ctoken)
        external
        view
        returns (
            bool,
            uint256,
            bool
        );

    function compSpeeds(address ctoken) external view returns (uint256);
}

// Part: iearn-finance/[email protected]/BaseStrategy

/**
 * @title Yearn Base Strategy
 * @author yearn.finance
 * @notice
 *  BaseStrategy implements all of the required functionality to interoperate
 *  closely with the Vault contract. This contract should be inherited and the
 *  abstract methods implemented to adapt the Strategy to the particular needs
 *  it has to create a return.
 *
 *  Of special interest is the relationship between `harvest()` and
 *  `vault.report()'. `harvest()` may be called simply because enough time has
 *  elapsed since the last report, and not because any funds need to be moved
 *  or positions adjusted. This is critical so that the Vault may maintain an
 *  accurate picture of the Strategy's performance. See  `vault.report()`,
 *  `harvest()`, and `harvestTrigger()` for further details.
 */
abstract contract BaseStrategy {
    using SafeMath for uint256;

    /**
     * @notice
     *  Used to track which version of `StrategyAPI` this Strategy
     *  implements.
     * @dev The Strategy's version must match the Vault's `API_VERSION`.
     * @return A string which holds the current API version of this contract.
     */
    function apiVersion() public pure returns (string memory) {
        return "0.3.0";
    }

    /**
     * @notice This Strategy's name.
     * @dev
     *  You can use this field to manage the "version" of this Strategy, e.g.
     *  `StrategySomethingOrOtherV1`. However, "API Version" is managed by
     *  `apiVersion()` function above.
     * @return This Strategy's name.
     */
    function name() external virtual view returns (string memory);

    /**
     * @notice
     *  The amount (priced in want) of the total assets managed by this strategy should not count
     *  towards Yearn's TVL calculations.
     * @dev
     *  You can override this field to set it to a non-zero value if some of the assets of this
     *  Strategy is somehow delegated inside another part of of Yearn's ecosystem e.g. another Vault.
     *  Note that this value must be strictly less than or equal to the amount provided by
     *  `estimatedTotalAssets()` below, as the TVL calc will be total assets minus delegated assets.
     * @return
     *  The amount of assets this strategy manages that should not be included in Yearn's Total Value
     *  Locked (TVL) calculation across it's ecosystem.
     */
    function delegatedAssets() external virtual view returns (uint256) {
        return 0;
    }

    VaultAPI public vault;
    address public strategist;
    address public rewards;
    address public keeper;

    IERC20 public want;

    // So indexers can keep track of this
    event Harvested(uint256 profit, uint256 loss, uint256 debtPayment, uint256 debtOutstanding);

    event UpdatedStrategist(address newStrategist);

    event UpdatedKeeper(address newKeeper);

    event UpdatedRewards(address rewards);

    event UpdatedReportDelay(uint256 delay);

    event UpdatedProfitFactor(uint256 profitFactor);

    event UpdatedDebtThreshold(uint256 debtThreshold);

    event EmergencyExitEnabled();

    // The maximum number of seconds between harvest calls. See
    // `setMaxReportDelay()` for more details.
    uint256 public maxReportDelay = 86400; // ~ once a day

    // The minimum multiple that `callCost` must be above the credit/profit to
    // be "justifiable". See `setProfitFactor()` for more details.
    uint256 public profitFactor = 100;

    // Use this to adjust the threshold at which running a debt causes a
    // harvest trigger. See `setDebtThreshold()` for more details.
    uint256 public debtThreshold = 0;

    // See note on `setEmergencyExit()`.
    bool public emergencyExit;

    // modifiers
    modifier onlyAuthorized() {
        require(msg.sender == strategist || msg.sender == governance(), "!authorized");
        _;
    }

    modifier onlyStrategist() {
        require(msg.sender == strategist, "!strategist");
        _;
    }

    modifier onlyGovernance() {
        require(msg.sender == governance(), "!authorized");
        _;
    }

    modifier onlyKeepers() {
        require(msg.sender == keeper || msg.sender == strategist || msg.sender == governance(), "!authorized");
        _;
    }

    /**
     * @notice
     *  Initializes the Strategy, this is called only once, when the
     *  contract is deployed.
     * @dev `_vault` should implement `VaultAPI`.
     * @param _vault The address of the Vault responsible for this Strategy.
     */
    constructor(address _vault) public {
        vault = VaultAPI(_vault);
        want = IERC20(vault.token());
        want.approve(_vault, uint256(-1)); // Give Vault unlimited access (might save gas)
        strategist = msg.sender;
        rewards = msg.sender;
        keeper = msg.sender;
    }

    /**
     * @notice
     *  Used to change `strategist`.
     *
     *  This may only be called by governance or the existing strategist.
     * @param _strategist The new address to assign as `strategist`.
     */
    function setStrategist(address _strategist) external onlyAuthorized {
        require(_strategist != address(0));
        strategist = _strategist;
        emit UpdatedStrategist(_strategist);
    }

    /**
     * @notice
     *  Used to change `keeper`.
     *
     *  `keeper` is the only address that may call `tend()` or `harvest()`,
     *  other than `governance()` or `strategist`. However, unlike
     *  `governance()` or `strategist`, `keeper` may *only* call `tend()`
     *  and `harvest()`, and no other authorized functions, following the
     *  principle of least privilege.
     *
     *  This may only be called by governance or the strategist.
     * @param _keeper The new address to assign as `keeper`.
     */
    function setKeeper(address _keeper) external onlyAuthorized {
        require(_keeper != address(0));
        keeper = _keeper;
        emit UpdatedKeeper(_keeper);
    }

    /**
     * @notice
     *  Used to change `rewards`. Any distributed rewards will cease flowing
     *  to the old address and begin flowing to this address once the change
     *  is in effect.
     *
     *  This may only be called by the strategist.
     * @param _rewards The address to use for collecting rewards.
     */
    function setRewards(address _rewards) external onlyStrategist {
        require(_rewards != address(0));
        rewards = _rewards;
        emit UpdatedRewards(_rewards);
    }

    /**
     * @notice
     *  Used to change `maxReportDelay`. `maxReportDelay` is the maximum number
     *  of blocks that should pass for `harvest()` to be called.
     *
     *  For external keepers (such as the Keep3r network), this is the maximum
     *  time between jobs to wait. (see `harvestTrigger()`
     *  for more details.)
     *
     *  This may only be called by governance or the strategist.
     * @param _delay The maximum number of seconds to wait between harvests.
     */
    function setMaxReportDelay(uint256 _delay) external onlyAuthorized {
        maxReportDelay = _delay;
        emit UpdatedReportDelay(_delay);
    }

    /**
     * @notice
     *  Used to change `profitFactor`. `profitFactor` is used to determine
     *  if it's worthwhile to harvest, given gas costs. (See `harvestTrigger()`
     *  for more details.)
     *
     *  This may only be called by governance or the strategist.
     * @param _profitFactor A ratio to multiply anticipated
     * `harvest()` gas cost against.
     */
    function setProfitFactor(uint256 _profitFactor) external onlyAuthorized {
        profitFactor = _profitFactor;
        emit UpdatedProfitFactor(_profitFactor);
    }

    /**
     * @notice
     *  Sets how far the Strategy can go into loss without a harvest and report
     *  being required.
     *
     *  By default this is 0, meaning any losses would cause a harvest which
     *  will subsequently report the loss to the Vault for tracking. (See
     *  `harvestTrigger()` for more details.)
     *
     *  This may only be called by governance or the strategist.
     * @param _debtThreshold How big of a loss this Strategy may carry without
     * being required to report to the Vault.
     */
    function setDebtThreshold(uint256 _debtThreshold) external onlyAuthorized {
        debtThreshold = _debtThreshold;
        emit UpdatedDebtThreshold(_debtThreshold);
    }

    /**
     * Resolve governance address from Vault contract, used to make assertions
     * on protected functions in the Strategy.
     */
    function governance() internal view returns (address) {
        return vault.governance();
    }

    /**
     * @notice
     *  Provide an accurate estimate for the total amount of assets
     *  (principle + return) that this Strategy is currently managing,
     *  denominated in terms of `want` tokens.
     *
     *  This total should be "realizable" e.g. the total value that could
     *  *actually* be obtained from this Strategy if it were to divest its
     *  entire position based on current on-chain conditions.
     * @dev
     *  Care must be taken in using this function, since it relies on external
     *  systems, which could be manipulated by the attacker to give an inflated
     *  (or reduced) value produced by this function, based on current on-chain
     *  conditions (e.g. this function is possible to influence through
     *  flashloan attacks, oracle manipulations, or other DeFi attack
     *  mechanisms).
     *
     *  It is up to governance to use this function to correctly order this
     *  Strategy relative to its peers in the withdrawal queue to minimize
     *  losses for the Vault based on sudden withdrawals. This value should be
     *  higher than the total debt of the Strategy and higher than its expected
     *  value to be "safe".
     * @return The estimated total assets in this Strategy.
     */
    function estimatedTotalAssets() public virtual view returns (uint256);

    /*
     * @notice
     *  Provide an indication of whether this strategy is currently "active"
     *  in that it is managing an active position, or will manage a position in
     *  the future. This should correlate to `harvest()` activity, so that Harvest
     *  events can be tracked externally by indexing agents.
     * @return True if the strategy is actively managing a position.
     */
    function isActive() public view returns (bool) {
        return vault.strategies(address(this)).debtRatio > 0 || estimatedTotalAssets() > 0;
    }

    /**
     * Perform any Strategy unwinding or other calls necessary to capture the
     * "free return" this Strategy has generated since the last time its core
     * position(s) were adjusted. Examples include unwrapping extra rewards.
     * This call is only used during "normal operation" of a Strategy, and
     * should be optimized to minimize losses as much as possible.
     *
     * This method returns any realized profits and/or realized losses
     * incurred, and should return the total amounts of profits/losses/debt
     * payments (in `want` tokens) for the Vault's accounting (e.g.
     * `want.balanceOf(this) >= _debtPayment + _profit - _loss`).
     *
     * `_debtOutstanding` will be 0 if the Strategy is not past the configured
     * debt limit, otherwise its value will be how far past the debt limit
     * the Strategy is. The Strategy's debt limit is configured in the Vault.
     *
     * NOTE: `_debtPayment` should be less than or equal to `_debtOutstanding`.
     *       It is okay for it to be less than `_debtOutstanding`, as that
     *       should only used as a guide for how much is left to pay back.
     *       Payments should be made to minimize loss from slippage, debt,
     *       withdrawal fees, etc.
     *
     * See `vault.debtOutstanding()`.
     */
    function prepareReturn(uint256 _debtOutstanding)
        internal
        virtual
        returns (
            uint256 _profit,
            uint256 _loss,
            uint256 _debtPayment
        );

    /**
     * Perform any adjustments to the core position(s) of this Strategy given
     * what change the Vault made in the "investable capital" available to the
     * Strategy. Note that all "free capital" in the Strategy after the report
     * was made is available for reinvestment. Also note that this number
     * could be 0, and you should handle that scenario accordingly.
     *
     * See comments regarding `_debtOutstanding` on `prepareReturn()`.
     */
    function adjustPosition(uint256 _debtOutstanding) internal virtual;

    /**
     * Liquidate up to `_amountNeeded` of `want` of this strategy's positions,
     * irregardless of slippage. Any excess will be re-invested with `adjustPosition()`.
     * This function should return the amount of `want` tokens made available by the
     * liquidation. If there is a difference between them, `_loss` indicates whether the
     * difference is due to a realized loss, or if there is some other sitution at play
     * (e.g. locked funds). This function is used during emergency exit instead of
     * `prepareReturn()` to liquidate all of the Strategy's positions back to the Vault.
     *
     * NOTE: The invariant `_amountFreed + _loss <= _amountNeeded` should always be maintained
     */
    function liquidatePosition(uint256 _amountNeeded) internal virtual returns (uint256 _liquidatedAmount, uint256 _loss);

    /**
     *  `Harvest()` calls this function after shares are created during
     *  `vault.report()`. You can customize this function to any share
     *  distribution mechanism you want.
     *
     *   See `vault.report()` for further details.
     */
    function distributeRewards() internal virtual {
        // Transfer 100% of newly-minted shares awarded to this contract to the rewards address.
        uint256 balance = vault.balanceOf(address(this));
        if (balance > 0) {
            vault.transfer(rewards, balance);
        }
    }

    /**
     * @notice
     *  Provide a signal to the keeper that `tend()` should be called. The
     *  keeper will provide the estimated gas cost that they would pay to call
     *  `tend()`, and this function should use that estimate to make a
     *  determination if calling it is "worth it" for the keeper. This is not
     *  the only consideration into issuing this trigger, for example if the
     *  position would be negatively affected if `tend()` is not called
     *  shortly, then this can return `true` even if the keeper might be
     *  "at a loss" (keepers are always reimbursed by Yearn).
     * @dev
     *  `callCost` must be priced in terms of `want`.
     *
     *  This call and `harvestTrigger()` should never return `true` at the same
     *  time.
     * @param callCost The keeper's estimated cast cost to call `tend()`.
     * @return `true` if `tend()` should be called, `false` otherwise.
     */
    function tendTrigger(uint256 callCost) public virtual view returns (bool) {
        // We usually don't need tend, but if there are positions that need
        // active maintainence, overriding this function is how you would
        // signal for that.
        return false;
    }

    /**
     * @notice
     *  Adjust the Strategy's position. The purpose of tending isn't to
     *  realize gains, but to maximize yield by reinvesting any returns.
     *
     *  See comments on `adjustPosition()`.
     *
     *  This may only be called by governance, the strategist, or the keeper.
     */
    function tend() external onlyKeepers {
        // Don't take profits with this call, but adjust for better gains
        adjustPosition(vault.debtOutstanding());
    }

    /**
     * @notice
     *  Provide a signal to the keeper that `harvest()` should be called. The
     *  keeper will provide the estimated gas cost that they would pay to call
     *  `harvest()`, and this function should use that estimate to make a
     *  determination if calling it is "worth it" for the keeper. This is not
     *  the only consideration into issuing this trigger, for example if the
     *  position would be negatively affected if `harvest()` is not called
     *  shortly, then this can return `true` even if the keeper might be "at a
     *  loss" (keepers are always reimbursed by Yearn).
     * @dev
     *  `callCost` must be priced in terms of `want`.
     *
     *  This call and `tendTrigger` should never return `true` at the
     *  same time.
     *
     *  See `maxReportDelay`, `profitFactor`, `debtThreshold` to adjust the
     *  strategist-controlled parameters that will influence whether this call
     *  returns `true` or not. These parameters will be used in conjunction
     *  with the parameters reported to the Vault (see `params`) to determine
     *  if calling `harvest()` is merited.
     *
     *  It is expected that an external system will check `harvestTrigger()`.
     *  This could be a script run off a desktop or cloud bot (e.g.
     *  https://github.com/iearn-finance/yearn-vaults/blob/master/scripts/keep.py),
     *  or via an integration with the Keep3r network (e.g.
     *  https://github.com/Macarse/GenericKeep3rV2/blob/master/contracts/keep3r/GenericKeep3rV2.sol).
     * @param callCost The keeper's estimated cast cost to call `harvest()`.
     * @return `true` if `harvest()` should be called, `false` otherwise.
     */
    function harvestTrigger(uint256 callCost) public virtual view returns (bool) {
        StrategyParams memory params = vault.strategies(address(this));

        // Should not trigger if Strategy is not activated
        if (params.activation == 0) return false;

        // Should trigger if hasn't been called in a while
        if (block.timestamp.sub(params.lastReport) >= maxReportDelay) return true;

        // If some amount is owed, pay it back
        // NOTE: Since debt is based on deposits, it makes sense to guard against large
        //       changes to the value from triggering a harvest directly through user
        //       behavior. This should ensure reasonable resistance to manipulation
        //       from user-initiated withdrawals as the outstanding debt fluctuates.
        uint256 outstanding = vault.debtOutstanding();
        if (outstanding > debtThreshold) return true;

        // Check for profits and losses
        uint256 total = estimatedTotalAssets();
        // Trigger if we have a loss to report
        if (total.add(debtThreshold) < params.totalDebt) return true;

        uint256 profit = 0;
        if (total > params.totalDebt) profit = total.sub(params.totalDebt); // We've earned a profit!

        // Otherwise, only trigger if it "makes sense" economically (gas cost
        // is <N% of value moved)
        uint256 credit = vault.creditAvailable();
        return (profitFactor.mul(callCost) < credit.add(profit));
    }

    /**
     * @notice
     *  Harvests the Strategy, recognizing any profits or losses and adjusting
     *  the Strategy's position.
     *
     *  In the rare case the Strategy is in emergency shutdown, this will exit
     *  the Strategy's position.
     *
     *  This may only be called by governance, the strategist, or the keeper.
     * @dev
     *  When `harvest()` is called, the Strategy reports to the Vault (via
     *  `vault.report()`), so in some cases `harvest()` must be called in order
     *  to take in profits, to borrow newly available funds from the Vault, or
     *  otherwise adjust its position. In other cases `harvest()` must be
     *  called to report to the Vault on the Strategy's position, especially if
     *  any losses have occurred.
     */
    function harvest() external onlyKeepers {
        uint256 profit = 0;
        uint256 loss = 0;
        uint256 debtOutstanding = vault.debtOutstanding();
        uint256 debtPayment = 0;
        if (emergencyExit) {
            // Free up as much capital as possible
            uint256 totalAssets = estimatedTotalAssets();
            // NOTE: use the larger of total assets or debt outstanding to book losses properly
            (debtPayment, loss) = liquidatePosition(totalAssets > debtOutstanding ? totalAssets : debtOutstanding);
            // NOTE: take up any remainder here as profit
            if (debtPayment > debtOutstanding) {
                profit = debtPayment.sub(debtOutstanding);
                debtPayment = debtOutstanding;
            }
        } else {
            // Free up returns for Vault to pull
            (profit, loss, debtPayment) = prepareReturn(debtOutstanding);
        }

        // Allow Vault to take up to the "harvested" balance of this contract,
        // which is the amount it has earned since the last time it reported to
        // the Vault.
        debtOutstanding = vault.report(profit, loss, debtPayment);

        // Distribute any reward shares earned by the strategy on this report
        distributeRewards();

        // Check if free returns are left, and re-invest them
        adjustPosition(debtOutstanding);

        emit Harvested(profit, loss, debtPayment, debtOutstanding);
    }

    /**
     * @notice
     *  Withdraws `_amountNeeded` to `vault`.
     *
     *  This may only be called by the Vault.
     * @param _amountNeeded How much `want` to withdraw.
     * @return _loss Any realized losses
     */
    function withdraw(uint256 _amountNeeded) external returns (uint256 _loss) {
        require(msg.sender == address(vault), "!vault");
        // Liquidate as much as possible to `want`, up to `_amount`
        uint256 amountFreed;
        (amountFreed, _loss) = liquidatePosition(_amountNeeded);
        // Send it directly back (NOTE: Using `msg.sender` saves some gas here)
        want.transfer(msg.sender, amountFreed);
        // NOTE: Reinvest anything leftover on next `tend`/`harvest`
    }

    /**
     * Do anything necessary to prepare this Strategy for migration, such as
     * transferring any reserve or LP tokens, CDPs, or other tokens or stores of
     * value.
     */
    function prepareMigration(address _newStrategy) internal virtual;

    /**
     * @notice
     *  Transfers all `want` from this Strategy to `_newStrategy`.
     *
     *  This may only be called by governance or the Vault.
     * @dev
     *  The new Strategy's Vault must be the same as this Strategy's Vault.
     * @param _newStrategy The Strategy to migrate to.
     */
    function migrate(address _newStrategy) external {
        require(msg.sender == address(vault) || msg.sender == governance());
        require(BaseStrategy(_newStrategy).vault() == vault);
        prepareMigration(_newStrategy);
        want.transfer(_newStrategy, want.balanceOf(address(this)));
    }

    /**
     * @notice
     *  Activates emergency exit. Once activated, the Strategy will exit its
     *  position upon the next harvest, depositing all funds into the Vault as
     *  quickly as is reasonable given on-chain conditions.
     *
     *  This may only be called by governance or the strategist.
     * @dev
     *  See `vault.setEmergencyShutdown()` and `harvest()` for further details.
     */
    function setEmergencyExit() external onlyAuthorized {
        emergencyExit = true;
        vault.revokeStrategy();

        emit EmergencyExitEnabled();
    }

    /**
     * Override this to add all tokens/tokenized positions this contract
     * manages on a *persistent* basis (e.g. not just for swapping back to
     * want ephemerally).
     *
     * NOTE: Do *not* include `want`, already included in `sweep` below.
     *
     * Example:
     *
     *    function protectedTokens() internal override view returns (address[] memory) {
     *      address[] memory protected = new address[](3);
     *      protected[0] = tokenA;
     *      protected[1] = tokenB;
     *      protected[2] = tokenC;
     *      return protected;
     *    }
     */
    function protectedTokens() internal virtual view returns (address[] memory);

    /**
     * @notice
     *  Removes tokens from this Strategy that are not the type of tokens
     *  managed by this Strategy. This may be used in case of accidentally
     *  sending the wrong kind of token to this Strategy.
     *
     *  Tokens will be sent to `governance()`.
     *
     *  This will fail if an attempt is made to sweep `want`, or any tokens
     *  that are protected by this Strategy.
     *
     *  This may only be called by governance.
     * @dev
     *  Implement `protectedTokens()` to specify any additional tokens that
     *  should be protected from sweeping in addition to `want`.
     * @param _token The token to transfer out of this vault.
     */
    function sweep(address _token) external onlyGovernance {
        require(_token != address(want), "!want");
        require(_token != address(vault), "!shares");

        address[] memory _protectedTokens = protectedTokens();
        for (uint256 i; i < _protectedTokens.length; i++) require(_token != _protectedTokens[i], "!protected");

        IERC20(_token).transfer(governance(), IERC20(_token).balanceOf(address(this)));
    }
}

// File: Strategy.sol

/********************
 *
 *   A lender optimisation strategy for any erc20 asset
 *   https://github.com/Grandthrax/yearnV2-generic-lender-strat
 *   v0.2.2
 *
 ********************* */

contract Strategy is BaseStrategy, DydxFlashloanBase, ICallee {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;

    // @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
    event Leverage(uint256 amountRequested, uint256 amountGiven, bool deficit, address flashLoan);

    //Flash Loan Providers
    address private constant SOLO = 0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e;

    // Comptroller address for compound.finance
    ComptrollerI public constant compound = ComptrollerI(0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B);

    //Only three tokens we use
    address public constant comp = address(0xc00e94Cb662C3520282E6f5717214004A7f26888);
    CErc20I public cToken;
    //address public constant DAI = address(0x6B175474E89094C44Da98b954EedeAC495271d0F);

    address public constant uniswapRouter = address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
    address public constant weth = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);

    //Operating variables
    uint256 public collateralTarget = 0.73 ether; // 73%
    uint256 public blocksToLiquidationDangerZone = 46500; // 7 days =  60*60*24*7/13

    uint256 public minWant = 0; //Only lend if we have enough want to be worth it. Can be set to non-zero
    uint256 public minCompToSell = 0.1 ether; //used both as the threshold to sell but also as a trigger for harvest

    //To deactivate flash loan provider if needed
    bool public DyDxActive = true;

    bool public forceMigrate = false;

    uint256 public dyDxMarketId;



    constructor(address _vault, address _cToken) public BaseStrategy(_vault) {
        cToken = CErc20I(address(_cToken));

        //pre-set approvals
        IERC20(comp).safeApprove(uniswapRouter, uint256(-1));
        want.safeApprove(address(cToken), uint256(-1));
        want.safeApprove(SOLO, uint256(-1));

        // You can set these parameters on deployment to whatever you want
        maxReportDelay = 86400; // once per 24 hours
        profitFactor = 100; // multiple before triggering harvest

        _setMarketIdFromTokenAddress();
    }

    function name() external override view returns (string memory){
        return "StrategyGenericLevCompFarm";
    }

    /*
     * Control Functions
     */
    function setDyDx(bool _dydx) external management {
        DyDxActive = _dydx;
    }

    function setForceMigrate(bool _force) external onlyGovernance {
        forceMigrate = _force;
    }

    function setMinCompToSell(uint256 _minCompToSell) external management {
        minCompToSell = _minCompToSell;
    }

    function setMinWant(uint256 _minWant) external management {
        minWant = _minWant;
    }

    function updateMarketId() external management {
        _setMarketIdFromTokenAddress();
    }

    function setCollateralTarget(uint256 _collateralTarget) external management {
        (, uint256 collateralFactorMantissa, ) = compound.markets(address(cToken));
        require(collateralFactorMantissa > _collateralTarget, "!dangerous collateral");
        collateralTarget = _collateralTarget;
    }

    /*
     * Base External Facing Functions
     */
    /*
     * An accurate estimate for the total amount of assets (principle + return)
     * that this strategy is currently managing, denominated in terms of want tokens.
     */
    function estimatedTotalAssets() public override view returns (uint256) {
        (uint256 deposits, uint256 borrows) = getCurrentPosition();

        uint256 _claimableComp = predictCompAccrued();
        uint256 currentComp = IERC20(comp).balanceOf(address(this));

        // Use touch price. it doesnt matter if we are wrong as this is not used for decision making
        uint256 estimatedWant =  priceCheck(comp, address(want),_claimableComp.add(currentComp));
        uint256 conservativeWant = estimatedWant.mul(9).div(10); //10% pessimist

        return want.balanceOf(address(this)).add(deposits).add(conservativeWant).sub(borrows);
    }

    //predicts our profit at next report
    function expectedReturn() public view returns (uint256) {
        uint256 estimateAssets = estimatedTotalAssets();

        uint256 debt = vault.strategies(address(this)).totalDebt;
        if (debt > estimateAssets) {
            return 0;
        } else {
            return estimateAssets - debt;
        }
    }

    /*
     * Provide a signal to the keeper that `tend()` should be called.
     * (keepers are always reimbursed by yEarn)
     *
     * NOTE: this call and `harvestTrigger` should never return `true` at the same time.
     * tendTrigger should be called with same gasCost as harvestTrigger
     */
    function tendTrigger(uint256 gasCost) public override view returns (bool) {
        if (harvestTrigger(gasCost)) {
            //harvest takes priority
            return false;
        }

        if (getblocksUntilLiquidation() <= blocksToLiquidationDangerZone) {
            return true;
        }
    }

    /*
     * Provide a signal to the keeper that `harvest()` should be called.
     * gasCost is expected_gas_use * gas_price
     * (keepers are always reimbursed by yEarn)
     *
     * NOTE: this call and `tendTrigger` should never return `true` at the same time.
     */
    function harvestTrigger(uint256 gasCost) public override view returns (bool) {
        
        StrategyParams memory params = vault.strategies(address(this));

        // Should not trigger if strategy is not activated
        if (params.activation == 0) return false;


        uint256 wantGasCost = priceCheck(weth, address(want), gasCost);
        uint256 compGasCost = priceCheck(weth, comp, gasCost);

        // after enough comp has accrued we want the bot to run
        uint256 _claimableComp = predictCompAccrued();

        if (_claimableComp > minCompToSell) {
            // check value of COMP in wei
            if ( _claimableComp.add(IERC20(comp).balanceOf(address(this))) > compGasCost.mul(profitFactor)) {
                return true;
            }
        }


        // Should trigger if hadn't been called in a while
        if (block.timestamp.sub(params.lastReport) >= maxReportDelay) return true;

        //check if vault wants lots of money back
        // dont return dust
        uint256 outstanding = vault.debtOutstanding();
        if (outstanding > profitFactor.mul(wantGasCost)) return true;

        // Check for profits and losses
        uint256 total = estimatedTotalAssets();

        uint256 profit = 0;
        if (total > params.totalDebt) profit = total.sub(params.totalDebt); // We've earned a profit!

        uint256 credit = vault.creditAvailable().add(profit);
        return (profitFactor.mul(wantGasCost) < credit);
    }

    //WARNING. manipulatable and simple routing. Only use for safe functions
    function priceCheck(address start, address end, uint256 _amount) public view returns (uint256) {
        if (_amount == 0) {
            return 0;
        }
        address[] memory path;
        if(start == weth){
            path = new address[](2);
            path[0] = weth;
            path[1] = end;
        }else{
            path = new address[](3);
            path[0] = start; 
            path[1] = weth; 
            path[2] = end;
        }
 
        uint256[] memory amounts = IUni(uniswapRouter).getAmountsOut(_amount, path);

        return amounts[amounts.length - 1];
    }

    /*****************
     * Public non-base function
     ******************/

    //Calculate how many blocks until we are in liquidation based on current interest rates
    //WARNING does not include compounding so the estimate becomes more innacurate the further ahead we look
    //equation. Compound doesn't include compounding for most blocks
    //((deposits*colateralThreshold - borrows) / (borrows*borrowrate - deposits*colateralThreshold*interestrate));
    function getblocksUntilLiquidation() public view returns (uint256) {
        (, uint256 collateralFactorMantissa, ) = compound.markets(address(cToken));

        (uint256 deposits, uint256 borrows) = getCurrentPosition();

        uint256 borrrowRate = cToken.borrowRatePerBlock();

        uint256 supplyRate = cToken.supplyRatePerBlock();

        uint256 collateralisedDeposit1 = deposits.mul(collateralFactorMantissa).div(1e18);
        uint256 collateralisedDeposit = collateralisedDeposit1;

        uint256 denom1 = borrows.mul(borrrowRate);
        uint256 denom2 = collateralisedDeposit.mul(supplyRate);

        if (denom2 >= denom1) {
            return uint256(-1);
        } else {
            uint256 numer = collateralisedDeposit.sub(borrows);
            uint256 denom = denom1 - denom2;
            //minus 1 for this block
            return numer.mul(1e18).div(denom);
        }
    }

    // This function makes a prediction on how much comp is accrued
    // It is not 100% accurate as it uses current balances in Compound to predict into the past
    function predictCompAccrued() public view returns (uint256) {
        (uint256 deposits, uint256 borrows) = getCurrentPosition();
        if (deposits == 0) {
            return 0; // should be impossible to have 0 balance and positive comp accrued
        }

        //comp speed is amount to borrow or deposit (so half the total distribution for want)
        uint256 distributionPerBlock = compound.compSpeeds(address(cToken));

        uint256 totalBorrow = cToken.totalBorrows();

        //total supply needs to be echanged to underlying using exchange rate
        uint256 totalSupplyCtoken = cToken.totalSupply();
        uint256 totalSupply = totalSupplyCtoken.mul(cToken.exchangeRateStored()).div(1e18);

        uint256 blockShareSupply = 0;
        if(totalSupply > 0){
            blockShareSupply = deposits.mul(distributionPerBlock).div(totalSupply);
        }
        
        uint256 blockShareBorrow = 0;
        if(totalBorrow > 0){
            blockShareBorrow = borrows.mul(distributionPerBlock).div(totalBorrow);
        }
        
        //how much we expect to earn per block
        uint256 blockShare = blockShareSupply.add(blockShareBorrow);

        //last time we ran harvest
        uint256 lastReport = vault.strategies(address(this)).lastReport;
        uint256 blocksSinceLast= (block.timestamp.sub(lastReport)).div(13); //roughly 13 seconds per block

        return blocksSinceLast.mul(blockShare);
    }

    //Returns the current position
    //WARNING - this returns just the balance at last time someone touched the cToken token. Does not accrue interst in between
    //cToken is very active so not normally an issue.
    function getCurrentPosition() public view returns (uint256 deposits, uint256 borrows) {
        (, uint256 ctokenBalance, uint256 borrowBalance, uint256 exchangeRate) = cToken.getAccountSnapshot(address(this));
        borrows = borrowBalance;

        deposits = ctokenBalance.mul(exchangeRate).div(1e18);
    }

    //statechanging version
    function getLivePosition() public returns (uint256 deposits, uint256 borrows) {
        deposits = cToken.balanceOfUnderlying(address(this));

        //we can use non state changing now because we updated state with balanceOfUnderlying call
        borrows = cToken.borrowBalanceStored(address(this));
    }

    //Same warning as above
    function netBalanceLent() public view returns (uint256) {
        (uint256 deposits, uint256 borrows) = getCurrentPosition();
        return deposits.sub(borrows);
    }

    /***********
     * internal core logic
     *********** */
    /*
     * A core method.
     * Called at beggining of harvest before providing report to owner
     * 1 - claim accrued comp
     * 2 - if enough to be worth it we sell
     * 3 - because we lose money on our loans we need to offset profit from comp.
     */
    function prepareReturn(uint256 _debtOutstanding)
        internal
        override
        returns (
            uint256 _profit,
            uint256 _loss,
            uint256 _debtPayment
        ) {
        _profit = 0;
        _loss = 0; //for clarity. also reduces bytesize

        if (cToken.balanceOf(address(this)) == 0) {
            uint256 wantBalance = want.balanceOf(address(this));
            //no position to harvest
            //but we may have some debt to return
            //it is too expensive to free more debt in this method so we do it in adjust position
            _debtPayment = Math.min(wantBalance, _debtOutstanding); 
            return (_profit, _loss, _debtPayment);
        }
        (uint256 deposits, uint256 borrows) = getLivePosition();

        //claim comp accrued
        _claimComp();
        //sell comp
        _disposeOfComp();

        uint256 wantBalance = want.balanceOf(address(this));

        uint256 investedBalance = deposits.sub(borrows);
        uint256 balance = investedBalance.add(wantBalance);

        uint256 debt = vault.strategies(address(this)).totalDebt;

        //Balance - Total Debt is profit
        if (balance > debt) {
            _profit = balance - debt;

            if (wantBalance < _profit) {
                //all reserve is profit                
                _profit = wantBalance;
            } else if (wantBalance > _profit.add(_debtOutstanding)){
                _debtPayment = _debtOutstanding;
            }else{
                _debtPayment = wantBalance - _profit;
            }
        } else {
            //we will lose money until we claim comp then we will make money
            //this has an unintended side effect of slowly lowering our total debt allowed
            _loss = debt - balance;
            _debtPayment = Math.min(wantBalance, _debtOutstanding);
        }
    }

    /*
     * Second core function. Happens after report call.
     *
     * Similar to deposit function from V1 strategy
     */

    function adjustPosition(uint256 _debtOutstanding) internal override {
        //emergency exit is dealt with in prepareReturn
        if (emergencyExit) {
            return;
        }

        //we are spending all our cash unless we have debt outstanding
        uint256 _wantBal = want.balanceOf(address(this));
        if(_wantBal < _debtOutstanding){
            //this is graceful withdrawal. dont use backup
            //we use more than 1 because withdrawunderlying causes problems with 1 token due to different decimals
            if(cToken.balanceOf(address(this)) > 1){ 
                _withdrawSome(_debtOutstanding - _wantBal);
            }

            return;
        }
        
        (uint256 position, bool deficit) = _calculateDesiredPosition(_wantBal - _debtOutstanding, true);
        
        //if we are below minimun want change it is not worth doing
        //need to be careful in case this pushes to liquidation
        if (position > minWant) {
            //if dydx is not active we just try our best with basic leverage
            if (!DyDxActive) {
                uint i = 0;
                while(position > 0){
                    position = position.sub(_noFlashLoan(position, deficit));
                    if(i >= 6){
                        break;
                    }
                    i++;
                }
            } else {
                //if there is huge position to improve we want to do normal leverage. it is quicker
                if (position > want.balanceOf(SOLO)) {
                    position = position.sub(_noFlashLoan(position, deficit));
                }

                //flash loan to position
                if(position > minWant){
                    doDyDxFlashLoan(deficit, position);
                }

            }
        }
    }

    /*************
     * Very important function
     * Input: amount we want to withdraw and whether we are happy to pay extra for Aave.
     *       cannot be more than we have
     * Returns amount we were able to withdraw. notall if user has some balance left
     *
     * Deleverage position -> redeem our cTokens
     ******************** */
    function _withdrawSome(uint256 _amount) internal returns (bool notAll) {
        (uint256 position, bool deficit) = _calculateDesiredPosition(_amount, false);

        //If there is no deficit we dont need to adjust position
        //if the position change is tiny do nothing
        if (deficit && position > minWant) {
            //we do a flash loan to give us a big gap. from here on out it is cheaper to use normal deleverage. Use Aave for extremely large loans
            if (DyDxActive) {
                position = position.sub(doDyDxFlashLoan(deficit, position));
            }

            uint8 i = 0;
            //position will equal 0 unless we haven't been able to deleverage enough with flash loan
            //if we are not in deficit we dont need to do flash loan
            while (position > minWant.add(100)) {
                position = position.sub(_noFlashLoan(position, true));
                i++;

                //A limit set so we don't run out of gas
                if (i >= 5) {
                    notAll = true;
                    break;
                }
            }
        }

        //now withdraw
        //if we want too much we just take max

        //This part makes sure our withdrawal does not force us into liquidation
        (uint256 depositBalance, uint256 borrowBalance) = getCurrentPosition();

        uint256 tempColla = collateralTarget;

        uint256 reservedAmount = 0;
        if(tempColla == 0){
            tempColla = 1e15; // 0.001 * 1e18. lower we have issues
        } 
        
        reservedAmount = borrowBalance.mul(1e18).div(tempColla);

        if(depositBalance >= reservedAmount){
            uint256 redeemable = depositBalance.sub(reservedAmount);

            if (redeemable < _amount) {
                cToken.redeemUnderlying(redeemable);
            
            } else {
                cToken.redeemUnderlying(_amount);
            }
        }
       
        if(collateralTarget == 0 && want.balanceOf(address(this)) > borrowBalance){
            cToken.repayBorrow(borrowBalance);
        }

        //let's sell some comp if we have more than needed
        //flash loan would have sent us comp if we had some accrued so we don't need to call claim comp
        _disposeOfComp();
    }

    /***********
     *  This is the main logic for calculating how to change our lends and borrows
     *  Input: balance. The net amount we are going to deposit/withdraw.
     *  Input: dep. Is it a deposit or withdrawal
     *  Output: position. The amount we want to change our current borrow position.
     *  Output: deficit. True if we are reducing position size
     *
     *  For instance deficit =false, position 100 means increase borrowed balance by 100
     ****** */
    function _calculateDesiredPosition(uint256 balance, bool dep) internal returns (uint256 position, bool deficit) {
        //we want to use statechanging for safety
        (uint256 deposits, uint256 borrows) = getLivePosition();

        //When we unwind we end up with the difference between borrow and supply
        uint256 unwoundDeposit = deposits.sub(borrows);

        //we want to see how close to collateral target we are.
        //So we take our unwound deposits and add or remove the balance we are are adding/removing.
        //This gives us our desired future undwoundDeposit (desired supply)

        uint256 desiredSupply = 0;
        if (dep) {
            desiredSupply = unwoundDeposit.add(balance);
        } else { 
            if(balance > unwoundDeposit) balance = unwoundDeposit;
            desiredSupply = unwoundDeposit.sub(balance);
        }

        //(ds *c)/(1-c)
        uint256 num = desiredSupply.mul(collateralTarget);
        uint256 den = uint256(1e18).sub(collateralTarget);

        uint256 desiredBorrow = num.div(den);
        if (desiredBorrow > 1e5) {
            //stop us going right up to the wire
            desiredBorrow = desiredBorrow - 1e5;
        }

        //now we see if we want to add or remove balance
        // if the desired borrow is less than our current borrow we are in deficit. so we want to reduce position
        if (desiredBorrow < borrows) {
            deficit = true;
            position = borrows - desiredBorrow; //safemath check done in if statement
        } else {
            //otherwise we want to increase position
            deficit = false;
            position = desiredBorrow - borrows;
        }
    }

    /*
     * Liquidate as many assets as possible to `want`, irregardless of slippage,
     * up to `_amount`. Any excess should be re-invested here as well.
     */
    function liquidatePosition(uint256 _amountNeeded) internal override returns (uint256 _amountFreed, uint256 _loss) {
        uint256 _balance = want.balanceOf(address(this));
        uint256 assets = netBalanceLent().add(_balance);

        uint256 debtOutstanding = vault.debtOutstanding();

        if(debtOutstanding > assets){
            _loss = debtOutstanding - assets;
        }

        if (assets < _amountNeeded) {

            //if we cant afford to withdraw we take all we can
            //withdraw all we can
            (uint256 deposits, uint256 borrows) = getLivePosition();

            //1 token causes rounding error with withdrawUnderlying
            if(cToken.balanceOf(address(this)) > 1){ 
                _withdrawSome(deposits.sub(borrows));
            }

            _amountFreed = Math.min(_amountNeeded, want.balanceOf(address(this)));
           
        } else {
            if (_balance < _amountNeeded) {
                _withdrawSome(_amountNeeded.sub(_balance));

                //overflow error if we return more than asked for
                _amountFreed = Math.min(_amountNeeded, want.balanceOf(address(this)));
            }else{
                _amountFreed = _amountNeeded;
            }
        }
    }

    function _claimComp() internal {
        CTokenI[] memory tokens = new CTokenI[](1);
        tokens[0] = cToken;

        compound.claimComp(address(this), tokens);
    }

    //sell comp function
    function _disposeOfComp() internal {
        uint256 _comp = IERC20(comp).balanceOf(address(this));

        if (_comp > minCompToSell) {
            address[] memory path = new address[](3);
            path[0] = comp;
            path[1] = weth;
            path[2] = address(want);

            IUni(uniswapRouter).swapExactTokensForTokens(_comp, uint256(0), path, address(this), now);
        }
    }

    //lets leave
    //if we can't deleverage in one go set collateralFactor to 0 and call harvest multiple times until delevered
    function prepareMigration(address _newStrategy) internal override {

        if(!forceMigrate){
            (uint256 deposits, uint256 borrows) = getLivePosition();
            _withdrawSome(deposits.sub(borrows));

            (, , uint256 borrowBalance, ) = cToken.getAccountSnapshot(address(this));

            require(borrowBalance < 10_000, "DELEVERAGE_FIRST");

            IERC20 _comp = IERC20(comp);
            uint _compB = _comp.balanceOf(address(this));
            if(_compB > 0){
                _comp.safeTransfer(_newStrategy, _compB);
            }
        }
        
    }

    //Three functions covering normal leverage and deleverage situations
    // max is the max amount we want to increase our borrowed balance
    // returns the amount we actually did
    function _noFlashLoan(uint256 max, bool deficit) internal returns (uint256 amount) {
        //we can use non-state changing because this function is always called after _calculateDesiredPosition
        (uint256 lent, uint256 borrowed) = getCurrentPosition();

        //if we have nothing borrowed then we can't deleverage any more
        if (borrowed == 0 && deficit) {
            return 0;
        }

        (, uint256 collateralFactorMantissa, ) = compound.markets(address(cToken));

        if (deficit) {
            amount = _normalDeleverage(max, lent, borrowed, collateralFactorMantissa);
        } else {
            amount = _normalLeverage(max, lent, borrowed, collateralFactorMantissa);
        }

        emit Leverage(max, amount, deficit, address(0));
    }

    //maxDeleverage is how much we want to reduce by
    function _normalDeleverage(
        uint256 maxDeleverage,
        uint256 lent,
        uint256 borrowed,
        uint256 collatRatio
    ) internal returns (uint256 deleveragedAmount) {
        uint256 theoreticalLent = 0;

        //collat ration should never be 0. if it is something is very wrong... but just incase
        if(collatRatio != 0){
            theoreticalLent = borrowed.mul(1e18).div(collatRatio);
        }
        deleveragedAmount = lent.sub(theoreticalLent);

        if (deleveragedAmount >= borrowed) {
            deleveragedAmount = borrowed;
        }
        if (deleveragedAmount >= maxDeleverage) {
            deleveragedAmount = maxDeleverage;
        }
        uint256 exchangeRateStored = cToken.exchangeRateStored();
        //redeemTokens = redeemAmountIn *1e18 / exchangeRate. must be more than 0
        //a rounding error means we need another small addition
        if(deleveragedAmount.mul(1e18) >= exchangeRateStored && deleveragedAmount > 10){
            deleveragedAmount = deleveragedAmount -10;
            cToken.redeemUnderlying(deleveragedAmount);

            //our borrow has been increased by no more than maxDeleverage
            cToken.repayBorrow(deleveragedAmount);
        }
    }

    //maxDeleverage is how much we want to increase by
    function _normalLeverage(
        uint256 maxLeverage,
        uint256 lent,
        uint256 borrowed,
        uint256 collatRatio
    ) internal returns (uint256 leveragedAmount) {
        uint256 theoreticalBorrow = lent.mul(collatRatio).div(1e18);

        leveragedAmount = theoreticalBorrow.sub(borrowed);

        if (leveragedAmount >= maxLeverage) {
            leveragedAmount = maxLeverage;
        }
        if(leveragedAmount > 10){
            leveragedAmount = leveragedAmount -10;
            cToken.borrow(leveragedAmount);
            cToken.mint(want.balanceOf(address(this)));
        }

    }

    //called by flash loan
    function _loanLogic(
        bool deficit,
        uint256 amount
    ) internal {
        uint256 bal = want.balanceOf(address(this));
        require(bal >= amount, "FLASH_FAILED"); // to stop malicious calls

        //if in deficit we repay amount and then withdraw
        if (deficit) {
            cToken.repayBorrow(amount);

            //if we are withdrawing we take more to cover fee
            cToken.redeemUnderlying(amount.add(2));
        } else {
            //check if this failed incase we borrow into liquidation
            require(cToken.mint(bal) == 0, "mint error");
            //borrow more to cover fee
            // fee is so low for dydx that it does not effect our liquidation risk.
            //DONT USE FOR AAVE
            cToken.borrow(amount.add(2));
        }
    }

    //emergency function that we can use to deleverage manually if something is broken
    function manualDeleverage(uint256 amount) external management{
        require(cToken.redeemUnderlying(amount) == 0, "failed redeem");
        require(cToken.repayBorrow(amount) == 0, "failed repay borrow");
    }
    //emergency function that we can use to deleverage manually if something is broken
    function manualReleaseWant(uint256 amount) external onlyGovernance{
        require(cToken.redeemUnderlying(amount) ==0, "failed redeem");
    }

    function protectedTokens() internal override view returns (address[] memory) {

        //want is protected automatically
        address[] memory protected = new address[](0);
        return protected;
    }

    /******************
     * Flash loan stuff
     ****************/

    // Flash loan DXDY
    // amount desired is how much we are willing for position to change
    function doDyDxFlashLoan(bool deficit, uint256 amountDesired) internal returns (uint256) {
        if(amountDesired == 0){
            return 0;
        }
        uint256 amount = amountDesired;
        ISoloMargin solo = ISoloMargin(SOLO);
        
        // Not enough want in DyDx. So we take all we can
        uint256 amountInSolo = want.balanceOf(SOLO);

        if (amountInSolo < amount) {
            amount = amountInSolo;
        }

        bytes memory data = abi.encode(deficit, amount);

        // 1. Withdraw $
        // 2. Call callFunction(...)
        // 3. Deposit back $
        Actions.ActionArgs[] memory operations = new Actions.ActionArgs[](3);

        operations[0] = _getWithdrawAction(dyDxMarketId, amount);
        operations[1] = _getCallAction(
            // Encode custom data for callFunction
            data
        );
        operations[2] = _getDepositAction(dyDxMarketId, amount.add(2));

        Account.Info[] memory accountInfos = new Account.Info[](1);
        accountInfos[0] = _getAccountInfo();

        solo.operate(accountInfos, operations);

        emit Leverage(amountDesired, amount, deficit, SOLO);

        return amount;
    }

    //returns our current collateralisation ratio. Should be compared with collateralTarget
    function storedCollateralisation() public view returns (uint256 collat) {
        (uint256 lend, uint256 borrow) = getCurrentPosition();
        if (lend == 0) {
            return 0;
        }
        collat = uint256(1e18).mul(borrow).div(lend);
    }

    //DyDx calls this function after doing flash loan
    function callFunction(
        address sender,
        Account.Info memory account,
        bytes memory data
    ) public override {
        (bool deficit, uint256 amount) = abi.decode(data, (bool, uint256));
        require(msg.sender == SOLO, "NOT_SOLO");
        require(sender == address(this));

        _loanLogic(deficit, amount);
       
    }
    
    // -- Internal Helper functions -- //

    function _setMarketIdFromTokenAddress() internal {
        ISoloMargin solo = ISoloMargin(SOLO);

        uint256 numMarkets = solo.getNumMarkets();

        address curToken;
        for (uint256 i = 0; i < numMarkets; i++) {
            curToken = solo.getMarketTokenAddress(i);

            if (curToken == address(want)) {
                dyDxMarketId = i;
                return;
            }
        }

        revert("No marketId found for provided token");
    }

    modifier management(){
        require(msg.sender == governance() || msg.sender == strategist, "!management");
        _;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_cToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"EmergencyExitEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"profit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loss","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"debtPayment","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"debtOutstanding","type":"uint256"}],"name":"Harvested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountRequested","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountGiven","type":"uint256"},{"indexed":false,"internalType":"bool","name":"deficit","type":"bool"},{"indexed":false,"internalType":"address","name":"flashLoan","type":"address"}],"name":"Leverage","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"debtThreshold","type":"uint256"}],"name":"UpdatedDebtThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newKeeper","type":"address"}],"name":"UpdatedKeeper","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"profitFactor","type":"uint256"}],"name":"UpdatedProfitFactor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"delay","type":"uint256"}],"name":"UpdatedReportDelay","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"rewards","type":"address"}],"name":"UpdatedRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newStrategist","type":"address"}],"name":"UpdatedStrategist","type":"event"},{"inputs":[],"name":"DyDxActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"apiVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"blocksToLiquidationDangerZone","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cToken","outputs":[{"internalType":"contract CErc20I","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"number","type":"uint256"}],"internalType":"struct Account.Info","name":"account","type":"tuple"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"callFunction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collateralTarget","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"comp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"compound","outputs":[{"internalType":"contract ComptrollerI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debtThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delegatedAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dyDxMarketId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyExit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"estimatedTotalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"expectedReturn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forceMigrate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPosition","outputs":[{"internalType":"uint256","name":"deposits","type":"uint256"},{"internalType":"uint256","name":"borrows","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLivePosition","outputs":[{"internalType":"uint256","name":"deposits","type":"uint256"},{"internalType":"uint256","name":"borrows","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getblocksUntilLiquidation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"gasCost","type":"uint256"}],"name":"harvestTrigger","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keeper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"manualDeleverage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"manualReleaseWant","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxReportDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newStrategy","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minCompToSell","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minWant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"netBalanceLent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"predictCompAccrued","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"start","type":"address"},{"internalType":"address","name":"end","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"priceCheck","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"profitFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collateralTarget","type":"uint256"}],"name":"setCollateralTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_debtThreshold","type":"uint256"}],"name":"setDebtThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_dydx","type":"bool"}],"name":"setDyDx","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setEmergencyExit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_force","type":"bool"}],"name":"setForceMigrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_keeper","type":"address"}],"name":"setKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_delay","type":"uint256"}],"name":"setMaxReportDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minCompToSell","type":"uint256"}],"name":"setMinCompToSell","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minWant","type":"uint256"}],"name":"setMinWant","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_profitFactor","type":"uint256"}],"name":"setProfitFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewards","type":"address"}],"name":"setRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategist","type":"address"}],"name":"setStrategist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"storedCollateralisation","outputs":[{"internalType":"uint256","name":"collat","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"strategist","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tend","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"gasCost","type":"uint256"}],"name":"tendTrigger","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"updateMarketId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract VaultAPI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"want","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountNeeded","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"_loss","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103835760003560e01c8063748747e6116101de578063c7b9d5301161010f578063ec38a862116100ad578063f69e20461161007c578063f69e204614610659578063f7c99bea14610661578063fbfa77cf14610669578063fcf2d0ad1461067157610383565b8063ec38a86214610618578063ed882c2b1461062b578063efbb5cb01461063e578063f017c92f1461064657610383565b8063ce5494bb116100e9578063ce5494bb146105e2578063d3406abd146105f5578063db2fd745146105fd578063e00425a31461061057610383565b8063c7b9d530146105bf578063cb1965dd146105d2578063ccce1d7f146105da57610383565b806391397ab41161017c5780639ec5a894116101565780639ec5a8941461059f578063a2344974146105a7578063aced1661146105af578063c1bb4b54146105b757610383565b806391397ab4146105715780639a561fbf146105845780639be8ef141461059757610383565b806389be318a116101b857806389be318a1461053b5780638b4187131461054e5780638cdfe166146105615780638e6350e21461056957610383565b8063748747e614610518578063775d35e51461052b578063853e0a3b1461053357610383565b80632e1a7d4d116102b8578063440368a3116102565780635641ec03116102305780635641ec03146104ed578063650d1880146104f557806369e527da14610508578063735de9f71461051057610383565b8063440368a3146104ca5780634641257d146104d257806354f809e3146104da57610383565b80633631ad5f116102925780633631ad5f14610486578063396794cd146104995780633fc8cef3146104ac578063418f35cc146104b457610383565b80632e1a7d4d1461044d5780633042087c14610460578063341b3eb91461047357610383565b80631d12f28b11610325578063205409d3116102ff578063205409d31461042d57806322f3e2d414610435578063258294101461043d57806328b7ccf71461044557610383565b80631d12f28b146104155780631f1fcd511461041d5780631fe4a6861461042557610383565b806306fdde031161036157806306fdde03146103c35780630ee08f7b146103d85780630f969b87146103ed578063109d0af81461040057610383565b806301681a62146103885780630268ff0b1461039d57806304324af8146103bb575b600080fd5b61039b610396366004614e49565b610679565b005b6103a5610883565b6040516103b29190615813565b60405180910390f35b6103a56108a7565b6103cb6108ad565b6040516103b29190615461565b6103e06108e4565b6040516103b29190615446565b61039b6103fb366004615131565b6108ed565b61040861097a565b6040516103b29190615290565b6103a5610992565b610408610998565b6104086109a7565b6103a56109b6565b6103e06109bc565b6103cb610a5a565b6103a5610a79565b6103a561045b366004615131565b610a7f565b61039b61046e366004615131565b610b45565b61039b610481366004615018565b610cdb565b61039b610494366004615131565b610d3b565b61039b6104a7366004615131565b610d8d565b610408610e68565b6104bc610e80565b6040516103b2929190615835565b61039b610f46565b61039b61102d565b61039b6104e8366004615018565b61125c565b6103e06112ae565b6103e0610503366004615131565b6112b7565b6104086112e8565b6104086112fc565b61039b610526366004614e49565b611314565b6104bc6113bf565b6103a56114d6565b6103a5610549366004614e81565b611723565b61039b61055c366004614ec1565b611964565b6103a56119d9565b6103a56119df565b61039b61057f366004615131565b6119e4565b61039b610592366004615131565b611a66565b6103a5611b77565b610408611bb2565b61039b611bc1565b610408611c16565b6103a5611c25565b61039b6105cd366004614e49565b611c2b565b6103e0611cd6565b6103a5611ce4565b61039b6105f0366004614e49565b611cea565b6103a5611eca565b61039b61060b366004615131565b611f7e565b6103a5611fd0565b61039b610626366004614e49565b61233e565b6103e0610639366004615131565b6123c6565b6103a5612750565b61039b610654366004615131565b6128ad565b61040861292f565b6103a5612947565b61040861294d565b61039b61295c565b610681612b4b565b6001600160a01b0316336001600160a01b0316146106ba5760405162461bcd60e51b81526004016106b190615704565b60405180910390fd5b6004546001600160a01b03828116911614156106e85760405162461bcd60e51b81526004016106b190615499565b6000546001600160a01b03828116911614156107165760405162461bcd60e51b81526004016106b190615614565b6060610720612bd2565b905060005b815181101561077b5781818151811061073a57fe5b60200260200101516001600160a01b0316836001600160a01b031614156107735760405162461bcd60e51b81526004016106b190615773565b600101610725565b50816001600160a01b031663a9059cbb610793612b4b565b6040516370a0823160e01b81526001600160a01b038616906370a08231906107bf903090600401615290565b60206040518083038186803b1580156107d757600080fd5b505afa1580156107eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080f9190615149565b6040518363ffffffff1660e01b815260040161082c9291906152a4565b602060405180830381600087803b15801561084657600080fd5b505af115801561085a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087e9190615034565b505050565b6000806000610890610e80565b909250905061089f8282612be4565b925050505b90565b600c5481565b60408051808201909152601a81527f537472617465677947656e657269634c6576436f6d704661726d000000000000602082015290565b600d5460ff1681565b6001546001600160a01b031633148061091e5750610909612b4b565b6001600160a01b0316336001600160a01b0316145b61093a5760405162461bcd60e51b81526004016106b190615704565b60078190556040517fa68ba126373d04c004c5748c300c9fca12bd444b3d4332e261f3bd2bac4a86009061096f908390615813565b60405180910390a150565b73c00e94cb662c3520282e6f5717214004a7f2688881565b60075481565b6004546001600160a01b031681565b6001546001600160a01b031681565b600b5481565b600080546040516339ebf82360e01b815282916001600160a01b0316906339ebf823906109ed903090600401615290565b6101006040518083038186803b158015610a0657600080fd5b505afa158015610a1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3e91906150bf565b604001511180610a5557506000610a53612750565b115b905090565b6040805180820190915260058152640302e332e360dc1b602082015290565b60055481565b600080546001600160a01b03163314610aaa5760405162461bcd60e51b81526004016106b1906155b0565b6000610ab583612c2f565b6004805460405163a9059cbb60e01b81529295509293506001600160a01b039092169163a9059cbb91610aec9133918691016152a4565b602060405180830381600087803b158015610b0657600080fd5b505af1158015610b1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3e9190615034565b5050919050565b610b4d612b4b565b6001600160a01b0316336001600160a01b03161480610b7657506001546001600160a01b031633145b610b925760405162461bcd60e51b81526004016106b1906156df565b60085460405163852a12e360e01b81526101009091046001600160a01b03169063852a12e390610bc6908490600401615813565b602060405180830381600087803b158015610be057600080fd5b505af1158015610bf4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c189190615149565b15610c355760405162461bcd60e51b81526004016106b1906154ef565b60085460405163073a938160e11b81526101009091046001600160a01b031690630e75270290610c69908490600401615813565b602060405180830381600087803b158015610c8357600080fd5b505af1158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb9190615149565b15610cd85760405162461bcd60e51b81526004016106b1906156b2565b50565b610ce3612b4b565b6001600160a01b0316336001600160a01b03161480610d0c57506001546001600160a01b031633145b610d285760405162461bcd60e51b81526004016106b1906156df565b600d805460ff1916911515919091179055565b610d43612b4b565b6001600160a01b0316336001600160a01b03161480610d6c57506001546001600160a01b031633145b610d885760405162461bcd60e51b81526004016106b1906156df565b600b55565b610d95612b4b565b6001600160a01b0316336001600160a01b031614610dc55760405162461bcd60e51b81526004016106b190615704565b60085460405163852a12e360e01b81526101009091046001600160a01b03169063852a12e390610df9908490600401615813565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190615149565b15610cd85760405162461bcd60e51b81526004016106b1906154ef565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6008546040516361bfb47160e11b8152600091829182918291829161010090046001600160a01b03169063c37f68e290610ebe903090600401615290565b60806040518083038186803b158015610ed657600080fd5b505afa158015610eea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0e9190615161565b93509350935050819350610f3d670de0b6b3a7640000610f378386612f0590919063ffffffff16565b90612f3f565b94505050509091565b6003546001600160a01b0316331480610f6957506001546001600160a01b031633145b80610f8c5750610f77612b4b565b6001600160a01b0316336001600160a01b0316145b610fa85760405162461bcd60e51b81526004016106b190615704565b6000546040805163bf3759b560e01b8152905161102b926001600160a01b03169163bf3759b5916004808301926020929190829003018186803b158015610fee57600080fd5b505afa158015611002573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110269190615149565b612f81565b565b6003546001600160a01b031633148061105057506001546001600160a01b031633145b80611073575061105e612b4b565b6001600160a01b0316336001600160a01b0316145b61108f5760405162461bcd60e51b81526004016106b190615704565b60008060008060009054906101000a90046001600160a01b03166001600160a01b031663bf3759b56040518163ffffffff1660e01b815260040160206040518083038186803b1580156110e157600080fd5b505afa1580156110f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111199190615149565b60085490915060009060ff161561116f576000611134612750565b905061114d8382116111465783611148565b815b612c2f565b9450915082821115611169576111638284612be4565b94508291505b50611180565b611178826131e9565b919550935090505b6000546040516328766ebf60e21b81526001600160a01b039091169063a1d9bafc906111b4908790879086906004016158a5565b602060405180830381600087803b1580156111ce57600080fd5b505af11580156111e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112069190615149565b91506112106134b8565b61121982612f81565b7f4c0f499ffe6befa0ca7c826b0916cf87bea98de658013e76938489368d60d5098484838560405161124e94939291906158bb565b60405180910390a150505050565b611264612b4b565b6001600160a01b0316336001600160a01b0316146112945760405162461bcd60e51b81526004016106b190615704565b600d80549115156101000261ff0019909216919091179055565b60085460ff1681565b60006112c2826123c6565b156112cf575060006112e3565b600a546112da6114d6565b116112e3575060015b919050565b60085461010090046001600160a01b031681565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b6001546001600160a01b03163314806113455750611330612b4b565b6001600160a01b0316336001600160a01b0316145b6113615760405162461bcd60e51b81526004016106b190615704565b6001600160a01b03811661137457600080fd5b600380546001600160a01b0319166001600160a01b0383161790556040517f2f202ddb4a2e345f6323ed90f8fc8559d770a7abbbeee84dde8aca3351fe71549061096f908390615290565b600854604051633af9e66960e01b815260009182916101009091046001600160a01b031690633af9e669906113f8903090600401615290565b602060405180830381600087803b15801561141257600080fd5b505af1158015611426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144a9190615149565b6008546040516395dd919360e01b815291935061010090046001600160a01b0316906395dd919390611480903090600401615290565b60206040518083038186803b15801561149857600080fd5b505afa1580156114ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d09190615149565b90509091565b600854604051638e8f294b60e01b81526000918291733d9819210a31b4961b30ef54be2aed79b9c9cd3b91638e8f294b916115229161010090046001600160a01b031690600401615290565b60606040518083038186803b15801561153a57600080fd5b505afa15801561154e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611572919061507d565b50915050600080611581610e80565b915091506000600860019054906101000a90046001600160a01b03166001600160a01b031663f8f9da286040518163ffffffff1660e01b815260040160206040518083038186803b1580156115d557600080fd5b505afa1580156115e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160d9190615149565b90506000600860019054906101000a90046001600160a01b03166001600160a01b031663ae9d70b06040518163ffffffff1660e01b815260040160206040518083038186803b15801561165f57600080fd5b505afa158015611673573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116979190615149565b905060006116b1670de0b6b3a7640000610f378789612f05565b90508060006116c08686612f05565b905060006116ce8386612f05565b90508181106116ea5760001999505050505050505050506108a4565b60006116f68489612be4565b905081830361171181610f3784670de0b6b3a7640000612f05565b9b5050505050505050505050506108a4565b6000816117325750600061195d565b60606001600160a01b03851673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214156117ee57604080516002808252606082018352909160208301908036833701905050905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160008151811061179b57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505083816001815181106117c957fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506118ae565b604080516003808252608082019092529060208201606080368337019050509050848160008151811061181d57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160018151811061185f57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050838160028151811061188d57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b60405163d06ca61f60e01b8152606090737a250d5630b4cf539739df2c5dacb4c659f2488d9063d06ca61f906118ea908790869060040161581c565b60006040518083038186803b15801561190257600080fd5b505afa158015611916573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261193e9190810190614f88565b90508060018251038151811061195057fe5b6020026020010151925050505b9392505050565b6000808280602001905181019061197b9190615050565b909250905033731e0447b19bb6ecfdae1e4ae1694b0c3659614e4e146119b35760405162461bcd60e51b81526004016106b190615635565b6001600160a01b03851630146119c857600080fd5b6119d28282613577565b5050505050565b60065481565b600090565b6001546001600160a01b0316331480611a155750611a00612b4b565b6001600160a01b0316336001600160a01b0316145b611a315760405162461bcd60e51b81526004016106b190615704565b60068190556040517fd94596337df4c2f0f44d30a7fc5db1c7bb60d9aca4185ed77c6fd96eb45ec2989061096f908390615813565b611a6e612b4b565b6001600160a01b0316336001600160a01b03161480611a9757506001546001600160a01b031633145b611ab35760405162461bcd60e51b81526004016106b1906156df565b600854604051638e8f294b60e01b8152600091733d9819210a31b4961b30ef54be2aed79b9c9cd3b91638e8f294b91611afe916101009091046001600160a01b031690600401615290565b60606040518083038186803b158015611b1657600080fd5b505afa158015611b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4e919061507d565b50915050818111611b715760405162461bcd60e51b81526004016106b190615540565b50600955565b6000806000611b84610e80565b915091508160001415611b9c576000925050506108a4565b61089f82610f37670de0b6b3a764000084612f05565b6002546001600160a01b031681565b611bc9612b4b565b6001600160a01b0316336001600160a01b03161480611bf257506001546001600160a01b031633145b611c0e5760405162461bcd60e51b81526004016106b1906156df565b61102b61386f565b6003546001600160a01b031681565b60095481565b6001546001600160a01b0316331480611c5c5750611c47612b4b565b6001600160a01b0316336001600160a01b0316145b611c785760405162461bcd60e51b81526004016106b190615704565b6001600160a01b038116611c8b57600080fd5b600180546001600160a01b0319166001600160a01b0383161790556040517f352ececae6d7d1e6d26bcf2c549dfd55be1637e9b22dc0cf3b71ddb36097a6b49061096f908390615290565b600d54610100900460ff1681565b600a5481565b6000546001600160a01b0316331480611d1b5750611d06612b4b565b6001600160a01b0316336001600160a01b0316145b611d2457600080fd5b60008054906101000a90046001600160a01b03166001600160a01b0316816001600160a01b031663fbfa77cf6040518163ffffffff1660e01b815260040160206040518083038186803b158015611d7a57600080fd5b505afa158015611d8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611db29190614e65565b6001600160a01b031614611dc557600080fd5b611dce816139cb565b600480546040516370a0823160e01b81526001600160a01b039091169163a9059cbb91849184916370a0823191611e0791309101615290565b60206040518083038186803b158015611e1f57600080fd5b505afa158015611e33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e579190615149565b6040518363ffffffff1660e01b8152600401611e749291906152a4565b602060405180830381600087803b158015611e8e57600080fd5b505af1158015611ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec69190615034565b5050565b600080611ed5612750565b600080546040516339ebf82360e01b815292935090916001600160a01b03909116906339ebf82390611f0b903090600401615290565b6101006040518083038186803b158015611f2457600080fd5b505afa158015611f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5c91906150bf565b60a00151905081811115611f75576000925050506108a4565b900390506108a4565b611f86612b4b565b6001600160a01b0316336001600160a01b03161480611faf57506001546001600160a01b031633145b611fcb5760405162461bcd60e51b81526004016106b1906156df565b600c55565b6000806000611fdd610e80565b915091508160001415611ff5576000925050506108a4565b600854604051631d7b33d760e01b8152600091733d9819210a31b4961b30ef54be2aed79b9c9cd3b91631d7b33d791612040916101009091046001600160a01b031690600401615290565b60206040518083038186803b15801561205857600080fd5b505afa15801561206c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120909190615149565b90506000600860019054906101000a90046001600160a01b03166001600160a01b03166347bd37186040518163ffffffff1660e01b815260040160206040518083038186803b1580156120e257600080fd5b505afa1580156120f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211a9190615149565b90506000600860019054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561216c57600080fd5b505afa158015612180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121a49190615149565b90506000612244670de0b6b3a7640000610f37600860019054906101000a90046001600160a01b03166001600160a01b031663182df0f56040518163ffffffff1660e01b815260040160206040518083038186803b15801561220557600080fd5b505afa158015612219573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223d9190615149565b8590612f05565b90506000811561225f5761225c82610f378988612f05565b90505b600084156122785761227585610f378989612f05565b90505b60006122848383613b54565b600080546040516339ebf82360e01b815292935090916001600160a01b03909116906339ebf823906122ba903090600401615290565b6101006040518083038186803b1580156122d357600080fd5b505afa1580156122e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230b91906150bf565b6080015190506000612322600d610f374285612be4565b905061232e8184612f05565b9b50505050505050505050505090565b6001546001600160a01b031633146123685760405162461bcd60e51b81526004016106b190615474565b6001600160a01b03811661237b57600080fd5b600280546001600160a01b0319166001600160a01b0383161790556040517fafbb66abf8f3b719799940473a4052a3717cdd8e40fb6c8a3faadab316b1a0699061096f908390615290565b60006123d0614d67565b6000546040516339ebf82360e01b81526001600160a01b03909116906339ebf82390612400903090600401615290565b6101006040518083038186803b15801561241957600080fd5b505afa15801561242d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245191906150bf565b905080602001516000141561246a5760009150506112e3565b6004546000906124999073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906001600160a01b031686611723565b905060006124d073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273c00e94cb662c3520282e6f5717214004a7f2688887611723565b905060006124dc611fd0565b9050600c5481111561259b576006546124f6908390612f05565b6040516370a0823160e01b81526125889073c00e94cb662c3520282e6f5717214004a7f26888906370a0823190612531903090600401615290565b60206040518083038186803b15801561254957600080fd5b505afa15801561255d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125819190615149565b8390613b54565b111561259b5760019450505050506112e3565b60055460808501516125ae904290612be4565b106125c05760019450505050506112e3565b60008060009054906101000a90046001600160a01b03166001600160a01b031663bf3759b56040518163ffffffff1660e01b815260040160206040518083038186803b15801561260f57600080fd5b505afa158015612623573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126479190615149565b6006549091506126579085612f05565b81111561266c576001955050505050506112e3565b6000612676612750565b905060008660a001518211156126995760a0870151612696908390612be4565b90505b60006127298260008054906101000a90046001600160a01b03166001600160a01b031663112c1f9b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156126eb57600080fd5b505afa1580156126ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127239190615149565b90613b54565b90508061274188600654612f0590919063ffffffff16565b109a9950505050505050505050565b600080600061275d610e80565b91509150600061276b611fd0565b6040516370a0823160e01b815290915060009073c00e94cb662c3520282e6f5717214004a7f26888906370a08231906127a8903090600401615290565b60206040518083038186803b1580156127c057600080fd5b505afa1580156127d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127f89190615149565b60045490915060009061282e9073c00e94cb662c3520282e6f5717214004a7f26888906001600160a01b03166105498686613b54565b90506000612842600a610f37846009612f05565b600480546040516370a0823160e01b81529293506128a292889261289c928692612723928d926001600160a01b0316916370a082319161288491309101615290565b60206040518083038186803b1580156126eb57600080fd5b90612be4565b965050505050505090565b6001546001600160a01b03163314806128de57506128c9612b4b565b6001600160a01b0316336001600160a01b0316145b6128fa5760405162461bcd60e51b81526004016106b190615704565b60058190556040517f4aaf232568bff365c53cad69bdb6e83014e79df80216ceba8ee01769723dfd689061096f908390615813565b733d9819210a31b4961b30ef54be2aed79b9c9cd3b81565b600e5481565b6000546001600160a01b031681565b6001546001600160a01b031633148061298d5750612978612b4b565b6001600160a01b0316336001600160a01b0316145b6129a95760405162461bcd60e51b81526004016106b190615704565b6008805460ff19166001179055600080546040805163507257cd60e11b815290516001600160a01b039092169263a0e4af9a9260048084019382900301818387803b1580156129f757600080fd5b505af1158015612a0b573d6000803e3d6000fd5b50506040517f97e963041e952738788b9d4871d854d282065b8f90a464928d6528f2e9a4fd0b925060009150a1565b801580612ac25750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e90612a7090309086906004016152bd565b60206040518083038186803b158015612a8857600080fd5b505afa158015612a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ac09190615149565b155b612ade5760405162461bcd60e51b81526004016106b1906157bd565b61087e8363095ea7b360e01b8484604051602401612afd9291906152a4565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613b79565b6060612b438484600085613c08565b949350505050565b60008060009054906101000a90046001600160a01b03166001600160a01b0316635aa6e6756040518163ffffffff1660e01b815260040160206040518083038186803b158015612b9a57600080fd5b505afa158015612bae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a559190614e65565b60408051600081526020810190915290565b6000612c2683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613cd6565b90505b92915050565b600480546040516370a0823160e01b8152600092839283926001600160a01b03909116916370a0823191612c6591309101615290565b60206040518083038186803b158015612c7d57600080fd5b505afa158015612c91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cb59190615149565b90506000612cc582612723610883565b905060008060009054906101000a90046001600160a01b03166001600160a01b031663bf3759b56040518163ffffffff1660e01b815260040160206040518083038186803b158015612d1657600080fd5b505afa158015612d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d4e9190615149565b905081811115612d5e5781810393505b85821015612ea957600080612d716113bf565b6008546040516370a0823160e01b81529294509092506001916101009091046001600160a01b0316906370a0823190612dae903090600401615290565b60206040518083038186803b158015612dc657600080fd5b505afa158015612dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dfe9190615149565b1115612e1857612e16612e118383612be4565b613d02565b505b600480546040516370a0823160e01b8152612ea0928b926001600160a01b0316916370a0823191612e4b91309101615290565b60206040518083038186803b158015612e6357600080fd5b505afa158015612e77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e9b9190615149565b614028565b96505050612efd565b85831015612ef957612ebe612e118785612be4565b50600480546040516370a0823160e01b8152612ef29289926001600160a01b0316916370a0823191612e4b91309101615290565b9450612efd565b8594505b505050915091565b600082612f1457506000612c29565b82820282848281612f2157fe5b0414612c265760405162461bcd60e51b81526004016106b19061556f565b6000612c2683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061403e565b60085460ff1615612f9157610cd8565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191612fc391309101615290565b60206040518083038186803b158015612fdb57600080fd5b505afa158015612fef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130139190615149565b9050818110156130bc576008546040516370a0823160e01b815260019161010090046001600160a01b0316906370a0823190613053903090600401615290565b60206040518083038186803b15801561306b57600080fd5b505afa15801561307f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a39190615149565b11156130b6576130b4818303613d02565b505b50610cd8565b6000806130cc8484036001614075565b91509150600b548211156131e357600d5460ff1661311e5760005b8215613118576131016130fa8484614150565b8490612be4565b92506006811061311057613118565b6001016130e7565b506131e3565b600480546040516370a0823160e01b81526001600160a01b03909116916370a082319161316191731e0447b19bb6ecfdae1e4ae1694b0c3659614e4e9101615290565b60206040518083038186803b15801561317957600080fd5b505afa15801561318d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131b19190615149565b8211156131cf576131cc6131c58383614150565b8390612be4565b91505b600b548211156131e3576119d2818361428c565b50505050565b6008546040516370a0823160e01b81526000918291829161010090046001600160a01b0316906370a0823190613223903090600401615290565b60206040518083038186803b15801561323b57600080fd5b505afa15801561324f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132739190615149565b61330d57600480546040516370a0823160e01b81526000926001600160a01b03909216916370a08231916132a991309101615290565b60206040518083038186803b1580156132c157600080fd5b505afa1580156132d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132f99190615149565b90506133058186614028565b9150506134b1565b6000806133186113bf565b9150915061332461451f565b61332c6145e2565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a082319161335e91309101615290565b60206040518083038186803b15801561337657600080fd5b505afa15801561338a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133ae9190615149565b905060006133bc8484612be4565b905060006133ca8284613b54565b600080546040516339ebf82360e01b815292935090916001600160a01b03909116906339ebf82390613400903090600401615290565b6101006040518083038186803b15801561341957600080fd5b505afa15801561342d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061345191906150bf565b60a001519050808211156134985780820398508884101561347457839850613493565b61347e898b613b54565b84111561348d57899650613493565b88840396505b6134aa565b81810397506134a7848b614028565b96505b5050505050505b9193909250565b600080546040516370a0823160e01b81526001600160a01b03909116906370a08231906134e9903090600401615290565b60206040518083038186803b15801561350157600080fd5b505afa158015613515573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135399190615149565b90508015610cd85760005460025460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92611e749291169085906004016152a4565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a08231916135a991309101615290565b60206040518083038186803b1580156135c157600080fd5b505afa1580156135d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f99190615149565b90508181101561361b5760405162461bcd60e51b81526004016106b190615797565b821561373d5760085460405163073a938160e11b81526101009091046001600160a01b031690630e75270290613655908590600401615813565b602060405180830381600087803b15801561366f57600080fd5b505af1158015613683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136a79190615149565b5060085461010090046001600160a01b031663852a12e36136c9846002613b54565b6040518263ffffffff1660e01b81526004016136e59190615813565b602060405180830381600087803b1580156136ff57600080fd5b505af1158015613713573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137379190615149565b5061087e565b60085460405163140e25ad60e31b81526101009091046001600160a01b03169063a0712d6890613771908490600401615813565b602060405180830381600087803b15801561378b57600080fd5b505af115801561379f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137c39190615149565b156137e05760405162461bcd60e51b81526004016106b190615657565b60085461010090046001600160a01b031663c5ebeaec613801846002613b54565b6040518263ffffffff1660e01b815260040161381d9190615813565b602060405180830381600087803b15801561383757600080fd5b505af115801561384b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131e39190615149565b6000731e0447b19bb6ecfdae1e4ae1694b0c3659614e4e90506000816001600160a01b031663295c39a56040518163ffffffff1660e01b815260040160206040518083038186803b1580156138c357600080fd5b505afa1580156138d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138fb9190615149565b90506000805b828110156139b25760405163062bd3e960e01b81526001600160a01b0385169063062bd3e990613935908490600401615813565b60206040518083038186803b15801561394d57600080fd5b505afa158015613961573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139859190614e65565b6004549092506001600160a01b03808416911614156139aa57600e555061102b915050565b600101613901565b5060405162461bcd60e51b81526004016106b1906155d0565b600d54610100900460ff16610cd8576000806139e56113bf565b90925090506139f7612e118383612be4565b506008546040516361bfb47160e11b815260009161010090046001600160a01b03169063c37f68e290613a2e903090600401615290565b60806040518083038186803b158015613a4657600080fd5b505afa158015613a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a7e9190615161565b50925050506127108110613aa45760405162461bcd60e51b81526004016106b190615516565b6040516370a0823160e01b815273c00e94cb662c3520282e6f5717214004a7f268889060009082906370a0823190613ae0903090600401615290565b60206040518083038186803b158015613af857600080fd5b505afa158015613b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b309190615149565b90508015613b4c57613b4c6001600160a01b03831687836147d7565b505050505050565b600082820183811015612c265760405162461bcd60e51b81526004016106b1906154b8565b6060613bce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612b349092919063ffffffff16565b80519091501561087e5780806020019051810190613bec9190615034565b61087e5760405162461bcd60e51b81526004016106b190615729565b6060613c13856147f6565b613c2f5760405162461bcd60e51b81526004016106b19061567b565b60006060866001600160a01b03168587604051613c4c9190615274565b60006040518083038185875af1925050503d8060008114613c89576040519150601f19603f3d011682016040523d82523d6000602084013e613c8e565b606091505b50915091508115613ca2579150612b439050565b805115613cb25780518082602001fd5b8360405162461bcd60e51b81526004016106b19190615461565b5050949350505050565b60008184841115613cfa5760405162461bcd60e51b81526004016106b19190615461565b505050900390565b6000806000613d12846000614075565b91509150808015613d245750600b5482115b15613d8a57600d5460ff1615613d4457613d416131c5828461428c565b91505b60005b600b54613d55906064613b54565b831115613d8857613d6a6130fa846001614150565b9250600101600560ff821610613d835760019350613d88565b613d47565b505b600080613d95610e80565b6009549193509150600081613daf5766038d7ea4c6800091505b613dc582610f3785670de0b6b3a7640000612f05565b9050808410613efa576000613dda8583612be4565b905088811015613e705760085460405163852a12e360e01b81526101009091046001600160a01b03169063852a12e390613e18908490600401615813565b602060405180830381600087803b158015613e3257600080fd5b505af1158015613e46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e6a9190615149565b50613ef8565b60085460405163852a12e360e01b81526101009091046001600160a01b03169063852a12e390613ea4908c90600401615813565b602060405180830381600087803b158015613ebe57600080fd5b505af1158015613ed2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ef69190615149565b505b505b600954158015613f885750600480546040516370a0823160e01b815285926001600160a01b03909216916370a0823191613f3691309101615290565b60206040518083038186803b158015613f4e57600080fd5b505afa158015613f62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f869190615149565b115b156140155760085460405163073a938160e11b81526101009091046001600160a01b031690630e75270290613fc1908690600401615813565b602060405180830381600087803b158015613fdb57600080fd5b505af1158015613fef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140139190615149565b505b61401d6145e2565b505050505050919050565b60008183106140375781612c26565b5090919050565b6000818361405f5760405162461bcd60e51b81526004016106b19190615461565b50600083858161406b57fe5b0495945050505050565b6000806000806140836113bf565b909250905060006140948383612be4565b9050600086156140af576140a88289613b54565b90506140c8565b818811156140bb578197505b6140c58289612be4565b90505b60006140df60095483612f0590919063ffffffff16565b90506000614100600954670de0b6b3a7640000612be490919063ffffffff16565b9050600061410e8383612f3f565b9050620186a0811115614122576201869f19015b8581101561413857600197508086039850614142565b6000975085810398505b505050505050509250929050565b600080600061415d610e80565b9150915080600014801561416e5750835b1561417e57600092505050612c29565b600854604051638e8f294b60e01b8152600091733d9819210a31b4961b30ef54be2aed79b9c9cd3b91638e8f294b916141c9916101009091046001600160a01b031690600401615290565b60606040518083038186803b1580156141e157600080fd5b505afa1580156141f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614219919061507d565b5091505084156142365761422f8684848461482f565b9350614245565b61424286848484614a43565b93505b7f012a05dea1e4b56be6c250aaa3e6189a1f531f1fd201b35b2a74c56577000bf4868587600060405161427b949392919061587f565b60405180910390a150505092915050565b60008161429b57506000612c29565b600480546040516370a0823160e01b81528492731e0447b19bb6ecfdae1e4ae1694b0c3659614e4e926000926001600160a01b03909116916370a08231916142e591869101615290565b60206040518083038186803b1580156142fd57600080fd5b505afa158015614311573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143359190615149565b905082811015614343578092505b60608684604051602001614358929190615451565b60408051808303601f19018152600380845260808401909252925060609190816020015b614384614dac565b81526020019060019003908161437c5790505090506143a5600e5486614c14565b816000815181106143b257fe5b60200260200101819052506143c682614c9e565b816001815181106143d357fe5b6020908102919091010152600e546143f5906143f0876002613b54565b614d0c565b8160028151811061440257fe5b6020908102919091010152604080516001808252818301909252606091816020015b61442c614dfe565b815260200190600190039081614424579050509050614449614d47565b8160008151811061445657fe5b602090810291909101015260405163a67a6a4560e01b81526001600160a01b0386169063a67a6a459061448f9084908690600401615333565b600060405180830381600087803b1580156144a957600080fd5b505af11580156144bd573d6000803e3d6000fd5b505050507f012a05dea1e4b56be6c250aaa3e6189a1f531f1fd201b35b2a74c56577000bf488878b731e0447b19bb6ecfdae1e4ae1694b0c3659614e4e60405161450a949392919061587f565b60405180910390a15093979650505050505050565b60408051600180825281830190925260609160208083019080368337019050509050600860019054906101000a90046001600160a01b03168160008151811061456457fe5b6001600160a01b039092166020928302919091019091015260405162e1ed9760e51b8152733d9819210a31b4961b30ef54be2aed79b9c9cd3b90631c3db2e0906145b490309085906004016152d7565b600060405180830381600087803b1580156145ce57600080fd5b505af11580156119d2573d6000803e3d6000fd5b6040516370a0823160e01b815260009073c00e94cb662c3520282e6f5717214004a7f26888906370a082319061461c903090600401615290565b60206040518083038186803b15801561463457600080fd5b505afa158015614648573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061466c9190615149565b9050600c54811115610cd8576040805160038082526080820190925260609160208201838036833701905050905073c00e94cb662c3520282e6f5717214004a7f26888816000815181106146bc57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2816001815181106146fe57fe5b6001600160a01b03928316602091820292909201015260045482519116908290600290811061472957fe5b6001600160a01b03909216602092830291909101909101526040516338ed173960e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d906338ed173990614781908590600090869030904290600401615843565b600060405180830381600087803b15801561479b57600080fd5b505af11580156147af573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261087e9190810190614f88565b61087e8363a9059cbb60e01b8484604051602401612afd9291906152a4565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590612b43575050151592915050565b60008082156148515761484e83610f3786670de0b6b3a7640000612f05565b90505b61485b8582612be4565b9150838210614868578391505b858210614873578591505b6000600860019054906101000a90046001600160a01b03166001600160a01b031663182df0f56040518163ffffffff1660e01b815260040160206040518083038186803b1580156148c357600080fd5b505afa1580156148d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148fb9190615149565b90508061491084670de0b6b3a7640000612f05565b1015801561491e5750600a83115b15613ccc5760085460405163852a12e360e01b815260091994909401936101009091046001600160a01b03169063852a12e39061495f908690600401615813565b602060405180830381600087803b15801561497957600080fd5b505af115801561498d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149b19190615149565b5060085460405163073a938160e11b81526101009091046001600160a01b031690630e752702906149e6908690600401615813565b602060405180830381600087803b158015614a0057600080fd5b505af1158015614a14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a389190615149565b505050949350505050565b600080614a5c670de0b6b3a7640000610f378786612f05565b9050614a688185612be4565b9150858210614a75578591505b600a821115614c0b5760085460405163317afabb60e21b815260091993909301926101009091046001600160a01b03169063c5ebeaec90614aba908590600401615813565b602060405180830381600087803b158015614ad457600080fd5b505af1158015614ae8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b0c9190615149565b50600854600480546040516370a0823160e01b81526001600160a01b0361010090940484169363a0712d68939216916370a0823191614b4d91309101615290565b60206040518083038186803b158015614b6557600080fd5b505afa158015614b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b9d9190615149565b6040518263ffffffff1660e01b8152600401614bb99190615813565b602060405180830381600087803b158015614bd357600080fd5b505af1158015614be7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ccc9190615149565b50949350505050565b614c1c614dac565b604080516101008101825260018152600060208083018290528351608081018552828152929384019291908201905b81526020016000815260200185815250815260200184815260200160008152602001306001600160a01b031681526020016000815260200160405180602001604052806000815250815250905092915050565b614ca6614dac565b6040805161010081018252600881526000602080830182905283516080810185528281529293840192919082019081526020016000815260006020918201819052918352820181905260408201819052306060830152608082015260a001929092525090565b614d14614dac565b60408051610100810182526000808252602080830182905283516080810185526001815292938401929190820190614c4b565b614d4f614dfe565b50604080518082019091523081526001602082015290565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604080516101008101825260008082526020820152908101614dcc614e15565b8152602001600081526020016000815260200160006001600160a01b0316815260200160008152602001606081525090565b604080518082019091526000808252602082015290565b604080516080810190915260008082526020820190815260200160008152602001600081525090565b8035612c2981615983565b600060208284031215614e5a578081fd5b8135612c2681615983565b600060208284031215614e76578081fd5b8151612c2681615983565b600080600060608486031215614e95578182fd5b8335614ea081615983565b92506020840135614eb081615983565b929592945050506040919091013590565b60008060008385036080811215614ed6578384fd5b8435614ee181615983565b93506040601f1982011215614ef4578283fd5b50614eff60406158d6565b614f0c8660208701614e3e565b8152604085013560208201529150606084013567ffffffffffffffff811115614f33578182fd5b8401601f81018613614f43578182fd5b8035614f56614f518261591d565b6158d6565b818152876020838501011115614f6a578384fd5b614f7b826020830160208601615941565b8093505050509250925092565b60006020808385031215614f9a578182fd5b825167ffffffffffffffff811115614fb0578283fd5b8301601f81018513614fc0578283fd5b8051614fce614f51826158fd565b8181528381019083850185840285018601891015614fea578687fd5b8694505b8385101561500c578051835260019490940193918501918501614fee565b50979650505050505050565b600060208284031215615029578081fd5b8135612c2681615998565b600060208284031215615045578081fd5b8151612c2681615998565b60008060408385031215615062578182fd5b825161506d81615998565b6020939093015192949293505050565b600080600060608486031215615091578283fd5b835161509c81615998565b6020850151604086015191945092506150b481615998565b809150509250925092565b60006101008083850312156150d2578182fd5b6150db816158d6565b9050825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201528091505092915050565b600060208284031215615142578081fd5b5035919050565b60006020828403121561515a578081fd5b5051919050565b60008060008060808587031215615176578182fd5b505082516020840151604085015160609095015191969095509092509050565b80516001600160a01b031682526020908101519082015260400190565b6001600160a01b03169052565b6000815180845260208085019450808401835b838110156151f85781516001600160a01b0316875295820195908201906001016151d3565b509495945050505050565b6000815180845261521b81602086016020860161594d565b601f01601f19169290920160200192915050565b6009811061523957fe5b9052565b805115158252602081015161525181615979565b6020830152604081015161526481615979565b6040830152606090810151910152565b6000825161528681846020870161594d565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b038381168252604060208084018290528451918401829052600092858201929091906060860190855b81811015615325578551851683529483019491830191600101615307565b509098975050505050505050565b6000604080830181845280865161534a8184615813565b915060209250828801855b8281101561537657615368848351615196565b935090840190600101615355565b5050508481038286015285518082528282019080840283018401888501875b8381101561543657601f1986840301855281516101606153b685835161522f565b8882015189860152898201516153ce8b87018261523d565b50606082015160c081818801526080840151915060e0828189015260a085015192506153fe6101008901846151b3565b90840151610120880152909201516101408601829052915061542281860183615203565b968901969450505090860190600101615395565b50909a9950505050505050505050565b901515815260200190565b9115158252602082015260400190565b600060208252612c266020830184615203565b6020808252600b908201526a085cdd1c985d1959da5cdd60aa1b604082015260600190565b602080825260059082015264085dd85b9d60da1b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252600d908201526c6661696c65642072656465656d60981b604082015260600190565b60208082526010908201526f111153115591549051d157d1925494d560821b604082015260600190565b6020808252601590820152740859185b99d95c9bdd5cc818dbdb1b185d195c985b605a1b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b60208082526024908201527f4e6f206d61726b6574496420666f756e6420666f722070726f7669646564207460408201526337b5b2b760e11b606082015260800190565b6020808252600790820152662173686172657360c81b604082015260600190565b6020808252600890820152674e4f545f534f4c4f60c01b604082015260600190565b6020808252600a908201526936b4b73a1032b93937b960b11b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601390820152726661696c656420726570617920626f72726f7760681b604082015260600190565b6020808252600b908201526a085b585b9859d95b595b9d60aa1b604082015260600190565b6020808252600b908201526a08585d5d1a1bdc9a5e995960aa1b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252600a9082015269085c1c9bdd1958dd195960b21b604082015260600190565b6020808252600c908201526b11931054d217d1905253115160a21b604082015260600190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b90815260200190565b600083825260406020830152612b4360408301846151c0565b918252602082015260400190565b600086825285602083015260a0604083015261586260a08301866151c0565b6001600160a01b0394909416606083015250608001529392505050565b9384526020840192909252151560408301526001600160a01b0316606082015260800190565b9283526020830191909152604082015260600190565b93845260208401929092526040830152606082015260800190565b60405181810167ffffffffffffffff811182821017156158f557600080fd5b604052919050565b600067ffffffffffffffff821115615913578081fd5b5060209081020190565b600067ffffffffffffffff821115615933578081fd5b50601f01601f191660200190565b82818337506000910152565b60005b83811015615968578181015183820152602001615950565b838111156131e35750506000910152565b60028110610cd857fe5b6001600160a01b0381168114610cd857600080fd5b8015158114610cd857600080fdfea264697066735822122051dbcfa73ea186649db9732b85942b5e9e7dc35b3dacf32dfe0765be467c203d64736f6c634300060c0033

Deployed Bytecode Sourcemap

72734:31372:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;72067:440;;;;;;:::i;:::-;;:::i;:::-;;84353:172;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;74084:40;;;:::i;74947:116::-;;;:::i;:::-;;;;;;;:::i;74255:29::-;;;:::i;:::-;;;;;;;:::i;55270:175::-;;;;;;:::i;:::-;;:::i;73406:82::-;;;:::i;:::-;;;;;;;:::i;50546:32::-;;;:::i;49522:18::-;;;:::i;49431:25::-;;;:::i;73977:26::-;;;:::i;57469:148::-;;;:::i;48071:91::-;;;:::i;50152:37::-;;;:::i;68661:505::-;;;;;;:::i;:::-;;:::i;100557:216::-;;;;;;:::i;:::-;;:::i;75114:86::-;;;;;;:::i;:::-;;:::i;75445:95::-;;;;;;:::i;:::-;;:::i;100867:146::-;;;;;;:::i;:::-;;:::i;73713:82::-;;;:::i;83649:317::-;;;:::i;:::-;;;;;;;;:::i;62719:170::-;;;:::i;66935:1482::-;;;:::i;75208:102::-;;;;;;:::i;:::-;;:::i;50629:25::-;;;:::i;77554:314::-;;;;;;:::i;:::-;;:::i;73495:21::-;;;:::i;73615:91::-;;;:::i;52773:174::-;;;;;;:::i;:::-;;:::i;84003:313::-;;;:::i;80848:926::-;;;:::i;79755:611::-;;;;;;:::i;:::-;;:::i;103058:363::-;;;;;;:::i;:::-;;:::i;50362:33::-;;;:::i;49301:94::-;;;:::i;54544:169::-;;;;;;:::i;:::-;;:::i;75651:305::-;;;;;;:::i;:::-;;:::i;102736:259::-;;;:::i;49463:22::-;;;:::i;75548:95::-;;;:::i;49492:21::-;;;:::i;73831:44::-;;;:::i;52017:202::-;;;;;;:::i;:::-;;:::i;74293:32::-;;;:::i;73889:52::-;;;:::i;69757:307::-;;;;;;:::i;:::-;;:::i;76914:324::-;;;:::i;75318:119::-;;;;;;:::i;:::-;;:::i;81948:1473::-;;;:::i;53295:181::-;;;;;;:::i;:::-;;:::i;78159:1510::-;;;;;;:::i;:::-;;:::i;76205:659::-;;;:::i;53993:151::-;;;;;;:::i;:::-;;:::i;73269:96::-;;;:::i;74334:27::-;;;:::i;49403:21::-;;;:::i;70493:164::-;;;:::i;72067:440::-;50996:12;:10;:12::i;:::-;-1:-1:-1;;;;;50982:26:0;:10;-1:-1:-1;;;;;50982:26:0;;50974:50;;;;-1:-1:-1;;;50974:50:0;;;;;;;:::i;:::-;;;;;;;;;72159:4:::1;::::0;-1:-1:-1;;;;;72141:23:0;;::::1;72159:4:::0;::::1;72141:23;;72133:41;;;;-1:-1:-1::0;;;72133:41:0::1;;;;;;;:::i;:::-;72211:5;::::0;-1:-1:-1;;;;;72193:24:0;;::::1;72211:5:::0;::::1;72193:24;;72185:44;;;;-1:-1:-1::0;;;72185:44:0::1;;;;;;;:::i;:::-;72242:33;72278:17;:15;:17::i;:::-;72242:53;;72311:9;72306:102;72326:16;:23;72322:1;:27;72306:102;;;72374:16;72391:1;72374:19;;;;;;;;;;;;;;-1:-1:-1::0;;;;;72364:29:0::1;:6;-1:-1:-1::0;;;;;72364:29:0::1;;;72356:52;;;;-1:-1:-1::0;;;72356:52:0::1;;;;;;;:::i;:::-;72351:3;;72306:102;;;;72428:6;-1:-1:-1::0;;;;;72421:23:0::1;;72445:12;:10;:12::i;:::-;72459:39;::::0;-1:-1:-1;;;72459:39:0;;-1:-1:-1;;;;;72459:24:0;::::1;::::0;::::1;::::0;:39:::1;::::0;72492:4:::1;::::0;72459:39:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;72421:78;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;51035:1;72067:440:::0;:::o;84353:172::-;84400:7;84421:16;84439:15;84458:20;:18;:20::i;:::-;84420:58;;-1:-1:-1;84420:58:0;-1:-1:-1;84496:21:0;84420:58;;84496:12;:21::i;:::-;84489:28;;;;84353:172;;:::o;74084:40::-;;;;:::o;74947:116::-;75020:35;;;;;;;;;;;;;;;;;74947:116;:::o;74255:29::-;;;;;;:::o;55270:175::-;50740:10;;-1:-1:-1;;;;;50740:10:0;50726;:24;;:54;;;50768:12;:10;:12::i;:::-;-1:-1:-1;;;;;50754:26:0;:10;-1:-1:-1;;;;;50754:26:0;;50726:54;50718:78;;;;-1:-1:-1;;;50718:78:0;;;;;;;:::i;:::-;55355:13:::1;:30:::0;;;55401:36:::1;::::0;::::1;::::0;::::1;::::0;55371:14;;55401:36:::1;:::i;:::-;;;;;;;;55270:175:::0;:::o;73406:82::-;73445:42;73406:82;:::o;50546:32::-;;;;:::o;49522:18::-;;;-1:-1:-1;;;;;49522:18:0;;:::o;49431:25::-;;;-1:-1:-1;;;;;49431:25:0;;:::o;73977:26::-;;;;:::o;57469:148::-;57510:4;57534:5;;:31;;-1:-1:-1;;;57534:31:0;;57510:4;;-1:-1:-1;;;;;57534:5:0;;:16;;:31;;57559:4;;57534:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:41;;;:45;:75;;;;57608:1;57583:22;:20;:22::i;:::-;:26;57534:75;57527:82;;57469:148;:::o;48071:91::-;48140:14;;;;;;;;;;;;-1:-1:-1;;;48140:14:0;;;;48071:91;:::o;50152:37::-;;;;:::o;68661:505::-;68720:13;68776:5;;-1:-1:-1;;;;;68776:5:0;68754:10;:28;68746:47;;;;-1:-1:-1;;;68746:47:0;;;;;;;:::i;:::-;68873:19;68926:32;68944:13;68926:17;:32::i;:::-;69050:4;;;:38;;-1:-1:-1;;;69050:38:0;;68903:55;;-1:-1:-1;68903:55:0;;-1:-1:-1;;;;;;69050:4:0;;;;:13;;:38;;69064:10;;68903:55;;69050:38;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;68661:505;;;;:::o;100557:216::-;104027:12;:10;:12::i;:::-;-1:-1:-1;;;;;104013:26:0;:10;-1:-1:-1;;;;;104013:26:0;;:54;;;-1:-1:-1;104057:10:0;;-1:-1:-1;;;;;104057:10:0;104043;:24;104013:54;104005:78;;;;-1:-1:-1;;;104005:78:0;;;;;;;:::i;:::-;100637:6:::1;::::0;:31:::1;::::0;-1:-1:-1;;;100637:31:0;;:6:::1;::::0;;::::1;-1:-1:-1::0;;;;;100637:6:0::1;::::0;:23:::1;::::0;:31:::1;::::0;100661:6;;100637:31:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:36:::0;100629:62:::1;;;;-1:-1:-1::0;;;100629:62:0::1;;;;;;;:::i;:::-;100710:6;::::0;:26:::1;::::0;-1:-1:-1;;;100710:26:0;;:6:::1;::::0;;::::1;-1:-1:-1::0;;;;;100710:6:0::1;::::0;:18:::1;::::0;:26:::1;::::0;100729:6;;100710:26:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:31:::0;100702:63:::1;;;;-1:-1:-1::0;;;100702:63:0::1;;;;;;;:::i;:::-;100557:216:::0;:::o;75114:86::-;104027:12;:10;:12::i;:::-;-1:-1:-1;;;;;104013:26:0;:10;-1:-1:-1;;;;;104013:26:0;;:54;;;-1:-1:-1;104057:10:0;;-1:-1:-1;;;;;104057:10:0;104043;:24;104013:54;104005:78;;;;-1:-1:-1;;;104005:78:0;;;;;;;:::i;:::-;75174:10:::1;:18:::0;;-1:-1:-1;;75174:18:0::1;::::0;::::1;;::::0;;;::::1;::::0;;75114:86::o;75445:95::-;104027:12;:10;:12::i;:::-;-1:-1:-1;;;;;104013:26:0;:10;-1:-1:-1;;;;;104013:26:0;;:54;;;-1:-1:-1;104057:10:0;;-1:-1:-1;;;;;104057:10:0;104043;:24;104013:54;104005:78;;;;-1:-1:-1;;;104005:78:0;;;;;;;:::i;:::-;75514:7:::1;:18:::0;75445:95::o;100867:146::-;50996:12;:10;:12::i;:::-;-1:-1:-1;;;;;50982:26:0;:10;-1:-1:-1;;;;;50982:26:0;;50974:50;;;;-1:-1:-1;;;50974:50:0;;;;;;;:::i;:::-;100952:6:::1;::::0;:31:::1;::::0;-1:-1:-1;;;100952:31:0;;:6:::1;::::0;;::::1;-1:-1:-1::0;;;;;100952:6:0::1;::::0;:23:::1;::::0;:31:::1;::::0;100976:6;;100952:31:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:35:::0;100944:61:::1;;;;-1:-1:-1::0;;;100944:61:0::1;;;;;;;:::i;73713:82::-:0;73752:42;73713:82;:::o;83649:317::-;83819:6;;:40;;-1:-1:-1;;;83819:40:0;;83700:16;;;;;;;;;;83819:6;;;-1:-1:-1;;;;;83819:6:0;;:25;;:40;;83853:4;;83819:40;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;83746:113;;;;;;;83880:13;83870:23;;83917:41;83953:4;83917:31;83935:12;83917:13;:17;;:31;;;;:::i;:::-;:35;;:41::i;:::-;83906:52;;83649:317;;;;;:::o;62719:170::-;51108:6;;-1:-1:-1;;;;;51108:6:0;51094:10;:20;;:48;;-1:-1:-1;51132:10:0;;-1:-1:-1;;;;;51132:10:0;51118;:24;51094:48;:78;;;;51160:12;:10;:12::i;:::-;-1:-1:-1;;;;;51146:26:0;:10;-1:-1:-1;;;;;51146:26:0;;51094:78;51086:102;;;;-1:-1:-1;;;51086:102:0;;;;;;;:::i;:::-;62857:5:::1;::::0;:23:::1;::::0;;-1:-1:-1;;;62857:23:0;;;;62842:39:::1;::::0;-1:-1:-1;;;;;62857:5:0::1;::::0;:21:::1;::::0;:23:::1;::::0;;::::1;::::0;::::1;::::0;;;;;;;;:5;:23;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;62842:14;:39::i;:::-;62719:170::o:0;66935:1482::-;51108:6;;-1:-1:-1;;;;;51108:6:0;51094:10;:20;;:48;;-1:-1:-1;51132:10:0;;-1:-1:-1;;;;;51132:10:0;51118;:24;51094:48;:78;;;;51160:12;:10;:12::i;:::-;-1:-1:-1;;;;;51146:26:0;:10;-1:-1:-1;;;;;51146:26:0;;51094:78;51086:102;;;;-1:-1:-1;;;51086:102:0;;;;;;;:::i;:::-;66986:14:::1;67015:12:::0;67042:23:::1;67068:5:::0;::::1;;;;;;;;-1:-1:-1::0;;;;;67068:5:0::1;-1:-1:-1::0;;;;;67068:21:0::1;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;67140:13;::::0;67042:49;;-1:-1:-1;67102:19:0::1;::::0;67140:13:::1;;67136:731;;;67222:19;67244:22;:20;:22::i;:::-;67222:44;;67400:80;67432:15;67418:11;:29;:61;;67464:15;67418:61;;;67450:11;67418:61;67400:17;:80::i;:::-;67378:102:::0;-1:-1:-1;67378:102:0;-1:-1:-1;67558:29:0;;::::1;67554:159;;;67617:32;:11:::0;67633:15;67617::::1;:32::i;:::-;67608:41;;67682:15;67668:29;;67554:159;67136:731;;;;67825:30;67839:15;67825:13;:30::i;:::-;67795:60:::0;;-1:-1:-1;67795:60:0;-1:-1:-1;67795:60:0;-1:-1:-1;67136:731:0::1;68081:5;::::0;:39:::1;::::0;-1:-1:-1;;;68081:39:0;;-1:-1:-1;;;;;68081:5:0;;::::1;::::0;:12:::1;::::0;:39:::1;::::0;68094:6;;68102:4;;68108:11;;68081:39:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;68063:57;;68212:19;:17;:19::i;:::-;68307:31;68322:15;68307:14;:31::i;:::-;68356:53;68366:6;68374:4;68380:11;68393:15;68356:53;;;;;;;;;:::i;:::-;;;;;;;;51199:1;;;;66935:1482::o:0;75208:102::-;50996:12;:10;:12::i;:::-;-1:-1:-1;;;;;50982:26:0;:10;-1:-1:-1;;;;;50982:26:0;;50974:50;;;;-1:-1:-1;;;50974:50:0;;;;;;;:::i;:::-;75281:12:::1;:21:::0;;;::::1;;;;-1:-1:-1::0;;75281:21:0;;::::1;::::0;;;::::1;::::0;;75208:102::o;50629:25::-;;;;;;:::o;77554:314::-;77622:4;77643:23;77658:7;77643:14;:23::i;:::-;77639:106;;;-1:-1:-1;77728:5:0;77721:12;;77639:106;77792:29;;77761:27;:25;:27::i;:::-;:60;77757:104;;-1:-1:-1;77845:4:0;77757:104;77554:314;;;:::o;73495:21::-;;;;;;-1:-1:-1;;;;;73495:21:0;;:::o;73615:91::-;73663:42;73615:91;:::o;52773:174::-;50740:10;;-1:-1:-1;;;;;50740:10:0;50726;:24;;:54;;;50768:12;:10;:12::i;:::-;-1:-1:-1;;;;;50754:26:0;:10;-1:-1:-1;;;;;50754:26:0;;50726:54;50718:78;;;;-1:-1:-1;;;50718:78:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;52852:21:0;::::1;52844:30;;;::::0;::::1;;52885:6;:16:::0;;-1:-1:-1;;;;;;52885:16:0::1;-1:-1:-1::0;;;;;52885:16:0;::::1;;::::0;;52917:22:::1;::::0;::::1;::::0;::::1;::::0;52885:16;;52917:22:::1;:::i;84003:313::-:0;84103:6;;:41;;-1:-1:-1;;;84103:41:0;;84046:16;;;;84103:6;;;;-1:-1:-1;;;;;84103:6:0;;:26;;:41;;84138:4;;84103:41;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;84267:6;;:41;;-1:-1:-1;;;84267:41:0;;84092:52;;-1:-1:-1;84267:6:0;;;-1:-1:-1;;;;;84267:6:0;;:26;;:41;;84302:4;;84267:41;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;84257:51;;84003:313;;:::o;80848:926::-;80992:6;;80967:33;;-1:-1:-1;;;80967:33:0;;80906:7;;;;73322:42;;80967:16;;:33;;80992:6;;;-1:-1:-1;;;;;80992:6:0;;80967:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;80926:74;;;;81014:16;81032:15;81051:20;:18;:20::i;:::-;81013:58;;;;81084:19;81106:6;;;;;;;;;-1:-1:-1;;;;;81106:6:0;-1:-1:-1;;;;;81106:25:0;;:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;81084:49;;81146:18;81167:6;;;;;;;;;-1:-1:-1;;;;;81167:6:0;-1:-1:-1;;;;;81167:25:0;;:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;81146:48;-1:-1:-1;81207:30:0;81240:48;81283:4;81240:38;:8;81253:24;81240:12;:38::i;:48::-;81207:81;-1:-1:-1;81207:81:0;81299:29;81383:24;:7;81395:11;81383;:24::i;:::-;81366:41;-1:-1:-1;81418:14:0;81435:37;:21;81461:10;81435:25;:37::i;:::-;81418:54;;81499:6;81489;:16;81485:282;;-1:-1:-1;;81522:18:0;;;;;;;;;;;;;81485:282;81573:13;81589:34;:21;81615:7;81589:25;:34::i;:::-;81573:50;-1:-1:-1;81654:15:0;;;81729:26;81654:15;81729;81573:50;81739:4;81729:9;:15::i;:26::-;81722:33;;;;;;;;;;;;;;;79755:611;79841:7;79865:12;79861:53;;-1:-1:-1;79901:1:0;79894:8;;79861:53;79924:21;-1:-1:-1;;;;;79959:13:0;;73752:42;79959:13;79956:267;;;79995:16;;;80009:1;79995:16;;;;;;;;;;;;;;;;;;;;-1:-1:-1;79995:16:0;79988:23;;73752:42;80026:4;80031:1;80026:7;;;;;;;;;;;;;:14;-1:-1:-1;;;;;80026:14:0;;;-1:-1:-1;;;;;80026:14:0;;;;;80065:3;80055:4;80060:1;80055:7;;;;;;;;;;;;;:13;-1:-1:-1;;;;;80055:13:0;;;-1:-1:-1;;;;;80055:13:0;;;;;79956:267;;;80106:16;;;80120:1;80106:16;;;;;;;;;;;;;;;;;;;;-1:-1:-1;80106:16:0;80099:23;;80147:5;80137:4;80142:1;80137:7;;;;;;;;;;;;;:15;-1:-1:-1;;;;;80137:15:0;;;-1:-1:-1;;;;;80137:15:0;;;;;73752:42;80168:4;80173:1;80168:7;;;;;;;;;;;;;:14;-1:-1:-1;;;;;80168:14:0;;;-1:-1:-1;;;;;80168:14:0;;;;;80208:3;80198:4;80203:1;80198:7;;;;;;;;;;;;;:13;-1:-1:-1;;;;;80198:13:0;;;-1:-1:-1;;;;;80198:13:0;;;;;79956:267;80263:48;;-1:-1:-1;;;80263:48:0;;80236:24;;73663:42;;80263:33;;:48;;80297:7;;80306:4;;80263:48;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;80263:48:0;;;;;;;;;;;;:::i;:::-;80236:75;;80331:7;80356:1;80339:7;:14;:18;80331:27;;;;;;;;;;;;;;80324:34;;;;79755:611;;;;;;:::o;103058:363::-;103206:12;103220:14;103249:4;103238:33;;;;;;;;;;;;:::i;:::-;103205:66;;-1:-1:-1;103205:66:0;-1:-1:-1;103290:10:0;73169:42;103290:18;103282:39;;;;-1:-1:-1;;;103282:39:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;103340:23:0;;103358:4;103340:23;103332:32;;;;;;103377:27;103388:7;103397:6;103377:10;:27::i;:::-;103058:363;;;;;:::o;50362:33::-;;;;:::o;49301:94::-;49359:7;49301:94;:::o;54544:169::-;50740:10;;-1:-1:-1;;;;;50740:10:0;50726;:24;;:54;;;50768:12;:10;:12::i;:::-;-1:-1:-1;;;;;50754:26:0;:10;-1:-1:-1;;;;;50754:26:0;;50726:54;50718:78;;;;-1:-1:-1;;;50718:78:0;;;;;;;:::i;:::-;54627:12:::1;:28:::0;;;54671:34:::1;::::0;::::1;::::0;::::1;::::0;54642:13;;54671:34:::1;:::i;75651:305::-:0;104027:12;:10;:12::i;:::-;-1:-1:-1;;;;;104013:26:0;:10;-1:-1:-1;;;;;104013:26:0;;:54;;;-1:-1:-1;104057:10:0;;-1:-1:-1;;;;;104057:10:0;104043;:24;104013:54;104005:78;;;;-1:-1:-1;;;104005:78:0;;;;;;;:::i;:::-;75804:6:::1;::::0;75779:33:::1;::::0;-1:-1:-1;;;75779:33:0;;75741:32:::1;::::0;73322:42:::1;::::0;75779:16:::1;::::0;:33:::1;::::0;75804:6:::1;::::0;;::::1;-1:-1:-1::0;;;;;75804:6:0::1;::::0;75779:33:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;75738:74;;;;75858:17;75831:24;:44;75823:78;;;;-1:-1:-1::0;;;75823:78:0::1;;;;;;;:::i;:::-;-1:-1:-1::0;75912:16:0::1;:36:::0;75651:305::o;102736:259::-;102792:14;102820:12;102834:14;102852:20;:18;:20::i;:::-;102819:53;;;;102887:4;102895:1;102887:9;102883:50;;;102920:1;102913:8;;;;;;102883:50;102952:35;102982:4;102952:25;102960:4;102970:6;102952:17;:25::i;49463:22::-;;;-1:-1:-1;;;;;49463:22:0;;:::o;75548:95::-;104027:12;:10;:12::i;:::-;-1:-1:-1;;;;;104013:26:0;:10;-1:-1:-1;;;;;104013:26:0;;:54;;;-1:-1:-1;104057:10:0;;-1:-1:-1;;;;;104057:10:0;104043;:24;104013:54;104005:78;;;;-1:-1:-1;;;104005:78:0;;;;;;;:::i;:::-;75605:30:::1;:28;:30::i;49492:21::-:0;;;-1:-1:-1;;;;;49492:21:0;;:::o;73831:44::-;;;;:::o;52017:202::-;50740:10;;-1:-1:-1;;;;;50740:10:0;50726;:24;;:54;;;50768:12;:10;:12::i;:::-;-1:-1:-1;;;;;50754:26:0;:10;-1:-1:-1;;;;;50754:26:0;;50726:54;50718:78;;;;-1:-1:-1;;;50718:78:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;52104:25:0;::::1;52096:34;;;::::0;::::1;;52141:10;:24:::0;;-1:-1:-1;;;;;;52141:24:0::1;-1:-1:-1::0;;;;;52141:24:0;::::1;;::::0;;52181:30:::1;::::0;::::1;::::0;::::1;::::0;52141:24;;52181:30:::1;:::i;74293:32::-:0;;;;;;;;;:::o;73889:52::-;;;;:::o;69757:307::-;69846:5;;-1:-1:-1;;;;;69846:5:0;69824:10;:28;;:58;;;69870:12;:10;:12::i;:::-;-1:-1:-1;;;;;69856:26:0;:10;-1:-1:-1;;;;;69856:26:0;;69824:58;69816:67;;;;;;69940:5;;;;;;;;-1:-1:-1;;;;;69940:5:0;-1:-1:-1;;;;;69902:43:0;69915:12;-1:-1:-1;;;;;69902:32:0;;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;69902:43:0;;69894:52;;;;;;69957:30;69974:12;69957:16;:30::i;:::-;69998:4;;;70026:29;;-1:-1:-1;;;70026:29:0;;-1:-1:-1;;;;;69998:4:0;;;;:13;;70012:12;;69998:4;;70026:14;;:29;;70049:4;;70026:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;69998:58;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;69757:307;:::o;76914:324::-;76961:7;76981:22;77006;:20;:22::i;:::-;77041:12;77056:5;;:31;;-1:-1:-1;;;77056:31:0;;76981:47;;-1:-1:-1;77041:12:0;;-1:-1:-1;;;;;77056:5:0;;;;:16;;:31;;77081:4;;77056:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:41;;;77041:56;;77119:14;77112:4;:21;77108:123;;;77157:1;77150:8;;;;;;77108:123;77198:21;;;-1:-1:-1;77191:28:0;;75318:119;104027:12;:10;:12::i;:::-;-1:-1:-1;;;;;104013:26:0;:10;-1:-1:-1;;;;;104013:26:0;;:54;;;-1:-1:-1;104057:10:0;;-1:-1:-1;;;;;104057:10:0;104043;:24;104013:54;104005:78;;;;-1:-1:-1;;;104005:78:0;;;;;;;:::i;:::-;75399:13:::1;:30:::0;75318:119::o;81948:1473::-;81999:7;82020:16;82038:15;82057:20;:18;:20::i;:::-;82019:58;;;;82092:8;82104:1;82092:13;82088:122;;;82129:1;82122:8;;;;;;82088:122;82376:6;;82348:36;;-1:-1:-1;;;82348:36:0;;82317:28;;73322:42;;82348:19;;:36;;82376:6;;;;-1:-1:-1;;;;;82376:6:0;;82348:36;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;82317:67;;82397:19;82419:6;;;;;;;;;-1:-1:-1;;;;;82419:6:0;-1:-1:-1;;;;;82419:19:0;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;82397:43;;82532:25;82560:6;;;;;;;;;-1:-1:-1;;;;;82560:6:0;-1:-1:-1;;;;;82560:18:0;;:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;82532:48;;82591:19;82613:60;82668:4;82613:50;82635:6;;;;;;;;;-1:-1:-1;;;;;82635:6:0;-1:-1:-1;;;;;82635:25:0;;:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;82613:17;;:21;:50::i;:60::-;82591:82;-1:-1:-1;82686:24:0;82728:15;;82725:116;;82778:51;82817:11;82778:34;:8;82791:20;82778:12;:34::i;:51::-;82759:70;;82725:116;82861:24;82903:15;;82900:115;;82953:50;82991:11;82953:33;:7;82965:20;82953:11;:33::i;:50::-;82934:69;;82900:115;83083:18;83104:38;:16;83125;83104:20;:38::i;:::-;83191:18;83212:5;;:31;;-1:-1:-1;;;83212:31:0;;83083:59;;-1:-1:-1;83191:18:0;;-1:-1:-1;;;;;83212:5:0;;;;:16;;:31;;83237:4;;83212:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:42;;;;-1:-1:-1;83265:23:0;83290:41;83328:2;83291:31;:15;83212:42;83291:19;:31::i;83290:41::-;83265:66;-1:-1:-1;83382:31:0;83265:66;83402:10;83382:19;:31::i;:::-;83375:38;;;;;;;;;;;;;81948:1473;:::o;53295:181::-;50883:10;;-1:-1:-1;;;;;50883:10:0;50869;:24;50861:48;;;;-1:-1:-1;;;50861:48:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;53376:22:0;::::1;53368:31;;;::::0;::::1;;53410:7;:18:::0;;-1:-1:-1;;;;;;53410:18:0::1;-1:-1:-1::0;;;;;53410:18:0;::::1;;::::0;;53444:24:::1;::::0;::::1;::::0;::::1;::::0;53410:18;;53444:24:::1;:::i;78159:1510::-:0;78230:4;78257:28;;:::i;:::-;78288:5;;:31;;-1:-1:-1;;;78288:31:0;;-1:-1:-1;;;;;78288:5:0;;;;:16;;:31;;78313:4;;78288:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;78257:62;;78396:6;:17;;;78417:1;78396:22;78392:40;;;78427:5;78420:12;;;;;78392:40;78494:4;;78447:19;;78469:40;;73752:42;;-1:-1:-1;;;;;78494:4:0;78501:7;78469:10;:40::i;:::-;78447:62;;78520:19;78542:31;73752:42;73445;78565:7;78542:10;:31::i;:::-;78520:53;;78651:22;78676:20;:18;:20::i;:::-;78651:45;;78730:13;;78713:14;:30;78709:247;;;78884:12;;78868:29;;:11;;:15;:29::i;:::-;78827:37;;-1:-1:-1;;;78827:37:0;;78808:57;;73445:42;;78827:22;;:37;;78858:4;;78827:37;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;78808:14;;:18;:57::i;:::-;:89;78803:142;;;78925:4;78918:11;;;;;;;;78803:142;79076:14;;79054:17;;;;79034:38;;:15;;:19;:38::i;:::-;:56;79030:73;;79099:4;79092:11;;;;;;;;79030:73;79196:19;79218:5;;;;;;;;;-1:-1:-1;;;;;79218:5:0;-1:-1:-1;;;;;79218:21:0;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;79270:12;;79196:45;;-1:-1:-1;79270:29:0;;79287:11;79270:16;:29::i;:::-;79256:11;:43;79252:60;;;79308:4;79301:11;;;;;;;;;79252:60;79366:13;79382:22;:20;:22::i;:::-;79366:38;;79417:14;79458:6;:16;;;79450:5;:24;79446:66;;;79495:16;;;;79485:27;;:5;;:9;:27::i;:::-;79476:36;;79446:66;79551:14;79568:35;79596:6;79568:5;;;;;;;;-1:-1:-1;;;;;79568:5:0;-1:-1:-1;;;;;79568:21:0;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:27;;:35::i;:::-;79551:52;;79654:6;79622:29;79639:11;79622:12;;:16;;:29;;;;:::i;:::-;:38;;78159:1510;-1:-1:-1;;;;;;;;;;78159:1510:0:o;76205:659::-;76267:7;76288:16;76306:15;76325:20;:18;:20::i;:::-;76287:58;;;;76358:22;76383:20;:18;:20::i;:::-;76436:37;;-1:-1:-1;;;76436:37:0;;76358:45;;-1:-1:-1;76414:19:0;;73445:42;;76436:22;;:37;;76467:4;;76436:37;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;76638:4;;76414:59;;-1:-1:-1;76588:21:0;;76613:63;;73445:42;;-1:-1:-1;;;;;76638:4:0;76644:31;:14;76414:59;76644:18;:31::i;76613:63::-;76588:88;-1:-1:-1;76687:24:0;76714:28;76739:2;76714:20;76588:88;76732:1;76714:17;:20::i;:28::-;76778:4;;;:29;;-1:-1:-1;;;76778:29:0;;76687:55;;-1:-1:-1;76778:78:0;;76848:7;;76778:65;;76687:55;;76778:43;;76812:8;;-1:-1:-1;;;;;76778:4:0;;:14;;:29;;76801:4;;76778:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;:65;:69;;:78::i;:::-;76771:85;;;;;;;;76205:659;:::o;53993:151::-;50740:10;;-1:-1:-1;;;;;50740:10:0;50726;:24;;:54;;;50768:12;:10;:12::i;:::-;-1:-1:-1;;;;;50754:26:0;:10;-1:-1:-1;;;;;50754:26:0;;50726:54;50718:78;;;;-1:-1:-1;;;50718:78:0;;;;;;;:::i;:::-;54071:14:::1;:23:::0;;;54110:26:::1;::::0;::::1;::::0;::::1;::::0;54088:6;;54110:26:::1;:::i;73269:96::-:0;73322:42;73269:96;:::o;74334:27::-;;;;:::o;49403:21::-;;;-1:-1:-1;;;;;49403:21:0;;:::o;70493:164::-;50740:10;;-1:-1:-1;;;;;50740:10:0;50726;:24;;:54;;;50768:12;:10;:12::i;:::-;-1:-1:-1;;;;;50754:26:0;:10;-1:-1:-1;;;;;50754:26:0;;50726:54;50718:78;;;;-1:-1:-1;;;50718:78:0;;;;;;;:::i;:::-;70556:13:::1;:20:::0;;-1:-1:-1;;70556:20:0::1;70572:4;70556:20;::::0;;:13:::1;70587:5:::0;;:22:::1;::::0;;-1:-1:-1;;;70587:22:0;;;;-1:-1:-1;;;;;70587:5:0;;::::1;::::0;:20:::1;::::0;:22:::1;::::0;;::::1;::::0;;;;;;70556:13;70587:5;:22;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;70627:22:0::1;::::0;::::1;::::0;-1:-1:-1;70627:22:0;;-1:-1:-1;70627:22:0::1;70493:164::o:0;37551:622::-;37921:10;;;37920:62;;-1:-1:-1;37937:39:0;;-1:-1:-1;;;37937:39:0;;-1:-1:-1;;;;;37937:15:0;;;;;:39;;37961:4;;37968:7;;37937:39;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:44;37920:62;37912:152;;;;-1:-1:-1;;;37912:152:0;;;;;;;:::i;:::-;38075:90;38095:5;38125:22;;;38149:7;38158:5;38102:62;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;38102:62:0;;;;;;;;;;;;;;-1:-1:-1;;;;;38102:62:0;-1:-1:-1;;;;;;38102:62:0;;;;;;;;;;38075:19;:90::i;17492:196::-;17595:12;17627:53;17650:6;17658:4;17664:1;17667:12;17627:22;:53::i;:::-;17620:60;17492:196;-1:-1:-1;;;;17492:196:0:o;55599:98::-;55644:7;55671:5;;;;;;;;;-1:-1:-1;;;;;55671:5:0;-1:-1:-1;;;;;55671:16:0;;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;101021:213::-;101183:16;;;101197:1;101183:16;;;;;;;;;101021:213::o;24827:136::-;24885:7;24912:43;24916:1;24919;24912:43;;;;;;;;;;;;;;;;;:3;:43::i;:::-;24905:50;;24827:136;;;;;:::o;93919:1281::-;94063:4;;;:29;;-1:-1:-1;;;94063:29:0;;93996:20;;;;;;-1:-1:-1;;;;;94063:4:0;;;;:14;;:29;;94086:4;;94063:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;94044:48;;94103:14;94120:30;94141:8;94120:16;:14;:16::i;:30::-;94103:47;;94163:23;94189:5;;;;;;;;;-1:-1:-1;;;;;94189:5:0;-1:-1:-1;;;;;94189:21:0;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;94163:49;;94246:6;94228:15;:24;94225:87;;;94294:6;94276:15;:24;94268:32;;94225:87;94337:13;94328:6;:22;94324:869;;;94469:16;94487:15;94506:17;:15;:17::i;:::-;94612:6;;:31;;-1:-1:-1;;;94612:31:0;;94468:55;;-1:-1:-1;94468:55:0;;-1:-1:-1;94646:1:0;;94612:6;;;;-1:-1:-1;;;;;94612:6:0;;:16;;:31;;94637:4;;94612:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:35;94609:111;;;94668:36;94682:21;:8;94695:7;94682:12;:21::i;:::-;94668:13;:36::i;:::-;;94609:111;94775:4;;;:29;;-1:-1:-1;;;94775:29:0;;94751:54;;94760:13;;-1:-1:-1;;;;;94775:4:0;;:14;;:29;;94798:4;;94775:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;94751:8;:54::i;:::-;94736:69;;94324:869;;;;;94866:13;94855:8;:24;94851:331;;;94900:42;94914:27;:13;94932:8;94914:17;:27::i;94900:42::-;-1:-1:-1;95069:4:0;;;:29;;-1:-1:-1;;;95069:29:0;;95045:54;;95054:13;;-1:-1:-1;;;;;95069:4:0;;:14;;:29;;95092:4;;95069:29;;:::i;95045:54::-;95030:69;;94851:331;;;95153:13;95138:28;;94851:331;93919:1281;;;;;;:::o;25717:471::-;25775:7;26020:6;26016:47;;-1:-1:-1;26050:1:0;26043:8;;26016:47;26087:5;;;26091:1;26087;:5;:1;26111:5;;;;;:10;26103:56;;;;-1:-1:-1;;;26103:56:0;;;;;;;:::i;26664:132::-;26722:7;26749:39;26753:1;26756;26749:39;;;;;;;;;;;;;;;;;:3;:39::i;86945:1861::-;87085:13;;;;87081:52;;;87115:7;;87081:52;87236:4;;;:29;;-1:-1:-1;;;87236:29:0;;87217:16;;-1:-1:-1;;;;;87236:4:0;;;;:14;;:29;;87259:4;;87236:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;87217:48;;87290:16;87279:8;:27;87276:373;;;87501:6;;:31;;-1:-1:-1;;;87501:31:0;;87535:1;;87501:6;;;-1:-1:-1;;;;;87501:6:0;;:16;;:31;;87526:4;;87501:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:35;87498:117;;;87557:42;87590:8;87571:16;:27;87557:13;:42::i;:::-;;87498:117;87631:7;;;87276:373;87670:16;87688:12;87704:60;87741:16;87730:8;:27;87759:4;87704:25;:60::i;:::-;87669:95;;;;87934:7;;87923:8;:18;87919:880;;;88041:10;;;;88036:752;;88072:6;88101:232;88107:12;;88101:232;;88154:45;88167:31;88180:8;88190:7;88167:12;:31::i;:::-;88154:8;;:12;:45::i;:::-;88143:56;;88230:1;88225;:6;88222:66;;88259:5;;88222:66;88310:3;;88101:232;;;88036:752;;;;88489:4;;;:20;;-1:-1:-1;;;88489:20:0;;-1:-1:-1;;;;;88489:4:0;;;;:14;;:20;;73169:42;;88489:20;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;88478:8;:31;88474:136;;;88545:45;88558:31;88571:8;88581:7;88558:12;:31::i;:::-;88545:8;;:12;:45::i;:::-;88534:56;;88474:136;88686:7;;88675:8;:18;88672:99;;;88717:34;88733:7;88742:8;88717:15;:34::i;88672:99::-;86945:1861;;;;:::o;84871:1929::-;85174:6;;:31;;-1:-1:-1;;;85174:31:0;;84988:15;;;;;;85174:6;;;-1:-1:-1;;;;;85174:6:0;;:16;;:31;;85199:4;;85174:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;85170:430;;85249:4;;;:29;;-1:-1:-1;;;85249:29:0;;85227:19;;-1:-1:-1;;;;;85249:4:0;;;;:14;;:29;;85272:4;;85249:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;85227:51;;85496:39;85505:11;85518:16;85496:8;:39::i;:::-;85481:54;;85551:37;;;85170:430;85611:16;85629:15;85648:17;:15;:17::i;:::-;85610:55;;;;85708:12;:10;:12::i;:::-;85752:16;:14;:16::i;:::-;85803:4;;;:29;;-1:-1:-1;;;85803:29:0;;85781:19;;-1:-1:-1;;;;;85803:4:0;;;;:14;;:29;;85826:4;;85803:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;85781:51;-1:-1:-1;85845:23:0;85871:21;:8;85884:7;85871:12;:21::i;:::-;85845:47;-1:-1:-1;85903:15:0;85921:32;85845:47;85941:11;85921:19;:32::i;:::-;85966:12;85981:5;;:31;;-1:-1:-1;;;85981:31:0;;85903:50;;-1:-1:-1;85966:12:0;;-1:-1:-1;;;;;85981:5:0;;;;:16;;:31;;86006:4;;85981:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:41;;;85966:56;;86091:4;86081:7;:14;86077:716;;;86132:4;86122:7;:14;86112:24;;86171:7;86157:11;:21;86153:335;;;86266:11;86256:21;;86153:335;;;86317:29;:7;86329:16;86317:11;:29::i;:::-;86303:11;:43;86299:189;;;86381:16;86366:31;;86299:189;;;86465:7;86451:11;:21;86436:36;;86299:189;86077:716;;;86705:7;86698:4;:14;86690:22;;86742:39;86751:11;86764:16;86742:8;:39::i;:::-;86727:54;;86077:716;84871:1929;;;;;;;;;;;;:::o;60851:297::-;61006:15;61024:5;;:30;;-1:-1:-1;;;61024:30:0;;-1:-1:-1;;;;;61024:5:0;;;;:15;;:30;;61048:4;;61024:30;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;61006:48;-1:-1:-1;61069:11:0;;61065:76;;61097:5;;61112:7;;61097:32;;-1:-1:-1;;;61097:32:0;;-1:-1:-1;;;;;61097:5:0;;;;:14;;:32;;61112:7;;;61121;;61097:32;;;:::i;99636:825::-;99745:4;;;:29;;-1:-1:-1;;;99745:29:0;;99731:11;;-1:-1:-1;;;;;99745:4:0;;;;:14;;:29;;99768:4;;99745:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;99731:43;;99800:6;99793:3;:13;;99785:38;;;;-1:-1:-1;;;99785:38:0;;;;;;;:::i;:::-;99926:7;99922:532;;;99950:6;;:26;;-1:-1:-1;;;99950:26:0;;:6;;;;-1:-1:-1;;;;;99950:6:0;;:18;;:26;;99969:6;;99950:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;100056:6:0;;;;;-1:-1:-1;;;;;100056:6:0;:23;100080:13;:6;100091:1;100080:10;:13::i;:::-;100056:38;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;99922:532;;;100205:6;;:16;;-1:-1:-1;;;100205:16:0;;:6;;;;-1:-1:-1;;;;;100205:6:0;;:11;;:16;;100217:3;;100205:16;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:21;100197:44;;;;-1:-1:-1;;;100197:44:0;;;;;;;:::i;:::-;100414:6;;;;;-1:-1:-1;;;;;100414:6:0;:13;100428;:6;100439:1;100428:10;:13::i;:::-;100414:28;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;103478:487::-;103538:16;73169:42;103538:36;;103587:18;103608:4;-1:-1:-1;;;;;103608:18:0;;:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;103587:41;-1:-1:-1;103641:16:0;;103668:231;103692:10;103688:1;:14;103668:231;;;103735:29;;-1:-1:-1;;;103735:29:0;;-1:-1:-1;;;;;103735:26:0;;;;;:29;;103762:1;;103735:29;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;103805:4;;103724:40;;-1:-1:-1;;;;;;103785:25:0;;;103805:4;;103785:25;103781:107;;;103831:12;:16;-1:-1:-1;103866:7:0;;-1:-1:-1;;103866:7:0;103781:107;103704:3;;103668:231;;;;103911:46;;-1:-1:-1;;;103911:46:0;;;;;;;:::i;95972:609::-;96055:12;;;;;;;96051:513;;96084:16;96102:15;96121:17;:15;:17::i;:::-;96083:55;;-1:-1:-1;96083:55:0;-1:-1:-1;96153:36:0;96167:21;96083:55;;96167:12;:21::i;96153:36::-;-1:-1:-1;96238:6:0;;:40;;-1:-1:-1;;;96238:40:0;;96211:21;;96238:6;;;-1:-1:-1;;;;;96238:6:0;;:25;;:40;;96272:4;;96238:40;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;96206:72;;;;;96319:6;96303:13;:22;96295:51;;;;-1:-1:-1;;;96295:51:0;;;;;;;:::i;:::-;96419:30;;-1:-1:-1;;;96419:30:0;;73445:42;;96363:12;;73445:42;;96419:15;;:30;;96443:4;;96419:30;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;96405:44;-1:-1:-1;96467:10:0;;96464:89;;96497:40;-1:-1:-1;;;;;96497:18:0;;96516:12;96530:6;96497:18;:40::i;:::-;96051:513;;;;;95972:609;:::o;24363:181::-;24421:7;24453:5;;;24477:6;;;;24469:46;;;;-1:-1:-1;;;24469:46:0;;;;;;;:::i;39197:761::-;39621:23;39647:69;39675:4;39647:69;;;;;;;;;;;;;;;;;39655:5;-1:-1:-1;;;;;39647:27:0;;;:69;;;;;:::i;:::-;39731:17;;39621:95;;-1:-1:-1;39731:21:0;39727:224;;39873:10;39862:30;;;;;;;;;;;;:::i;:::-;39854:85;;;;-1:-1:-1;;;39854:85:0;;;;;;;:::i;18869:979::-;18999:12;19032:18;19043:6;19032:10;:18::i;:::-;19024:60;;;;-1:-1:-1;;;19024:60:0;;;;;;;:::i;:::-;19158:12;19172:23;19199:6;-1:-1:-1;;;;;19199:11:0;19219:8;19230:4;19199:36;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19157:78;;;;19250:7;19246:595;;;19281:10;-1:-1:-1;19274:17:0;;-1:-1:-1;19274:17:0;19246:595;19395:17;;:21;19391:439;;19658:10;19652:17;19719:15;19706:10;19702:2;19698:19;19691:44;19606:148;19801:12;19794:20;;-1:-1:-1;;;19794:20:0;;;;;;;;:::i;19391:439::-;18869:979;;;;;;;;:::o;25266:192::-;25352:7;25388:12;25380:6;;;;25372:29;;;;-1:-1:-1;;;25372:29:0;;;;;;;;:::i;:::-;-1:-1:-1;;;25424:5:0;;;25266:192::o;89172:2339::-;89230:11;89255:16;89273:12;89289:41;89315:7;89324:5;89289:25;:41::i;:::-;89254:76;;;;89466:7;:29;;;;;89488:7;;89477:8;:18;89466:29;89462:853;;;89664:10;;;;89660:110;;;89706:48;89719:34;89735:7;89744:8;89719:15;:34::i;89706:48::-;89695:59;;89660:110;89786:7;89984:320;90002:7;;:16;;90014:3;90002:11;:16::i;:::-;89991:8;:27;89984:320;;;90050:42;90063:28;90076:8;90086:4;90063:12;:28::i;90050:42::-;90039:53;-1:-1:-1;90111:3:0;;90202:1;90197:6;;;;90193:96;;90237:4;90228:13;;90264:5;;90193:96;89984:320;;;89462:853;;90484:22;90508:21;90533:20;:18;:20::i;:::-;90586:16;;90483:70;;-1:-1:-1;90483:70:0;-1:-1:-1;90566:17:0;90655:14;90652:99;;90697:4;90685:16;;90652:99;90789:38;90817:9;90789:23;:13;90807:4;90789:17;:23::i;:38::-;90772:55;;90861:14;90843;:32;90840:317;;90891:18;90912:34;:14;90931;90912:18;:34::i;:::-;90891:55;;90980:7;90967:10;:20;90963:183;;;91008:6;;:35;;-1:-1:-1;;;91008:35:0;;:6;;;;-1:-1:-1;;;;;91008:6:0;;:23;;:35;;91032:10;;91008:35;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;90963:183;;;91098:6;;:32;;-1:-1:-1;;;91098:32:0;;:6;;;;-1:-1:-1;;;;;91098:6:0;;:23;;:32;;91122:7;;91098:32;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;90963:183;90840:317;;91179:16;;:21;:70;;;;-1:-1:-1;91204:4:0;;;:29;;-1:-1:-1;;;91204:29:0;;91236:13;;-1:-1:-1;;;;;91204:4:0;;;;:14;;:29;;91227:4;;91204:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:45;91179:70;91176:134;;;91265:6;;:33;;-1:-1:-1;;;91265:33:0;;:6;;;;-1:-1:-1;;;;;91265:6:0;;:18;;:33;;91284:13;;91265:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;91176:134;91487:16;:14;:16::i;:::-;89172:2339;;;;;;;;;:::o;23035:106::-;23093:7;23124:1;23120;:5;:13;;23132:1;23120:13;;;-1:-1:-1;23128:1:0;;23035:106;-1:-1:-1;23035:106:0:o;27292:278::-;27378:7;27413:12;27406:5;27398:28;;;;-1:-1:-1;;;27398:28:0;;;;;;;;:::i;:::-;;27437:9;27453:1;27449;:5;;;;;;;27292:278;-1:-1:-1;;;;;27292:278:0:o;92009:1731::-;92089:16;92107:12;92184:16;92202:15;92221:17;:15;:17::i;:::-;92183:55;;-1:-1:-1;92183:55:0;-1:-1:-1;92333:22:0;92358:21;92183:55;;92358:12;:21::i;:::-;92333:46;;92637:21;92677:3;92673:224;;;92713:27;:14;92732:7;92713:18;:27::i;:::-;92697:43;;92673:224;;;92787:14;92777:7;:24;92774:53;;;92813:14;92803:24;;92774:53;92858:27;:14;92877:7;92858:18;:27::i;:::-;92842:43;;92673:224;92934:11;92948:35;92966:16;;92948:13;:17;;:35;;;;:::i;:::-;92934:49;;92994:11;93008:35;93026:16;;93016:4;93008:17;;:35;;;;:::i;:::-;92994:49;-1:-1:-1;93056:21:0;93080:12;:3;92994:49;93080:7;:12::i;:::-;93056:36;;93123:3;93107:13;:19;93103:137;;;-1:-1:-1;;93209:19:0;93103:137;93445:7;93429:13;:23;93425:308;;;93479:4;93469:14;;93519:13;93509:7;:23;93498:34;;93425:308;;;93667:5;93657:15;;93714:7;93698:13;:23;93687:34;;93425:308;92009:1731;;;;;;;;;;;;:::o;96777:795::-;96844:14;96984:12;96998:16;97018:20;:18;:20::i;:::-;96983:55;;;;97128:8;97140:1;97128:13;:24;;;;;97145:7;97128:24;97124:65;;;97176:1;97169:8;;;;;;97124:65;97267:6;;97242:33;;-1:-1:-1;;;97242:33:0;;97204:32;;73322:42;;97242:16;;:33;;97267:6;;;;-1:-1:-1;;;;;97267:6:0;;97242:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;97201:74;;;;97292:7;97288:217;;;97325:64;97343:3;97348:4;97354:8;97364:24;97325:17;:64::i;:::-;97316:73;;97288:217;;;97431:62;97447:3;97452:4;97458:8;97468:24;97431:15;:62::i;:::-;97422:71;;97288:217;97522:42;97531:3;97536:6;97544:7;97561:1;97522:42;;;;;;;;;:::i;:::-;;;;;;;;96777:795;;;;;;;:::o;101415:1220::-;101495:7;101518:18;101515:57;;-1:-1:-1;101559:1:0;101552:8;;101515:57;101762:4;;;:20;;-1:-1:-1;;;101762:20:0;;101599:13;;73169:42;;101582:14;;-1:-1:-1;;;;;101762:4:0;;;;:14;;:20;;73169:42;;101762:20;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;101739:43;;101814:6;101799:12;:21;101795:75;;;101846:12;101837:21;;101795:75;101882:17;101913:7;101922:6;101902:27;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;;101902:27:0;;;102102:1;102077:27;;;;;;;;;101902;-1:-1:-1;102036:38:0;;101902:27;102077;;;;;;:::i;:::-;;;;;;;;;;;;;;;;102036:68;;102133:40;102152:12;;102166:6;102133:18;:40::i;:::-;102117:10;102128:1;102117:13;;;;;;;;;;;;;:56;;;;102200:96;102281:4;102200:14;:96::i;:::-;102184:10;102195:1;102184:13;;;;;;;;;;;;;;;;;:112;102341:12;;102323:46;;102355:13;:6;102366:1;102355:10;:13::i;:::-;102323:17;:46::i;:::-;102307:10;102318:1;102307:13;;;;;;;;;;;;;;;;;:62;102419:21;;;102438:1;102419:21;;;;;;;;;102382:34;;102419:21;;;;;;:::i;:::-;;;;;;;;;;;;;;;;102382:58;;102469:17;:15;:17::i;:::-;102451:12;102464:1;102451:15;;;;;;;;;;;;;;;;;:35;102499:38;;-1:-1:-1;;;102499:38:0;;-1:-1:-1;;;;;102499:12:0;;;;;:38;;102512:12;;102526:10;;102499:38;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;102555:46;102564:13;102579:6;102587:7;73169:42;102555:46;;;;;;;;;:::i;:::-;;;;;;;;-1:-1:-1;102621:6:0;;101415:1220;-1:-1:-1;;;;;;;101415:1220:0:o;95208:175::-;95276:16;;;95290:1;95276:16;;;;;;;;;95250:23;;95276:16;;;;;;;;;;;-1:-1:-1;95276:16:0;95250:42;;95315:6;;;;;;;;;-1:-1:-1;;;;;95315:6:0;95303;95310:1;95303:9;;;;;;;;-1:-1:-1;;;;;95303:18:0;;;:9;;;;;;;;;;;:18;95334:41;;-1:-1:-1;;;95334:41:0;;73322:42;;95334:18;;:41;;95361:4;;95368:6;;95334:41;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;95417:415;95479:37;;-1:-1:-1;;;95479:37:0;;95463:13;;73445:42;;95479:22;;:37;;95510:4;;95479:37;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;95463:53;;95541:13;;95533:5;:21;95529:296;;;95595:16;;;95609:1;95595:16;;;;;;;;;95571:21;;95595:16;;;95571:21;;95595:16;;;;;-1:-1:-1;95595:16:0;95571:40;;73445:42;95626:4;95631:1;95626:7;;;;;;;;;;;;;:14;-1:-1:-1;;;;;95626:14:0;;;-1:-1:-1;;;;;95626:14:0;;;;;73752:42;95655:4;95660:1;95655:7;;;;;;;;-1:-1:-1;;;;;95655:14:0;;;:7;;;;;;;;;:14;95702:4;;95684:7;;95702:4;;;95684;;95689:1;;95684:7;;;;;;-1:-1:-1;;;;;95684:23:0;;;:7;;;;;;;;;;;:23;95724:89;;-1:-1:-1;;;95724:89:0;;73663:42;;95724:44;;:89;;95769:5;;95784:1;;95788:4;;95802;;95809:3;;95724:89;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;95724:89:0;;;;;;;;;;;;:::i;36892:177::-;36975:86;36995:5;37025:23;;;37050:2;37054:5;37002:58;;;;;;;;;:::i;14377:619::-;14437:4;14905:20;;14748:66;14945:23;;;;;;:42;;-1:-1:-1;;14972:15:0;;;14937:51;-1:-1:-1;;14377:619:0:o;97634:1271::-;97798:25;;97975:16;;97972:100;;98025:35;98048:11;98025:18;:8;98038:4;98025:12;:18::i;:35::-;98007:53;;97972:100;98102:25;:4;98111:15;98102:8;:25::i;:::-;98082:45;;98165:8;98144:17;:29;98140:90;;98210:8;98190:28;;98140:90;98265:13;98244:17;:34;98240:100;;98315:13;98295:33;;98240:100;98350:26;98379:6;;;;;;;;;-1:-1:-1;;;;;98379:6:0;-1:-1:-1;;;;;98379:25:0;;:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;98350:56;-1:-1:-1;98350:56:0;98568:27;:17;98590:4;98568:21;:27::i;:::-;:49;;:75;;;;;98641:2;98621:17;:22;98568:75;98565:333;;;98715:6;;:42;;-1:-1:-1;;;98715:42:0;;-1:-1:-1;;98679:21:0;;;;;98715:6;;;;-1:-1:-1;;;;;98715:6:0;;:23;;:42;;98679:21;;98715:42;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;98849:6:0;;:37;;-1:-1:-1;;;98849:37:0;;:6;;;;-1:-1:-1;;;;;98849:6:0;;:18;;:37;;98868:17;;98849:37;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;97634:1271;;;;;;;;:::o;98969:631::-;99129:23;;99193:31;99219:4;99193:21;:4;99202:11;99193:8;:21::i;:31::-;99165:59;-1:-1:-1;99255:31:0;99165:59;99277:8;99255:21;:31::i;:::-;99237:49;;99322:11;99303:15;:30;99299:92;;99368:11;99350:29;;99299:92;99422:2;99404:15;:20;99401:190;;;99492:6;;:30;;-1:-1:-1;;;99492:30:0;;-1:-1:-1;;99458:19:0;;;;;99492:6;;;;-1:-1:-1;;;;;99492:6:0;;:13;;:30;;99458:19;;99492:30;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;99537:6:0;;99549:4;;;:29;;-1:-1:-1;;;99549:29:0;;-1:-1:-1;;;;;99537:6:0;;;;;;;:11;;99549:4;;;:14;;:29;;99572:4;;99549:29;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;99537:42;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;99401:190::-;98969:631;;;;;;;:::o;34225:720::-;34310:25;;:::i;:::-;34368:569;;;;;;;;34418:27;34368:569;;-1:-1:-1;34368:569:0;;;;;;;34503:226;;;;;;;;;;34368:569;;;;;34503:226;;;;;;;;;;34647:26;34503:226;;;;34703:6;34503:226;;;34368:569;;;;34765:8;34368:569;;;;34811:1;34368:569;;;;34853:4;-1:-1:-1;;;;;34368:569:0;;;;;34893:1;34368:569;;;;;;;;;;;;;;;;;;;34348:589;;34225:720;;;;:::o;34953:584::-;35019:25;;:::i;:::-;35077:452;;;;;;;;35127:23;35077:452;;-1:-1:-1;35077:452:0;;;;;;;35208:118;;;;;;;;;;35077:452;;;;;35208:118;;;;;;;;;35288:26;35208:118;;35323:1;35208:118;;;;;;;35077:452;;;;;;;;;;;;;;35443:4;35077:452;;;;;;;;;;;;;;-1:-1:-1;35057:472:0;34953:584::o;35545:717::-;35629:25;;:::i;:::-;35687:567;;;;;;;;-1:-1:-1;35687:567:0;;;;;;;;;;35821:225;;;;;;;35868:4;35821:225;;35687:567;;;;;35821:225;;;;;;;34073:144;34123:19;;:::i;:::-;-1:-1:-1;34162:47:0;;;;;;;;;34191:4;34162:47;;34206:1;34162:47;;;;34073:144;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;5:130::-;72:20;;97:33;72:20;97:33;:::i;4222:241::-;;4326:2;4314:9;4305:7;4301:23;4297:32;4294:2;;;-1:-1;;4332:12;4294:2;85:6;72:20;97:33;124:5;97:33;:::i;4470:263::-;;4585:2;4573:9;4564:7;4560:23;4556:32;4553:2;;;-1:-1;;4591:12;4553:2;226:6;220:13;238:33;265:5;238:33;:::i;4740:491::-;;;;4878:2;4866:9;4857:7;4853:23;4849:32;4846:2;;;-1:-1;;4884:12;4846:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;4936:63;-1:-1;5036:2;5075:22;;72:20;97:33;72:20;97:33;:::i;:::-;4840:391;;5044:63;;-1:-1;;;5144:2;5183:22;;;;4011:20;;4840:391::o;5238:636::-;;;;5393:9;5384:7;5380:23;5405:3;5380:23;5376:33;5373:2;;;-1:-1;;5412:12;5373:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;5464:63;-1:-1;2056:4;-1:-1;;2035:19;;2031:30;2028:2;;;-1:-1;;2064:12;2028:2;;2092:20;2056:4;2092:20;:::i;:::-;2195:49;2240:3;5564:2;5627:9;5623:22;2195:49;:::i;:::-;2170:75;;2056:4;2362:22;;4011:20;5564:2;2323:16;;2316:75;2177:16;-1:-1;5720:2;5705:18;;5692:32;5744:18;5733:30;;5730:2;;;-1:-1;;5766:12;5730:2;5826:22;;1392:4;1380:17;;1376:27;-1:-1;1366:2;;-1:-1;;1407:12;1366:2;1454:6;1441:20;1476:64;1491:48;1532:6;1491:48;:::i;:::-;1476:64;:::i;:::-;1560:6;1553:5;1546:21;1664:3;5564:2;1655:6;1588;1646:16;;1643:25;1640:2;;;-1:-1;;1671:12;1640:2;1691:41;1725:6;5564:2;1622:5;1618:16;5564:2;1588:6;1584:17;1691:41;:::i;:::-;5786:72;;;;;;5367:507;;;;;:::o;5881:392::-;;6021:2;;6009:9;6000:7;5996:23;5992:32;5989:2;;;-1:-1;;6027:12;5989:2;6078:17;6072:24;6116:18;6108:6;6105:30;6102:2;;;-1:-1;;6138:12;6102:2;6225:22;;422:4;410:17;;406:27;-1:-1;396:2;;-1:-1;;437:12;396:2;477:6;471:13;499:80;514:64;571:6;514:64;:::i;499:80::-;607:21;;;664:14;;;;639:17;;;753;;;744:27;;;;741:36;-1:-1;738:2;;;-1:-1;;780:12;738:2;-1:-1;806:10;;800:217;825:6;822:1;819:13;800:217;;;4159:13;;893:61;;847:1;840:9;;;;;968:14;;;;996;;800:217;;;-1:-1;6158:99;5983:290;-1:-1;;;;;;;5983:290::o;6280:235::-;;6381:2;6369:9;6360:7;6356:23;6352:32;6349:2;;;-1:-1;;6387:12;6349:2;1108:6;1095:20;1120:30;1144:5;1120:30;:::i;6522:257::-;;6634:2;6622:9;6613:7;6609:23;6605:32;6602:2;;;-1:-1;;6640:12;6602:2;1243:6;1237:13;1255:30;1279:5;1255:30;:::i;6786:393::-;;;6915:2;6903:9;6894:7;6890:23;6886:32;6883:2;;;-1:-1;;6921:12;6883:2;1243:6;1237:13;1255:30;1279:5;1255:30;:::i;:::-;7081:2;7131:22;;;;4159:13;6973:71;;4159:13;;-1:-1;;;6877:302::o;7186:523::-;;;;7329:2;7317:9;7308:7;7304:23;7300:32;7297:2;;;-1:-1;;7335:12;7297:2;1243:6;1237:13;1255:30;1279:5;1255:30;:::i;:::-;7495:2;7545:22;;4159:13;7614:2;7661:22;;1237:13;7387:71;;-1:-1;4159:13;-1:-1;1255:30;1237:13;1255:30;:::i;:::-;7622:71;;;;7291:418;;;;;:::o;8020:324::-;;8165:3;;8153:9;8144:7;8140:23;8136:33;8133:2;;;-1:-1;;8172:12;8133:2;2615:22;8165:3;2615:22;:::i;:::-;2606:31;;2761:22;4159:13;2711:16;2704:86;2857:2;2926:9;2922:22;4159:13;2857:2;2876:5;2872:16;2865:86;3017:2;3086:9;3082:22;4159:13;3017:2;3036:5;3032:16;3025:86;3177:2;3246:9;3242:22;4159:13;3177:2;3196:5;3192:16;3185:86;3338:3;3408:9;3404:22;4159:13;3338:3;3358:5;3354:16;3347:86;3499:3;3569:9;3565:22;4159:13;3499:3;3519:5;3515:16;3508:86;3660:3;3730:9;3726:22;4159:13;3660:3;3680:5;3676:16;3669:86;3821:3;3891:9;3887:22;4159:13;3821:3;3841:5;3837:16;3830:86;8224:104;;;;8127:217;;;;:::o;8351:241::-;;8455:2;8443:9;8434:7;8430:23;8426:32;8423:2;;;-1:-1;;8461:12;8423:2;-1:-1;4011:20;;8417:175;-1:-1;8417:175::o;8599:263::-;;8714:2;8702:9;8693:7;8689:23;8685:32;8682:2;;;-1:-1;;8720:12;8682:2;-1:-1;4159:13;;8676:186;-1:-1;8676:186::o;8869:672::-;;;;;9035:3;9023:9;9014:7;9010:23;9006:33;9003:2;;;-1:-1;;9042:12;9003:2;-1:-1;;4159:13;;9205:2;9255:22;;4159:13;9324:2;9374:22;;4159:13;9443:2;9493:22;;;4159:13;;;;;-1:-1;4159:13;;-1:-1;8997:544;-1:-1;8997:544::o;10211:253::-;26505:23;;-1:-1;;;;;49200:54;10682:37;;26678:4;26667:16;;;26661:23;26738:14;;;26842:37;10453:4;10444:14;;10331:133::o;10621:103::-;-1:-1;;;;;49200:54;10682:37;;10676:48::o;10882:690::-;;11075:5;45979:12;47424:6;47419:3;47412:19;47461:4;;47456:3;47452:14;11087:93;;47461:4;11251:5;45297:14;-1:-1;11290:260;11315:6;11312:1;11309:13;11290:260;;;11376:13;;-1:-1;;;;;49200:54;10682:37;;9702:14;;;;46860;;;;5744:18;11330:9;11290:260;;;-1:-1;11556:10;;11006:566;-1:-1;;;;;11006:566::o;14654:323::-;;14786:5;45979:12;47424:6;47419:3;47412:19;14869:52;14914:6;47461:4;47456:3;47452:14;47461:4;14895:5;14891:16;14869:52;:::i;:::-;2035:19;52137:14;-1:-1;;52133:28;14933:39;;;;47461:4;14933:39;;14734:243;-1:-1;;14734:243::o;16170:138::-;52256:1;52249:5;52246:12;52236:2;;52262:9;52236:2;16242:61;;16236:72::o;25438:821::-;25651:16;25645:23;48550:13;48543:21;14504:3;14497:34;25818:4;25811:5;25807:16;25801:23;48920:55;48969:5;48920:55;:::i;:::-;25818:4;25898:14;;16396:70;25991:4;25980:16;;25974:23;48920:55;25974:23;48920:55;:::i;:::-;25991:4;26068:14;;16556:67;26163:4;26152:16;;;26146:23;26223:14;;26842:37;25552:707::o;27011:271::-;;15144:5;45979:12;15255:52;15300:6;15295:3;15288:4;15281:5;15277:16;15255:52;:::i;:::-;15319:16;;;;;27145:137;-1:-1;;27145:137::o;27289:222::-;-1:-1;;;;;49200:54;;;;10682:37;;27416:2;27401:18;;27387:124::o;27518:349::-;-1:-1;;;;;49200:54;;;;10551:58;;27853:2;27838:18;;26842:37;27681:2;27666:18;;27652:215::o;27874:333::-;-1:-1;;;;;49200:54;;;10682:37;;49200:54;;28193:2;28178:18;;10682:37;28029:2;28014:18;;28000:207::o;28214:513::-;-1:-1;;;;;49200:54;;;10682:37;;28435:2;28553;28538:18;;;28531:48;;;45979:12;;28420:18;;;47412:19;;;28214:513;;45297:14;;;;49211:42;;28553:2;47452:14;;;;28214:513;12076:292;12101:6;12098:1;12095:13;12076:292;;;12162:13;;49200:54;;15434:66;;46860:14;;;;9916;;;;12123:1;12116:9;12076:292;;;-1:-1;28585:132;;28406:321;-1:-1;;;;;;;;28406:321::o;29074:813::-;;29421:2;;29410:9;29406:18;29421:2;29442:17;29435:47;29496:148;13837:5;45979:12;13856:106;13955:6;13950:3;13856:106;:::i;:::-;13849:113;;45306:4;;;;14053:5;45297:14;-1:-1;14092:320;14117:6;14114:1;14111:13;14092:320;;;14205:103;14304:3;14184:6;14178:13;14205:103;:::i;:::-;14198:110;-1:-1;46860:14;;;;14139:1;14132:9;14092:320;;;-1:-1;;;29682:20;;;29662:18;;;29655:48;45979:12;;47412:19;;;47452:14;;;;12920:17;;;12911:27;;;;45297:14;;;-1:-1;13074:408;13099:6;13096:1;13093:13;13074:408;;;2035:19;;47456:3;13155:4;13151:20;;13146:3;13139:33;13206:6;13200:13;23898:6;24001:74;24060:14;23978:16;23972:23;24001:74;:::i;:::-;45306:4;24152:5;24148:16;24142:23;45306:4;24223:3;24219:14;26842:37;29421:2;24308:5;24304:16;24298:23;24327:121;29421:2;24437:3;24433:14;24419:12;24327:121;:::i;:::-;;24538:4;24531:5;24527:16;24521:23;24607:4;24521:23;24607:4;24602:3;24598:14;26842:37;24705:4;24698:5;24694:16;24688:23;;;24774:4;24688:23;24774:4;24769:3;24765:14;26842:37;24867:4;24860:5;24856:16;24850:23;24830:43;;24879:65;24936:6;24931:3;24927:16;24913:12;24879:65;:::i;:::-;25022:16;;;25016:23;25102:6;25093:16;;26842:37;25178:16;;;25172:23;25224:6;25215:16;;25208:40;;;25172:23;-1:-1;25263:71;23889:16;;;25172:23;25263:71;:::i;:::-;13461:14;;;;13220:124;-1:-1;;;46860:14;;;;14139:1;13114:9;13074:408;;;-1:-1;29709:168;;29392:495;-1:-1;;;;;;;;;;29392:495::o;29894:210::-;48550:13;;48543:21;14497:34;;30015:2;30000:18;;29986:118::o;30111:321::-;48550:13;;48543:21;14497:34;;30418:2;30403:18;;26842:37;30260:2;30245:18;;30231:201::o;31491:310::-;;31638:2;31659:17;31652:47;31713:78;31638:2;31627:9;31623:18;31777:6;31713:78;:::i;31808:416::-;32008:2;32022:47;;;17214:2;31993:18;;;47412:19;-1:-1;;;47452:14;;;17230:34;17283:12;;;31979:245::o;32231:416::-;32431:2;32445:47;;;17534:1;32416:18;;;47412:19;-1:-1;;;47452:14;;;17549:28;17596:12;;;32402:245::o;32654:416::-;32854:2;32868:47;;;17847:2;32839:18;;;47412:19;17883:29;47452:14;;;17863:50;17932:12;;;32825:245::o;33077:416::-;33277:2;33291:47;;;18183:2;33262:18;;;47412:19;-1:-1;;;47452:14;;;18199:36;18254:12;;;33248:245::o;33500:416::-;33700:2;33714:47;;;18505:2;33685:18;;;47412:19;-1:-1;;;47452:14;;;18521:39;18579:12;;;33671:245::o;33923:416::-;34123:2;34137:47;;;18830:2;34108:18;;;47412:19;-1:-1;;;47452:14;;;18846:44;18909:12;;;34094:245::o;34346:416::-;34546:2;34560:47;;;19160:2;34531:18;;;47412:19;19196:34;47452:14;;;19176:55;-1:-1;;;19251:12;;;19244:25;19288:12;;;34517:245::o;34769:416::-;34969:2;34983:47;;;19539:1;34954:18;;;47412:19;-1:-1;;;47452:14;;;19554:29;19602:12;;;34940:245::o;35192:416::-;35392:2;35406:47;;;19853:2;35377:18;;;47412:19;19889:34;47452:14;;;19869:55;-1:-1;;;19944:12;;;19937:28;19984:12;;;35363:245::o;35615:416::-;35815:2;35829:47;;;20235:1;35800:18;;;47412:19;-1:-1;;;47452:14;;;20250:30;20299:12;;;35786:245::o;36038:416::-;36238:2;36252:47;;;20550:1;36223:18;;;47412:19;-1:-1;;;47452:14;;;20565:31;20615:12;;;36209:245::o;36461:416::-;36661:2;36675:47;;;20866:2;36646:18;;;47412:19;-1:-1;;;47452:14;;;20882:33;20934:12;;;36632:245::o;36884:416::-;37084:2;37098:47;;;21185:2;37069:18;;;47412:19;21221:31;47452:14;;;21201:52;21272:12;;;37055:245::o;37307:416::-;37507:2;37521:47;;;21523:2;37492:18;;;47412:19;-1:-1;;;47452:14;;;21539:42;21600:12;;;37478:245::o;37730:416::-;37930:2;37944:47;;;21851:2;37915:18;;;47412:19;-1:-1;;;47452:14;;;21867:34;21920:12;;;37901:245::o;38153:416::-;38353:2;38367:47;;;22171:2;38338:18;;;47412:19;-1:-1;;;47452:14;;;22187:34;22240:12;;;38324:245::o;38576:416::-;38776:2;38790:47;;;22491:2;38761:18;;;47412:19;22527:34;47452:14;;;22507:55;-1:-1;;;22582:12;;;22575:34;22628:12;;;38747:245::o;38999:416::-;39199:2;39213:47;;;22879:2;39184:18;;;47412:19;-1:-1;;;47452:14;;;22895:33;22947:12;;;39170:245::o;39422:416::-;39622:2;39636:47;;;23198:2;39607:18;;;47412:19;-1:-1;;;47452:14;;;23214:35;23268:12;;;39593:245::o;39845:416::-;40045:2;40059:47;;;23519:2;40030:18;;;47412:19;23555:34;47452:14;;;23535:55;-1:-1;;;23610:12;;;23603:46;23668:12;;;40016:245::o;40268:222::-;26842:37;;;40395:2;40380:18;;40366:124::o;40497:481::-;;26872:5;26849:3;26842:37;40702:2;40820;40809:9;40805:18;40798:48;40860:108;40702:2;40691:9;40687:18;40954:6;40860:108;:::i;40985:333::-;26842:37;;;41304:2;41289:18;;26842:37;41140:2;41125:18;;41111:207::o;41325:816::-;;26872:5;26849:3;26842:37;26872:5;41779:2;41768:9;41764:18;26842:37;41614:3;41816:2;41805:9;41801:18;41794:48;41856:108;41614:3;41603:9;41599:19;41950:6;41856:108;:::i;:::-;-1:-1;;;;;49200:54;;;;42043:2;42028:18;;10682:37;-1:-1;42126:3;42111:19;26842:37;41848:116;41585:556;-1:-1;;;41585:556::o;42148:544::-;26842:37;;;42518:2;42503:18;;26842:37;;;;48550:13;48543:21;42595:2;42580:18;;14497:34;-1:-1;;;;;49200:54;42678:2;42663:18;;10682:37;42353:3;42338:19;;42324:368::o;43266:444::-;26842:37;;;43613:2;43598:18;;26842:37;;;;43696:2;43681:18;;26842:37;43449:2;43434:18;;43420:290::o;43717:556::-;26842:37;;;44093:2;44078:18;;26842:37;;;;44176:2;44161:18;;26842:37;44259:2;44244:18;;26842:37;43928:3;43913:19;;43899:374::o;44280:256::-;44342:2;44336:9;44368:17;;;44443:18;44428:34;;44464:22;;;44425:62;44422:2;;;44500:1;;44490:12;44422:2;44342;44509:22;44320:216;;-1:-1;44320:216::o;44543:304::-;;44702:18;44694:6;44691:30;44688:2;;;-1:-1;;44724:12;44688:2;-1:-1;44769:4;44757:17;;;44822:15;;44625:222::o;44854:321::-;;44997:18;44989:6;44986:30;44983:2;;;-1:-1;;45019:12;44983:2;-1:-1;2035:19;45073:17;-1:-1;;45069:33;45160:4;45150:15;;44920:255::o;51639:145::-;51720:6;51715:3;51710;51697:30;-1:-1;51776:1;51758:16;;51751:27;51690:94::o;51793:268::-;51858:1;51865:101;51879:6;51876:1;51873:13;51865:101;;;51946:11;;;51940:18;51927:11;;;51920:39;51901:2;51894:10;51865:101;;;51981:6;51978:1;51975:13;51972:2;;;-1:-1;;51858:1;52028:16;;52021:27;51842:219::o;52285:113::-;52376:1;52369:5;52366:12;52356:2;;52382:9;52522:117;-1:-1;;;;;49200:54;;52581:35;;52571:2;;52630:1;;52620:12;52646:111;52727:5;48550:13;48543:21;52705:5;52702:32;52692:2;;52748:1;;52738:12

Swarm Source

ipfs://51dbcfa73ea186649db9732b85942b5e9e7dc35b3dacf32dfe0765be467c203d

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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