false
false

Contract Address Details

0x03e0a570F0c5531AB76725b57cdaDcF481a99dE2

Contract Name
StrategyLP2
Creator
0x9ab7a2–138be3 at 0x3a64b9–7aed19
Balance
0 KCS
Tokens
Fetching tokens...
Transactions
1,786 Transactions
Transfers
11,961 Transfers
Gas Used
626,557,538
Last Balance Update
44804208
Contract is not verified. However, we found a verified contract with the same bytecode in Blockscout DB 0x69d7c0b81122b3f6964de6744f27a2a02e1840ba.
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
Verify & Publish
Contract name:
StrategyLP2




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
Verified at
2022-06-28T15:17:31.047882Z

Contract source code

// Sources flattened with hardhat v2.4.3 https://hardhat.org

// File contracts/ISwapPathRegistry.sol

pragma solidity ^0.6.0;
interface ISwapPathRegistry {
    function getSwapRoute(address _router, address _fromToken, address _toToken) external view returns (address[] memory);
}


// File contracts/IPanwexPair.sol

pragma solidity ^0.6.0;
interface IPanwexPair {
    function token0() external view returns (address);
    function token1() external view returns (address);
}


// File @uniswap/v2-periphery/contracts/interfaces/[email protected]

pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}


// File @uniswap/v2-periphery/contracts/interfaces/[email protected]

pragma solidity >=0.6.2;

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}


// File contracts/KCSRouter2.sol

pragma solidity >=0.6.2;
interface KCSRouter2 is IUniswapV2Router02{
 
     function addLiquidityKCS(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
//     function addLiquidity(
//         address tokenA,
//         address tokenB,
//         uint amountADesired,
//         uint amountBDesired,
//         uint amountAMin,
//         uint amountBMin,
//         address to,
//         uint deadline
//     ) external returns (uint amountA, uint amountB, uint liquidity);
//   function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
  
        
//     function swapExactTokensForTokensSupportingFeeOnTransferTokens(
//         uint amountIn,
//         uint amountOutMin,
//         address[] calldata path,
//         address to,
//         uint deadline
//     ) external;
  
  
}


// File @openzeppelin/contracts/GSN/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

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

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


// File contracts/Pausable.sol

pragma solidity ^0.6.0;
/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!_paused, "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(_paused, "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}


// File contracts/Buybackstrat.sol

pragma solidity ^0.6.0;

interface Buybackstrat{
    function performanceFeeBps() external view returns(uint);
    function withdrawalFeesBps() external view returns(uint);
    function setBuybackStrat() external;
}


// File @openzeppelin/contracts/token/ERC20/[email protected]



pragma solidity ^0.6.0;

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

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

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

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

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

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

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

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


// File @openzeppelin/contracts/math/[email protected]



pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, 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;
    }
}


// File @openzeppelin/contracts/utils/[email protected]



pragma solidity ^0.6.2;

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


// File @openzeppelin/contracts/token/ERC20/[email protected]



pragma solidity ^0.6.0;



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


// File @openzeppelin/contracts/access/[email protected]



pragma solidity ^0.6.0;

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

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

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

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

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

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

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


// File contracts/StrategyLP2.sol

pragma solidity ^0.6.0;
interface IMasterChefWStakingReferral {
    
    function deposit(uint256 poolId, uint256 amount) external;
    function withdraw(uint256 poolId, uint256 amount) external;

    function enterStaking(uint256 _amount) external;
    function leaveStaking(uint256 _amount) external;

    function deposit(uint256 poolId, uint256 amount, address referrer) external;

    function userInfo(uint256 poolId, address user) external view returns (uint256, uint256);
}


/**
 * @dev Implementation of a strategy to get yields from farming LP Pools in PanwexSwap.
 * PanwexSwap is an automated market maker (“AMM”) that allows two tokens to be exchanged on the Binance Smart Chain.
 * It is fast, cheap, and allows anyone to participate. PanwexSwap is aiming to be the #1 liquidity provider on BSC.
 *
 * This strategy simply deposits whatever funds it receives from the vault into the selected MasterChef pool.
 * CAKE rewards from providing liquidity are farmed every few minutes, sold and split 50/50. 
 * The corresponding pair of assets are bought and more liquidity is added to the MasterChef pool.
 * 
 * This strat is currently compatible with all LP pools.
 */
contract StrategyLP2 is Ownable, Pausable {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;

    /**
     * @dev Tokens Used:
     * {wkcs} - Required for liquidity routing when doing swaps.
     * {wex} - Token generated by staking our funds. In this case it's the CAKEs token.
     * {eleven} - ElevenFinance token, used to send funds to the treasury.
     * {lpPair} - Token that the strategy maximizes. The same token that users deposit in the vault.
     * {lpToken0, lpToken1} - Tokens that the strategy maximizes. IPanwexPair tokens
     */
    modifier onlyOwnerOrVault() {
        require(owner() == _msgSender() || vault == _msgSender() , "Ownable: caller is not the owner/vault");
        _;
    }
    
    modifier onlyVault() {
        require(vault == _msgSender() , "Ownable: caller is not the vault");
        _;
    }
    // these cant be changed after constructor
    address public lpPair;

    address public rewardToken;
    address public otherToken;
    address public baseToken;

    address public router;

    address public masterchef;
    uint256 public poolId;

    address public vault;
    
    // these can be changed after constructor, by the vault
    address public buybackstrat;
    address public swapPathRegistry;
    uint256 public MIN_TO_LIQUIFY = 100;
    bool public stakingMode = false;
    bool public referralMode = false;

    event Deposit(address indexed account, uint256 amt);
    event Withdraw(address indexed account, uint256 amt);
    event Compound(address indexed caller, uint256 lpAdded);
    event CompoundLoss(address indexed caller, uint256 change); // shouldnt happen since im comparing balanceOfPool
    

    function setBuybackStrat(address _address) external onlyOwner{
        buybackstrat = _address;
    }
    function setStakingMode(bool _b) external onlyOwner{
        stakingMode = _b;
    }
    function setReferralMode(bool _b) external onlyOwner{
        referralMode = _b;
    }
    function setSwapPathRegistry(address _a) external onlyOwner{
        swapPathRegistry = _a;
    }
    function setMinToLiquify(uint256 n) external onlyOwner{
        MIN_TO_LIQUIFY = n;
    }

    function depositToFarm(uint256 amt) internal{
        if (stakingMode){
            IMasterChefWStakingReferral(masterchef).enterStaking(amt);
        } else if (referralMode){
            IMasterChefWStakingReferral(masterchef).deposit(poolId,amt, address(0));
        } else {
            IMasterChefWStakingReferral(masterchef).deposit(poolId,amt);
        }
        emit Deposit(msg.sender, amt);

    }
    function withdrawFromFarm(uint256 amt) internal {
        if (stakingMode){
            IMasterChefWStakingReferral(masterchef).leaveStaking(amt);
        } else {
            IMasterChefWStakingReferral(masterchef).withdraw(poolId,amt);
        }
        emit Withdraw(msg.sender, amt);
    }
    /**
     * @dev Initializes the strategy with the token to maximize.
     */
    constructor(address _lpPair, 
    address _rewardToken, 
    address _baseToken, // 0 when in token mode
    address _vault, 
    address _masterchef, 
    uint256 _poolId, address _router, address _swapPathRegistry, address _feeStrat) public {
        lpPair = _lpPair;
        masterchef = _masterchef;
        poolId = _poolId;
        router = _router;
        swapPathRegistry = _swapPathRegistry;
        buybackstrat = _feeStrat;

        vault = _vault;
        
        if (_baseToken == address(0)){
            // token mode
            otherToken = address(0);
            baseToken = address(0);
        } else {
            address token0 = IPanwexPair(_lpPair).token0();
            address token1 = IPanwexPair(_lpPair).token1();
            (otherToken, baseToken) = (token0 == _baseToken) ? (token1,token0) : (token0,token1);
            IERC20(otherToken).safeApprove(router, 0);
            IERC20(otherToken).safeApprove(router, uint(-1));
            IERC20(baseToken).safeApprove(router, 0);
            IERC20(baseToken).safeApprove(router, uint(-1));
        }

        rewardToken = _rewardToken;

        IERC20(lpPair).safeApprove(masterchef, 0);
        IERC20(lpPair).safeApprove(masterchef, uint(-1));
        IERC20(rewardToken).safeApprove(router, 0);
        IERC20(rewardToken).safeApprove(router, uint(-1));
    }

    

    /**
     * @dev Function that puts the funds to work.
     * It gets called whenever someone deposits in the strategy's vault contract.
     * It deposits {lpPair} in the MasterChef to farm {wex}
     */
    function deposit() public {
        uint256 pairBal = IERC20(lpPair).balanceOf(address(this));

        if (pairBal > 0) {
            depositToFarm(pairBal);
        }
    }
    
    /**
     * @dev Withdraws funds and sents them back to the vault.
     * It withdraws {lpPair} from the MasterChef.
     * The available {lpPair} minus fees is returned to the vault.
     */
    function withdraw(uint256 _amount) external onlyVault {

        uint256 pairBal = IERC20(lpPair).balanceOf(address(this));

        if (pairBal < _amount) {   
            withdrawFromFarm(_amount.sub(pairBal));
            pairBal = IERC20(lpPair).balanceOf(address(this));
            IERC20(lpPair).safeTransfer(vault, pairBal);
        } else {
            IERC20(lpPair).safeTransfer(vault, _amount);
        }
    }
    
    
    function addliquidity() internal{
        uint amount = IERC20(rewardToken).balanceOf(address(this));

        uint amtToSell = amount.div(2);
        address[] memory path = ISwapPathRegistry(swapPathRegistry).getSwapRoute(router, rewardToken, baseToken);
        require(path.length > 0, "check swapPathRegistry1");
        KCSRouter2(router).swapExactTokensForTokensSupportingFeeOnTransferTokens(amtToSell, 0, path, address(this), now);

        if (otherToken != rewardToken){
            address[] memory path2 = ISwapPathRegistry(swapPathRegistry).getSwapRoute(router, rewardToken, otherToken);
            require(path2.length > 0, "check swapPathRegistry2");
            KCSRouter2(router).swapExactTokensForTokensSupportingFeeOnTransferTokens(amtToSell, 0, path2, address(this), now);
        }

        KCSRouter2(router).addLiquidity(otherToken, baseToken, IERC20(otherToken).balanceOf(address(this)), IERC20(baseToken).balanceOf(address(this)), 0, 0, address(this), now);
    }
    function swapToStakingToken() internal{
        if (rewardToken != lpPair){
            uint amount = IERC20(rewardToken).balanceOf(address(this));
            address[] memory path = ISwapPathRegistry(swapPathRegistry).getSwapRoute(router, rewardToken, lpPair);
            require(path.length > 0, "check swapPathRegistry3");
            KCSRouter2(router).swapExactTokensForTokensSupportingFeeOnTransferTokens(amount, 0, path, address(this), now);
        }
    }

    /**
     * @dev Core function of the strat, in charge of collecting and re-investing rewards.
     * 1. It claims rewards from the MasterChef.
     * 2. It charges the system fees to simplify the split.
     * 3. It swaps the {wex} token for {lpToken0} & {lpToken1}
     * 4. Adds more liquidity to the pool.
     * 5. It deposits the new LP tokens.
     */
    function harvest() external {
        require(!Address.isContract(msg.sender), "!contract");
        _harvest();
    }

    function harvestFromVault() external onlyVault {
        _harvest();
    }

    function _harvest() internal whenNotPaused {
        uint256 preBal = balanceOfPool();
        depositToFarm(0);

        if (IERC20(rewardToken).balanceOf(address(this)) > MIN_TO_LIQUIFY){
            chargeFees();
            if (baseToken != address(0)){
                addliquidity();
            } else {
                swapToStakingToken();
            }
            deposit();
        }

        uint256 postBal = balanceOfPool();
        if (postBal > preBal){
            emit Compound(msg.sender, postBal.sub(preBal));
        } else if (postBal < preBal){
            emit CompoundLoss(msg.sender, preBal.sub(postBal));
        }

    }

    function getBPSFee() public view returns (uint) {
        return Buybackstrat(buybackstrat).performanceFeeBps();
    }

    function chargeFees() internal {
        if(buybackstrat!=address(0)){
            uint toSell = IERC20(rewardToken).balanceOf(address(this)).mul(getBPSFee()).div(10000);
            IERC20(rewardToken).transfer(buybackstrat, toSell);
        }
    }

    /**
     * @dev Function to calculate the total underlaying {lpPair} held by the strat.
     * It takes into account both the funds in hand, as the funds allocated in the MasterChef.
     */
    function balanceOf() public view returns (uint256) {
        return balanceOfLpPair().add(balanceOfPool());
    }
    
    /**
     * @dev It calculates how much {lpPair} the contract holds.
     */
    function balanceOfLpPair() public view returns (uint256) {
        return IERC20(lpPair).balanceOf(address(this));
    }

    /**
     * @dev It calculates how much {lpPair} the strategy has allocated in the MasterChef
     */
    function balanceOfPool() public view returns (uint256) {
        (uint256 _amount,) = IMasterChefWStakingReferral(masterchef).userInfo(poolId, address(this));
        return _amount;
    }

    /**
     * @dev Function that has to be called as part of strat migration. It sends all the available funds back to the 
     * vault, ready to be migrated to the new strat.
     */ 
    function retireStrat() external onlyOwner {
        panic();

        uint256 pairBal = IERC20(lpPair).balanceOf(address(this));
        IERC20(lpPair).transfer(vault, pairBal);
    }

    /**
     * @dev Pauses deposits. Withdraws all funds from the MasterChef, leaving rewards behind
     */
    function panic() public onlyOwner {
        pause();
        withdrawFromFarm(balanceOfPool());
    }

    /**
     * @dev Pauses the strat.
     */
    function pause() public onlyOwner {
        _pause();
        IERC20(lpPair).safeApprove(masterchef, 0);
        IERC20(rewardToken).safeApprove(router, 0);
        if (baseToken != address(0)){
            IERC20(otherToken).safeApprove(router, 0);
            IERC20(baseToken).safeApprove(router, 0);
        }
    }

    /**
     * @dev Unpauses the strat.
     */
    function unpause() external onlyOwner {
        _unpause();

        IERC20(lpPair).safeApprove(masterchef, 0);
        IERC20(lpPair).safeApprove(masterchef, uint(-1));
        IERC20(rewardToken).safeApprove(router, 0);
        IERC20(rewardToken).safeApprove(router, uint(-1));
        if (baseToken != address(0)){
            IERC20(otherToken).safeApprove(router, 0);
            IERC20(otherToken).safeApprove(router, uint(-1));
            IERC20(baseToken).safeApprove(router, 0);
            IERC20(baseToken).safeApprove(router, uint(-1));
        }
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_lpPair","internalType":"address"},{"type":"address","name":"_rewardToken","internalType":"address"},{"type":"address","name":"_baseToken","internalType":"address"},{"type":"address","name":"_vault","internalType":"address"},{"type":"address","name":"_masterchef","internalType":"address"},{"type":"uint256","name":"_poolId","internalType":"uint256"},{"type":"address","name":"_router","internalType":"address"},{"type":"address","name":"_swapPathRegistry","internalType":"address"},{"type":"address","name":"_feeStrat","internalType":"address"}]},{"type":"event","name":"Compound","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint256","name":"lpAdded","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"CompoundLoss","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint256","name":"change","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint256","name":"amt","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint256","name":"amt","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MIN_TO_LIQUIFY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOfLpPair","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOfPool","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"baseToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"buybackstrat","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getBPSFee","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"harvest","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"harvestFromVault","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"lpPair","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"masterchef","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"otherToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"panic","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"referralMode","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"retireStrat","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"rewardToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"router","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBuybackStrat","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMinToLiquify","inputs":[{"type":"uint256","name":"n","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setReferralMode","inputs":[{"type":"bool","name":"_b","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStakingMode","inputs":[{"type":"bool","name":"_b","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSwapPathRegistry","inputs":[{"type":"address","name":"_a","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"stakingMode","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"swapPathRegistry","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"vault","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]}]
              

Contract Creation Code

Verify & Publish
0x60806040526064600b55600c805461ffff191690553480156200002157600080fd5b50604051620031343803806200313483398181016040526101208110156200004857600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e08801516101009098015196979596949593949293919290919060006200009062000427565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506000805460ff60a01b19169055600180546001600160a01b03199081166001600160a01b038c8116919091179092556006805482168884161790556007869055600580548216868416179055600a805482168584161790556009805482168484161790556008805490911688831617905587166200017457600380546001600160a01b03199081169091556004805490911690556200034e565b6000896001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015620001b057600080fd5b505afa158015620001c5573d6000803e3d6000fd5b505050506040513d6020811015620001dc57600080fd5b50516040805163d21220a760e01b815290519192506000916001600160a01b038d169163d21220a7916004808301926020929190829003018186803b1580156200022557600080fd5b505afa1580156200023a573d6000803e3d6000fd5b505050506040513d60208110156200025157600080fd5b505190506001600160a01b03828116908a16146200027157818162000274565b80825b600480546001600160a01b03199081166001600160a01b0393841617909155600380549091169282169290921791829055600554620002c5928216911660006200042b602090811b6200112417901c565b600554600354620002f2916001600160a01b0391821691166000196200042b602090811b6200112417901c565b6005546004546200031e916001600160a01b03918216911660006200042b602090811b6200112417901c565b6005546004546200034b916001600160a01b0391821691166000196200042b602090811b6200112417901c565b50505b600280546001600160a01b0319166001600160a01b038a8116919091179091556006546001546200039292908116911660006200042b602090811b6200112417901c565b600654600154620003bf916001600160a01b0391821691166000196200042b602090811b6200112417901c565b600554600254620003eb916001600160a01b03918216911660006200042b602090811b6200112417901c565b60055460025462000418916001600160a01b0391821691166000196200042b602090811b6200112417901c565b50505050505050505062000816565b3390565b801580620004b5575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156200048557600080fd5b505afa1580156200049a573d6000803e3d6000fd5b505050506040513d6020811015620004b157600080fd5b5051155b620004f25760405162461bcd60e51b8152600401808060200182810382526036815260200180620030fe6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526200054a9185916200054f16565b505050565b6060620005ab826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166200060b60201b62001237179092919060201c565b8051909150156200054a57808060200190516020811015620005cc57600080fd5b50516200054a5760405162461bcd60e51b815260040180806020018281038252602a815260200180620030d4602a913960400191505060405180910390fd5b60606200061c848460008562000624565b949350505050565b60606200063185620007dc565b62000683576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310620006c45780518252601f199092019160209182019101620006a3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811462000728576040519150601f19603f3d011682016040523d82523d6000602084013e6200072d565b606091505b50915091508115620007435791506200061c9050565b805115620007545780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620007a057818101518382015260200162000786565b50505050905090810190601f168015620007ce5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906200061c575050151592915050565b6128ae80620008266000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80637c5126221161011a578063d0e30db0116100ad578063f7c618c11161007c578063f7c618c1146103e9578063f887ea40146103f1578063fb1db278146103f9578063fb61778714610401578063fbfa77cf1461040957610206565b8063d0e30db014610376578063d2cd94441461037e578063d8ad1e60146103a4578063f2fde38b146103c357610206565b80638da5cb5b116100e95780638da5cb5b14610356578063a6057fa71461035e578063c2351cdd14610366578063c55dae631461036e57610206565b80637c512622146103015780637d034b13146103275780638456cb591461034657806386e655ec1461034e57610206565b8063452ed4f11161019d57806367c1fe3d1161016c57806367c1fe3d146102c45780636a0ddbd5146102cc5780636fa9deaf146102d4578063715018a6146102f1578063722713f7146102f957610206565b8063452ed4f1146102905780634641257d146102985780634700d305146102a05780635c975abb146102a857610206565b80633e0dc34e116101d95780633e0dc34e146102545780633f4ba83a1461025c57806340b8622414610264578063433b3c051461028857610206565b806304f5606c1461020b5780631158808614610215578063118118581461022f5780632e1a7d4d14610237575b600080fd5b610213610411565b005b61021d610485565b60408051918252519081900360200190f35b61021d61050c565b6102136004803603602081101561024d57600080fd5b5035610582565b61021d61073c565b610213610742565b61026c6108a7565b604080516001600160a01b039092168252519081900360200190f35b61026c6108b6565b61026c6108c5565b6102136108d4565b61021361091b565b6102b0610986565b604080519115158252519081900360200190f35b61021d610996565b61026c61099c565b610213600480360360208110156102ea57600080fd5b50356109ab565b610213610a08565b61021d610aaa565b6102136004803603602081101561031757600080fd5b50356001600160a01b0316610aca565b6102136004803603602081101561033d57600080fd5b50351515610b44565b610213610bb6565b6102b0610c9f565b61026c610ca8565b6102b0610cb7565b61021d610cc5565b61026c610d10565b610213610d1f565b6102136004803603602081101561039457600080fd5b50356001600160a01b0316610daa565b610213600480360360208110156103ba57600080fd5b50351515610e24565b610213600480360360208110156103d957600080fd5b50356001600160a01b0316610e8f565b61026c610f87565b61026c610f96565b61026c610fa5565b610213610fb4565b61026c611115565b61041961124e565b6008546001600160a01b0390811691161461047b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865207661756c74604482015290519081900360640190fd5b610483611252565b565b600654600754604080516393f1a40b60e01b81526004810192909252306024830152805160009384936001600160a01b03909116926393f1a40b92604480840193829003018186803b1580156104da57600080fd5b505afa1580156104ee573d6000803e3d6000fd5b505050506040513d604081101561050457600080fd5b505191505090565b6009546040805163b9d4e87960e01b815290516000926001600160a01b03169163b9d4e879916004808301926020929190829003018186803b15801561055157600080fd5b505afa158015610565573d6000803e3d6000fd5b505050506040513d602081101561057b57600080fd5b5051905090565b61058a61124e565b6008546001600160a01b039081169116146105ec576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865207661756c74604482015290519081900360640190fd5b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561063757600080fd5b505afa15801561064b573d6000803e3d6000fd5b505050506040513d602081101561066157600080fd5b505190508181101561071b5761067f61067a838361140f565b61145a565b600154604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156106ca57600080fd5b505afa1580156106de573d6000803e3d6000fd5b505050506040513d60208110156106f457600080fd5b5051600854600154919250610716916001600160a01b03908116911683611578565b610738565b600854600154610738916001600160a01b03918216911684611578565b5050565b60075481565b61074a61124e565b6000546001600160a01b0390811691161461079a576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b6107a26115ca565b6006546001546107c0916001600160a01b0391821691166000611124565b6006546001546107df916001600160a01b039182169116600019611124565b6005546002546107fd916001600160a01b0391821691166000611124565b60055460025461081c916001600160a01b039182169116600019611124565b6004546001600160a01b0316156104835760055460035461084b916001600160a01b0391821691166000611124565b60055460035461086a916001600160a01b039182169116600019611124565b600554600454610888916001600160a01b0391821691166000611124565b600554600454610483916001600160a01b039182169116600019611124565b6009546001600160a01b031681565b6003546001600160a01b031681565b6001546001600160a01b031681565b6108dd33611672565b1561047b576040805162461bcd60e51b81526020600482015260096024820152680858dbdb9d1c9858dd60ba1b604482015290519081900360640190fd5b61092361124e565b6000546001600160a01b03908116911614610973576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b61097b610bb6565b61048361067a610485565b600054600160a01b900460ff1690565b600b5481565b600a546001600160a01b031681565b6109b361124e565b6000546001600160a01b03908116911614610a03576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600b55565b610a1061124e565b6000546001600160a01b03908116911614610a60576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610ac5610ab7610485565b610abf610cc5565b906116ab565b905090565b610ad261124e565b6000546001600160a01b03908116911614610b22576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610b4c61124e565b6000546001600160a01b03908116911614610b9c576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600c80549115156101000261ff0019909216919091179055565b610bbe61124e565b6000546001600160a01b03908116911614610c0e576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b610c16611705565b600654600154610c34916001600160a01b0391821691166000611124565b600554600254610c52916001600160a01b0391821691166000611124565b6004546001600160a01b03161561048357600554600354610c81916001600160a01b0391821691166000611124565b600554600454610483916001600160a01b0391821691166000611124565b600c5460ff1681565b6000546001600160a01b031690565b600c54610100900460ff1681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561055157600080fd5b6004546001600160a01b031681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610d6a57600080fd5b505afa158015610d7e573d6000803e3d6000fd5b505050506040513d6020811015610d9457600080fd5b505190508015610da757610da781611793565b50565b610db261124e565b6000546001600160a01b03908116911614610e02576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b610e2c61124e565b6000546001600160a01b03908116911614610e7c576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600c805460ff1916911515919091179055565b610e9761124e565b6000546001600160a01b03908116911614610ee7576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b6001600160a01b038116610f2c5760405162461bcd60e51b81526004018080602001828103825260268152602001806127b26026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b6005546001600160a01b031681565b6006546001600160a01b031681565b610fbc61124e565b6000546001600160a01b0390811691161461100c576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b61101461091b565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d602081101561108957600080fd5b50516001546008546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b1580156110e657600080fd5b505af11580156110fa573d6000803e3d6000fd5b505050506040513d602081101561111057600080fd5b505050565b6008546001600160a01b031681565b8015806111aa575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561117c57600080fd5b505afa158015611190573d6000803e3d6000fd5b505050506040513d60208110156111a657600080fd5b5051155b6111e55760405162461bcd60e51b81526004018080602001828103825260368152602001806128436036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261111090849061191e565b606061124684846000856119cf565b949350505050565b3390565b600054600160a01b900460ff16156112a4576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60006112ae610485565b90506112ba6000611793565b600b54600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561130857600080fd5b505afa15801561131c573d6000803e3d6000fd5b505050506040513d602081101561133257600080fd5b5051111561137057611342611b7a565b6004546001600160a01b0316156113605761135b611c7c565b611368565b611368612376565b611370610d1f565b600061137a610485565b9050818111156113c657337f169f1815ebdea059aac3bb00ec9a9594c7a5ffcb64a17e8392b5d84909a145566113b0838561140f565b60408051918252519081900360200190a2610738565b8181101561073857337fdf5ee50bba1a120f14b1b64d8ed407af28c5baa9ddb2cef0b98a75e241ab71116113fa848461140f565b60408051918252519081900360200190a25050565b600061145183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061265c565b90505b92915050565b600c5460ff16156114cf5760065460408051631058d28160e01b81526004810184905290516001600160a01b0390921691631058d2819160248082019260009290919082900301818387803b1580156114b257600080fd5b505af11580156114c6573d6000803e3d6000fd5b5050505061153f565b60065460075460408051630441a3e760e41b8152600481019290925260248201849052516001600160a01b039092169163441a3e709160448082019260009290919082900301818387803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b505050505b60408051828152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a250565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261111090849061191e565b600054600160a01b900460ff1661161f576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61165561124e565b604080516001600160a01b039092168252519081900360200190a1565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611246575050151592915050565b600082820183811015611451576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600054600160a01b900460ff1615611757576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861165561124e565b600c5460ff161561180857600654604080516341441d3b60e01b81526004810184905290516001600160a01b03909216916341441d3b9160248082019260009290919082900301818387803b1580156117eb57600080fd5b505af11580156117ff573d6000803e3d6000fd5b505050506118e5565b600c54610100900460ff16156118755760065460075460408051638dbdbe6d60e01b815260048101929092526024820184905260006044830181905290516001600160a01b0390931692638dbdbe6d92606480820193929182900301818387803b1580156117eb57600080fd5b60065460075460408051631c57762b60e31b8152600481019290925260248201849052516001600160a01b039092169163e2bbb1589160448082019260009290919082900301818387803b1580156118cc57600080fd5b505af11580156118e0573d6000803e3d6000fd5b505050505b60408051828152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a250565b6060611973826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112379092919063ffffffff16565b8051909150156111105780806020019051602081101561199257600080fd5b50516111105760405162461bcd60e51b815260040180806020018281038252602a815260200180612819602a913960400191505060405180910390fd5b60606119da85611672565b611a2b576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611a6a5780518252601f199092019160209182019101611a4b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611acc576040519150601f19603f3d011682016040523d82523d6000602084013e611ad1565b606091505b50915091508115611ae55791506112469050565b805115611af55780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b3f578181015183820152602001611b27565b50505050905090810190601f168015611b6c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6009546001600160a01b031615610483576000611c21612710611c1b611b9e61050c565b600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015611be957600080fd5b505afa158015611bfd573d6000803e3d6000fd5b505050506040513d6020811015611c1357600080fd5b5051906126b6565b9061270f565b6002546009546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b1580156110e657600080fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611cc757600080fd5b505afa158015611cdb573d6000803e3d6000fd5b505050506040513d6020811015611cf157600080fd5b505190506000611d0282600261270f565b600a546005546002546004805460408051631206e48360e21b81526001600160a01b03958616938101939093529284166024830152831660448201529051939450606093919092169163481b920c916064808301926000929190829003018186803b158015611d7057600080fd5b505afa158015611d84573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015611dad57600080fd5b8101908080516040519392919084640100000000821115611dcd57600080fd5b908301906020820185811115611de257600080fd5b8251866020820283011164010000000082111715611dff57600080fd5b82525081516020918201928201910280838360005b83811015611e2c578181015183820152602001611e14565b5050505090500160405250505090506000815111611e91576040805162461bcd60e51b815260206004820152601760248201527f636865636b207377617050617468526567697374727931000000000000000000604482015290519081900360640190fd5b600554604051635c11d79560e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b0390971696635c11d795968a968a9594939092909160c40190602080880191028083838b5b83811015611f17578181015183820152602001611eff565b505050509050019650505050505050600060405180830381600087803b158015611f4057600080fd5b505af1158015611f54573d6000803e3d6000fd5b50506002546003546001600160a01b0390811691161491506121c5905057600a5460055460025460035460408051631206e48360e21b81526001600160a01b0394851660048201529284166024840152908316604483015251606093929092169163481b920c91606480820192600092909190829003018186803b158015611fdb57600080fd5b505afa158015611fef573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561201857600080fd5b810190808051604051939291908464010000000082111561203857600080fd5b90830190602082018581111561204d57600080fd5b825186602082028301116401000000008211171561206a57600080fd5b82525081516020918201928201910280838360005b8381101561209757818101518382015260200161207f565b50505050905001604052505050905060008151116120fc576040805162461bcd60e51b815260206004820152601760248201527f636865636b207377617050617468526567697374727932000000000000000000604482015290519081900360640190fd5b600554604051635c11d79560e01b8152600481018581526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b0390971696635c11d795968b968a9594939092909160c40190602080880191028083838b5b8381101561218257818101518382015260200161216a565b505050509050019650505050505050600060405180830381600087803b1580156121ab57600080fd5b505af11580156121bf573d6000803e3d6000fd5b50505050505b60055460035460048054604080516370a0823160e01b81523093810193909352516001600160a01b039485169463e8e337009481169392169183916370a0823191602480820192602092909190829003018186803b15801561222657600080fd5b505afa15801561223a573d6000803e3d6000fd5b505050506040513d602081101561225057600080fd5b505160048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561229e57600080fd5b505afa1580156122b2573d6000803e3d6000fd5b505050506040513d60208110156122c857600080fd5b5051604080516001600160e01b031960e088901b1681526001600160a01b0395861660048201529390941660248401526044830191909152606482015260006084820181905260a482018190523060c48301524260e483015291516101048083019360609383900390910190829087803b15801561234557600080fd5b505af1158015612359573d6000803e3d6000fd5b505050506040513d606081101561236f57600080fd5b5050505050565b6001546002546001600160a01b0390811691161461048357600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156123d957600080fd5b505afa1580156123ed573d6000803e3d6000fd5b505050506040513d602081101561240357600080fd5b5051600a5460055460025460015460408051631206e48360e21b81526001600160a01b0394851660048201529284166024840152908316604483015251939450606093919092169163481b920c916064808301926000929190829003018186803b15801561247057600080fd5b505afa158015612484573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156124ad57600080fd5b81019080805160405193929190846401000000008211156124cd57600080fd5b9083019060208201858111156124e257600080fd5b82518660208202830111640100000000821117156124ff57600080fd5b82525081516020918201928201910280838360005b8381101561252c578181015183820152602001612514565b5050505090500160405250505090506000815111612591576040805162461bcd60e51b815260206004820152601760248201527f636865636b207377617050617468526567697374727933000000000000000000604482015290519081900360640190fd5b600554604051635c11d79560e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b0390971696635c11d795968a968a9594939092909160c40190602080880191028083838b5b838110156126175781810151838201526020016125ff565b505050509050019650505050505050600060405180830381600087803b15801561264057600080fd5b505af1158015612654573d6000803e3d6000fd5b505050505050565b600081848411156126ae5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611b3f578181015183820152602001611b27565b505050900390565b6000826126c557506000611454565b828202828482816126d257fe5b04146114515760405162461bcd60e51b81526004018080602001828103825260218152602001806127d86021913960400191505060405180910390fd5b600061145183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506000818361279b5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611b3f578181015183820152602001611b27565b5060008385816127a757fe5b049594505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212204e31d5a0f233e862b3e6bc9f6c32820a15e73b6655fd53e3f31d6d8bcad9ad2564736f6c634300060c00335361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000000000001724d7d4341f3318e57baee2829bb93d51dc8b0000000000000000000000006c1b568a1d7fb33de6707238803f8821e9472539000000000000000000000000980a5afef3d17ad98635f6c5aebcbaeded3c34300000000000000000000000001d911824caf39861257552578abe3c28a96ff321000000000000000000000000723f61a9bcd6c390474d0d2b3d5e65e1f9ada8240000000000000000000000000000000000000000000000000000000000000005000000000000000000000000f742609f4cafeef624816e309d770222aa8a55cc0000000000000000000000007dcc096adf6b80f106accf9133a095fa277d6714000000000000000000000000d5f08f5c0cf28d3da911a2bf3172068f08293657

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106102065760003560e01c80637c5126221161011a578063d0e30db0116100ad578063f7c618c11161007c578063f7c618c1146103e9578063f887ea40146103f1578063fb1db278146103f9578063fb61778714610401578063fbfa77cf1461040957610206565b8063d0e30db014610376578063d2cd94441461037e578063d8ad1e60146103a4578063f2fde38b146103c357610206565b80638da5cb5b116100e95780638da5cb5b14610356578063a6057fa71461035e578063c2351cdd14610366578063c55dae631461036e57610206565b80637c512622146103015780637d034b13146103275780638456cb591461034657806386e655ec1461034e57610206565b8063452ed4f11161019d57806367c1fe3d1161016c57806367c1fe3d146102c45780636a0ddbd5146102cc5780636fa9deaf146102d4578063715018a6146102f1578063722713f7146102f957610206565b8063452ed4f1146102905780634641257d146102985780634700d305146102a05780635c975abb146102a857610206565b80633e0dc34e116101d95780633e0dc34e146102545780633f4ba83a1461025c57806340b8622414610264578063433b3c051461028857610206565b806304f5606c1461020b5780631158808614610215578063118118581461022f5780632e1a7d4d14610237575b600080fd5b610213610411565b005b61021d610485565b60408051918252519081900360200190f35b61021d61050c565b6102136004803603602081101561024d57600080fd5b5035610582565b61021d61073c565b610213610742565b61026c6108a7565b604080516001600160a01b039092168252519081900360200190f35b61026c6108b6565b61026c6108c5565b6102136108d4565b61021361091b565b6102b0610986565b604080519115158252519081900360200190f35b61021d610996565b61026c61099c565b610213600480360360208110156102ea57600080fd5b50356109ab565b610213610a08565b61021d610aaa565b6102136004803603602081101561031757600080fd5b50356001600160a01b0316610aca565b6102136004803603602081101561033d57600080fd5b50351515610b44565b610213610bb6565b6102b0610c9f565b61026c610ca8565b6102b0610cb7565b61021d610cc5565b61026c610d10565b610213610d1f565b6102136004803603602081101561039457600080fd5b50356001600160a01b0316610daa565b610213600480360360208110156103ba57600080fd5b50351515610e24565b610213600480360360208110156103d957600080fd5b50356001600160a01b0316610e8f565b61026c610f87565b61026c610f96565b61026c610fa5565b610213610fb4565b61026c611115565b61041961124e565b6008546001600160a01b0390811691161461047b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865207661756c74604482015290519081900360640190fd5b610483611252565b565b600654600754604080516393f1a40b60e01b81526004810192909252306024830152805160009384936001600160a01b03909116926393f1a40b92604480840193829003018186803b1580156104da57600080fd5b505afa1580156104ee573d6000803e3d6000fd5b505050506040513d604081101561050457600080fd5b505191505090565b6009546040805163b9d4e87960e01b815290516000926001600160a01b03169163b9d4e879916004808301926020929190829003018186803b15801561055157600080fd5b505afa158015610565573d6000803e3d6000fd5b505050506040513d602081101561057b57600080fd5b5051905090565b61058a61124e565b6008546001600160a01b039081169116146105ec576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865207661756c74604482015290519081900360640190fd5b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561063757600080fd5b505afa15801561064b573d6000803e3d6000fd5b505050506040513d602081101561066157600080fd5b505190508181101561071b5761067f61067a838361140f565b61145a565b600154604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156106ca57600080fd5b505afa1580156106de573d6000803e3d6000fd5b505050506040513d60208110156106f457600080fd5b5051600854600154919250610716916001600160a01b03908116911683611578565b610738565b600854600154610738916001600160a01b03918216911684611578565b5050565b60075481565b61074a61124e565b6000546001600160a01b0390811691161461079a576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b6107a26115ca565b6006546001546107c0916001600160a01b0391821691166000611124565b6006546001546107df916001600160a01b039182169116600019611124565b6005546002546107fd916001600160a01b0391821691166000611124565b60055460025461081c916001600160a01b039182169116600019611124565b6004546001600160a01b0316156104835760055460035461084b916001600160a01b0391821691166000611124565b60055460035461086a916001600160a01b039182169116600019611124565b600554600454610888916001600160a01b0391821691166000611124565b600554600454610483916001600160a01b039182169116600019611124565b6009546001600160a01b031681565b6003546001600160a01b031681565b6001546001600160a01b031681565b6108dd33611672565b1561047b576040805162461bcd60e51b81526020600482015260096024820152680858dbdb9d1c9858dd60ba1b604482015290519081900360640190fd5b61092361124e565b6000546001600160a01b03908116911614610973576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b61097b610bb6565b61048361067a610485565b600054600160a01b900460ff1690565b600b5481565b600a546001600160a01b031681565b6109b361124e565b6000546001600160a01b03908116911614610a03576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600b55565b610a1061124e565b6000546001600160a01b03908116911614610a60576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610ac5610ab7610485565b610abf610cc5565b906116ab565b905090565b610ad261124e565b6000546001600160a01b03908116911614610b22576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610b4c61124e565b6000546001600160a01b03908116911614610b9c576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600c80549115156101000261ff0019909216919091179055565b610bbe61124e565b6000546001600160a01b03908116911614610c0e576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b610c16611705565b600654600154610c34916001600160a01b0391821691166000611124565b600554600254610c52916001600160a01b0391821691166000611124565b6004546001600160a01b03161561048357600554600354610c81916001600160a01b0391821691166000611124565b600554600454610483916001600160a01b0391821691166000611124565b600c5460ff1681565b6000546001600160a01b031690565b600c54610100900460ff1681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561055157600080fd5b6004546001600160a01b031681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610d6a57600080fd5b505afa158015610d7e573d6000803e3d6000fd5b505050506040513d6020811015610d9457600080fd5b505190508015610da757610da781611793565b50565b610db261124e565b6000546001600160a01b03908116911614610e02576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b610e2c61124e565b6000546001600160a01b03908116911614610e7c576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b600c805460ff1916911515919091179055565b610e9761124e565b6000546001600160a01b03908116911614610ee7576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b6001600160a01b038116610f2c5760405162461bcd60e51b81526004018080602001828103825260268152602001806127b26026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b6005546001600160a01b031681565b6006546001600160a01b031681565b610fbc61124e565b6000546001600160a01b0390811691161461100c576040805162461bcd60e51b815260206004820181905260248201526000805160206127f9833981519152604482015290519081900360640190fd5b61101461091b565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d602081101561108957600080fd5b50516001546008546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b1580156110e657600080fd5b505af11580156110fa573d6000803e3d6000fd5b505050506040513d602081101561111057600080fd5b505050565b6008546001600160a01b031681565b8015806111aa575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561117c57600080fd5b505afa158015611190573d6000803e3d6000fd5b505050506040513d60208110156111a657600080fd5b5051155b6111e55760405162461bcd60e51b81526004018080602001828103825260368152602001806128436036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261111090849061191e565b606061124684846000856119cf565b949350505050565b3390565b600054600160a01b900460ff16156112a4576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60006112ae610485565b90506112ba6000611793565b600b54600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561130857600080fd5b505afa15801561131c573d6000803e3d6000fd5b505050506040513d602081101561133257600080fd5b5051111561137057611342611b7a565b6004546001600160a01b0316156113605761135b611c7c565b611368565b611368612376565b611370610d1f565b600061137a610485565b9050818111156113c657337f169f1815ebdea059aac3bb00ec9a9594c7a5ffcb64a17e8392b5d84909a145566113b0838561140f565b60408051918252519081900360200190a2610738565b8181101561073857337fdf5ee50bba1a120f14b1b64d8ed407af28c5baa9ddb2cef0b98a75e241ab71116113fa848461140f565b60408051918252519081900360200190a25050565b600061145183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061265c565b90505b92915050565b600c5460ff16156114cf5760065460408051631058d28160e01b81526004810184905290516001600160a01b0390921691631058d2819160248082019260009290919082900301818387803b1580156114b257600080fd5b505af11580156114c6573d6000803e3d6000fd5b5050505061153f565b60065460075460408051630441a3e760e41b8152600481019290925260248201849052516001600160a01b039092169163441a3e709160448082019260009290919082900301818387803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b505050505b60408051828152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a250565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261111090849061191e565b600054600160a01b900460ff1661161f576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61165561124e565b604080516001600160a01b039092168252519081900360200190a1565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611246575050151592915050565b600082820183811015611451576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600054600160a01b900460ff1615611757576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861165561124e565b600c5460ff161561180857600654604080516341441d3b60e01b81526004810184905290516001600160a01b03909216916341441d3b9160248082019260009290919082900301818387803b1580156117eb57600080fd5b505af11580156117ff573d6000803e3d6000fd5b505050506118e5565b600c54610100900460ff16156118755760065460075460408051638dbdbe6d60e01b815260048101929092526024820184905260006044830181905290516001600160a01b0390931692638dbdbe6d92606480820193929182900301818387803b1580156117eb57600080fd5b60065460075460408051631c57762b60e31b8152600481019290925260248201849052516001600160a01b039092169163e2bbb1589160448082019260009290919082900301818387803b1580156118cc57600080fd5b505af11580156118e0573d6000803e3d6000fd5b505050505b60408051828152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a250565b6060611973826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112379092919063ffffffff16565b8051909150156111105780806020019051602081101561199257600080fd5b50516111105760405162461bcd60e51b815260040180806020018281038252602a815260200180612819602a913960400191505060405180910390fd5b60606119da85611672565b611a2b576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611a6a5780518252601f199092019160209182019101611a4b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611acc576040519150601f19603f3d011682016040523d82523d6000602084013e611ad1565b606091505b50915091508115611ae55791506112469050565b805115611af55780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b3f578181015183820152602001611b27565b50505050905090810190601f168015611b6c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6009546001600160a01b031615610483576000611c21612710611c1b611b9e61050c565b600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015611be957600080fd5b505afa158015611bfd573d6000803e3d6000fd5b505050506040513d6020811015611c1357600080fd5b5051906126b6565b9061270f565b6002546009546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b1580156110e657600080fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611cc757600080fd5b505afa158015611cdb573d6000803e3d6000fd5b505050506040513d6020811015611cf157600080fd5b505190506000611d0282600261270f565b600a546005546002546004805460408051631206e48360e21b81526001600160a01b03958616938101939093529284166024830152831660448201529051939450606093919092169163481b920c916064808301926000929190829003018186803b158015611d7057600080fd5b505afa158015611d84573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015611dad57600080fd5b8101908080516040519392919084640100000000821115611dcd57600080fd5b908301906020820185811115611de257600080fd5b8251866020820283011164010000000082111715611dff57600080fd5b82525081516020918201928201910280838360005b83811015611e2c578181015183820152602001611e14565b5050505090500160405250505090506000815111611e91576040805162461bcd60e51b815260206004820152601760248201527f636865636b207377617050617468526567697374727931000000000000000000604482015290519081900360640190fd5b600554604051635c11d79560e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b0390971696635c11d795968a968a9594939092909160c40190602080880191028083838b5b83811015611f17578181015183820152602001611eff565b505050509050019650505050505050600060405180830381600087803b158015611f4057600080fd5b505af1158015611f54573d6000803e3d6000fd5b50506002546003546001600160a01b0390811691161491506121c5905057600a5460055460025460035460408051631206e48360e21b81526001600160a01b0394851660048201529284166024840152908316604483015251606093929092169163481b920c91606480820192600092909190829003018186803b158015611fdb57600080fd5b505afa158015611fef573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561201857600080fd5b810190808051604051939291908464010000000082111561203857600080fd5b90830190602082018581111561204d57600080fd5b825186602082028301116401000000008211171561206a57600080fd5b82525081516020918201928201910280838360005b8381101561209757818101518382015260200161207f565b50505050905001604052505050905060008151116120fc576040805162461bcd60e51b815260206004820152601760248201527f636865636b207377617050617468526567697374727932000000000000000000604482015290519081900360640190fd5b600554604051635c11d79560e01b8152600481018581526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b0390971696635c11d795968b968a9594939092909160c40190602080880191028083838b5b8381101561218257818101518382015260200161216a565b505050509050019650505050505050600060405180830381600087803b1580156121ab57600080fd5b505af11580156121bf573d6000803e3d6000fd5b50505050505b60055460035460048054604080516370a0823160e01b81523093810193909352516001600160a01b039485169463e8e337009481169392169183916370a0823191602480820192602092909190829003018186803b15801561222657600080fd5b505afa15801561223a573d6000803e3d6000fd5b505050506040513d602081101561225057600080fd5b505160048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561229e57600080fd5b505afa1580156122b2573d6000803e3d6000fd5b505050506040513d60208110156122c857600080fd5b5051604080516001600160e01b031960e088901b1681526001600160a01b0395861660048201529390941660248401526044830191909152606482015260006084820181905260a482018190523060c48301524260e483015291516101048083019360609383900390910190829087803b15801561234557600080fd5b505af1158015612359573d6000803e3d6000fd5b505050506040513d606081101561236f57600080fd5b5050505050565b6001546002546001600160a01b0390811691161461048357600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156123d957600080fd5b505afa1580156123ed573d6000803e3d6000fd5b505050506040513d602081101561240357600080fd5b5051600a5460055460025460015460408051631206e48360e21b81526001600160a01b0394851660048201529284166024840152908316604483015251939450606093919092169163481b920c916064808301926000929190829003018186803b15801561247057600080fd5b505afa158015612484573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156124ad57600080fd5b81019080805160405193929190846401000000008211156124cd57600080fd5b9083019060208201858111156124e257600080fd5b82518660208202830111640100000000821117156124ff57600080fd5b82525081516020918201928201910280838360005b8381101561252c578181015183820152602001612514565b5050505090500160405250505090506000815111612591576040805162461bcd60e51b815260206004820152601760248201527f636865636b207377617050617468526567697374727933000000000000000000604482015290519081900360640190fd5b600554604051635c11d79560e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b0390971696635c11d795968a968a9594939092909160c40190602080880191028083838b5b838110156126175781810151838201526020016125ff565b505050509050019650505050505050600060405180830381600087803b15801561264057600080fd5b505af1158015612654573d6000803e3d6000fd5b505050505050565b600081848411156126ae5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611b3f578181015183820152602001611b27565b505050900390565b6000826126c557506000611454565b828202828482816126d257fe5b04146114515760405162461bcd60e51b81526004018080602001828103825260218152602001806127d86021913960400191505060405180910390fd5b600061145183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506000818361279b5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611b3f578181015183820152602001611b27565b5060008385816127a757fe5b049594505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212204e31d5a0f233e862b3e6bc9f6c32820a15e73b6655fd53e3f31d6d8bcad9ad2564736f6c634300060c0033