ETH Price: $3,441.74 (-1.09%)
Gas: 4 Gwei

Contract

0xc2262671A154cc29A0cf6783DaDB130F2cD80fb9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Rebalance160990112022-12-02 18:47:47598 days ago1670006867IN
0xc2262671...F2cD80fb9
0 ETH0.0378282213.41690162
Rebalance160881422022-12-01 6:23:35600 days ago1669875815IN
0xc2262671...F2cD80fb9
0 ETH0.0169581311.29021956
Rebalance160666682022-11-28 6:23:35603 days ago1669616615IN
0xc2262671...F2cD80fb9
0 ETH0.0125069710.53461542
Rebalance160451882022-11-25 6:23:35606 days ago1669357415IN
0xc2262671...F2cD80fb9
0 ETH0.0175827111.89651979
Rebalance160205682022-11-21 19:46:47609 days ago1669060007IN
0xc2262671...F2cD80fb9
0 ETH0.049382217.17404335
Rebalance160094132022-11-20 6:23:35611 days ago1668925415IN
0xc2262671...F2cD80fb9
0 ETH0.0147184212.58342365
Harvest VSP160040862022-11-19 12:33:23611 days ago1668861203IN
0xc2262671...F2cD80fb9
0 ETH0.0033016110.54210376
Rebalance159879292022-11-17 6:23:35614 days ago1668666215IN
0xc2262671...F2cD80fb9
0 ETH0.018499813.1794542
Rebalance159653772022-11-14 2:46:11617 days ago1668393971IN
0xc2262671...F2cD80fb9
0 ETH0.0381594415.15178819
Rebalance159521182022-11-12 6:23:35619 days ago1668234215IN
0xc2262671...F2cD80fb9
0 ETH0.0175415814.82516826
Rebalance159304152022-11-09 5:33:35622 days ago1667972015IN
0xc2262671...F2cD80fb9
0 ETH0.0211456516.95548367
Rebalance159276052022-11-08 20:08:35622 days ago1667938115IN
0xc2262671...F2cD80fb9
0 ETH0.13280657130.50063252
Rebalance159091642022-11-06 6:23:35625 days ago1667715815IN
0xc2262671...F2cD80fb9
0 ETH0.0159383711.35466588
Rebalance158876842022-11-03 6:23:35628 days ago1667456615IN
0xc2262671...F2cD80fb9
0 ETH0.0196255416.58641198
Rebalance158662222022-10-31 6:23:47631 days ago1667197427IN
0xc2262671...F2cD80fb9
0 ETH0.008905665.99847466
Rebalance158447412022-10-28 6:23:23634 days ago1666938203IN
0xc2262671...F2cD80fb9
0 ETH0.012038359.74412677
Rebalance158232822022-10-25 6:23:35637 days ago1666679015IN
0xc2262671...F2cD80fb9
0 ETH0.0129196612.24160598
Rebalance158021382022-10-22 7:25:47640 days ago1666423547IN
0xc2262671...F2cD80fb9
0 ETH0.0190840516.12877513
Rebalance157809372022-10-19 8:23:35642 days ago1666167815IN
0xc2262671...F2cD80fb9
0 ETH0.0290669718.86734205
Rebalance157597562022-10-16 9:23:35645 days ago1665912215IN
0xc2262671...F2cD80fb9
0 ETH0.0195571813.45352624
Harvest VSP157535382022-10-15 12:32:59646 days ago1665837179IN
0xc2262671...F2cD80fb9
0 ETH0.0045334914.9734866
Rebalance157386542022-10-13 10:39:47648 days ago1665657587IN
0xc2262671...F2cD80fb9
0 ETH0.0326596425.69155599
Rebalance157373842022-10-13 6:23:47649 days ago1665642227IN
0xc2262671...F2cD80fb9
0 ETH0.0117480510.8486388
Rebalance157158912022-10-10 6:23:35652 days ago1665383015IN
0xc2262671...F2cD80fb9
0 ETH0.0342373927.88886067
Rebalance156944102022-10-07 6:23:35655 days ago1665123815IN
0xc2262671...F2cD80fb9
0 ETH0.005438414.36517499
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AaveV2VesperXy

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 100 runs

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

pragma solidity 0.8.9;

import "vesper-pools/contracts/interfaces/vesper/IVesperPool.sol";
import "./AaveV2Xy.sol";

/// @title Deposit Collateral in Aave and earn interest by depositing borrowed token in a Vesper Pool.
contract AaveV2VesperXy is AaveV2Xy {
    using SafeERC20 for IERC20;

    // Destination Grow Pool for borrowed Token
    IVesperPool public immutable vPool;
    // VSP token address
    address public immutable vsp;

    constructor(
        address _pool,
        address _swapper,
        address _rewardToken,
        address _receiptToken,
        address _borrowToken,
        address _vPool,
        address _vspAddress,
        string memory _name
    ) AaveV2Xy(_pool, _swapper, _rewardToken, _receiptToken, _borrowToken, _name) {
        require(_vspAddress != address(0), "invalid-vsp-address");
        require(address(IVesperPool(_vPool).token()) == borrowToken, "invalid-grow-pool");
        vPool = IVesperPool(_vPool);
        vsp = _vspAddress;
    }

    /// @notice Claim VSP and convert to collateral token
    function harvestVSP() external {
        address _poolRewards = vPool.poolRewards();
        if (_poolRewards != address(0)) {
            IPoolRewards(_poolRewards).claimReward(address(this));
        }
        uint256 _vspAmount = IERC20(vsp).balanceOf(address(this));
        if (_vspAmount > 0) {
            _swapExactInput(vsp, address(collateralToken), _vspAmount);
        }
    }

    /// @notice After borrowing Y, deposit to Vesper Pool
    function _afterBorrowY(uint256 _amount) internal virtual override {
        vPool.deposit(_amount);
    }

    /// @notice Approve all required tokens
    function _approveToken(uint256 _amount) internal virtual override {
        super._approveToken(_amount);
        IERC20(borrowToken).safeApprove(address(vPool), _amount);
        IERC20(vsp).safeApprove(address(swapper), _amount);
    }

    /// @notice Before repaying Y, withdraw it from Vesper Pool
    function _beforeRepayY(uint256 _amount) internal virtual override {
        _withdrawFromVesperPool(_amount);
    }

    /// @notice Borrowed Y balance deposited in Vesper Pool
    function _getInvestedBorrowBalance() internal view virtual override returns (uint256) {
        return
            IERC20(borrowToken).balanceOf(address(this)) +
            ((vPool.pricePerShare() * vPool.balanceOf(address(this))) / 1e18);
    }

    /// @notice Swap excess borrow for more collateral when underlying VSP pool is making profits
    function _rebalanceBorrow(uint256 _excessBorrow) internal virtual override {
        if (_excessBorrow > 0) {
            _withdrawFromVesperPool(_excessBorrow);
            uint256 _borrowedHere = IERC20(borrowToken).balanceOf(address(this));
            if (_borrowedHere > 0) {
                _safeSwapExactInput(borrowToken, address(collateralToken), _borrowedHere);
            }
        }
    }

    /// @notice Withdraw _shares proportional to collateral _amount from vPool
    function _withdrawFromVesperPool(uint256 _amount) internal {
        if (_amount > 0) {
            uint256 _pricePerShare = vPool.pricePerShare();
            uint256 _shares = (_amount * 1e18) / _pricePerShare;
            _shares = _amount > ((_shares * _pricePerShare) / 1e18) ? _shares + 1 : _shares;
            vPool.withdraw(Math.min(_shares, vPool.balanceOf(address(this))));
        }
    }
}

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

pragma solidity 0.8.9;

interface IStrategy {
    function rebalance()
        external
        returns (
            uint256 _profit,
            uint256 _loss,
            uint256 _payback
        );

    function sweepERC20(address _fromToken) external;

    function withdraw(uint256 _amount) external;

    function feeCollector() external view returns (address);

    function isReservedToken(address _token) external view returns (bool);

    function keepers() external view returns (address[] memory);

    function migrate(address _newStrategy) external;

    function token() external view returns (address);

    function pool() external view returns (address);

    // solhint-disable-next-line func-name-mixedcase
    function VERSION() external view returns (string memory);

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

File 3 of 19 : Errors.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/// @title Errors library
library Errors {
    string public constant INVALID_COLLATERAL_AMOUNT = "1"; // Collateral must be greater than 0 or > defined limit
    string public constant INVALID_SHARE_AMOUNT = "2"; // Share must be greater than 0
    string public constant INVALID_INPUT_LENGTH = "3"; // Input array length must be greater than 0
    string public constant INPUT_LENGTH_MISMATCH = "4"; // Input array length mismatch with another array length
    string public constant NOT_WHITELISTED_ADDRESS = "5"; // Caller is not whitelisted to withdraw without fee
    string public constant MULTI_TRANSFER_FAILED = "6"; // Multi transfer of tokens has failed
    string public constant FEE_COLLECTOR_NOT_SET = "7"; // Fee Collector is not set
    string public constant NOT_ALLOWED_TO_SWEEP = "8"; // Token is not allowed to sweep
    string public constant INSUFFICIENT_BALANCE = "9"; // Insufficient balance to performs operations to follow
    string public constant INPUT_ADDRESS_IS_ZERO = "10"; // Input address is zero
    string public constant FEE_LIMIT_REACHED = "11"; // Fee must be less than MAX_BPS
    string public constant ALREADY_INITIALIZED = "12"; // Data structure, contract, or logic already initialized and can not be called again
    string public constant ADD_IN_LIST_FAILED = "13"; // Cannot add address in address list
    string public constant REMOVE_FROM_LIST_FAILED = "14"; // Cannot remove address from address list
    string public constant STRATEGY_IS_ACTIVE = "15"; // Strategy is already active, an inactive strategy is required
    string public constant STRATEGY_IS_NOT_ACTIVE = "16"; // Strategy is not active, an active strategy is required
    string public constant INVALID_STRATEGY = "17"; // Given strategy is not a strategy of this pool
    string public constant DEBT_RATIO_LIMIT_REACHED = "18"; // Debt ratio limit reached. It must be less than MAX_BPS
    string public constant TOTAL_DEBT_IS_NOT_ZERO = "19"; // Strategy total debt must be 0
    string public constant LOSS_TOO_HIGH = "20"; // Strategy reported loss must be less than current debt
    string public constant INVALID_MAX_BORROW_LIMIT = "21"; // Max borrow limit is beyond range.
    string public constant MAX_LIMIT_LESS_THAN_MIN = "22"; // Max limit should be greater than min limit.
    string public constant INVALID_SLIPPAGE = "23"; // Slippage should be less than MAX_BPS
    string public constant WRONG_RECEIPT_TOKEN = "24"; // Wrong receipt token address
    string public constant AAVE_FLASH_LOAN_NOT_ACTIVE = "25"; // aave flash loan is not active
    string public constant DYDX_FLASH_LOAN_NOT_ACTIVE = "26"; // DYDX flash loan is not active
    string public constant INVALID_FLASH_LOAN = "27"; // invalid-flash-loan
    string public constant INVALID_INITIATOR = "28"; // "invalid-initiator"
    string public constant INCORRECT_WITHDRAW_AMOUNT = "29"; // withdrawn amount is not correct
    string public constant NO_MARKET_ID_FOUND = "30"; // dydx flash loan no marketId found for token
    string public constant SAME_AS_PREVIOUS = "31"; // Input should not be same as previous value.
    string public constant INVALID_INPUT = "32"; // Generic invalid input error code
}

File 4 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 5 of 19 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 6 of 19 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

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

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

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // 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) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

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

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

File 7 of 19 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // 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");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

File 8 of 19 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with 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) {
        return msg.sender;
    }

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

File 9 of 19 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

File 10 of 19 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

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

pragma solidity 0.8.9;

/**
 * @notice Governable interface
 */
interface IGovernable {
    function governor() external view returns (address _governor);

    function transferGovernorship(address _proposedGovernor) external;
}

File 12 of 19 : IPausable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

/**
 * @notice Pausable interface
 */
interface IPausable {
    function paused() external view returns (bool);

    function stopEverything() external view returns (bool);

    function pause() external;

    function unpause() external;

    function shutdown() external;

    function open() external;
}

File 13 of 19 : IPoolRewards.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

interface IPoolRewards {
    /// Emitted after reward added
    event RewardAdded(address indexed rewardToken, uint256 reward, uint256 rewardDuration);
    /// Emitted whenever any user claim rewards
    event RewardPaid(address indexed user, address indexed rewardToken, uint256 reward);
    /// Emitted after adding new rewards token into rewardTokens array
    event RewardTokenAdded(address indexed rewardToken, address[] existingRewardTokens);

    function claimReward(address) external;

    function notifyRewardAmount(
        address _rewardToken,
        uint256 _rewardAmount,
        uint256 _rewardDuration
    ) external;

    function notifyRewardAmount(
        address[] memory _rewardTokens,
        uint256[] memory _rewardAmounts,
        uint256[] memory _rewardDurations
    ) external;

    function updateReward(address) external;

    function claimable(address _account)
        external
        view
        returns (address[] memory _rewardTokens, uint256[] memory _claimableAmounts);

    function lastTimeRewardApplicable(address _rewardToken) external view returns (uint256);

    function rewardForDuration()
        external
        view
        returns (address[] memory _rewardTokens, uint256[] memory _rewardForDuration);

    function rewardPerToken()
        external
        view
        returns (address[] memory _rewardTokens, uint256[] memory _rewardPerTokenRate);
}

File 14 of 19 : IVesperPool.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import "../../dependencies/openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "./IGovernable.sol";
import "./IPausable.sol";

interface IVesperPool is IGovernable, IPausable, IERC20Metadata {
    function calculateUniversalFee(uint256 _profit) external view returns (uint256 _fee);

    function deposit(uint256 _share) external;

    function multiTransfer(address[] memory _recipients, uint256[] memory _amounts) external returns (bool);

    function excessDebt(address _strategy) external view returns (uint256);

    function poolAccountant() external view returns (address);

    function poolRewards() external view returns (address);

    function reportEarning(
        uint256 _profit,
        uint256 _loss,
        uint256 _payback
    ) external;

    function reportLoss(uint256 _loss) external;

    function sweepERC20(address _fromToken) external;

    function withdraw(uint256 _amount) external;

    function keepers() external view returns (address[] memory);

    function isKeeper(address _address) external view returns (bool);

    function maintainers() external view returns (address[] memory);

    function isMaintainer(address _address) external view returns (bool);

    function pricePerShare() external view returns (uint256);

    function strategy(address _strategy)
        external
        view
        returns (
            bool _active,
            uint256 _interestFee, // Obsolete
            uint256 _debtRate, // Obsolete
            uint256 _lastRebalance,
            uint256 _totalDebt,
            uint256 _totalLoss,
            uint256 _totalProfit,
            uint256 _debtRatio,
            uint256 _externalDepositFee
        );

    function token() external view returns (IERC20);

    function tokensHere() external view returns (uint256);

    function totalDebtOf(address _strategy) external view returns (uint256);

    function totalValue() external view returns (uint256);

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

File 15 of 19 : IAave.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import "vesper-pools/contracts/dependencies/openzeppelin/contracts/token/ERC20/IERC20.sol";

// @dev Interface support both Aave v2 and v3 methods
interface PoolAddressesProvider {
    function getPool() external view returns (address);

    // Aave v2 method.
    function getLendingPool() external view returns (address);

    function getPoolDataProvider() external view returns (address);

    function getAddress(bytes32 id) external view returns (address);

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

interface AaveOracle {
    function getAssetPrice(address _asset) external view returns (uint256);
}

interface AToken is IERC20 {
    /**
     * @dev Returns the address of the incentives controller contract
     **/
    function getIncentivesController() external view returns (address);

    function mint(
        address user,
        uint256 amount,
        uint256 index
    ) external returns (bool);

    function burn(
        address user,
        address receiverOfUnderlying,
        uint256 amount,
        uint256 index
    ) external;

    //solhint-disable func-name-mixedcase
    function UNDERLYING_ASSET_ADDRESS() external view returns (address);
}

interface AaveIncentivesController {
    function getRewardsBalance(address[] calldata assets, address user) external view returns (uint256);

    function claimRewards(
        address[] calldata assets,
        uint256 amount,
        address to
    ) external returns (uint256);

    function claimAllRewards(address[] calldata assets, address to)
        external
        returns (address[] memory rewardsList, uint256[] memory claimedAmounts);

    function getRewardsList() external view returns (address[] memory);
}

interface AaveLendingPool {
    function deposit(
        address asset,
        uint256 amount,
        address onBehalfOf,
        uint16 referralCode
    ) external;

    function supply(
        address asset,
        uint256 amount,
        address onBehalfOf,
        uint16 referralCode
    ) external;

    function withdraw(
        address asset,
        uint256 amount,
        address to
    ) external returns (uint256);

    function flashLoan(
        address receiverAddress,
        address[] calldata assets,
        uint256[] calldata amounts,
        uint256[] calldata interestRateModes,
        address onBehalfOf,
        bytes calldata params,
        uint16 referralCode
    ) external;

    function borrow(
        address asset,
        uint256 amount,
        uint256 interestRateMode,
        uint16 referralCode,
        address onBehalfOf
    ) external;

    function repay(
        address asset,
        uint256 amount,
        uint256 interestRateMode,
        address onBehalfOf
    ) external;

    function getUserAccountData(address _user)
        external
        view
        returns (
            uint256 totalCollateralETH,
            uint256 totalDebtETH,
            uint256 availableBorrowsETH,
            uint256 currentLiquidationThreshold,
            uint256 ltv,
            uint256 healthFactor
        );
}

interface AaveProtocolDataProvider {
    function getReserveTokensAddresses(address asset)
        external
        view
        returns (
            address aTokenAddress,
            address stableDebtTokenAddress,
            address variableDebtTokenAddress
        );

    function getReserveData(address asset)
        external
        view
        returns (
            uint256 availableLiquidity,
            uint256 totalStableDebt,
            uint256 totalVariableDebt,
            uint256 liquidityRate,
            uint256 variableBorrowRate,
            uint256 stableBorrowRate,
            uint256 averageStableBorrowRate,
            uint256 liquidityIndex,
            uint256 variableBorrowIndex,
            uint40 lastUpdateTimestamp
        );

    function getReserveConfigurationData(address asset)
        external
        view
        returns (
            uint256 decimals,
            uint256 ltv,
            uint256 liquidationThreshold,
            uint256 liquidationBonus,
            uint256 reserveFactor,
            bool usageAsCollateralEnabled,
            bool borrowingEnabled,
            bool stableBorrowRateEnabled,
            bool isActive,
            bool isFrozen
        );
}

//solhint-disable func-name-mixedcase
interface StakedAave is IERC20 {
    function claimRewards(address to, uint256 amount) external;

    function cooldown() external;

    function stake(address onBehalfOf, uint256 amount) external;

    function redeem(address to, uint256 amount) external;

    function getTotalRewardsBalance(address staker) external view returns (uint256);

    function stakersCooldowns(address staker) external view returns (uint256);

    function COOLDOWN_SECONDS() external view returns (uint256);

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

File 16 of 19 : IRoutedSwapper.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

/**
 * @notice Routed Swapper interface
 * @dev This contract doesn't support native coins (e.g. ETH, AVAX, MATIC, etc) use wrapper tokens instead
 */
interface IRoutedSwapper {
    /**
     * @notice The list of supported DEXes
     * @dev This function is gas intensive
     */
    function getAllExchanges() external view returns (address[] memory);

    /**
     * @notice Get *spot* quote
     * It will return the swap amount based on the current reserves of the best pair/path found (i.e. spot price).
     * @dev It shouldn't be used as oracle!!!
     */
    function getAmountIn(
        address tokenIn_,
        address tokenOut_,
        uint256 amountOut_
    ) external returns (uint256 _amountIn);

    /**
     * @notice Get *spot* quote
     * It will return the swap amount based on the current reserves of the best pair/path found (i.e. spot price).
     * @dev It shouldn't be used as oracle!!!
     */
    function getAmountOut(
        address tokenIn_,
        address tokenOut_,
        uint256 amountIn_
    ) external returns (uint256 _amountOut);

    /**
     * @notice Perform an exact input swap - will revert if there is no default routing
     */
    function swapExactInput(
        address tokenIn_,
        address tokenOut_,
        uint256 amountIn_,
        uint256 amountOutMin_,
        address _receiver
    ) external returns (uint256 _amountOut);

    /**
     * @notice Perform an exact output swap - will revert if there is no default routing
     */
    function swapExactOutput(
        address tokenIn_,
        address tokenOut_,
        uint256 amountOut_,
        uint256 amountInMax_,
        address receiver_
    ) external returns (uint256 _amountIn);
}

File 17 of 19 : Strategy.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import "vesper-pools/contracts/interfaces/vesper/IVesperPool.sol";
import "vesper-pools/contracts/dependencies/openzeppelin/contracts/token/ERC20/IERC20.sol";
import "vesper-pools/contracts/dependencies/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "vesper-pools/contracts/dependencies/openzeppelin/contracts/utils/Context.sol";
import "vesper-pools/contracts/dependencies/openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "vesper-pools/contracts/dependencies/openzeppelin/contracts/utils/math/Math.sol";
import "vesper-commons/contracts/interfaces/vesper/IStrategy.sol";
import "../interfaces/swapper/IRoutedSwapper.sol";

abstract contract Strategy is IStrategy, Context {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    IERC20 public immutable collateralToken;
    address public receiptToken;
    address public immutable override pool;
    address public override feeCollector;
    IRoutedSwapper public swapper;
    address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
    uint256 internal constant MAX_UINT_VALUE = type(uint256).max;

    EnumerableSet.AddressSet private _keepers;

    event UpdatedFeeCollector(address indexed previousFeeCollector, address indexed newFeeCollector);
    event UpdatedSwapper(IRoutedSwapper indexed oldSwapper, IRoutedSwapper indexed newSwapper);

    constructor(
        address _pool,
        address _swapper,
        address _receiptToken
    ) {
        require(_pool != address(0), "pool-address-is-zero");
        require(_swapper != address(0), "swapper-address-is-zero");
        swapper = IRoutedSwapper(_swapper);
        pool = _pool;
        collateralToken = IVesperPool(_pool).token();
        receiptToken = _receiptToken;
        require(_keepers.add(_msgSender()), "add-keeper-failed");
    }

    modifier onlyGovernor() {
        require(_msgSender() == IVesperPool(pool).governor(), "caller-is-not-the-governor");
        _;
    }

    modifier onlyKeeper() {
        require(_keepers.contains(_msgSender()), "caller-is-not-a-keeper");
        _;
    }

    modifier onlyPool() {
        require(_msgSender() == pool, "caller-is-not-vesper-pool");
        _;
    }

    /**
     * @notice Add given address in keepers list.
     * @param _keeperAddress keeper address to add.
     */
    function addKeeper(address _keeperAddress) external onlyGovernor {
        require(_keepers.add(_keeperAddress), "add-keeper-failed");
    }

    /// @dev Approve all required tokens
    function approveToken() external onlyKeeper {
        _approveToken(0);
        _approveToken(MAX_UINT_VALUE);
    }

    /// @notice Check whether given token is reserved or not. Reserved tokens are not allowed to sweep.
    function isReservedToken(address _token) public view virtual override returns (bool);

    /// @notice Return list of keepers
    function keepers() external view override returns (address[] memory) {
        return _keepers.values();
    }

    /**
     * @notice Migrate all asset and vault ownership,if any, to new strategy
     * @dev _beforeMigration hook can be implemented in child strategy to do extra steps.
     * @param _newStrategy Address of new strategy
     */
    function migrate(address _newStrategy) external virtual override onlyPool {
        require(_newStrategy != address(0), "new-strategy-address-is-zero");
        require(IStrategy(_newStrategy).pool() == pool, "not-valid-new-strategy");
        _beforeMigration(_newStrategy);
        IERC20(receiptToken).safeTransfer(_newStrategy, IERC20(receiptToken).balanceOf(address(this)));
        collateralToken.safeTransfer(_newStrategy, collateralToken.balanceOf(address(this)));
    }

    /**
     * @notice OnlyKeeper: Rebalance profit, loss and investment of this strategy.
     *  Calculate profit, loss and payback of this strategy and realize profit/loss and
     *  withdraw fund for payback, if any, and submit this report to pool.
     * @return _profit Realized profit in collateral.
     * @return _loss Realized loss, if any, in collateral.
     * @return _payback If strategy has any excess debt, we have to liquidate asset to payback excess debt.
     */
    function rebalance()
        external
        onlyKeeper
        returns (
            uint256 _profit,
            uint256 _loss,
            uint256 _payback
        )
    {
        return _rebalance();
    }

    /**
     * @notice Remove given address from keepers list.
     * @param _keeperAddress keeper address to remove.
     */
    function removeKeeper(address _keeperAddress) external onlyGovernor {
        require(_keepers.remove(_keeperAddress), "remove-keeper-failed");
    }

    /**
     * @notice sweep given token to feeCollector of strategy
     * @param _fromToken token address to sweep
     */
    function sweepERC20(address _fromToken) external override onlyKeeper {
        require(feeCollector != address(0), "fee-collector-not-set");
        require(_fromToken != address(collateralToken), "not-allowed-to-sweep-collateral");
        require(!isReservedToken(_fromToken), "not-allowed-to-sweep");
        if (_fromToken == ETH) {
            Address.sendValue(payable(feeCollector), address(this).balance);
        } else {
            uint256 _amount = IERC20(_fromToken).balanceOf(address(this));
            IERC20(_fromToken).safeTransfer(feeCollector, _amount);
        }
    }

    /// @notice Returns address of token correspond to receipt token
    function token() external view override returns (address) {
        return receiptToken;
    }

    /// @notice Returns address of token correspond to collateral token
    function collateral() external view override returns (address) {
        return address(collateralToken);
    }

    /// @notice Returns total collateral locked in the strategy
    function tvl() external view virtual returns (uint256);

    /**
     * @notice Update fee collector
     * @param _feeCollector fee collector address
     */
    function updateFeeCollector(address _feeCollector) external onlyGovernor {
        require(_feeCollector != address(0), "fee-collector-address-is-zero");
        require(_feeCollector != feeCollector, "fee-collector-is-same");
        emit UpdatedFeeCollector(feeCollector, _feeCollector);
        feeCollector = _feeCollector;
    }

    /**
     * @notice Update swapper
     * @param _swapper swapper address
     */
    function updateSwapper(IRoutedSwapper _swapper) external onlyGovernor {
        require(address(_swapper) != address(0), "swapper-address-is-zero");
        require(_swapper != swapper, "swapper-is-same");
        emit UpdatedSwapper(swapper, _swapper);
        swapper = _swapper;
    }

    /**
     * @notice Withdraw collateral token from end protocol.
     * @param _amount Amount of collateral token
     */
    function withdraw(uint256 _amount) external override onlyPool {
        uint256 _collateralHere = collateralToken.balanceOf(address(this));
        if (_collateralHere >= _amount) {
            collateralToken.safeTransfer(pool, _amount);
        } else {
            _withdrawHere(_amount - _collateralHere);
            // Do not assume _withdrawHere() will withdraw exact amount. Check balance again and transfer to pool
            _collateralHere = collateralToken.balanceOf(address(this));
            collateralToken.safeTransfer(pool, Math.min(_amount, _collateralHere));
        }
    }

    function _approveToken(uint256 _amount) internal virtual {
        collateralToken.safeApprove(pool, _amount);
    }

    /**
     * @dev some strategy may want to prepare before doing migration.
     *  Example In Maker old strategy want to give vault ownership to new strategy
     * @param _newStrategy .
     */
    function _beforeMigration(address _newStrategy) internal virtual;

    function _rebalance()
        internal
        virtual
        returns (
            uint256 _profit,
            uint256 _loss,
            uint256 _payback
        );

    function _swapExactInput(
        address _tokenIn,
        address _tokenOut,
        uint256 _amountIn
    ) internal returns (uint256 _amountOut) {
        _amountOut = swapper.swapExactInput(_tokenIn, _tokenOut, _amountIn, 1, address(this));
    }

    function _safeSwapExactInput(
        address _tokenIn,
        address _tokenOut,
        uint256 _amountIn
    ) internal {
        try swapper.swapExactInput(_tokenIn, _tokenOut, _amountIn, 1, address(this)) {} catch {} //solhint-disable no-empty-blocks
    }

    // These methods must be implemented by the inheriting strategy
    function _withdrawHere(uint256 _amount) internal virtual;
}

File 18 of 19 : AaveV2Core.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import "vesper-pools/contracts/dependencies/openzeppelin/contracts/utils/math/Math.sol";
import "vesper-pools/contracts/Errors.sol";
import "../../../interfaces/aave/IAave.sol";

/// @title This contract provide core operations for Aave
abstract contract AaveV2Core {
    //solhint-disable-next-line const-name-snakecase
    StakedAave public constant stkAAVE = StakedAave(0x4da27a545c0c5B758a6BA100e3a049001de870f5);
    address public constant AAVE = 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9;

    AaveLendingPool public immutable aaveLendingPool;
    AaveProtocolDataProvider public aaveProtocolDataProvider;
    AaveIncentivesController public immutable aaveIncentivesController;
    PoolAddressesProvider internal immutable aaveAddressesProvider_;

    AToken internal immutable aToken;
    bytes32 private constant AAVE_PROVIDER_ID = 0x0100000000000000000000000000000000000000000000000000000000000000;

    constructor(address _receiptToken) {
        require(_receiptToken != address(0), Errors.INPUT_ADDRESS_IS_ZERO);
        aToken = AToken(_receiptToken);
        // If there is no AAVE incentive then below call will fail
        try AToken(_receiptToken).getIncentivesController() returns (address _aaveIncentivesController) {
            aaveIncentivesController = AaveIncentivesController(_aaveIncentivesController);
        } catch {} //solhint-disable no-empty-blocks
        aaveAddressesProvider_ = PoolAddressesProvider(0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5);
        aaveLendingPool = AaveLendingPool(aaveAddressesProvider_.getLendingPool());
        aaveProtocolDataProvider = AaveProtocolDataProvider(aaveAddressesProvider_.getAddress(AAVE_PROVIDER_ID));
    }

    ///////////////////////// External access functions /////////////////////////

    /**
     * @notice Initiate cooldown to unstake aave.
     * @dev We only want to call this function when cooldown is expired and
     * that's the reason we have 'if' condition.
     * @dev Child contract should expose this function as external and onlyKeeper
     */
    function _startCooldown() internal returns (bool) {
        if (canStartCooldown()) {
            stkAAVE.cooldown();
            return true;
        }
        return false;
    }

    /**
     * @notice Unstake Aave from stakedAave contract
     * @dev We want to unstake as soon as favorable condition exit
     * @dev No guarding condition thus this call can fail, if we can't unstake.
     * @dev Child contract should expose this function as external and onlyKeeper
     */
    function _unstakeAave() internal {
        stkAAVE.redeem(address(this), type(uint256).max);
    }

    ///////////////////////////////////////////////////////////////////////////

    /// @notice Returns true if Aave can be unstaked
    function canUnstake() external view returns (bool) {
        (, uint256 _cooldownEnd, uint256 _unstakeEnd) = cooldownData();
        return _canUnstake(_cooldownEnd, _unstakeEnd);
    }

    /// @notice Returns true if we should start cooldown
    function canStartCooldown() public view returns (bool) {
        (uint256 _cooldownStart, , uint256 _unstakeEnd) = cooldownData();
        return _canStartCooldown(_cooldownStart, _unstakeEnd);
    }

    /// @notice Return cooldown related timestamps
    function cooldownData()
        public
        view
        returns (
            uint256 _cooldownStart,
            uint256 _cooldownEnd,
            uint256 _unstakeEnd
        )
    {
        _cooldownStart = stkAAVE.stakersCooldowns(address(this));
        _cooldownEnd = _cooldownStart + stkAAVE.COOLDOWN_SECONDS();
        _unstakeEnd = _cooldownEnd + stkAAVE.UNSTAKE_WINDOW();
    }

    /**
     * @notice Claim Aave. Also unstake all Aave if favorable condition exits or start cooldown.
     * @dev If we unstake all Aave, we can't start cooldown because it requires StakedAave balance.
     * @dev DO NOT convert 'if else' to 2 'if's as we are reading cooldown state once to save gas.
     * @dev Not all collateral token has aave incentive
     */
    function _claimAave() internal returns (uint256) {
        if (address(aaveIncentivesController) == address(0)) {
            return 0;
        }
        (uint256 _cooldownStart, uint256 _cooldownEnd, uint256 _unstakeEnd) = cooldownData();
        if (_cooldownStart == 0 || block.timestamp > _unstakeEnd) {
            // claim stkAave when its first rebalance or unstake period passed.
            aaveIncentivesController.claimRewards(getAssets(), type(uint256).max, address(this));
        }
        // Fetch and check again for next action.
        (_cooldownStart, _cooldownEnd, _unstakeEnd) = cooldownData();
        if (_canUnstake(_cooldownEnd, _unstakeEnd)) {
            stkAAVE.redeem(address(this), type(uint256).max);
        } else if (_canStartCooldown(_cooldownStart, _unstakeEnd)) {
            stkAAVE.cooldown();
        }

        stkAAVE.claimRewards(address(this), type(uint256).max);
        return IERC20(AAVE).balanceOf(address(this));
    }

    /// @notice Deposit asset into Aave
    function _deposit(address _asset, uint256 _amount) internal {
        if (_amount > 0) {
            try aaveLendingPool.deposit(_asset, _amount, address(this), 0) {} catch Error(string memory _reason) {
                // Aave uses liquidityIndex and some other indexes as needed to normalize input.
                // If normalized input equals to 0 then error will be thrown with '56' error code.
                // CT_INVALID_MINT_AMOUNT = '56'; //invalid amount to mint
                // Hence discard error where error code is '56'
                require(bytes32(bytes(_reason)) == "56", "deposit failed");
            }
        }
    }

    function getAssets() internal view returns (address[] memory) {
        address[] memory _assets = new address[](1);
        _assets[0] = address(aToken);
        return _assets;
    }

    /**
     * @notice Safe withdraw will make sure to check asking amount against available amount.
     * @dev Check we have enough aToken and liquidity to support this withdraw
     * @param _asset Address of asset to withdraw
     * @param _to Address that will receive collateral token.
     * @param _amount Amount of collateral to withdraw.
     * @return Actual collateral withdrawn
     */
    function _safeWithdraw(
        address _asset,
        address _to,
        uint256 _amount
    ) internal returns (uint256) {
        uint256 _aTokenBalance = aToken.balanceOf(address(this));
        // If Vesper becomes large liquidity provider in Aave(This happened in past in vUSDC 1.0)
        // In this case we might have more aToken compare to available liquidity in Aave and any
        // withdraw asking more than available liquidity will fail. To do safe withdraw, check
        // _amount against available liquidity.
        uint256 _availableLiquidity = IERC20(_asset).balanceOf(address(aToken));

        // Get minimum of _amount, _aTokenBalance and _availableLiquidity
        return _withdraw(_asset, _to, Math.min(_amount, Math.min(_aTokenBalance, _availableLiquidity)));
    }

    /**
     * @notice Withdraw given amount of collateral from Aave to given address
     * @param _asset Address of asset to withdraw
     * @param _to Address that will receive collateral token.
     * @param _amount Amount of collateral to withdraw.
     * @return Actual collateral withdrawn
     */
    function _withdraw(
        address _asset,
        address _to,
        uint256 _amount
    ) internal returns (uint256) {
        if (_amount > 0) {
            require(aaveLendingPool.withdraw(_asset, _amount, _to) == _amount, Errors.INCORRECT_WITHDRAW_AMOUNT);
        }
        return _amount;
    }

    /**
     * @dev Return true, only if we have StakedAave balance and either cooldown expired or cooldown is zero
     * @dev If we are in cooldown period we cannot unstake Aave. But our cooldown is still valid so we do
     * not want to reset/start cooldown.
     */
    function _canStartCooldown(uint256 _cooldownStart, uint256 _unstakeEnd) internal view returns (bool) {
        return stkAAVE.balanceOf(address(this)) > 0 && (_cooldownStart == 0 || block.timestamp > _unstakeEnd);
    }

    /// @dev Return true, if cooldown is over and we are in unstake window.
    function _canUnstake(uint256 _cooldownEnd, uint256 _unstakeEnd) internal view returns (bool) {
        return block.timestamp > _cooldownEnd && block.timestamp <= _unstakeEnd;
    }

    /**
     * @notice Return total AAVE incentive allocated to this address
     * @dev Aave and StakedAave are 1:1
     * @dev Not all collateral token has aave incentive
     */
    function _totalAave() internal view returns (uint256) {
        if (address(aaveIncentivesController) == address(0)) {
            return 0;
        }
        // TotalAave = Get current StakedAave rewards from controller +
        //             StakedAave balance here +
        //             Aave rewards by staking Aave in StakedAave contract
        return
            aaveIncentivesController.getRewardsBalance(getAssets(), address(this)) +
            stkAAVE.balanceOf(address(this)) +
            stkAAVE.getTotalRewardsBalance(address(this));
    }
}

File 19 of 19 : AaveV2Xy.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import "vesper-pools/contracts/interfaces/vesper/IPoolRewards.sol";
import "../../../interfaces/aave/IAave.sol";
import "../../Strategy.sol";
import "./AaveV2Core.sol";

// solhint-disable no-empty-blocks

/// @title Deposit Collateral in Aave and earn interest by depositing borrowed token in a Vesper Pool.
contract AaveV2Xy is Strategy, AaveV2Core {
    using SafeERC20 for IERC20;

    // solhint-disable-next-line var-name-mixedcase
    string public NAME;
    string public constant VERSION = "5.0.0";

    uint256 internal constant MAX_BPS = 10_000; //100%
    uint256 public minBorrowLimit = 7_000; // 70% of actual collateral factor of protocol
    uint256 public maxBorrowLimit = 8_500; // 85% of actual collateral factor of protocol

    uint32 internal constant TWAP_PERIOD = 3600;
    address public rewardToken;
    address public borrowToken;
    AToken public vdToken; // Variable Debt Token
    address internal aBorrowToken;
    event UpdatedBorrowLimit(
        uint256 previousMinBorrowLimit,
        uint256 newMinBorrowLimit,
        uint256 previousMaxBorrowLimit,
        uint256 newMaxBorrowLimit
    );

    constructor(
        address _pool,
        address _swapper,
        address _rewardToken,
        address _receiptToken,
        address _borrowToken,
        string memory _name
    ) Strategy(_pool, _swapper, _receiptToken) AaveV2Core(_receiptToken) {
        NAME = _name;
        rewardToken = _rewardToken;
        (address _aBorrowToken, , address _vdToken) = aaveProtocolDataProvider.getReserveTokensAddresses(_borrowToken);
        vdToken = AToken(_vdToken);
        borrowToken = _borrowToken;
        aBorrowToken = _aBorrowToken;
    }

    function isReservedToken(address _token) public view virtual override returns (bool) {
        return _token == address(aToken) || address(vdToken) == _token || borrowToken == _token;
    }

    /// @notice Returns total collateral locked in the strategy
    function tvl() external view override returns (uint256) {
        return aToken.balanceOf(address(this)) + collateralToken.balanceOf(address(this));
    }

    /// @notice After borrowing Y Hook
    function _afterBorrowY(uint256 _amount) internal virtual {}

    /// @notice Approve all required tokens
    function _approveToken(uint256 _amount) internal virtual override {
        super._approveToken(_amount);
        collateralToken.safeApprove(address(aToken), _amount);
        collateralToken.safeApprove(address(aaveLendingPool), _amount);
        IERC20(borrowToken).safeApprove(address(aaveLendingPool), _amount);
        IERC20(collateralToken).safeApprove(address(swapper), _amount);
        IERC20(rewardToken).safeApprove(address(swapper), _amount);
        IERC20(borrowToken).safeApprove(address(swapper), _amount);
    }

    /**
     * @notice Claim rewardToken and transfer to new strategy
     * @param _newStrategy Address of new strategy.
     */
    function _beforeMigration(address _newStrategy) internal virtual override {
        require(IStrategy(_newStrategy).token() == address(aToken), "wrong-receipt-token");
        _repayY(vdToken.balanceOf(address(this)));
    }

    /// @notice Before repaying Y Hook
    function _beforeRepayY(uint256 _amount) internal virtual {}

    function _borrowY(uint256 _amount) internal virtual {
        if (_amount > 0) {
            // 2 for variable rate borrow, 0 for referralCode
            aaveLendingPool.borrow(borrowToken, _amount, 2, 0, address(this));
            _afterBorrowY(_amount);
        }
    }

    /**
     * @notice Calculate borrow and repay amount based on current collateral and new deposit/withdraw amount.
     * @param _depositAmount deposit amount
     * @param _withdrawAmount withdraw amount
     * @return _borrowAmount borrow more amount
     * @return _repayAmount repay amount to keep ltv within limit
     */
    function _calculateBorrowPosition(uint256 _depositAmount, uint256 _withdrawAmount)
        internal
        view
        returns (uint256 _borrowAmount, uint256 _repayAmount)
    {
        require(_depositAmount == 0 || _withdrawAmount == 0, "all-input-gt-zero");
        uint256 _borrowed = vdToken.balanceOf(address(this));
        // If maximum borrow limit set to 0 then repay borrow
        if (maxBorrowLimit == 0) {
            return (0, _borrowed);
        }
        uint256 _collateral = aToken.balanceOf(address(this));
        // In case of withdraw, _amount can be greater than _supply
        uint256 _hypotheticalCollateral =
            _depositAmount > 0 ? _collateral + _depositAmount : _collateral > _withdrawAmount
                ? _collateral - _withdrawAmount
                : 0;
        if (_hypotheticalCollateral == 0) {
            return (0, _borrowed);
        }
        AaveOracle _aaveOracle = AaveOracle(aaveAddressesProvider_.getPriceOracle());
        // Oracle prices are in 18 decimal
        uint256 _borrowTokenPrice = _aaveOracle.getAssetPrice(borrowToken);
        uint256 _collateralTokenPrice = _aaveOracle.getAssetPrice(address(collateralToken));
        if (_borrowTokenPrice == 0 || _collateralTokenPrice == 0) {
            // Oracle problem. Lets payback all
            return (0, _borrowed);
        }
        // _collateralFactor in 4 decimal. 10_000 = 100%
        (, uint256 _collateralFactor, , , , , , , , ) =
            aaveProtocolDataProvider.getReserveConfigurationData(address(collateralToken));

        // Collateral in base currency based on oracle price and cf;
        uint256 _actualCollateralForBorrow =
            (_hypotheticalCollateral * _collateralFactor * _collateralTokenPrice) /
                (MAX_BPS * (10**IERC20Metadata(address(collateralToken)).decimals()));
        // Calculate max borrow possible in borrow token number
        uint256 _maxBorrowPossible =
            (_actualCollateralForBorrow * (10**IERC20Metadata(address(borrowToken)).decimals())) / _borrowTokenPrice;
        if (_maxBorrowPossible == 0) {
            return (0, _borrowed);
        }
        // Safe buffer to avoid liquidation due to price variations.
        uint256 _borrowUpperBound = (_maxBorrowPossible * maxBorrowLimit) / MAX_BPS;

        // Borrow up to _borrowLowerBound and keep buffer of _borrowUpperBound - _borrowLowerBound for price variation
        uint256 _borrowLowerBound = (_maxBorrowPossible * minBorrowLimit) / MAX_BPS;

        // If current borrow is greater than max borrow, then repay to achieve safe position.
        if (_borrowed > _borrowUpperBound) {
            // If borrow > upperBound then it is greater than lowerBound too.
            _repayAmount = _borrowed - _borrowLowerBound;
        } else if (_borrowLowerBound > _borrowed) {
            _borrowAmount = _borrowLowerBound - _borrowed;
            uint256 _availableLiquidity = IERC20(borrowToken).balanceOf(aBorrowToken);
            if (_borrowAmount > _availableLiquidity) {
                _borrowAmount = _availableLiquidity;
            }
        }
    }

    /// @notice Deposit collateral in Aave and adjust borrow position
    function _deposit() internal {
        uint256 _collateralBalance = collateralToken.balanceOf(address(this));

        (uint256 _borrowAmount, uint256 _repayAmount) = _calculateBorrowPosition(_collateralBalance, 0);

        if (_repayAmount > 0) {
            // Repay _borrowAmount to maintain safe position
            _repayY(_repayAmount);
            _mint(_collateralBalance);
        } else {
            // Happy path, mint more borrow more
            _mint(_collateralBalance);
            _borrowY(_borrowAmount);
        }
    }

    /// @notice Borrowed Y balance deposited here or elsewhere hook
    function _getInvestedBorrowBalance() internal view virtual returns (uint256) {
        return IERC20(borrowToken).balanceOf(address(this));
    }

    /**
     * @dev Aave support WETH as collateral.
     */
    function _mint(uint256 _amount) internal virtual {
        _deposit(address(collateralToken), _amount);
    }

    /**
     * @notice Generate report for pools accounting and also send profit and any payback to pool.
     * @dev Claim rewardToken and convert to collateral.
     */
    function _rebalance()
        internal
        override
        returns (
            uint256 _profit,
            uint256 _loss,
            uint256 _payback
        )
    {
        uint256 _excessDebt = IVesperPool(pool).excessDebt(address(this));
        uint256 _totalDebt = IVesperPool(pool).totalDebtOf(address(this));

        // Claim rewards and convert to collateral token
        uint256 _aaveAmount = _claimAave();
        if (_aaveAmount > 0) {
            _safeSwapExactInput(rewardToken, address(collateralToken), _aaveAmount);
        }

        uint256 _borrow = vdToken.balanceOf(address(this));
        uint256 _investedBorrowBalance = _getInvestedBorrowBalance();

        // _borrow increases every block. Convert collateral to borrowToken.
        if (_borrow > _investedBorrowBalance) {
            _swapToBorrowToken(_borrow - _investedBorrowBalance);
        } else {
            // When _investedBorrowBalance exceeds _borrow balance from Aave
            // Customize this hook to handle the excess borrowToken for profit
            _rebalanceBorrow(_investedBorrowBalance - _borrow);
        }

        uint256 _supply = aToken.balanceOf(address(this));
        uint256 _collateralHere = collateralToken.balanceOf(address(this));
        uint256 _totalCollateral = _supply + _collateralHere;

        if (_totalCollateral > _totalDebt) {
            _profit = _totalCollateral - _totalDebt;
        } else {
            _loss = _totalDebt - _totalCollateral;
        }
        uint256 _profitAndExcessDebt = _profit + _excessDebt;
        if (_collateralHere < _profitAndExcessDebt) {
            uint256 _totalAmountToWithdraw = Math.min((_profitAndExcessDebt - _collateralHere), _supply);
            if (_totalAmountToWithdraw > 0) {
                _withdrawHere(_totalAmountToWithdraw);
                _collateralHere = collateralToken.balanceOf(address(this));
            }
        }

        // Make sure _collateralHere >= _payback + profit. set actual payback first and then profit
        _payback = Math.min(_collateralHere, _excessDebt);
        _profit = _collateralHere > _payback ? Math.min((_collateralHere - _payback), _profit) : 0;
        IVesperPool(pool).reportEarning(_profit, _loss, _payback);
        _deposit();
    }

    /// @notice Swap excess borrow for more collateral hook
    function _rebalanceBorrow(uint256 _excessBorrow) internal virtual {}

    function _redeemX(uint256 _amount) internal virtual {
        _safeWithdraw(address(collateralToken), address(this), _amount);
    }

    function _repayY(uint256 _amount) internal virtual {
        _beforeRepayY(_amount);
        aaveLendingPool.repay(borrowToken, _amount, 2, address(this));
    }

    /**
     * @dev Swap collateral token to borrowToken
     * @param _shortOnBorrow Expected output of this swap
     */
    function _swapToBorrowToken(uint256 _shortOnBorrow) internal {
        // Looking for _amountIn using fixed output amount
        uint256 _amountIn = swapper.getAmountIn(address(collateralToken), borrowToken, _shortOnBorrow);
        if (_amountIn > 0) {
            uint256 _collateralHere = collateralToken.balanceOf(address(this));
            if (_amountIn > _collateralHere) {
                // Redeem some collateral, so that we have enough collateral to get expected output
                _redeemX(_amountIn - _collateralHere);
            }
            swapper.swapExactOutput(address(collateralToken), borrowToken, _shortOnBorrow, _amountIn, address(this));
        }
    }

    /// @dev Withdraw collateral here. Do not transfer to pool
    function _withdrawHere(uint256 _requireAmount) internal override {
        (, uint256 _repayAmount) = _calculateBorrowPosition(0, _requireAmount);
        if (_repayAmount > 0) {
            _repayY(_repayAmount);
        }
        _redeemX(_requireAmount);
    }

    /************************************************************************************************
     *                          Governor/admin/keeper function                                      *
     ***********************************************************************************************/
    /**
     * @notice Update upper and lower borrow limit. Usually maxBorrowLimit < 100% of actual collateral factor of protocol.
     * @dev It is possible to set _maxBorrowLimit and _minBorrowLimit as 0 to not borrow anything
     * @param _minBorrowLimit It is % of actual collateral factor of protocol
     * @param _maxBorrowLimit It is % of actual collateral factor of protocol
     */
    function updateBorrowLimit(uint256 _minBorrowLimit, uint256 _maxBorrowLimit) external onlyGovernor {
        require(_maxBorrowLimit < MAX_BPS, "invalid-max-borrow-limit");
        // set _maxBorrowLimit and _minBorrowLimit to disable borrow;
        require(
            (_maxBorrowLimit == 0 && _minBorrowLimit == 0) || _maxBorrowLimit > _minBorrowLimit,
            "max-should-be-higher-than-min"
        );
        emit UpdatedBorrowLimit(minBorrowLimit, _minBorrowLimit, maxBorrowLimit, _maxBorrowLimit);
        minBorrowLimit = _minBorrowLimit;
        maxBorrowLimit = _maxBorrowLimit;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"address","name":"_swapper","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_receiptToken","type":"address"},{"internalType":"address","name":"_borrowToken","type":"address"},{"internalType":"address","name":"_vPool","type":"address"},{"internalType":"address","name":"_vspAddress","type":"address"},{"internalType":"string","name":"_name","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousMinBorrowLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newMinBorrowLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"previousMaxBorrowLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newMaxBorrowLimit","type":"uint256"}],"name":"UpdatedBorrowLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousFeeCollector","type":"address"},{"indexed":true,"internalType":"address","name":"newFeeCollector","type":"address"}],"name":"UpdatedFeeCollector","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IRoutedSwapper","name":"oldSwapper","type":"address"},{"indexed":true,"internalType":"contract IRoutedSwapper","name":"newSwapper","type":"address"}],"name":"UpdatedSwapper","type":"event"},{"inputs":[],"name":"AAVE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aaveIncentivesController","outputs":[{"internalType":"contract AaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aaveLendingPool","outputs":[{"internalType":"contract AaveLendingPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aaveProtocolDataProvider","outputs":[{"internalType":"contract AaveProtocolDataProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_keeperAddress","type":"address"}],"name":"addKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"borrowToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canStartCooldown","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canUnstake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateral","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateralToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cooldownData","outputs":[{"internalType":"uint256","name":"_cooldownStart","type":"uint256"},{"internalType":"uint256","name":"_cooldownEnd","type":"uint256"},{"internalType":"uint256","name":"_unstakeEnd","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvestVSP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"isReservedToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keepers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxBorrowLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newStrategy","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minBorrowLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebalance","outputs":[{"internalType":"uint256","name":"_profit","type":"uint256"},{"internalType":"uint256","name":"_loss","type":"uint256"},{"internalType":"uint256","name":"_payback","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"receiptToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_keeperAddress","type":"address"}],"name":"removeKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stkAAVE","outputs":[{"internalType":"contract StakedAave","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapper","outputs":[{"internalType":"contract IRoutedSwapper","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_fromToken","type":"address"}],"name":"sweepERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tvl","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"_maxBorrowLimit","type":"uint256"}],"name":"updateBorrowLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeCollector","type":"address"}],"name":"updateFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IRoutedSwapper","name":"_swapper","type":"address"}],"name":"updateSwapper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vPool","outputs":[{"internalType":"contract IVesperPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vdToken","outputs":[{"internalType":"contract AToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vsp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610180604052611b586007556121346008553480156200001e57600080fd5b5060405162005728380380620057288339810160408190526200004191620007ea565b878787878785828686826001600160a01b038316620000a75760405162461bcd60e51b815260206004820152601460248201527f706f6f6c2d616464726573732d69732d7a65726f00000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b038216620000ff5760405162461bcd60e51b815260206004820152601760248201527f737761707065722d616464726573732d69732d7a65726f00000000000000000060448201526064016200009e565b600280546001600160a01b0319166001600160a01b0384811691909117909155831660a081905260408051637e062a3560e11b8152905163fc0c546a91600480820192602092909190829003018186803b1580156200015d57600080fd5b505afa15801562000172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200019891906200093c565b6001600160a01b03908116608052600080546001600160a01b031916918316919091179055620001df620001c93390565b60036200067060201b62001aee1790919060201c565b620002215760405162461bcd60e51b81526020600482015260116024820152701859190b5ad9595c195c8b59985a5b1959607a1b60448201526064016200009e565b5050604080518082019091526002815261031360f41b602082015290506001600160a01b038216620002685760405162461bcd60e51b81526004016200009e919062000963565b506001600160a01b038116610120819052604080516375d2641360e01b815290516375d2641391600480820192602092909190829003018186803b158015620002b057600080fd5b505afa925050508015620002e3575060408051601f3d908101601f19168201909252620002e0918101906200093c565b60015b620002ee57620002fb565b6001600160a01b031660e0525b73b53c1a33016b2dc2ff3653530bff1848a515c8c561010081905260408051630261bf8b60e01b81529051630261bf8b91600480820192602092909190829003018186803b1580156200034d57600080fd5b505afa15801562000362573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200038891906200093c565b6001600160a01b0390811660c052610100516040516321f8a72160e01b8152600160f81b60048201529116906321f8a7219060240160206040518083038186803b158015620003d657600080fd5b505afa158015620003eb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200041191906200093c565b600580546001600160a01b0319166001600160a01b039290921691909117905550805162000447906006906020840190620006e2565b50600980546001600160a01b0319166001600160a01b03868116919091179091556005546040516334924edb60e21b815284831660048201526000928392169063d2493b6c9060240160606040518083038186803b158015620004a957600080fd5b505afa158015620004be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004e4919062000998565b600b80546001600160a01b03199081166001600160a01b0393841617909155600a8054821698831698909817909755600c8054909716928116929092179095558a16151597506200058096505050505050505760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642d7673702d616464726573730000000000000000000000000060448201526064016200009e565b600a5460408051637e062a3560e11b815290516001600160a01b039283169286169163fc0c546a916004808301926020929190829003018186803b158015620005c857600080fd5b505afa158015620005dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200060391906200093c565b6001600160a01b0316146200064f5760405162461bcd60e51b81526020600482015260116024820152701a5b9d985b1a590b59dc9bddcb5c1bdbdb607a1b60448201526064016200009e565b506001600160a01b039182166101405216610160525062000a299350505050565b600062000687836001600160a01b03841662000690565b90505b92915050565b6000818152600183016020526040812054620006d9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200068a565b5060006200068a565b828054620006f090620009ec565b90600052602060002090601f0160209004810192826200071457600085556200075f565b82601f106200072f57805160ff19168380011785556200075f565b828001600101855582156200075f579182015b828111156200075f57825182559160200191906001019062000742565b506200076d92915062000771565b5090565b5b808211156200076d576000815560010162000772565b6001600160a01b03811681146200079e57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620007d4578181015183820152602001620007ba565b83811115620007e4576000848401525b50505050565b600080600080600080600080610100898b0312156200080857600080fd5b8851620008158162000788565b60208a0151909850620008288162000788565b60408a01519097506200083b8162000788565b60608a01519096506200084e8162000788565b60808a0151909550620008618162000788565b60a08a0151909450620008748162000788565b60c08a0151909350620008878162000788565b60e08a01519092506001600160401b0380821115620008a557600080fd5b818b0191508b601f830112620008ba57600080fd5b815181811115620008cf57620008cf620007a1565b604051601f8201601f19908116603f01168101908382118183101715620008fa57620008fa620007a1565b816040528281528e60208487010111156200091457600080fd5b62000927836020830160208801620007b7565b80955050505050509295985092959890939650565b6000602082840312156200094f57600080fd5b81516200095c8162000788565b9392505050565b602081526000825180602084015262000984816040850160208701620007b7565b601f01601f19169190910160400192915050565b600080600060608486031215620009ae57600080fd5b8351620009bb8162000788565b6020850151909350620009ce8162000788565b6040850151909250620009e18162000788565b809150509250925092565b600181811c9082168062000a0157607f821691505b6020821081141562000a2357634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161010051610120516101405161016051614ac462000c64600039600081816102bf01528181610d4201528181610dd401526122d80152600081816103ba01528181610c29015281816122a201528181613327015281816133c301528181613d3201528181613e1c01528181613e4f01526143b0015260008181610bbc0152818161187e01528181611f7401528181612303015281816128b2015281816138fe01528181613b4e01528181613bfd0152613cd90152600061298301526000818161037801528181612f800152612fda0152600081816104eb01528181612eef015281816139520152818161398901528181613fab015281816141c601526142c001526000818161024d01528181610585015281816108580152818161097401528181610a5201528181610aae01528181610f6001528181610ffd01528181611229015281816113f20152818161192b01528181611d1501528181611db501528181612200015261404101526000818161042e0152818161049e015281816108b701528181610952015281816109c601528181610a8501528181610df50152818161118d01528181611624015281816117e201528181611e7501528181611fff0152818161212201528181612aaf01528181612b8701528181612c0f01528181612f56015281816134b30152818161356d0152818161363901528181613767015281816137a6015281816138dc01528181613930015281816139bf01528181613f43015261401f0152614ac46000f3fe608060405234801561001057600080fd5b50600436106102125760003560e01c8063951dc22c11610120578063e00af4a7116100b8578063f51896f81161007c578063f51896f814610520578063f7c618c114610528578063fb7ee1021461053b578063fc0c546a1461054e578063ffa1ad741461055f57600080fd5b8063e00af4a7146104c2578063e260d747146104d5578063e5328e06146104de578063e9d337b8146104e6578063ec78e8321461050d57600080fd5b8063951dc22c146103f757806399b71d5c1461040c578063a3f4df7e14610414578063b2016bd414610429578063c415b95c14610450578063ce5494bb14610463578063d2c35ce814610476578063d3033c3914610489578063d8dfeb451461049c57600080fd5b8063440d7248116101ae5780635f9d4d2e116101725780635f9d4d2e1461039a57806360a05a85146103ad5780636719578c146103b55780637d7c2a1c146103dc57806390d67514146103e457600080fd5b8063440d72481461031a578063456dc17a1461033d57806348ccda3c146103505780634fc90c2c1461036b5780635f2475ca1461037357600080fd5b80630181686c1461021757806314ae9f2e1461023357806316f0115b146102485780631fc29c011461027c57806321fc6bb01461029757806329ba73ed146102ba5780632b3297f9146102e15780632e1a7d4d146102f45780634032b72b14610307575b600080fd5b61022060085481565b6040519081526020015b60405180910390f35b610246610241366004614435565b610583565b005b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b60405161022a9190614452565b61026f734da27a545c0c5b758a6ba100e3a049001de870f581565b61029f61069e565b6040805193845260208401929092529082015260600161022a565b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b60025461026f906001600160a01b031681565b610246610302366004614466565b610855565b610246610315366004614435565b610aac565b61032d610328366004614435565b610bb8565b604051901515815260200161022a565b600a5461026f906001600160a01b031681565b61026f737fc66500c84a76ad7e9c93437bfc5ac33e2ddae981565b610246610c25565b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b60055461026f906001600160a01b031681565b61032d610e1f565b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b61029f610e42565b600b5461026f906001600160a01b031681565b6103ff610e82565b60405161022a91906144c3565b610246610e93565b61041c610ecf565b60405161022a9190614502565b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b60015461026f906001600160a01b031681565b610246610471366004614435565b610f5d565b610246610484366004614435565b611227565b610246610497366004614435565b6113f0565b7f000000000000000000000000000000000000000000000000000000000000000061026f565b6102466104d0366004614435565b6115ad565b61022060075481565b6102206117c8565b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b60005461026f906001600160a01b031681565b61032d61190d565b60095461026f906001600160a01b031681565b610246610549366004614535565b611929565b6000546001600160a01b031661026f565b61041c604051806040016040528060058152602001640352e302e360dc1b81525081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156105dc57600080fd5b505afa1580156105f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106149190614557565b6001600160a01b0316336001600160a01b03161461064d5760405162461bcd60e51b815260040161064490614574565b60405180910390fd5b610658600382611b0a565b61069b5760405162461bcd60e51b81526020600482015260146024820152731c995b5bdd994b5ad9595c195c8b59985a5b195960621b6044820152606401610644565b50565b60405163091030c360e01b815260009081908190734da27a545c0c5b758a6ba100e3a049001de870f59063091030c3906106dc903090600401614452565b60206040518083038186803b1580156106f457600080fd5b505afa158015610708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072c91906145ab565b9250734da27a545c0c5b758a6ba100e3a049001de870f56001600160a01b03166372b49d636040518163ffffffff1660e01b815260040160206040518083038186803b15801561077b57600080fd5b505afa15801561078f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b391906145ab565b6107bd90846145da565b9150734da27a545c0c5b758a6ba100e3a049001de870f56001600160a01b031663359c4a966040518163ffffffff1660e01b815260040160206040518083038186803b15801561080c57600080fd5b505afa158015610820573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084491906145ab565b61084e90836145da565b9050909192565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461089d5760405162461bcd60e51b8152600401610644906145f2565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906108ec903090600401614452565b60206040518083038186803b15801561090457600080fd5b505afa158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c91906145ab565b905081811061099d576109996001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000084611b1f565b5050565b6109af6109aa8284614625565b611b75565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906109fb903090600401614452565b60206040518083038186803b158015610a1357600080fd5b505afa158015610a27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4b91906145ab565b90506109997f0000000000000000000000000000000000000000000000000000000000000000610a7b8484611b9d565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169190611b1f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610b0557600080fd5b505afa158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3d9190614557565b6001600160a01b0316336001600160a01b031614610b6d5760405162461bcd60e51b815260040161064490614574565b610b78600382611aee565b61069b5760405162461bcd60e51b81526020600482015260116024820152701859190b5ad9595c195c8b59985a5b1959607a1b6044820152606401610644565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161480610c075750600b546001600160a01b038381169116145b80610c1f5750600a546001600160a01b038381169116145b92915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638bc6beb26040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8057600080fd5b505afa158015610c94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb89190614557565b90506001600160a01b03811615610d285760405163d279c19160e01b81526001600160a01b0382169063d279c19190610cf5903090600401614452565b600060405180830381600087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610d77903090600401614452565b60206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc791906145ab565b9050801561099957610e1a7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000083611bb3565b505050565b6000806000610e2c61069e565b9250509150610e3b8282611c47565b9250505090565b60008080610e53335b600390611ceb565b610e6f5760405162461bcd60e51b81526004016106449061463c565b610e77611d0d565b925092509250909192565b6060610e8e600361227a565b905090565b610e9c33610e4b565b610eb85760405162461bcd60e51b81526004016106449061463c565b610ec26000612287565b610ecd600019612287565b565b60068054610edc9061466c565b80601f0160208091040260200160405190810160405280929190818152602001828054610f089061466c565b8015610f555780601f10610f2a57610100808354040283529160200191610f55565b820191906000526020600020905b815481529060010190602001808311610f3857829003601f168201915b505050505081565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614610fa55760405162461bcd60e51b8152600401610644906145f2565b6001600160a01b038116610ffb5760405162461bcd60e51b815260206004820152601c60248201527f6e65772d73747261746567792d616464726573732d69732d7a65726f000000006044820152606401610644565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561105e57600080fd5b505afa158015611072573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110969190614557565b6001600160a01b0316146110e55760405162461bcd60e51b81526020600482015260166024820152756e6f742d76616c69642d6e65772d737472617465677960501b6044820152606401610644565b6110ee81612301565b6000546040516370a0823160e01b81526111879183916001600160a01b03909116906370a0823190611124903090600401614452565b60206040518083038186803b15801561113c57600080fd5b505afa158015611150573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117491906145ab565b6000546001600160a01b03169190611b1f565b61069b817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016111d79190614452565b60206040518083038186803b1580156111ef57600080fd5b505afa158015611203573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7b91906145ab565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561128057600080fd5b505afa158015611294573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b89190614557565b6001600160a01b0316336001600160a01b0316146112e85760405162461bcd60e51b815260040161064490614574565b6001600160a01b03811661133e5760405162461bcd60e51b815260206004820152601d60248201527f6665652d636f6c6c6563746f722d616464726573732d69732d7a65726f0000006044820152606401610644565b6001546001600160a01b03828116911614156113945760405162461bcd60e51b81526020600482015260156024820152746665652d636f6c6c6563746f722d69732d73616d6560581b6044820152606401610644565b6001546040516001600160a01b038084169216907f0f06062680f9bd68e786e9980d9bb03d73d5620fc3b345e417b6eacb310b970690600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561144957600080fd5b505afa15801561145d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114819190614557565b6001600160a01b0316336001600160a01b0316146114b15760405162461bcd60e51b815260040161064490614574565b6001600160a01b0381166115015760405162461bcd60e51b8152602060048201526017602482015276737761707065722d616464726573732d69732d7a65726f60481b6044820152606401610644565b6002546001600160a01b03828116911614156115515760405162461bcd60e51b815260206004820152600f60248201526e737761707065722d69732d73616d6560881b6044820152606401610644565b6002546040516001600160a01b038084169216907f6c953b7ec311055c20b96a42cea31e89528e375b1bf953a503db40854b3188fe90600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6115b633610e4b565b6115d25760405162461bcd60e51b81526004016106449061463c565b6001546001600160a01b03166116225760405162461bcd60e51b81526020600482015260156024820152741999594b58dbdb1b1958dd1bdc8b5b9bdd0b5cd95d605a1b6044820152606401610644565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031614156116a45760405162461bcd60e51b815260206004820152601f60248201527f6e6f742d616c6c6f7765642d746f2d73776565702d636f6c6c61746572616c006044820152606401610644565b6116ad81610bb8565b156116f15760405162461bcd60e51b815260206004820152601460248201527306e6f742d616c6c6f7765642d746f2d73776565760641b6044820152606401610644565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561172c5760015461069b906001600160a01b03164761246f565b6040516370a0823160e01b81526000906001600160a01b038316906370a082319061175b903090600401614452565b60206040518083038186803b15801561177357600080fd5b505afa158015611787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ab91906145ab565b600154909150610999906001600160a01b03848116911683611b1f565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190611817903090600401614452565b60206040518083038186803b15801561182f57600080fd5b505afa158015611843573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061186791906145ab565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906118b3903090600401614452565b60206040518083038186803b1580156118cb57600080fd5b505afa1580156118df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190391906145ab565b610e8e91906145da565b600080600061191a61069e565b9250925050610e3b8282612588565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561198257600080fd5b505afa158015611996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ba9190614557565b6001600160a01b0316336001600160a01b0316146119ea5760405162461bcd60e51b815260040161064490614574565b6127108110611a365760405162461bcd60e51b81526020600482015260186024820152771a5b9d985b1a590b5b585e0b589bdc9c9bddcb5b1a5b5a5d60421b6044820152606401610644565b80158015611a42575081155b80611a4c57508181115b611a985760405162461bcd60e51b815260206004820152601d60248201527f6d61782d73686f756c642d62652d6869676865722d7468616e2d6d696e0000006044820152606401610644565b6007546008546040805192835260208301859052820152606081018290527fedd77444afdf63401315e81ffe86d08f7865796e8ad2e11acf1d56a1393f07d59060800160405180910390a1600791909155600855565b6000611b03836001600160a01b03841661259d565b9392505050565b6000611b03836001600160a01b0384166125ec565b610e1a8363a9059cbb60e01b8484604051602401611b3e9291906146a7565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526126df565b6000611b826000836127b1565b9150508015611b9457611b9481612eb0565b61099982612f51565b6000818310611bac5781611b03565b5090919050565b600254604051636ccb2b0160e01b81526000916001600160a01b031690636ccb2b0190611bed9087908790879060019030906004016146c0565b602060405180830381600087803b158015611c0757600080fd5b505af1158015611c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3f91906145ab565b949350505050565b6040516370a0823160e01b81526000908190734da27a545c0c5b758a6ba100e3a049001de870f5906370a0823190611c83903090600401614452565b60206040518083038186803b158015611c9b57600080fd5b505afa158015611caf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cd391906145ab565b118015611b035750821580611b035750504211919050565b6001600160a01b03811660009081526001830160205260408120541515611b03565b6000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d53ddc26306040518263ffffffff1660e01b8152600401611d5f9190614452565b60206040518083038186803b158015611d7757600080fd5b505afa158015611d8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611daf91906145ab565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639f2b2833306040518263ffffffff1660e01b8152600401611dff9190614452565b60206040518083038186803b158015611e1757600080fd5b505afa158015611e2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4f91906145ab565b90506000611e5b612f7c565b90508015611e9a57600954611e9a906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613288565b600b546040516370a0823160e01b81526000916001600160a01b0316906370a0823190611ecb903090600401614452565b60206040518083038186803b158015611ee357600080fd5b505afa158015611ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1b91906145ab565b90506000611f2761331a565b905080821115611f4857611f43611f3e8284614625565b613496565b611f5a565b611f5a611f558383614625565b6136bd565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190611fa9903090600401614452565b60206040518083038186803b158015611fc157600080fd5b505afa158015611fd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff991906145ab565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016120499190614452565b60206040518083038186803b15801561206157600080fd5b505afa158015612075573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209991906145ab565b905060006120a782846145da565b9050868111156120c2576120bb8782614625565b9a506120cf565b6120cc8188614625565b99505b60006120db898d6145da565b9050808310156121ac5760006120fa6120f48584614625565b86611b9d565b905080156121aa5761210b81611b75565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190612157903090600401614452565b60206040518083038186803b15801561216f57600080fd5b505afa158015612183573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121a791906145ab565b93505b505b6121b6838a611b9d565b99508983116121c65760006121d9565b6121d96121d38b85614625565b8d611b9d565b6040516302df682360e11b815260048101829052602481018d9052604481018c9052909c507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906305bed04690606401600060405180830381600087803b15801561224c57600080fd5b505af1158015612260573d6000803e3d6000fd5b5050505061226c61378c565b505050505050505050909192565b60606000611b038361386a565b612290816138c6565b600a546122c7906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613a1e565b60025461069b906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683613a1e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561236457600080fd5b505afa158015612378573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239c9190614557565b6001600160a01b0316146123e85760405162461bcd60e51b81526020600482015260136024820152723bb937b73396b932b1b2b4b83a16ba37b5b2b760691b6044820152606401610644565b600b546040516370a0823160e01b815261069b916001600160a01b0316906370a082319061241a903090600401614452565b60206040518083038186803b15801561243257600080fd5b505afa158015612446573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061246a91906145ab565b612eb0565b804710156124bf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610644565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461250c576040519150601f19603f3d011682016040523d82523d6000602084013e612511565b606091505b5050905080610e1a5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610644565b60008242118015611b03575050421115919050565b60008181526001830160205260408120546125e457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c1f565b506000610c1f565b600081815260018301602052604081205480156126d5576000612610600183614625565b855490915060009061262490600190614625565b9050818114612689576000866000018281548110612644576126446146f0565b9060005260206000200154905080876000018481548110612667576126676146f0565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061269a5761269a614706565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c1f565b6000915050610c1f565b6000612734826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613b319092919063ffffffff16565b805190915015610e1a57808060200190518101906127529190614731565b610e1a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610644565b6000808315806127bf575082155b6127ff5760405162461bcd60e51b8152602060048201526011602482015270616c6c2d696e7075742d67742d7a65726f60781b6044820152606401610644565b600b546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612830903090600401614452565b60206040518083038186803b15801561284857600080fd5b505afa15801561285c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061288091906145ab565b90506008546000141561289857600092509050612ea9565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906128e7903090600401614452565b60206040518083038186803b1580156128ff57600080fd5b505afa158015612913573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293791906145ab565b9050600080871161295f57858211612950576000612969565b61295a8683614625565b612969565b61296987836145da565b90508061297f5760008394509450505050612ea9565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663fca513a86040518163ffffffff1660e01b815260040160206040518083038186803b1580156129da57600080fd5b505afa1580156129ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a129190614557565b600a5460405163b3596f0760e01b81529192506000916001600160a01b038085169263b3596f0792612a4a9290911690600401614452565b60206040518083038186803b158015612a6257600080fd5b505afa158015612a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a9a91906145ab565b90506000826001600160a01b031663b3596f077f00000000000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401612aea9190614452565b60206040518083038186803b158015612b0257600080fd5b505afa158015612b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3a91906145ab565b9050811580612b47575080155b15612b5e5760008697509750505050505050612ea9565b600554604051633e15014160e01b81526000916001600160a01b031690633e15014190612baf907f000000000000000000000000000000000000000000000000000000000000000090600401614452565b6101406040518083038186803b158015612bc857600080fd5b505afa158015612bdc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c00919061474c565b505050505050505091505060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015612c6657600080fd5b505afa158015612c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9e91906147e3565b612ca990600a6148ea565b612cb5906127106148f9565b83612cc084896148f9565b612cca91906148f9565b612cd49190614918565b9050600084600a60009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015612d2757600080fd5b505afa158015612d3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5f91906147e3565b612d6a90600a6148ea565b612d7490846148f9565b612d7e9190614918565b905080612d9a576000899a509a50505050505050505050612ea9565b600061271060085483612dad91906148f9565b612db79190614918565b9050600061271060075484612dcc91906148f9565b612dd69190614918565b9050818b1115612df157612dea818c614625565b9b50612e9d565b8a811115612e9d57612e038b82614625565b600a54600c546040516370a0823160e01b8152929f506000926001600160a01b03928316926370a0823192612e3d92911690600401614452565b60206040518083038186803b158015612e5557600080fd5b505afa158015612e69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e8d91906145ab565b9050808e1115612e9b57809d505b505b50505050505050505050505b9250929050565b612eb981613b40565b600a5460405163573ade8160e01b81526001600160a01b03918216600482015260248101839052600260448201523060648201527f00000000000000000000000000000000000000000000000000000000000000009091169063573ade81906084015b600060405180830381600087803b158015612f3657600080fd5b505af1158015612f4a573d6000803e3d6000fd5b5050505050565b6109997f00000000000000000000000000000000000000000000000000000000000000003083613b49565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612fb25750600090565b6000806000612fbf61069e565b9250925092508260001480612fd357508042115b15613085577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633111e7b361300f613cb1565b600019306040518463ffffffff1660e01b81526004016130319392919061493a565b602060405180830381600087803b15801561304b57600080fd5b505af115801561305f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061308391906145ab565b505b61308d61069e565b9194509250905061309e8282612588565b15613115576040516301e9a69560e41b8152734da27a545c0c5b758a6ba100e3a049001de870f590631e9a6950906130de903090600019906004016146a7565b600060405180830381600087803b1580156130f857600080fd5b505af115801561310c573d6000803e3d6000fd5b5050505061318c565b61311f8382611c47565b1561318c57734da27a545c0c5b758a6ba100e3a049001de870f56001600160a01b031663787a08a66040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561317357600080fd5b505af1158015613187573d6000803e3d6000fd5b505050505b6040516309a99b4f60e41b8152734da27a545c0c5b758a6ba100e3a049001de870f590639a99b4f0906131c7903090600019906004016146a7565b600060405180830381600087803b1580156131e157600080fd5b505af11580156131f5573d6000803e3d6000fd5b50506040516370a0823160e01b8152737fc66500c84a76ad7e9c93437bfc5ac33e2ddae992506370a082319150613230903090600401614452565b60206040518083038186803b15801561324857600080fd5b505afa15801561325c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061328091906145ab565b935050505090565b600254604051636ccb2b0160e01b81526001600160a01b0390911690636ccb2b01906132c19086908690869060019030906004016146c0565b602060405180830381600087803b1580156132db57600080fd5b505af192505050801561330b575060408051601f3d908101601f19168201909252613308918101906145ab565b60015b61331457505050565b50505050565b6000670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016133719190614452565b60206040518083038186803b15801561338957600080fd5b505afa15801561339d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133c191906145ab565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561341a57600080fd5b505afa15801561342e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061345291906145ab565b61345c91906148f9565b6134669190614918565b600a546040516370a0823160e01b81526001600160a01b03909116906370a08231906118b3903090600401614452565b600254600a546040516353b609b560e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015291821660248201526044810184905260009291909116906353b609b590606401602060405180830381600087803b15801561351357600080fd5b505af1158015613527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061354b91906145ab565b90508015610999576040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906135a2903090600401614452565b60206040518083038186803b1580156135ba57600080fd5b505afa1580156135ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f291906145ab565b90508082111561360e5761360e6136098284614625565b612f51565b600254600a546040516381cc619b60e01b81526001600160a01b03928316926381cc619b9261366b927f000000000000000000000000000000000000000000000000000000000000000092909116908890889030906004016146c0565b602060405180830381600087803b15801561368557600080fd5b505af1158015613699573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061331491906145ab565b801561069b576136cc81613d28565b600a546040516370a0823160e01b81526000916001600160a01b0316906370a08231906136fd903090600401614452565b60206040518083038186803b15801561371557600080fd5b505afa158015613729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061374d91906145ab565b9050801561099957600a54610999906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613288565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906137db903090600401614452565b60206040518083038186803b1580156137f357600080fd5b505afa158015613807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382b91906145ab565b905060008061383b8360006127b1565b909250905080156138585761384f81612eb0565b610e1a83613f3e565b61386183613f3e565b610e1a82613f68565b6060816000018054806020026020016040519081016040528092919081815260200182805480156138ba57602002820191906000526020600020905b8154815260200190600101908083116138a6575b50505050509050919050565b6138cf81614012565b6139236001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083613a1e565b6139776001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083613a1e565b600a546139ae906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613a1e565b6002546139e8906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683613a1e565b600254600954613a05916001600160a01b03918216911683613a1e565b600254600a5461069b916001600160a01b039182169116835b801580613aa75750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015613a6d57600080fd5b505afa158015613a81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613aa591906145ab565b155b613b125760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610644565b610e1a8363095ea7b360e01b8484604051602401611b3e9291906146a7565b6060611c3f8484600085614066565b61069b81613d28565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613b989190614452565b60206040518083038186803b158015613bb057600080fd5b505afa158015613bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613be891906145ab565b90506000856001600160a01b03166370a082317f00000000000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401613c389190614452565b60206040518083038186803b158015613c5057600080fd5b505afa158015613c64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c8891906145ab565b9050613ca78686613ca287613c9d8787611b9d565b611b9d565b61418e565b9695505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090507f000000000000000000000000000000000000000000000000000000000000000081600081518110613d0b57613d0b6146f0565b6001600160a01b0390921660209283029190910190910152919050565b801561069b5760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015613d8957600080fd5b505afa158015613d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dc191906145ab565b9050600081613dd884670de0b6b3a76400006148f9565b613de29190614918565b9050670de0b6b3a7640000613df783836148f9565b613e019190614918565b8311613e0d5780613e18565b613e188160016145da565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632e1a7d4d613ee9837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613e999190614452565b60206040518083038186803b158015613eb157600080fd5b505afa158015613ec5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9d91906145ab565b6040518263ffffffff1660e01b8152600401613f0791815260200190565b600060405180830381600087803b158015613f2157600080fd5b505af1158015613f35573d6000803e3d6000fd5b50505050505050565b61069b7f000000000000000000000000000000000000000000000000000000000000000082614287565b801561069b57600a5460405163a415bcad60e01b81526001600160a01b0391821660048201526024810183905260026044820152600060648201523060848201527f00000000000000000000000000000000000000000000000000000000000000009091169063a415bcad9060a401600060405180830381600087803b158015613ff157600080fd5b505af1158015614005573d6000803e3d6000fd5b5050505061069b8161439a565b61069b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083613a1e565b6060824710156140c75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610644565b843b6141155760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610644565b600080866001600160a01b03168587604051614131919061496d565b60006040518083038185875af1925050503d806000811461416e576040519150601f19603f3d011682016040523d82523d6000602084013e614173565b606091505b50915091506141838282866143e7565b979650505050505050565b6000811561428057604051631a4ca37b60e21b81526001600160a01b03858116600483015260248201849052848116604483015283917f0000000000000000000000000000000000000000000000000000000000000000909116906369328dec90606401602060405180830381600087803b15801561420c57600080fd5b505af1158015614220573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061424491906145ab565b1460405180604001604052806002815260200161323960f01b8152509061427e5760405162461bcd60e51b81526004016106449190614502565b505b5092915050565b80156109995760405163e8eda9df60e01b81526001600160a01b03838116600483015260248201839052306044830152600060648301527f0000000000000000000000000000000000000000000000000000000000000000169063e8eda9df90608401600060405180830381600087803b15801561430457600080fd5b505af1925050508015614315575060015b61099957614321614989565b806308c379a0141561438e57506143366149e0565b806143415750614390565b61434a81614a6a565b611a9b60f11b14610e1a5760405162461bcd60e51b815260206004820152600e60248201526d19195c1bdcda5d0819985a5b195960921b6044820152606401610644565b505b3d6000803e3d6000fd5b60405163b6b55f2560e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b6b55f2590602401612f1c565b606083156143f6575081611b03565b8251156144065782518084602001fd5b8160405162461bcd60e51b81526004016106449190614502565b6001600160a01b038116811461069b57600080fd5b60006020828403121561444757600080fd5b8135611b0381614420565b6001600160a01b0391909116815260200190565b60006020828403121561447857600080fd5b5035919050565b600081518084526020808501945080840160005b838110156144b85781516001600160a01b031687529582019590820190600101614493565b509495945050505050565b602081526000611b03602083018461447f565b60005b838110156144f15781810151838201526020016144d9565b838111156133145750506000910152565b60208152600082518060208401526145218160408501602087016144d6565b601f01601f19169190910160400192915050565b6000806040838503121561454857600080fd5b50508035926020909101359150565b60006020828403121561456957600080fd5b8151611b0381614420565b6020808252601a908201527f63616c6c65722d69732d6e6f742d7468652d676f7665726e6f72000000000000604082015260600190565b6000602082840312156145bd57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156145ed576145ed6145c4565b500190565b60208082526019908201527818d85b1b195c8b5a5ccb5b9bdd0b5d995cdc195c8b5c1bdbdb603a1b604082015260600190565b600082821015614637576146376145c4565b500390565b60208082526016908201527531b0b63632b916b4b996b737ba16b096b5b2b2b832b960511b604082015260600190565b600181811c9082168061468057607f821691505b602082108114156146a157634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039586168152938516602085015260408401929092526060830152909116608082015260a00190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b8051801515811461472c57600080fd5b919050565b60006020828403121561474357600080fd5b611b038261471c565b6000806000806000806000806000806101408b8d03121561476c57600080fd5b8a51995060208b0151985060408b0151975060608b0151965060808b0151955061479860a08c0161471c565b94506147a660c08c0161471c565b93506147b460e08c0161471c565b92506147c36101008c0161471c565b91506147d26101208c0161471c565b90509295989b9194979a5092959850565b6000602082840312156147f557600080fd5b815160ff81168114611b0357600080fd5b600181815b80851115614841578160001904821115614827576148276145c4565b8085161561483457918102915b93841c939080029061480b565b509250929050565b60008261485857506001610c1f565b8161486557506000610c1f565b816001811461487b5760028114614885576148a1565b6001915050610c1f565b60ff841115614896576148966145c4565b50506001821b610c1f565b5060208310610133831016604e8410600b84101617156148c4575081810a610c1f565b6148ce8383614806565b80600019048211156148e2576148e26145c4565b029392505050565b6000611b0360ff841683614849565b6000816000190483118215151615614913576149136145c4565b500290565b60008261493557634e487b7160e01b600052601260045260246000fd5b500490565b60608152600061494d606083018661447f565b6020830194909452506001600160a01b0391909116604090910152919050565b6000825161497f8184602087016144d6565b9190910192915050565b600060033d11156149a25760046000803e5060005160e01c5b90565b601f8201601f1916810167ffffffffffffffff811182821017156149d957634e487b7160e01b600052604160045260246000fd5b6040525050565b600060443d10156149ee5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715614a1e57505050505090565b8285019150815181811115614a365750505050505090565b843d8701016020828501011115614a505750505050505090565b614a5f602082860101876149a5565b509095945050505050565b805160208083015191908110156146a15760001960209190910360031b1b1691905056fea26469706673582212204213e6cad0d61bb48d7132f90e107ac8f58052f8fc1b3b702d7a8faa95c0d81c64736f6c63430008090033000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c10000000000000000000000008f156189a3cd28dfc8fb7bbbace58f98f09c0bb30000000000000000000000007fc66500c84a76ad7e9c93437bfc5ac33e2ddae9000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a804520000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e9984210000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001a4161766556325f5665737065725f58795f4c494e4b5f55534443000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102125760003560e01c8063951dc22c11610120578063e00af4a7116100b8578063f51896f81161007c578063f51896f814610520578063f7c618c114610528578063fb7ee1021461053b578063fc0c546a1461054e578063ffa1ad741461055f57600080fd5b8063e00af4a7146104c2578063e260d747146104d5578063e5328e06146104de578063e9d337b8146104e6578063ec78e8321461050d57600080fd5b8063951dc22c146103f757806399b71d5c1461040c578063a3f4df7e14610414578063b2016bd414610429578063c415b95c14610450578063ce5494bb14610463578063d2c35ce814610476578063d3033c3914610489578063d8dfeb451461049c57600080fd5b8063440d7248116101ae5780635f9d4d2e116101725780635f9d4d2e1461039a57806360a05a85146103ad5780636719578c146103b55780637d7c2a1c146103dc57806390d67514146103e457600080fd5b8063440d72481461031a578063456dc17a1461033d57806348ccda3c146103505780634fc90c2c1461036b5780635f2475ca1461037357600080fd5b80630181686c1461021757806314ae9f2e1461023357806316f0115b146102485780631fc29c011461027c57806321fc6bb01461029757806329ba73ed146102ba5780632b3297f9146102e15780632e1a7d4d146102f45780634032b72b14610307575b600080fd5b61022060085481565b6040519081526020015b60405180910390f35b610246610241366004614435565b610583565b005b61026f7f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c181565b60405161022a9190614452565b61026f734da27a545c0c5b758a6ba100e3a049001de870f581565b61029f61069e565b6040805193845260208401929092529082015260600161022a565b61026f7f0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e99842181565b60025461026f906001600160a01b031681565b610246610302366004614466565b610855565b610246610315366004614435565b610aac565b61032d610328366004614435565b610bb8565b604051901515815260200161022a565b600a5461026f906001600160a01b031681565b61026f737fc66500c84a76ad7e9c93437bfc5ac33e2ddae981565b610246610c25565b61026f7f000000000000000000000000d784927ff2f95ba542bfc824c8a8a98f3495f6b581565b60055461026f906001600160a01b031681565b61032d610e1f565b61026f7f000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a8045281565b61029f610e42565b600b5461026f906001600160a01b031681565b6103ff610e82565b60405161022a91906144c3565b610246610e93565b61041c610ecf565b60405161022a9190614502565b61026f7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca81565b60015461026f906001600160a01b031681565b610246610471366004614435565b610f5d565b610246610484366004614435565b611227565b610246610497366004614435565b6113f0565b7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca61026f565b6102466104d0366004614435565b6115ad565b61022060075481565b6102206117c8565b61026f7f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a981565b60005461026f906001600160a01b031681565b61032d61190d565b60095461026f906001600160a01b031681565b610246610549366004614535565b611929565b6000546001600160a01b031661026f565b61041c604051806040016040528060058152602001640352e302e360dc1b81525081565b7f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156105dc57600080fd5b505afa1580156105f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106149190614557565b6001600160a01b0316336001600160a01b03161461064d5760405162461bcd60e51b815260040161064490614574565b60405180910390fd5b610658600382611b0a565b61069b5760405162461bcd60e51b81526020600482015260146024820152731c995b5bdd994b5ad9595c195c8b59985a5b195960621b6044820152606401610644565b50565b60405163091030c360e01b815260009081908190734da27a545c0c5b758a6ba100e3a049001de870f59063091030c3906106dc903090600401614452565b60206040518083038186803b1580156106f457600080fd5b505afa158015610708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072c91906145ab565b9250734da27a545c0c5b758a6ba100e3a049001de870f56001600160a01b03166372b49d636040518163ffffffff1660e01b815260040160206040518083038186803b15801561077b57600080fd5b505afa15801561078f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b391906145ab565b6107bd90846145da565b9150734da27a545c0c5b758a6ba100e3a049001de870f56001600160a01b031663359c4a966040518163ffffffff1660e01b815260040160206040518083038186803b15801561080c57600080fd5b505afa158015610820573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084491906145ab565b61084e90836145da565b9050909192565b337f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b03161461089d5760405162461bcd60e51b8152600401610644906145f2565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a08231906108ec903090600401614452565b60206040518083038186803b15801561090457600080fd5b505afa158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c91906145ab565b905081811061099d576109996001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca167f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c184611b1f565b5050565b6109af6109aa8284614625565b611b75565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a08231906109fb903090600401614452565b60206040518083038186803b158015610a1357600080fd5b505afa158015610a27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4b91906145ab565b90506109997f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c1610a7b8484611b9d565b6001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca169190611b1f565b7f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610b0557600080fd5b505afa158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3d9190614557565b6001600160a01b0316336001600160a01b031614610b6d5760405162461bcd60e51b815260040161064490614574565b610b78600382611aee565b61069b5760405162461bcd60e51b81526020600482015260116024820152701859190b5ad9595c195c8b59985a5b1959607a1b6044820152606401610644565b60007f000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e06001600160a01b0316826001600160a01b03161480610c075750600b546001600160a01b038381169116145b80610c1f5750600a546001600160a01b038381169116145b92915050565b60007f000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a804526001600160a01b0316638bc6beb26040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8057600080fd5b505afa158015610c94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb89190614557565b90506001600160a01b03811615610d285760405163d279c19160e01b81526001600160a01b0382169063d279c19190610cf5903090600401614452565b600060405180830381600087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81526000906001600160a01b037f0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e99842116906370a0823190610d77903090600401614452565b60206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc791906145ab565b9050801561099957610e1a7f0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e9984217f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca83611bb3565b505050565b6000806000610e2c61069e565b9250509150610e3b8282611c47565b9250505090565b60008080610e53335b600390611ceb565b610e6f5760405162461bcd60e51b81526004016106449061463c565b610e77611d0d565b925092509250909192565b6060610e8e600361227a565b905090565b610e9c33610e4b565b610eb85760405162461bcd60e51b81526004016106449061463c565b610ec26000612287565b610ecd600019612287565b565b60068054610edc9061466c565b80601f0160208091040260200160405190810160405280929190818152602001828054610f089061466c565b8015610f555780601f10610f2a57610100808354040283529160200191610f55565b820191906000526020600020905b815481529060010190602001808311610f3857829003601f168201915b505050505081565b337f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b031614610fa55760405162461bcd60e51b8152600401610644906145f2565b6001600160a01b038116610ffb5760405162461bcd60e51b815260206004820152601c60248201527f6e65772d73747261746567792d616464726573732d69732d7a65726f000000006044820152606401610644565b7f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b0316816001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561105e57600080fd5b505afa158015611072573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110969190614557565b6001600160a01b0316146110e55760405162461bcd60e51b81526020600482015260166024820152756e6f742d76616c69642d6e65772d737472617465677960501b6044820152606401610644565b6110ee81612301565b6000546040516370a0823160e01b81526111879183916001600160a01b03909116906370a0823190611124903090600401614452565b60206040518083038186803b15801561113c57600080fd5b505afa158015611150573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117491906145ab565b6000546001600160a01b03169190611b1f565b61069b817f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016111d79190614452565b60206040518083038186803b1580156111ef57600080fd5b505afa158015611203573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7b91906145ab565b7f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561128057600080fd5b505afa158015611294573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b89190614557565b6001600160a01b0316336001600160a01b0316146112e85760405162461bcd60e51b815260040161064490614574565b6001600160a01b03811661133e5760405162461bcd60e51b815260206004820152601d60248201527f6665652d636f6c6c6563746f722d616464726573732d69732d7a65726f0000006044820152606401610644565b6001546001600160a01b03828116911614156113945760405162461bcd60e51b81526020600482015260156024820152746665652d636f6c6c6563746f722d69732d73616d6560581b6044820152606401610644565b6001546040516001600160a01b038084169216907f0f06062680f9bd68e786e9980d9bb03d73d5620fc3b345e417b6eacb310b970690600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b7f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561144957600080fd5b505afa15801561145d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114819190614557565b6001600160a01b0316336001600160a01b0316146114b15760405162461bcd60e51b815260040161064490614574565b6001600160a01b0381166115015760405162461bcd60e51b8152602060048201526017602482015276737761707065722d616464726573732d69732d7a65726f60481b6044820152606401610644565b6002546001600160a01b03828116911614156115515760405162461bcd60e51b815260206004820152600f60248201526e737761707065722d69732d73616d6560881b6044820152606401610644565b6002546040516001600160a01b038084169216907f6c953b7ec311055c20b96a42cea31e89528e375b1bf953a503db40854b3188fe90600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6115b633610e4b565b6115d25760405162461bcd60e51b81526004016106449061463c565b6001546001600160a01b03166116225760405162461bcd60e51b81526020600482015260156024820152741999594b58dbdb1b1958dd1bdc8b5b9bdd0b5cd95d605a1b6044820152606401610644565b7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316816001600160a01b031614156116a45760405162461bcd60e51b815260206004820152601f60248201527f6e6f742d616c6c6f7765642d746f2d73776565702d636f6c6c61746572616c006044820152606401610644565b6116ad81610bb8565b156116f15760405162461bcd60e51b815260206004820152601460248201527306e6f742d616c6c6f7765642d746f2d73776565760641b6044820152606401610644565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561172c5760015461069b906001600160a01b03164761246f565b6040516370a0823160e01b81526000906001600160a01b038316906370a082319061175b903090600401614452565b60206040518083038186803b15801561177357600080fd5b505afa158015611787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ab91906145ab565b600154909150610999906001600160a01b03848116911683611b1f565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a0823190611817903090600401614452565b60206040518083038186803b15801561182f57600080fd5b505afa158015611843573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061186791906145ab565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e016906370a08231906118b3903090600401614452565b60206040518083038186803b1580156118cb57600080fd5b505afa1580156118df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190391906145ab565b610e8e91906145da565b600080600061191a61069e565b9250925050610e3b8282612588565b7f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561198257600080fd5b505afa158015611996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ba9190614557565b6001600160a01b0316336001600160a01b0316146119ea5760405162461bcd60e51b815260040161064490614574565b6127108110611a365760405162461bcd60e51b81526020600482015260186024820152771a5b9d985b1a590b5b585e0b589bdc9c9bddcb5b1a5b5a5d60421b6044820152606401610644565b80158015611a42575081155b80611a4c57508181115b611a985760405162461bcd60e51b815260206004820152601d60248201527f6d61782d73686f756c642d62652d6869676865722d7468616e2d6d696e0000006044820152606401610644565b6007546008546040805192835260208301859052820152606081018290527fedd77444afdf63401315e81ffe86d08f7865796e8ad2e11acf1d56a1393f07d59060800160405180910390a1600791909155600855565b6000611b03836001600160a01b03841661259d565b9392505050565b6000611b03836001600160a01b0384166125ec565b610e1a8363a9059cbb60e01b8484604051602401611b3e9291906146a7565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526126df565b6000611b826000836127b1565b9150508015611b9457611b9481612eb0565b61099982612f51565b6000818310611bac5781611b03565b5090919050565b600254604051636ccb2b0160e01b81526000916001600160a01b031690636ccb2b0190611bed9087908790879060019030906004016146c0565b602060405180830381600087803b158015611c0757600080fd5b505af1158015611c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3f91906145ab565b949350505050565b6040516370a0823160e01b81526000908190734da27a545c0c5b758a6ba100e3a049001de870f5906370a0823190611c83903090600401614452565b60206040518083038186803b158015611c9b57600080fd5b505afa158015611caf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cd391906145ab565b118015611b035750821580611b035750504211919050565b6001600160a01b03811660009081526001830160205260408120541515611b03565b6000806000807f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b031663d53ddc26306040518263ffffffff1660e01b8152600401611d5f9190614452565b60206040518083038186803b158015611d7757600080fd5b505afa158015611d8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611daf91906145ab565b905060007f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b0316639f2b2833306040518263ffffffff1660e01b8152600401611dff9190614452565b60206040518083038186803b158015611e1757600080fd5b505afa158015611e2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4f91906145ab565b90506000611e5b612f7c565b90508015611e9a57600954611e9a906001600160a01b03167f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca83613288565b600b546040516370a0823160e01b81526000916001600160a01b0316906370a0823190611ecb903090600401614452565b60206040518083038186803b158015611ee357600080fd5b505afa158015611ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1b91906145ab565b90506000611f2761331a565b905080821115611f4857611f43611f3e8284614625565b613496565b611f5a565b611f5a611f558383614625565b6136bd565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e016906370a0823190611fa9903090600401614452565b60206040518083038186803b158015611fc157600080fd5b505afa158015611fd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff991906145ab565b905060007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016120499190614452565b60206040518083038186803b15801561206157600080fd5b505afa158015612075573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209991906145ab565b905060006120a782846145da565b9050868111156120c2576120bb8782614625565b9a506120cf565b6120cc8188614625565b99505b60006120db898d6145da565b9050808310156121ac5760006120fa6120f48584614625565b86611b9d565b905080156121aa5761210b81611b75565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a0823190612157903090600401614452565b60206040518083038186803b15801561216f57600080fd5b505afa158015612183573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121a791906145ab565b93505b505b6121b6838a611b9d565b99508983116121c65760006121d9565b6121d96121d38b85614625565b8d611b9d565b6040516302df682360e11b815260048101829052602481018d9052604481018c9052909c507f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c16001600160a01b0316906305bed04690606401600060405180830381600087803b15801561224c57600080fd5b505af1158015612260573d6000803e3d6000fd5b5050505061226c61378c565b505050505050505050909192565b60606000611b038361386a565b612290816138c6565b600a546122c7906001600160a01b03167f000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a8045283613a1e565b60025461069b906001600160a01b037f0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e9984218116911683613a1e565b7f000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e06001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561236457600080fd5b505afa158015612378573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239c9190614557565b6001600160a01b0316146123e85760405162461bcd60e51b81526020600482015260136024820152723bb937b73396b932b1b2b4b83a16ba37b5b2b760691b6044820152606401610644565b600b546040516370a0823160e01b815261069b916001600160a01b0316906370a082319061241a903090600401614452565b60206040518083038186803b15801561243257600080fd5b505afa158015612446573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061246a91906145ab565b612eb0565b804710156124bf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610644565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461250c576040519150601f19603f3d011682016040523d82523d6000602084013e612511565b606091505b5050905080610e1a5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610644565b60008242118015611b03575050421115919050565b60008181526001830160205260408120546125e457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c1f565b506000610c1f565b600081815260018301602052604081205480156126d5576000612610600183614625565b855490915060009061262490600190614625565b9050818114612689576000866000018281548110612644576126446146f0565b9060005260206000200154905080876000018481548110612667576126676146f0565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061269a5761269a614706565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c1f565b6000915050610c1f565b6000612734826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613b319092919063ffffffff16565b805190915015610e1a57808060200190518101906127529190614731565b610e1a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610644565b6000808315806127bf575082155b6127ff5760405162461bcd60e51b8152602060048201526011602482015270616c6c2d696e7075742d67742d7a65726f60781b6044820152606401610644565b600b546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612830903090600401614452565b60206040518083038186803b15801561284857600080fd5b505afa15801561285c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061288091906145ab565b90506008546000141561289857600092509050612ea9565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e016906370a08231906128e7903090600401614452565b60206040518083038186803b1580156128ff57600080fd5b505afa158015612913573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293791906145ab565b9050600080871161295f57858211612950576000612969565b61295a8683614625565b612969565b61296987836145da565b90508061297f5760008394509450505050612ea9565b60007f000000000000000000000000b53c1a33016b2dc2ff3653530bff1848a515c8c56001600160a01b031663fca513a86040518163ffffffff1660e01b815260040160206040518083038186803b1580156129da57600080fd5b505afa1580156129ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a129190614557565b600a5460405163b3596f0760e01b81529192506000916001600160a01b038085169263b3596f0792612a4a9290911690600401614452565b60206040518083038186803b158015612a6257600080fd5b505afa158015612a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a9a91906145ab565b90506000826001600160a01b031663b3596f077f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6040518263ffffffff1660e01b8152600401612aea9190614452565b60206040518083038186803b158015612b0257600080fd5b505afa158015612b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3a91906145ab565b9050811580612b47575080155b15612b5e5760008697509750505050505050612ea9565b600554604051633e15014160e01b81526000916001600160a01b031690633e15014190612baf907f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca90600401614452565b6101406040518083038186803b158015612bc857600080fd5b505afa158015612bdc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c00919061474c565b505050505050505091505060007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015612c6657600080fd5b505afa158015612c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9e91906147e3565b612ca990600a6148ea565b612cb5906127106148f9565b83612cc084896148f9565b612cca91906148f9565b612cd49190614918565b9050600084600a60009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015612d2757600080fd5b505afa158015612d3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5f91906147e3565b612d6a90600a6148ea565b612d7490846148f9565b612d7e9190614918565b905080612d9a576000899a509a50505050505050505050612ea9565b600061271060085483612dad91906148f9565b612db79190614918565b9050600061271060075484612dcc91906148f9565b612dd69190614918565b9050818b1115612df157612dea818c614625565b9b50612e9d565b8a811115612e9d57612e038b82614625565b600a54600c546040516370a0823160e01b8152929f506000926001600160a01b03928316926370a0823192612e3d92911690600401614452565b60206040518083038186803b158015612e5557600080fd5b505afa158015612e69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e8d91906145ab565b9050808e1115612e9b57809d505b505b50505050505050505050505b9250929050565b612eb981613b40565b600a5460405163573ade8160e01b81526001600160a01b03918216600482015260248101839052600260448201523060648201527f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a99091169063573ade81906084015b600060405180830381600087803b158015612f3657600080fd5b505af1158015612f4a573d6000803e3d6000fd5b5050505050565b6109997f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca3083613b49565b60007f000000000000000000000000d784927ff2f95ba542bfc824c8a8a98f3495f6b56001600160a01b0316612fb25750600090565b6000806000612fbf61069e565b9250925092508260001480612fd357508042115b15613085577f000000000000000000000000d784927ff2f95ba542bfc824c8a8a98f3495f6b56001600160a01b0316633111e7b361300f613cb1565b600019306040518463ffffffff1660e01b81526004016130319392919061493a565b602060405180830381600087803b15801561304b57600080fd5b505af115801561305f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061308391906145ab565b505b61308d61069e565b9194509250905061309e8282612588565b15613115576040516301e9a69560e41b8152734da27a545c0c5b758a6ba100e3a049001de870f590631e9a6950906130de903090600019906004016146a7565b600060405180830381600087803b1580156130f857600080fd5b505af115801561310c573d6000803e3d6000fd5b5050505061318c565b61311f8382611c47565b1561318c57734da27a545c0c5b758a6ba100e3a049001de870f56001600160a01b031663787a08a66040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561317357600080fd5b505af1158015613187573d6000803e3d6000fd5b505050505b6040516309a99b4f60e41b8152734da27a545c0c5b758a6ba100e3a049001de870f590639a99b4f0906131c7903090600019906004016146a7565b600060405180830381600087803b1580156131e157600080fd5b505af11580156131f5573d6000803e3d6000fd5b50506040516370a0823160e01b8152737fc66500c84a76ad7e9c93437bfc5ac33e2ddae992506370a082319150613230903090600401614452565b60206040518083038186803b15801561324857600080fd5b505afa15801561325c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061328091906145ab565b935050505090565b600254604051636ccb2b0160e01b81526001600160a01b0390911690636ccb2b01906132c19086908690869060019030906004016146c0565b602060405180830381600087803b1580156132db57600080fd5b505af192505050801561330b575060408051601f3d908101601f19168201909252613308918101906145ab565b60015b61331457505050565b50505050565b6000670de0b6b3a76400007f000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a804526001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016133719190614452565b60206040518083038186803b15801561338957600080fd5b505afa15801561339d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133c191906145ab565b7f000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a804526001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561341a57600080fd5b505afa15801561342e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061345291906145ab565b61345c91906148f9565b6134669190614918565b600a546040516370a0823160e01b81526001600160a01b03909116906370a08231906118b3903090600401614452565b600254600a546040516353b609b560e01b81526001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca8116600483015291821660248201526044810184905260009291909116906353b609b590606401602060405180830381600087803b15801561351357600080fd5b505af1158015613527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061354b91906145ab565b90508015610999576040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a08231906135a2903090600401614452565b60206040518083038186803b1580156135ba57600080fd5b505afa1580156135ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f291906145ab565b90508082111561360e5761360e6136098284614625565b612f51565b600254600a546040516381cc619b60e01b81526001600160a01b03928316926381cc619b9261366b927f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca92909116908890889030906004016146c0565b602060405180830381600087803b15801561368557600080fd5b505af1158015613699573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061331491906145ab565b801561069b576136cc81613d28565b600a546040516370a0823160e01b81526000916001600160a01b0316906370a08231906136fd903090600401614452565b60206040518083038186803b15801561371557600080fd5b505afa158015613729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061374d91906145ab565b9050801561099957600a54610999906001600160a01b03167f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca83613288565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a08231906137db903090600401614452565b60206040518083038186803b1580156137f357600080fd5b505afa158015613807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382b91906145ab565b905060008061383b8360006127b1565b909250905080156138585761384f81612eb0565b610e1a83613f3e565b61386183613f3e565b610e1a82613f68565b6060816000018054806020026020016040519081016040528092919081815260200182805480156138ba57602002820191906000526020600020905b8154815260200190600101908083116138a6575b50505050509050919050565b6138cf81614012565b6139236001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca167f000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e083613a1e565b6139776001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca167f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a983613a1e565b600a546139ae906001600160a01b03167f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a983613a1e565b6002546139e8906001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca8116911683613a1e565b600254600954613a05916001600160a01b03918216911683613a1e565b600254600a5461069b916001600160a01b039182169116835b801580613aa75750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015613a6d57600080fd5b505afa158015613a81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613aa591906145ab565b155b613b125760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610644565b610e1a8363095ea7b360e01b8484604051602401611b3e9291906146a7565b6060611c3f8484600085614066565b61069b81613d28565b6000807f000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e06001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613b989190614452565b60206040518083038186803b158015613bb057600080fd5b505afa158015613bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613be891906145ab565b90506000856001600160a01b03166370a082317f000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e06040518263ffffffff1660e01b8152600401613c389190614452565b60206040518083038186803b158015613c5057600080fd5b505afa158015613c64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c8891906145ab565b9050613ca78686613ca287613c9d8787611b9d565b611b9d565b61418e565b9695505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090507f000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e081600081518110613d0b57613d0b6146f0565b6001600160a01b0390921660209283029190910190910152919050565b801561069b5760007f000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a804526001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015613d8957600080fd5b505afa158015613d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dc191906145ab565b9050600081613dd884670de0b6b3a76400006148f9565b613de29190614918565b9050670de0b6b3a7640000613df783836148f9565b613e019190614918565b8311613e0d5780613e18565b613e188160016145da565b90507f000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a804526001600160a01b0316632e1a7d4d613ee9837f000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a804526001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613e999190614452565b60206040518083038186803b158015613eb157600080fd5b505afa158015613ec5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9d91906145ab565b6040518263ffffffff1660e01b8152600401613f0791815260200190565b600060405180830381600087803b158015613f2157600080fd5b505af1158015613f35573d6000803e3d6000fd5b50505050505050565b61069b7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca82614287565b801561069b57600a5460405163a415bcad60e01b81526001600160a01b0391821660048201526024810183905260026044820152600060648201523060848201527f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a99091169063a415bcad9060a401600060405180830381600087803b158015613ff157600080fd5b505af1158015614005573d6000803e3d6000fd5b5050505061069b8161439a565b61069b6001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca167f000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c183613a1e565b6060824710156140c75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610644565b843b6141155760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610644565b600080866001600160a01b03168587604051614131919061496d565b60006040518083038185875af1925050503d806000811461416e576040519150601f19603f3d011682016040523d82523d6000602084013e614173565b606091505b50915091506141838282866143e7565b979650505050505050565b6000811561428057604051631a4ca37b60e21b81526001600160a01b03858116600483015260248201849052848116604483015283917f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a9909116906369328dec90606401602060405180830381600087803b15801561420c57600080fd5b505af1158015614220573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061424491906145ab565b1460405180604001604052806002815260200161323960f01b8152509061427e5760405162461bcd60e51b81526004016106449190614502565b505b5092915050565b80156109995760405163e8eda9df60e01b81526001600160a01b03838116600483015260248201839052306044830152600060648301527f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a9169063e8eda9df90608401600060405180830381600087803b15801561430457600080fd5b505af1925050508015614315575060015b61099957614321614989565b806308c379a0141561438e57506143366149e0565b806143415750614390565b61434a81614a6a565b611a9b60f11b14610e1a5760405162461bcd60e51b815260206004820152600e60248201526d19195c1bdcda5d0819985a5b195960921b6044820152606401610644565b505b3d6000803e3d6000fd5b60405163b6b55f2560e01b8152600481018290527f000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a804526001600160a01b03169063b6b55f2590602401612f1c565b606083156143f6575081611b03565b8251156144065782518084602001fd5b8160405162461bcd60e51b81526004016106449190614502565b6001600160a01b038116811461069b57600080fd5b60006020828403121561444757600080fd5b8135611b0381614420565b6001600160a01b0391909116815260200190565b60006020828403121561447857600080fd5b5035919050565b600081518084526020808501945080840160005b838110156144b85781516001600160a01b031687529582019590820190600101614493565b509495945050505050565b602081526000611b03602083018461447f565b60005b838110156144f15781810151838201526020016144d9565b838111156133145750506000910152565b60208152600082518060208401526145218160408501602087016144d6565b601f01601f19169190910160400192915050565b6000806040838503121561454857600080fd5b50508035926020909101359150565b60006020828403121561456957600080fd5b8151611b0381614420565b6020808252601a908201527f63616c6c65722d69732d6e6f742d7468652d676f7665726e6f72000000000000604082015260600190565b6000602082840312156145bd57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156145ed576145ed6145c4565b500190565b60208082526019908201527818d85b1b195c8b5a5ccb5b9bdd0b5d995cdc195c8b5c1bdbdb603a1b604082015260600190565b600082821015614637576146376145c4565b500390565b60208082526016908201527531b0b63632b916b4b996b737ba16b096b5b2b2b832b960511b604082015260600190565b600181811c9082168061468057607f821691505b602082108114156146a157634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039586168152938516602085015260408401929092526060830152909116608082015260a00190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b8051801515811461472c57600080fd5b919050565b60006020828403121561474357600080fd5b611b038261471c565b6000806000806000806000806000806101408b8d03121561476c57600080fd5b8a51995060208b0151985060408b0151975060608b0151965060808b0151955061479860a08c0161471c565b94506147a660c08c0161471c565b93506147b460e08c0161471c565b92506147c36101008c0161471c565b91506147d26101208c0161471c565b90509295989b9194979a5092959850565b6000602082840312156147f557600080fd5b815160ff81168114611b0357600080fd5b600181815b80851115614841578160001904821115614827576148276145c4565b8085161561483457918102915b93841c939080029061480b565b509250929050565b60008261485857506001610c1f565b8161486557506000610c1f565b816001811461487b5760028114614885576148a1565b6001915050610c1f565b60ff841115614896576148966145c4565b50506001821b610c1f565b5060208310610133831016604e8410600b84101617156148c4575081810a610c1f565b6148ce8383614806565b80600019048211156148e2576148e26145c4565b029392505050565b6000611b0360ff841683614849565b6000816000190483118215151615614913576149136145c4565b500290565b60008261493557634e487b7160e01b600052601260045260246000fd5b500490565b60608152600061494d606083018661447f565b6020830194909452506001600160a01b0391909116604090910152919050565b6000825161497f8184602087016144d6565b9190910192915050565b600060033d11156149a25760046000803e5060005160e01c5b90565b601f8201601f1916810167ffffffffffffffff811182821017156149d957634e487b7160e01b600052604160045260246000fd5b6040525050565b600060443d10156149ee5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715614a1e57505050505090565b8285019150815181811115614a365750505050505090565b843d8701016020828501011115614a505750505050505090565b614a5f602082860101876149a5565b509095945050505050565b805160208083015191908110156146a15760001960209190910360031b1b1691905056fea26469706673582212204213e6cad0d61bb48d7132f90e107ac8f58052f8fc1b3b702d7a8faa95c0d81c64736f6c63430008090033

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

000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c10000000000000000000000008f156189a3cd28dfc8fb7bbbace58f98f09c0bb30000000000000000000000007fc66500c84a76ad7e9c93437bfc5ac33e2ddae9000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a804520000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e9984210000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001a4161766556325f5665737065725f58795f4c494e4b5f55534443000000000000

-----Decoded View---------------
Arg [0] : _pool (address): 0xef4F4604106de23CDadfEAE08fcC34602cB475C1
Arg [1] : _swapper (address): 0x8f156189A3CD28dFc8FB7BbbAce58F98F09c0bB3
Arg [2] : _rewardToken (address): 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9
Arg [3] : _receiptToken (address): 0xa06bC25B5805d5F8d82847D191Cb4Af5A3e873E0
Arg [4] : _borrowToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [5] : _vPool (address): 0xa8b607Aa09B6A2E306F93e74c282Fb13f6A80452
Arg [6] : _vspAddress (address): 0x1b40183EFB4Dd766f11bDa7A7c3AD8982e998421
Arg [7] : _name (string): AaveV2_Vesper_Xy_LINK_USDC

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000ef4f4604106de23cdadfeae08fcc34602cb475c1
Arg [1] : 0000000000000000000000008f156189a3cd28dfc8fb7bbbace58f98f09c0bb3
Arg [2] : 0000000000000000000000007fc66500c84a76ad7e9c93437bfc5ac33e2ddae9
Arg [3] : 000000000000000000000000a06bc25b5805d5f8d82847d191cb4af5a3e873e0
Arg [4] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [5] : 000000000000000000000000a8b607aa09b6a2e306f93e74c282fb13f6a80452
Arg [6] : 0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e998421
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [8] : 000000000000000000000000000000000000000000000000000000000000001a
Arg [9] : 4161766556325f5665737065725f58795f4c494e4b5f55534443000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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