More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 106 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Rebalance | 18240359 | 499 days ago | IN | 0 ETH | 0.00639172 | ||||
Rebalance | 18168647 | 509 days ago | IN | 0 ETH | 0.00349269 | ||||
Rebalance | 18097232 | 519 days ago | IN | 0 ETH | 0.00462681 | ||||
Rebalance | 18025513 | 529 days ago | IN | 0 ETH | 0.00597325 | ||||
Rebalance | 17890631 | 548 days ago | IN | 0 ETH | 0.01464186 | ||||
Rebalance | 17818835 | 558 days ago | IN | 0 ETH | 0.00688479 | ||||
Rebalance | 17747059 | 568 days ago | IN | 0 ETH | 0.0034979 | ||||
Rebalance | 17690096 | 576 days ago | IN | 0 ETH | 0.01296293 | ||||
Rebalance | 17618659 | 586 days ago | IN | 0 ETH | 0.01007411 | ||||
Rebalance | 17513078 | 600 days ago | IN | 0 ETH | 0.01256127 | ||||
Rebalance | 17441376 | 611 days ago | IN | 0 ETH | 0.0124067 | ||||
Rebalance | 17364246 | 621 days ago | IN | 0 ETH | 0.03280648 | ||||
Rebalance | 17164670 | 650 days ago | IN | 0 ETH | 0.03110479 | ||||
Rebalance | 17093166 | 660 days ago | IN | 0 ETH | 0.02675498 | ||||
Rebalance | 16994737 | 674 days ago | IN | 0 ETH | 0.01827854 | ||||
Rebalance | 16945281 | 681 days ago | IN | 0 ETH | 0.0190949 | ||||
Rebalance | 16895458 | 688 days ago | IN | 0 ETH | 0.01294948 | ||||
Rebalance | 16824286 | 698 days ago | IN | 0 ETH | 0.01962853 | ||||
Rebalance | 16774521 | 705 days ago | IN | 0 ETH | 0.01588908 | ||||
Rebalance | 16724756 | 712 days ago | IN | 0 ETH | 0.01592588 | ||||
Rebalance | 16674131 | 719 days ago | IN | 0 ETH | 0.02107971 | ||||
Rebalance | 16632234 | 725 days ago | IN | 0 ETH | 0.02494356 | ||||
Rebalance | 16582150 | 732 days ago | IN | 0 ETH | 0.02432639 | ||||
Rebalance | 16532055 | 739 days ago | IN | 0 ETH | 0.01199129 | ||||
Rebalance | 16481075 | 746 days ago | IN | 0 ETH | 0.01459849 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
EarnVesperStrategy
Compiler Version
v0.8.3+commit.8d00100c
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "../../Earn.sol"; import "../VesperStrategy.sol"; import "../../../interfaces/vesper/IVesperPool.sol"; /// @title This Earn strategy will deposit collateral token in a Vesper Grow Pool /// and converts the yield to another Drip Token // solhint-disable no-empty-blocks contract EarnVesperStrategy is VesperStrategy, Earn { using SafeERC20 for IERC20; constructor( address _pool, address _swapManager, address _receiptToken, address _dripToken, address _vsp, string memory _name ) VesperStrategy(_pool, _swapManager, _receiptToken, _vsp, _name) Earn(_dripToken) {} /// @notice Approve all required tokens function _approveToken(uint256 _amount) internal virtual override(VesperStrategy, Strategy) { collateralToken.safeApprove(pool, _amount); collateralToken.safeApprove(address(vToken), _amount); for (uint256 i = 0; i < swapManager.N_DEX(); i++) { IERC20(vsp).safeApprove(address(swapManager.ROUTERS(i)), _amount); collateralToken.safeApprove(address(swapManager.ROUTERS(i)), _amount); } } /** * @notice Calculate earning and withdraw it from Vesper Grow. * @param _totalDebt Total collateral debt of this strategy * @return profit in collateral token */ function _realizeProfit(uint256 _totalDebt) internal virtual override(VesperStrategy, Strategy) returns (uint256) { _claimRewardsAndConvertTo(address(dripToken)); uint256 _collateralBalance = _getCollateralBalance(); if (_collateralBalance > _totalDebt) { _withdrawHere(_collateralBalance - _totalDebt); } _convertCollateralToDrip(); _forwardEarning(); return 0; } /// @notice Claim VSP rewards in underlying Grow Pool, if any function _claimRewardsAndConvertTo(address _toToken) internal virtual override(VesperStrategy, Strategy) { VesperStrategy._claimRewardsAndConvertTo(_toToken); } }
// 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); }
// 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"); } } }
// 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); } } } }
// 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; } }
pragma solidity >=0.6.2; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); }
pragma solidity >=0.6.2; import './IUniswapV2Router01.sol'; interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; }
// 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; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; /* solhint-disable func-name-mixedcase */ import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; interface ISwapManager { event OracleCreated(address indexed _sender, address indexed _newOracle, uint256 _period); function N_DEX() external view returns (uint256); function ROUTERS(uint256 i) external view returns (IUniswapV2Router02); function bestOutputFixedInput( address _from, address _to, uint256 _amountIn ) external view returns ( address[] memory path, uint256 amountOut, uint256 rIdx ); function bestPathFixedInput( address _from, address _to, uint256 _amountIn, uint256 _i ) external view returns (address[] memory path, uint256 amountOut); function bestInputFixedOutput( address _from, address _to, uint256 _amountOut ) external view returns ( address[] memory path, uint256 amountIn, uint256 rIdx ); function bestPathFixedOutput( address _from, address _to, uint256 _amountOut, uint256 _i ) external view returns (address[] memory path, uint256 amountIn); function safeGetAmountsOut( uint256 _amountIn, address[] memory _path, uint256 _i ) external view returns (uint256[] memory result); function unsafeGetAmountsOut( uint256 _amountIn, address[] memory _path, uint256 _i ) external view returns (uint256[] memory result); function safeGetAmountsIn( uint256 _amountOut, address[] memory _path, uint256 _i ) external view returns (uint256[] memory result); function unsafeGetAmountsIn( uint256 _amountOut, address[] memory _path, uint256 _i ) external view returns (uint256[] memory result); function comparePathsFixedInput( address[] memory pathA, address[] memory pathB, uint256 _amountIn, uint256 _i ) external view returns (address[] memory path, uint256 amountOut); function comparePathsFixedOutput( address[] memory pathA, address[] memory pathB, uint256 _amountOut, uint256 _i ) external view returns (address[] memory path, uint256 amountIn); function ours(address a) external view returns (bool); function oracleCount() external view returns (uint256); function oracleAt(uint256 idx) external view returns (address); function getOracle( address _tokenA, address _tokenB, uint256 _period, uint256 _i ) external view returns (address); function createOrUpdateOracle( address _tokenA, address _tokenB, uint256 _period, uint256 _i ) external returns (address oracleAddr); function consultForFree( address _from, address _to, uint256 _amountIn, uint256 _period, uint256 _i ) external view returns (uint256 amountOut, uint256 lastUpdatedAt); /// get the data we want and pay the gas to update function consult( address _from, address _to, uint256 _amountIn, uint256 _period, uint256 _i ) external returns ( uint256 amountOut, uint256 lastUpdatedAt, bool updated ); function updateOracles() external returns (uint256 updated, uint256 expected); function updateOracles(address[] memory _oracleAddrs) external returns (uint256 updated, uint256 expected); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "./IPoolRewards.sol"; interface IEarnDrip is IPoolRewards { function rewardTokens(uint256 _index) external view returns (address); function growToken() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; 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); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; interface IStrategy { function rebalance() external; 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 totalValue() external view returns (uint256); function totalValueCurrent() external returns (uint256); function pool() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IVesperPool is IERC20 { function deposit() external payable; 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 permit( address, address, uint256, uint256, uint8, bytes32, bytes32 ) external; function poolRewards() external returns (address); function reportEarning( uint256 _profit, uint256 _loss, uint256 _payback ) external; function reportLoss(uint256 _loss) external; function resetApproval() external; function sweepERC20(address _fromToken) external; function withdraw(uint256 _amount) external; function withdrawETH(uint256 _amount) external; function whitelistedWithdraw(uint256 _amount) external; function governor() external view returns (address); 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 feeCollector() external view returns (address); function pricePerShare() external view returns (uint256); function strategy(address _strategy) external view returns ( bool _active, uint256 _interestFee, uint256 _debtRate, uint256 _lastRebalance, uint256 _totalDebt, uint256 _totalLoss, uint256 _totalProfit, uint256 _debtRatio ); function stopEverything() external view returns (bool); 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 withdrawFee() external view returns (uint256); // Function to get pricePerShare from V2 pools function getPricePerShare() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../interfaces/vesper/IEarnDrip.sol"; import "../interfaces/vesper/IVesperPool.sol"; import "./Strategy.sol"; abstract contract Earn is Strategy { using SafeERC20 for IERC20; address public immutable dripToken; uint256 public dripPeriod = 48 hours; uint256 public totalEarned; // accounting total stable coin earned. This amount is not reported to pool. event DripPeriodUpdated(uint256 oldDripPeriod, uint256 newDripPeriod); constructor(address _dripToken) { require(_dripToken != address(0), "dripToken-zero"); dripToken = _dripToken; } /** * @notice Update update period of distribution of earning done in one rebalance * @dev _dripPeriod in seconds */ function updateDripPeriod(uint256 _dripPeriod) external onlyGovernor { require(_dripPeriod != 0, "dripPeriod-zero"); require(_dripPeriod != dripPeriod, "same-dripPeriod"); emit DripPeriodUpdated(dripPeriod, _dripPeriod); dripPeriod = _dripPeriod; } /// @dev Approves EarnDrip' Grow token to spend dripToken function approveGrowToken() external onlyKeeper { address _dripContract = IVesperPool(pool).poolRewards(); address _growPool = IEarnDrip(_dripContract).growToken(); // Checks that the Grow Pool supports dripToken as underlying if (_growPool != address(0)) { require(address(IVesperPool(_growPool).token()) == dripToken, "invalid-grow-pool"); IERC20(dripToken).safeApprove(_growPool, 0); IERC20(dripToken).safeApprove(_growPool, MAX_UINT_VALUE); } } /// @notice Converts excess collateral earned to drip token function _convertCollateralToDrip() internal { uint256 _collateralAmount = collateralToken.balanceOf(address(this)); _convertCollateralToDrip(_collateralAmount); } function _convertCollateralToDrip(uint256 _collateralAmount) internal { if (_collateralAmount != 0) { uint256 minAmtOut = (swapSlippage != 10000) ? _calcAmtOutAfterSlippage( _getOracleRate(_simpleOraclePath(address(collateralToken), dripToken), _collateralAmount), swapSlippage ) : 1; _safeSwap(address(collateralToken), dripToken, _collateralAmount, minAmtOut); } } /** * @notice Send this earning to drip contract. */ function _forwardEarning() internal virtual { (, uint256 _interestFee, , , , , , ) = IVesperPool(pool).strategy(address(this)); address _dripContract = IVesperPool(pool).poolRewards(); uint256 _earned = IERC20(dripToken).balanceOf(address(this)); if (_earned != 0) { // Fetches which rewardToken collects the drip address _growPool = IEarnDrip(_dripContract).growToken(); totalEarned += _earned; // Checks that the Grow Pool supports dripToken as underlying if (_growPool != address(0) && address(IVesperPool(_growPool).token()) == dripToken) { uint256 _growPoolBalanceBefore = IERC20(_growPool).balanceOf(address(this)); IVesperPool(_growPool).deposit(_earned); uint256 _growPoolShares = IERC20(_growPool).balanceOf(address(this)) - _growPoolBalanceBefore; uint256 _fee = (_growPoolShares * _interestFee) / 10000; if (_fee != 0) { IERC20(_growPool).safeTransfer(feeCollector, _fee); _growPoolShares -= _fee; } IERC20(_growPool).safeTransfer(_dripContract, _growPoolShares); IEarnDrip(_dripContract).notifyRewardAmount(_growPool, _growPoolShares, dripPeriod); } else { // If no growToken is set for dripContract, forward the dripToken directly // Minus interestFee that goes to feeCollector uint256 _fee = (_earned * _interestFee) / 10000; if (_fee != 0) { IERC20(dripToken).safeTransfer(feeCollector, _fee); _earned -= _fee; } IERC20(dripToken).safeTransfer(_dripContract, _earned); IEarnDrip(_dripContract).notifyRewardAmount(dripToken, _earned, dripPeriod); } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "../dependencies/openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "../interfaces/bloq/ISwapManager.sol"; import "../interfaces/vesper/IStrategy.sol"; import "../interfaces/vesper/IVesperPool.sol"; abstract contract Strategy is IStrategy, Context { using SafeERC20 for IERC20; using EnumerableSet for EnumerableSet.AddressSet; address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; uint256 internal constant MAX_UINT_VALUE = type(uint256).max; // solhint-disable-next-line var-name-mixedcase address internal WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; IERC20 public immutable collateralToken; address public receiptToken; address public immutable override pool; address public override feeCollector; ISwapManager public swapManager; uint256 public oraclePeriod = 3600; // 1h uint256 public oracleRouterIdx = 0; // Uniswap V2 uint256 public swapSlippage = 10000; // 100% Don't use oracles by default EnumerableSet.AddressSet private _keepers; event UpdatedFeeCollector(address indexed previousFeeCollector, address indexed newFeeCollector); event UpdatedSwapManager(address indexed previousSwapManager, address indexed newSwapManager); event UpdatedSwapSlippage(uint256 oldSwapSlippage, uint256 newSwapSlippage); event UpdatedOracleConfig(uint256 oldPeriod, uint256 newPeriod, uint256 oldRouterIdx, uint256 newRouterIdx); constructor( address _pool, address _swapManager, address _receiptToken ) { require(_pool != address(0), "pool-address-is-zero"); require(_swapManager != address(0), "sm-address-is-zero"); swapManager = ISwapManager(_swapManager); 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"); } /// @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 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 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 swap manager address * @param _swapManager swap manager address */ function updateSwapManager(address _swapManager) external onlyGovernor { require(_swapManager != address(0), "sm-address-is-zero"); require(_swapManager != address(swapManager), "sm-is-same"); emit UpdatedSwapManager(address(swapManager), _swapManager); swapManager = ISwapManager(_swapManager); } function updateSwapSlippage(uint256 _newSwapSlippage) external onlyGovernor { require(_newSwapSlippage <= 10000, "invalid-slippage-value"); emit UpdatedSwapSlippage(swapSlippage, _newSwapSlippage); swapSlippage = _newSwapSlippage; } function updateOracleConfig(uint256 _newPeriod, uint256 _newRouterIdx) external onlyGovernor { require(_newRouterIdx < swapManager.N_DEX(), "invalid-router-index"); if (_newPeriod == 0) _newPeriod = oraclePeriod; require(_newPeriod > 59, "invalid-oracle-period"); emit UpdatedOracleConfig(oraclePeriod, _newPeriod, oracleRouterIdx, _newRouterIdx); oraclePeriod = _newPeriod; oracleRouterIdx = _newRouterIdx; } /// @dev Approve all required tokens function approveToken() external onlyKeeper { _approveToken(0); _approveToken(MAX_UINT_VALUE); } function setupOracles() external onlyKeeper { _setupOracles(); } /** * @dev Withdraw collateral token from lending pool. * @param _amount Amount of collateral token */ function withdraw(uint256 _amount) external override onlyPool { _withdraw(_amount); } /** * @dev Rebalance profit, loss and investment of this strategy */ function rebalance() external virtual override onlyKeeper { (uint256 _profit, uint256 _loss, uint256 _payback) = _generateReport(); IVesperPool(pool).reportEarning(_profit, _loss, _payback); _reinvest(); } /** * @dev 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 collateral token function token() external view override returns (address) { return receiptToken; } /** * @notice Calculate total value of asset under management * @dev Report total value in collateral token */ function totalValue() public view virtual override returns (uint256 _value); /** * @notice Calculate total value of asset under management (in real-time) * @dev Report total value in collateral token */ function totalValueCurrent() external virtual override returns (uint256) { return totalValue(); } /// @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 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; /** * @notice Generate report for current profit and loss. Also liquidate asset to payback * excess debt, if any. * @return _profit Calculate any realized profit and convert it to collateral, if not already. * @return _loss Calculate any loss that strategy has made on investment. Convert into collateral token. * @return _payback If strategy has any excess debt, we have to liquidate asset to payback excess debt. */ function _generateReport() internal virtual returns ( uint256 _profit, uint256 _loss, uint256 _payback ) { uint256 _excessDebt = IVesperPool(pool).excessDebt(address(this)); uint256 _totalDebt = IVesperPool(pool).totalDebtOf(address(this)); _profit = _realizeProfit(_totalDebt); _loss = _realizeLoss(_totalDebt); _payback = _liquidate(_excessDebt); } function _calcAmtOutAfterSlippage(uint256 _amount, uint256 _slippage) internal pure returns (uint256) { return (_amount * (10000 - _slippage)) / (10000); } function _simpleOraclePath(address _from, address _to) internal view returns (address[] memory path) { if (_from == WETH || _to == WETH) { path = new address[](2); path[0] = _from; path[1] = _to; } else { path = new address[](3); path[0] = _from; path[1] = WETH; path[2] = _to; } } function _consultOracle( address _from, address _to, uint256 _amt ) internal returns (uint256, bool) { for (uint256 i = 0; i < swapManager.N_DEX(); i++) { (bool _success, bytes memory _returnData) = address(swapManager).call( abi.encodePacked(swapManager.consult.selector, abi.encode(_from, _to, _amt, oraclePeriod, i)) ); if (_success) { (uint256 rate, uint256 lastUpdate, ) = abi.decode(_returnData, (uint256, uint256, bool)); if ((lastUpdate > (block.timestamp - oraclePeriod)) && (rate != 0)) return (rate, true); return (0, false); } } return (0, false); } function _getOracleRate(address[] memory path, uint256 _amountIn) internal returns (uint256 amountOut) { require(path.length > 1, "invalid-oracle-path"); amountOut = _amountIn; bool isValid; for (uint256 i = 0; i < path.length - 1; i++) { (amountOut, isValid) = _consultOracle(path[i], path[i + 1], amountOut); require(isValid, "invalid-oracle-rate"); } } /** * @notice Safe swap via Uniswap / Sushiswap (better rate of the two) * @dev There are many scenarios when token swap via Uniswap can fail, so this * method will wrap Uniswap call in a 'try catch' to make it fail safe. * however, this method will throw minAmountOut is not met * @param _from address of from token * @param _to address of to token * @param _amountIn Amount to be swapped * @param _minAmountOut minimum amount out */ function _safeSwap( address _from, address _to, uint256 _amountIn, uint256 _minAmountOut ) internal { (address[] memory path, uint256 amountOut, uint256 rIdx) = swapManager.bestOutputFixedInput(_from, _to, _amountIn); if (_minAmountOut == 0) _minAmountOut = 1; if (amountOut != 0) { swapManager.ROUTERS(rIdx).swapExactTokensForTokens( _amountIn, _minAmountOut, path, address(this), block.timestamp ); } } // These methods can be implemented by the inheriting strategy. /* solhint-disable no-empty-blocks */ function _claimRewardsAndConvertTo(address _toToken) internal virtual {} /** * @notice Set up any oracles that are needed for this strategy. */ function _setupOracles() internal virtual {} /* solhint-enable */ // These methods must be implemented by the inheriting strategy function _withdraw(uint256 _amount) internal virtual; function _approveToken(uint256 _amount) internal virtual; /** * @notice Withdraw collateral to payback excess debt in pool. * @param _excessDebt Excess debt of strategy in collateral token * @return _payback amount in collateral token. Usually it is equal to excess debt. */ function _liquidate(uint256 _excessDebt) internal virtual returns (uint256 _payback); /** * @notice Calculate earning and withdraw/convert it into collateral token. * @param _totalDebt Total collateral debt of this strategy * @return _profit Profit in collateral token */ function _realizeProfit(uint256 _totalDebt) internal virtual returns (uint256 _profit); /** * @notice Calculate loss * @param _totalDebt Total collateral debt of this strategy * @return _loss Realized loss in collateral token */ function _realizeLoss(uint256 _totalDebt) internal virtual returns (uint256 _loss); /** * @notice Reinvest collateral. * @dev Once we file report back in pool, we might have some collateral in hand * which we want to reinvest aka deposit in lender/provider. */ function _reinvest() internal virtual; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "../../interfaces/vesper/IVesperPool.sol"; import "../Strategy.sol"; /// @title This Strategy will deposit collateral token in a Vesper Grow Pool abstract contract VesperStrategy is Strategy { using SafeERC20 for IERC20; // solhint-disable-next-line var-name-mixedcase string public NAME; string public constant VERSION = "4.0.1"; address internal immutable vsp; IVesperPool internal immutable vToken; constructor( address _pool, address _swapManager, address _receiptToken, address _vsp, string memory _name ) Strategy(_pool, _swapManager, _receiptToken) { require(_receiptToken != address(0), "vToken-address-is-zero"); vToken = IVesperPool(_receiptToken); NAME = _name; vsp = _vsp; } /** * @notice Calculate total value using underlying vToken * @dev Report total value in collateral token */ function totalValue() public view override returns (uint256 _totalValue) { _totalValue = _getCollateralBalance(); } function isReservedToken(address _token) public view override returns (bool) { return _token == address(vToken); } /// @notice Approve all required tokens function _approveToken(uint256 _amount) internal virtual override { collateralToken.safeApprove(pool, _amount); collateralToken.safeApprove(address(vToken), _amount); for (uint256 i = 0; i < swapManager.N_DEX(); i++) { IERC20(vsp).safeApprove(address(swapManager.ROUTERS(i)), _amount); } } /** * @notice Before migration hook. * @param _newStrategy Address of new strategy. */ //solhint-disable-next-line no-empty-blocks function _beforeMigration(address _newStrategy) internal override {} /// @notice Withdraw collateral to payback excess debt function _liquidate(uint256 _excessDebt) internal override returns (uint256 _payback) { if (_excessDebt != 0) { _payback = _safeWithdraw(_excessDebt); } } /** * @notice Calculate earning and withdraw it from Vesper Grow. * @param _totalDebt Total collateral debt of this strategy * @return profit in collateral token */ function _realizeProfit(uint256 _totalDebt) internal virtual override returns (uint256) { _claimRewardsAndConvertTo(address(collateralToken)); uint256 _collateralBalance = _getCollateralBalance(); if (_collateralBalance > _totalDebt) { _withdrawHere(_collateralBalance - _totalDebt); } return collateralToken.balanceOf(address(this)); } /// @notice Claim VSP rewards in underlying Grow Pool, if any function _claimRewardsAndConvertTo(address _toToken) internal virtual override { uint256 _vspAmount = IERC20(vsp).balanceOf(address(this)); if (_vspAmount != 0) { _safeSwap(vsp, _toToken, _vspAmount, 1); } } /** * @notice Calculate realized loss. * @return _loss Realized loss in collateral token */ function _realizeLoss(uint256 _totalDebt) internal view override returns (uint256 _loss) { uint256 _collateralBalance = _getCollateralBalance(); if (_collateralBalance < _totalDebt) { _loss = _totalDebt - _collateralBalance; } } /// @notice Deposit collateral in Vesper Grow function _reinvest() internal virtual override { uint256 _collateralBalance = collateralToken.balanceOf(address(this)); if (_collateralBalance != 0) { vToken.deposit(_collateralBalance); } } /// @dev Withdraw collateral and transfer it to pool function _withdraw(uint256 _amount) internal override { _safeWithdraw(_amount); collateralToken.safeTransfer(pool, collateralToken.balanceOf(address(this))); } /** * @notice Safe withdraw will make sure to check asking amount against available amount. * @param _amount Amount of collateral to withdraw. * @return Actual collateral withdrawn */ function _safeWithdraw(uint256 _amount) internal returns (uint256) { uint256 _collateralBalance = _getCollateralBalance(); // Get minimum of _amount and _collateralBalance return _withdrawHere(_amount < _collateralBalance ? _amount : _collateralBalance); } /// @dev Withdraw collateral here. Do not transfer to pool function _withdrawHere(uint256 _amount) internal returns (uint256) { uint256 _collateralBefore = collateralToken.balanceOf(address(this)); vToken.whitelistedWithdraw(_convertToShares(_amount)); return collateralToken.balanceOf(address(this)) - _collateralBefore; } /// @dev Gets collateral balance deposited into Vesper Grow Pool function _getCollateralBalance() internal view returns (uint256) { uint256 _totalSupply = vToken.totalSupply(); // avoids division by zero error when pool is empty return (_totalSupply != 0) ? (vToken.totalValue() * vToken.balanceOf(address(this))) / _totalSupply : 0; } /// @dev Converts a collateral amount in its relative shares for Vesper Grow Pool function _convertToShares(uint256 _collateralAmount) internal view returns (uint256) { uint256 _totalValue = vToken.totalValue(); return (_totalValue != 0) ? (_collateralAmount * vToken.totalSupply()) / _totalValue : 0; } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 100 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"address","name":"_swapManager","type":"address"},{"internalType":"address","name":"_receiptToken","type":"address"},{"internalType":"address","name":"_dripToken","type":"address"},{"internalType":"address","name":"_vsp","type":"address"},{"internalType":"string","name":"_name","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldDripPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDripPeriod","type":"uint256"}],"name":"DripPeriodUpdated","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":false,"internalType":"uint256","name":"oldPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldRouterIdx","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRouterIdx","type":"uint256"}],"name":"UpdatedOracleConfig","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousSwapManager","type":"address"},{"indexed":true,"internalType":"address","name":"newSwapManager","type":"address"}],"name":"UpdatedSwapManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldSwapSlippage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newSwapSlippage","type":"uint256"}],"name":"UpdatedSwapSlippage","type":"event"},{"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":[{"internalType":"address","name":"_keeperAddress","type":"address"}],"name":"addKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveGrowToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collateralToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dripPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dripToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":[{"internalType":"address","name":"_newStrategy","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oraclePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleRouterIdx","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":[],"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":"setupOracles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapManager","outputs":[{"internalType":"contract ISwapManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapSlippage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"totalEarned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalValue","outputs":[{"internalType":"uint256","name":"_totalValue","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalValueCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dripPeriod","type":"uint256"}],"name":"updateDripPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeCollector","type":"address"}],"name":"updateFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPeriod","type":"uint256"},{"internalType":"uint256","name":"_newRouterIdx","type":"uint256"}],"name":"updateOracleConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_swapManager","type":"address"}],"name":"updateSwapManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newSwapSlippage","type":"uint256"}],"name":"updateSwapSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
610120604052600080546001600160a01b03191673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2178155610e106004556005556127106006556202a300600a553480156200004e57600080fd5b506040516200493e3803806200493e833981016040819052620000719162000470565b8286868685858484846001600160a01b038316620000d65760405162461bcd60e51b815260206004820152601460248201527f706f6f6c2d616464726573732d69732d7a65726f00000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b038216620001235760405162461bcd60e51b8152602060048201526012602482015271736d2d616464726573732d69732d7a65726f60701b6044820152606401620000cd565b600380546001600160a01b0319166001600160a01b0384811691909117909155606084901b6001600160601b03191660a05260408051637e062a3560e11b815290519185169163fc0c546a91600480820192602092909190829003018186803b1580156200019057600080fd5b505afa158015620001a5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001cb9190620005b4565b60601b6001600160601b031916608052600180546001600160a01b0319166001600160a01b03831617905562000218620002023390565b60076200035860201b620018f11790919060201c565b6200025a5760405162461bcd60e51b81526020600482015260116024820152701859190b5ad9595c195c8b59985a5b1959607a1b6044820152606401620000cd565b5050506001600160a01b038316620002b55760405162461bcd60e51b815260206004820152601660248201527f76546f6b656e2d616464726573732d69732d7a65726f000000000000000000006044820152606401620000cd565b6001600160601b0319606084901b1660e0528051620002dc906009906020840190620003ca565b505060601b6001600160601b03191660c0525050506001600160a01b0381166200033a5760405162461bcd60e51b815260206004820152600e60248201526d64726970546f6b656e2d7a65726f60901b6044820152606401620000cd565b60601b6001600160601b031916610100525062000646945050505050565b60006200036f836001600160a01b03841662000378565b90505b92915050565b6000818152600183016020526040812054620003c15750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000372565b50600062000372565b828054620003d890620005da565b90600052602060002090601f016020900481019282620003fc576000855562000447565b82601f106200041757805160ff191683800117855562000447565b8280016001018555821562000447579182015b82811115620004475782518255916020019190600101906200042a565b506200045592915062000459565b5090565b5b808211156200045557600081556001016200045a565b60008060008060008060c0878903121562000489578182fd5b865162000496816200062d565b80965050602080880151620004ab816200062d565b6040890151909650620004be816200062d565b6060890151909550620004d1816200062d565b6080890151909450620004e4816200062d565b60a08901519093506001600160401b038082111562000501578384fd5b818a0191508a601f83011262000515578384fd5b8151818111156200052a576200052a62000617565b604051601f8201601f19908116603f0116810190838211818310171562000555576200055562000617565b816040528281528d868487010111156200056d578687fd5b8693505b8284101562000590578484018601518185018701529285019262000571565b82841115620005a157868684830101525b8096505050505050509295509295509295565b600060208284031215620005c6578081fd5b8151620005d3816200062d565b9392505050565b600181811c90821680620005ef57607f821691505b602082108114156200061157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146200064357600080fd5b50565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c614138620008066000396000818161024901528181610ca701528181610d9701528181610dcc0152818161260001528181612ad101528181612c1401528181612f1e01528181612f6101528181612faf0152818161339f01526133f901526000818161082701528181611d4001528181611e3e015281816120980152818161214e015281816121d5015281816127950152818161301901526130b9015260008181611f7b0152818161329e01526133300152600081816101cf0152818161042801528181610543015281816106c9015281816107190152818161086401528181610a1701528181610b8e01528181610e5f01528181610fa501528181611205015281816112a2015281816114f60152818161193301528181611b1f01528181611bbf01528181611dea015281816129a70152612a3a01526000818161035701528181611429015281816114cd0152818161173e0152818161195401528181611c9d01528181611dc801528181611e1c0152818161202a015281816126f701528181612833015281816128fd0152818161337e01526133d801526141386000f3fe608060405234801561001057600080fd5b50600436106101b05760003560e01c8063951dc22c116100ef578063ce5494bb11610092578063ce5494bb14610395578063d2c35ce8146103a8578063d4c3eea0146103bb578063e00af4a7146103c3578063e645c202146103d6578063ec78e832146103de578063fc0c546a146103f1578063ffa1ad7414610402576101b0565b8063951dc22c1461030557806399b71d5c1461031a578063a3f4df7e14610322578063a923b2a614610337578063aa1018861461034a578063b2016bd414610352578063c415b95c14610379578063cd2d7ebe1461038c576101b0565b8063440d724811610157578063440d7248146102875780634c36fad7146102aa57806367f5e4b8146102bd5780636dfa8d99146102d0578063709d039d146102d957806371506414146102ec5780637737b672146102f55780637d7c2a1c146102fd576101b0565b806314ae9f2e146101b557806316f0115b146101ca5780631960d116146102075780631aedeabe1461021a5780632e1a7d4d14610231578063335bbf11146102445780634032b72b1461026b57806342189c8f1461027e575b600080fd5b6101c86101c3366004613b1e565b610426565b005b6101f17f000000000000000000000000000000000000000000000000000000000000000081565b6040516101fe9190613e31565b60405180910390f35b6101c8610215366004613d1c565b610541565b61022360065481565b6040519081526020016101fe565b6101c861023f366004613d1c565b6106c6565b6101f17f000000000000000000000000000000000000000000000000000000000000000081565b6101c8610279366004613b1e565b610717565b61022360045481565b61029a610295366004613b1e565b610823565b60405190151581526020016101fe565b6101c86102b8366004613b1e565b610862565b6101c86102cb366004613d1c565b610a15565b610223600b5481565b6003546101f1906001600160a01b031681565b610223600a5481565b6101c8610b61565b6101c8610df9565b61030d610ec8565b6040516101fe9190613e66565b6101c8610ed9565b61032a610f15565b6040516101fe9190613e79565b6101c8610345366004613d4c565b610fa3565b6101c86111d8565b6101f17f000000000000000000000000000000000000000000000000000000000000000081565b6002546101f1906001600160a01b031681565b61022360055481565b6101c86103a3366004613b1e565b611202565b6101c86103b6366004613b1e565b6114f4565b6102236116bd565b6101c86103d1366004613b1e565b6116c7565b6102236118e7565b6001546101f1906001600160a01b031681565b6001546001600160a01b03166101f1565b61032a60405180604001604052806005815260200164342e302e3160d81b81525081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561047f57600080fd5b505afa158015610493573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b79190613b3a565b6001600160a01b0316336001600160a01b0316146104f05760405162461bcd60e51b81526004016104e790613edc565b60405180910390fd5b6104fb60078261190f565b61053e5760405162461bcd60e51b81526020600482015260146024820152731c995b5bdd994b5ad9595c195c8b59985a5b195960621b60448201526064016104e7565b50565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561059a57600080fd5b505afa1580156105ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d29190613b3a565b6001600160a01b0316336001600160a01b0316146106025760405162461bcd60e51b81526004016104e790613edc565b806106415760405162461bcd60e51b815260206004820152600f60248201526e64726970506572696f642d7a65726f60881b60448201526064016104e7565b600a548114156106855760405162461bcd60e51b815260206004820152600f60248201526e1cd85b594b591c9a5c14195c9a5bd9608a1b60448201526064016104e7565b600a5460408051918252602082018390527f6a4a78fe36e2d43bd20405835c6211b888cc77a834e32ddc9ac64ded78f4b328910160405180910390a1600a55565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461070e5760405162461bcd60e51b81526004016104e790613f13565b61053e81611924565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561077057600080fd5b505afa158015610784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a89190613b3a565b6001600160a01b0316336001600160a01b0316146107d85760405162461bcd60e51b81526004016104e790613edc565b6107e36007826118f1565b61053e5760405162461bcd60e51b81526020600482015260116024820152701859190b5ad9595c195c8b59985a5b1959607a1b60448201526064016104e7565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161490505b919050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156108bb57600080fd5b505afa1580156108cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f39190613b3a565b6001600160a01b0316336001600160a01b0316146109235760405162461bcd60e51b81526004016104e790613edc565b6001600160a01b03811661096e5760405162461bcd60e51b8152602060048201526012602482015271736d2d616464726573732d69732d7a65726f60701b60448201526064016104e7565b6003546001600160a01b03828116911614156109b95760405162461bcd60e51b815260206004820152600a602482015269736d2d69732d73616d6560b01b60448201526064016104e7565b6003546040516001600160a01b038084169216907f2d19927e7cac08ceb98b38898a4fdff6da6a27295b9a2d62fe250408ebe044e190600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6e57600080fd5b505afa158015610a82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa69190613b3a565b6001600160a01b0316336001600160a01b031614610ad65760405162461bcd60e51b81526004016104e790613edc565b612710811115610b215760405162461bcd60e51b8152602060048201526016602482015275696e76616c69642d736c6970706167652d76616c756560501b60448201526064016104e7565b60065460408051918252602082018390527ef1c5db862c7598b3b6765552ca951f498611e06412c2d57f8d0b58f82e7f82910160405180910390a1600655565b610b6e335b60079061199e565b610b8a5760405162461bcd60e51b81526004016104e790613eac565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638bc6beb26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610be757600080fd5b505af1158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f9190613b3a565b90506000816001600160a01b031663e49e463b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c5c57600080fd5b505afa158015610c70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c949190613b3a565b90506001600160a01b03811615610df5577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0857600080fd5b505afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d409190613b3a565b6001600160a01b031614610d8a5760405162461bcd60e51b81526020600482015260116024820152701a5b9d985b1a590b59dc9bddcb5c1bdbdb607a1b60448201526064016104e7565b610dbf6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168260006119c0565b610df56001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016826000196119c0565b5050565b610e0233610b66565b610e1e5760405162461bcd60e51b81526004016104e790613eac565b6000806000610e2b611b17565b6040516302df682360e11b815260048101849052602481018390526044810182905292955090935091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906305bed04690606401600060405180830381600087803b158015610ea357600080fd5b505af1158015610eb7573d6000803e3d6000fd5b50505050610ec3611c83565b505050565b6060610ed46007611da7565b905090565b610ee233610b66565b610efe5760405162461bcd60e51b81526004016104e790613eac565b610f086000611dbb565b610f13600019611dbb565b565b60098054610f2290614071565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4e90614071565b8015610f9b5780601f10610f7057610100808354040283529160200191610f9b565b820191906000526020600020905b815481529060010190602001808311610f7e57829003601f168201915b505050505081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610ffc57600080fd5b505afa158015611010573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110349190613b3a565b6001600160a01b0316336001600160a01b0316146110645760405162461bcd60e51b81526004016104e790613edc565b600360009054906101000a90046001600160a01b03166001600160a01b031663c2fba6676040518163ffffffff1660e01b815260040160206040518083038186803b1580156110b257600080fd5b505afa1580156110c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ea9190613d34565b811061112f5760405162461bcd60e51b81526020600482015260146024820152730d2dcecc2d8d2c85ae4deeae8cae45ad2dcc8caf60631b60448201526064016104e7565b8161113a5760045491505b603b82116111825760405162461bcd60e51b81526020600482015260156024820152741a5b9d985b1a590b5bdc9858db194b5c195c9a5bd9605a1b60448201526064016104e7565b6004546005546040805192835260208301859052820152606081018290527f83bc5ab8030537fcf1d29c2334f6d22c26c82dcbe5ff03923d2cff5c692c0a7f9060800160405180910390a1600491909155600555565b6111e133610b66565b6111fd5760405162461bcd60e51b81526004016104e790613eac565b610f13565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461124a5760405162461bcd60e51b81526004016104e790613f13565b6001600160a01b0381166112a05760405162461bcd60e51b815260206004820152601c60248201527f6e65772d73747261746567792d616464726573732d69732d7a65726f0000000060448201526064016104e7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561130357600080fd5b505afa158015611317573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133b9190613b3a565b6001600160a01b03161461138a5760405162461bcd60e51b81526020600482015260166024820152756e6f742d76616c69642d6e65772d737472617465677960501b60448201526064016104e7565b6001546040516370a0823160e01b81526114239183916001600160a01b03909116906370a08231906113c0903090600401613e31565b60206040518083038186803b1580156113d857600080fd5b505afa1580156113ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114109190613d34565b6001546001600160a01b03169190612063565b61053e817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016114739190613e31565b60206040518083038186803b15801561148b57600080fd5b505afa15801561149f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c39190613d34565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169190612063565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561154d57600080fd5b505afa158015611561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115859190613b3a565b6001600160a01b0316336001600160a01b0316146115b55760405162461bcd60e51b81526004016104e790613edc565b6001600160a01b03811661160b5760405162461bcd60e51b815260206004820152601d60248201527f6665652d636f6c6c6563746f722d616464726573732d69732d7a65726f00000060448201526064016104e7565b6002546001600160a01b03828116911614156116615760405162461bcd60e51b81526020600482015260156024820152746665652d636f6c6c6563746f722d69732d73616d6560581b60448201526064016104e7565b6002546040516001600160a01b038084169216907f0f06062680f9bd68e786e9980d9bb03d73d5620fc3b345e417b6eacb310b970690600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000610ed4612093565b6116d033610b66565b6116ec5760405162461bcd60e51b81526004016104e790613eac565b6002546001600160a01b031661173c5760405162461bcd60e51b81526020600482015260156024820152741999594b58dbdb1b1958dd1bdc8b5b9bdd0b5cd95d605a1b60448201526064016104e7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031614156117be5760405162461bcd60e51b815260206004820152601f60248201527f6e6f742d616c6c6f7765642d746f2d73776565702d636f6c6c61746572616c0060448201526064016104e7565b6117c781610823565b1561180b5760405162461bcd60e51b815260206004820152601460248201527306e6f742d616c6c6f7765642d746f2d73776565760641b60448201526064016104e7565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561184b57600254611846906001600160a01b03164761227e565b61053e565b6040516370a0823160e01b81526000906001600160a01b038316906370a082319061187a903090600401613e31565b60206040518083038186803b15801561189257600080fd5b505afa1580156118a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ca9190613d34565b600254909150610df5906001600160a01b03848116911683612063565b6000610ed46116bd565b6000611906836001600160a01b038416612397565b90505b92915050565b6000611906836001600160a01b0384166123e6565b61192d81612503565b5061053e7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016114739190613e31565b6001600160a01b03811660009081526001830160205260408120541515611906565b801580611a495750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015611a0f57600080fd5b505afa158015611a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a479190613d34565b155b611ab45760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016104e7565b6040516001600160a01b038316602482015260448101829052610ec390849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612527565b6000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d53ddc26306040518263ffffffff1660e01b8152600401611b699190613e31565b60206040518083038186803b158015611b8157600080fd5b505afa158015611b95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bb99190613d34565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639f2b2833306040518263ffffffff1660e01b8152600401611c099190613e31565b60206040518083038186803b158015611c2157600080fd5b505afa158015611c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c599190613d34565b9050611c64816125f9565b9450611c6f81612660565b9350611c7a82612685565b92505050909192565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190611cd2903090600401613e31565b60206040518083038186803b158015611cea57600080fd5b505afa158015611cfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d229190613d34565b9050801561053e5760405163b6b55f2560e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b6b55f2590602401600060405180830381600087803b158015611d8c57600080fd5b505af1158015611da0573d6000803e3d6000fd5b5050505050565b60606000611db483612696565b9392505050565b611e0f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000836119c0565b611e636001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000836119c0565b60005b600360009054906101000a90046001600160a01b03166001600160a01b031663c2fba6676040518163ffffffff1660e01b815260040160206040518083038186803b158015611eb457600080fd5b505afa158015611ec8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eec9190613d34565b811015610df557600354604051636e74a6f760e01b815260048101839052611fa2916001600160a01b031690636e74a6f79060240160206040518083038186803b158015611f3957600080fd5b505afa158015611f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f719190613b3a565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690846119c0565b600354604051636e74a6f760e01b815260048101839052612051916001600160a01b031690636e74a6f79060240160206040518083038186803b158015611fe857600080fd5b505afa158015611ffc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120209190613b3a565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690846119c0565b8061205b816140a6565b915050611e66565b6040516001600160a01b038316602482015260448101829052610ec390849063a9059cbb60e01b90606401611ae0565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156120ef57600080fd5b505afa158015612103573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121279190613d34565b905080612135576000612278565b6040516370a0823160e01b815281906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190612183903090600401613e31565b60206040518083038186803b15801561219b57600080fd5b505afa1580156121af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d39190613d34565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d4c3eea06040518163ffffffff1660e01b815260040160206040518083038186803b15801561222c57600080fd5b505afa158015612240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122649190613d34565b61226e919061400f565b6122789190613fef565b91505090565b804710156122ce5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016104e7565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461231b576040519150601f19603f3d011682016040523d82523d6000602084013e612320565b606091505b5050905080610ec35760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016104e7565b60008181526001830160205260408120546123de57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611909565b506000611909565b600081815260018301602052604081205480156124f957600061240a60018361402e565b855490915060009061241e9060019061402e565b905081811461249f57600086600001828154811061244c57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508087600001848154811061247d57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b85548690806124be57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611909565b6000915050611909565b60008061250e612093565b9050611db48184106125205781612522565b835b6126f2565b600061257c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128c39092919063ffffffff16565b805190915015610ec3578080602001905181019061259a9190613c9d565b610ec35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104e7565b60006126247f00000000000000000000000000000000000000000000000000000000000000006128da565b600061262e612093565b90508281111561264757612645612522848361402e565b505b61264f6128e3565b61265761298d565b50600092915050565b60008061266b612093565b90508281101561267f57611db4818461402e565b50919050565b6000811561085d5761190982612503565b6060816000018054806020026020016040519081016040528092919081815260200182805480156126e657602002820191906000526020600020905b8154815260200190600101908083116126d2575b50505050509050919050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016127419190613e31565b60206040518083038186803b15801561275957600080fd5b505afa15801561276d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127919190613d34565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ff643a7c6127cb85613014565b6040518263ffffffff1660e01b81526004016127e991815260200190565b600060405180830381600087803b15801561280357600080fd5b505af1158015612817573d6000803e3d6000fd5b50506040516370a0823160e01b81528392506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691506370a0823190612869903090600401613e31565b60206040518083038186803b15801561288157600080fd5b505afa158015612895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b99190613d34565b611db4919061402e565b60606128d2848460008561315c565b949350505050565b61053e81613284565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190612932903090600401613e31565b60206040518083038186803b15801561294a57600080fd5b505afa15801561295e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129829190613d34565b905061053e81613358565b60405163228bfd9f60e01b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063228bfd9f906129dc903090600401613e31565b6101006040518083038186803b1580156129f557600080fd5b505afa158015612a09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a2d9190613cb7565b50505050505091505060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638bc6beb26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612a9357600080fd5b505af1158015612aa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612acb9190613b3a565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b1b9190613e31565b60206040518083038186803b158015612b3357600080fd5b505afa158015612b47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b6b9190613d34565b90508015610ec3576000826001600160a01b031663e49e463b6040518163ffffffff1660e01b815260040160206040518083038186803b158015612bae57600080fd5b505afa158015612bc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be69190613b3a565b905081600b6000828254612bfa9190613fd7565b90915550506001600160a01b03811615801590612cb857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612c7557600080fd5b505afa158015612c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cad9190613b3a565b6001600160a01b0316145b15612eec576040516370a0823160e01b81526000906001600160a01b038316906370a0823190612cec903090600401613e31565b60206040518083038186803b158015612d0457600080fd5b505afa158015612d18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d3c9190613d34565b60405163b6b55f2560e01b8152600481018590529091506001600160a01b0383169063b6b55f2590602401600060405180830381600087803b158015612d8157600080fd5b505af1158015612d95573d6000803e3d6000fd5b50505050600081836001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612dc89190613e31565b60206040518083038186803b158015612de057600080fd5b505afa158015612df4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e189190613d34565b612e22919061402e565b90506000612710612e33888461400f565b612e3d9190613fef565b90508015612e6c57600254612e5f906001600160a01b03868116911683612063565b612e69818361402e565b91505b612e806001600160a01b0385168784612063565b600a546040516328f362b160e21b81526001600160a01b0388169163a3cd8ac491612eb2918891879190600401613e45565b600060405180830381600087803b158015612ecc57600080fd5b505af1158015612ee0573d6000803e3d6000fd5b5050505050505061300e565b6000612710612efb868561400f565b612f059190613fef565b90508015612f5457600254612f47906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683612063565b612f51818461402e565b92505b612f886001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585612063565b600a546040516328f362b160e21b81526001600160a01b0386169163a3cd8ac491612fda917f000000000000000000000000000000000000000000000000000000000000000091889190600401613e45565b600060405180830381600087803b158015612ff457600080fd5b505af1158015613008573d6000803e3d6000fd5b50505050505b50505050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d4c3eea06040518163ffffffff1660e01b815260040160206040518083038186803b15801561307057600080fd5b505afa158015613084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a89190613d34565b9050806130b6576000611db4565b807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561311057600080fd5b505afa158015613124573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131489190613d34565b613152908561400f565b611db49190613fef565b6060824710156131bd5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104e7565b843b61320b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104e7565b600080866001600160a01b031685876040516132279190613e15565b60006040518083038185875af1925050503d8060008114613264576040519150601f19603f3d011682016040523d82523d6000602084013e613269565b606091505b509150915061327982828661341f565b979650505050505050565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906132d3903090600401613e31565b60206040518083038186803b1580156132eb57600080fd5b505afa1580156132ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133239190613d34565b90508015610df557610df57f000000000000000000000000000000000000000000000000000000000000000083836001613458565b801561053e57600060065461271014156133735760016133d1565b6133d16133c96133c37f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000613619565b846137dd565b600654613908565b9050610df57f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008484613458565b6060831561342e575081611db4565b82511561343e5782518084602001fd5b8160405162461bcd60e51b81526004016104e79190613e79565b600354604051631d1f307960e31b81526001600160a01b038681166004830152858116602483015260448201859052600092839283929091169063e8f983c89060640160006040518083038186803b1580156134b357600080fd5b505afa1580156134c7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526134ef9190810190613b56565b925092509250836000141561350357600193505b811561361057600354604051636e74a6f760e01b8152600481018390526001600160a01b0390911690636e74a6f79060240160206040518083038186803b15801561354d57600080fd5b505afa158015613561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135859190613b3a565b6001600160a01b03166338ed173986868630426040518663ffffffff1660e01b81526004016135b8959493929190613f46565b600060405180830381600087803b1580156135d257600080fd5b505af11580156135e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261360e9190810190613c0a565b505b50505050505050565b6000546060906001600160a01b038481169116148061364557506000546001600160a01b038381169116145b156136f3576040805160028082526060820183529091602083019080368337019050509050828160008151811061368c57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505081816001815181106136ce57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b031681525050611909565b604080516003808252608082019092529060208201606080368337019050509050828160008151811061373657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260005482519116908290600190811061377557634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505081816002815181106137b757634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505092915050565b600060018351116138265760405162461bcd60e51b81526020600482015260136024820152720d2dcecc2d8d2c85adee4c2c6d8ca5ae0c2e8d606b1b60448201526064016104e7565b50806000805b6001855161383a919061402e565b811015613900576138a685828151811061386457634e487b7160e01b600052603260045260246000fd5b60200260200101518683600161387a9190613fd7565b8151811061389857634e487b7160e01b600052603260045260246000fd5b60200260200101518561392b565b9093509150816138ee5760405162461bcd60e51b8152602060048201526013602482015272696e76616c69642d6f7261636c652d7261746560681b60448201526064016104e7565b806138f8816140a6565b91505061382c565b505092915050565b6000612710613917838261402e565b613921908561400f565b6119069190613fef565b60008060005b600360009054906101000a90046001600160a01b03166001600160a01b031663c2fba6676040518163ffffffff1660e01b815260040160206040518083038186803b15801561397f57600080fd5b505afa158015613993573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b79190613d34565b811015613afd57600354600454604080516001600160a01b038a811660208301528981168284015260608201899052608082019390935260a08082018690528251808303909101815260c0820190925260009384931691613a249163b67bb24d60e01b919060e001613de4565b60408051601f1981840301815290829052613a3e91613e15565b6000604051808303816000865af19150503d8060008114613a7b576040519150601f19603f3d011682016040523d82523d6000602084013e613a80565b606091505b50915091508115613ae85760008082806020019051810190613aa29190613d6d565b509150915060045442613ab5919061402e565b81118015613ac257508115155b15613ad75750945060019350613b0692505050565b600080965096505050505050613b06565b50508080613af5906140a6565b915050613931565b50600080915091505b935093915050565b8051801515811461085d57600080fd5b600060208284031215613b2f578081fd5b8135611db4816140ed565b600060208284031215613b4b578081fd5b8151611db4816140ed565b600080600060608486031215613b6a578182fd5b835167ffffffffffffffff811115613b80578283fd5b8401601f81018613613b90578283fd5b80516020613ba5613ba083613fb3565b613f82565b8083825282820191508285018a848660051b8801011115613bc4578788fd5b8795505b84861015613bef578051613bdb816140ed565b835260019590950194918301918301613bc8565b50918801516040909801519199979850909695505050505050565b60006020808385031215613c1c578182fd5b825167ffffffffffffffff811115613c32578283fd5b8301601f81018513613c42578283fd5b8051613c50613ba082613fb3565b80828252848201915084840188868560051b8701011115613c6f578687fd5b8694505b83851015613c91578051835260019490940193918501918501613c73565b50979650505050505050565b600060208284031215613cae578081fd5b61190682613b0e565b600080600080600080600080610100898b031215613cd3578384fd5b613cdc89613b0e565b97506020890151965060408901519550606089015194506080890151935060a0890151925060c0890151915060e089015190509295985092959890939650565b600060208284031215613d2d578081fd5b5035919050565b600060208284031215613d45578081fd5b5051919050565b60008060408385031215613d5e578182fd5b50508035926020909101359150565b600080600060608486031215613d81578283fd5b8351925060208401519150613d9860408501613b0e565b90509250925092565b6000815180845260208085019450808401835b83811015613dd95781516001600160a01b031687529582019590820190600101613db4565b509495945050505050565b6001600160e01b0319831681528151600090613e07816004850160208701614045565b919091016004019392505050565b60008251613e27818460208701614045565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039390931683526020830191909152604082015260600190565b6000602082526119066020830184613da1565b6000602082528251806020840152613e98816040850160208701614045565b601f01601f19169190910160400192915050565b60208082526016908201527531b0b63632b916b4b996b737ba16b096b5b2b2b832b960511b604082015260600190565b6020808252601a908201527f63616c6c65722d69732d6e6f742d7468652d676f7665726e6f72000000000000604082015260600190565b60208082526019908201527818d85b1b195c8b5a5ccb5b9bdd0b5d995cdc195c8b5c1bdbdb603a1b604082015260600190565b600086825285602083015260a06040830152613f6560a0830186613da1565b6001600160a01b0394909416606083015250608001529392505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715613fab57613fab6140d7565b604052919050565b600067ffffffffffffffff821115613fcd57613fcd6140d7565b5060051b60200190565b60008219821115613fea57613fea6140c1565b500190565b60008261400a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615614029576140296140c1565b500290565b600082821015614040576140406140c1565b500390565b60005b83811015614060578181015183820152602001614048565b8381111561300e5750506000910152565b600181811c9082168061408557607f821691505b6020821081141561267f57634e487b7160e01b600052602260045260246000fd5b60006000198214156140ba576140ba6140c1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461053e57600080fdfea26469706673582212203db8c7c483759a764517e81c528be29896b17e3281919d20d9a9d0fbb94e4c1664736f6c63430008030033000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b3000000000000000000000000e382d9f2394a359b01006faa8a1864b8a60d2710000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e99842100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000184561726e56657370657253747261746567794554484441490000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101b05760003560e01c8063951dc22c116100ef578063ce5494bb11610092578063ce5494bb14610395578063d2c35ce8146103a8578063d4c3eea0146103bb578063e00af4a7146103c3578063e645c202146103d6578063ec78e832146103de578063fc0c546a146103f1578063ffa1ad7414610402576101b0565b8063951dc22c1461030557806399b71d5c1461031a578063a3f4df7e14610322578063a923b2a614610337578063aa1018861461034a578063b2016bd414610352578063c415b95c14610379578063cd2d7ebe1461038c576101b0565b8063440d724811610157578063440d7248146102875780634c36fad7146102aa57806367f5e4b8146102bd5780636dfa8d99146102d0578063709d039d146102d957806371506414146102ec5780637737b672146102f55780637d7c2a1c146102fd576101b0565b806314ae9f2e146101b557806316f0115b146101ca5780631960d116146102075780631aedeabe1461021a5780632e1a7d4d14610231578063335bbf11146102445780634032b72b1461026b57806342189c8f1461027e575b600080fd5b6101c86101c3366004613b1e565b610426565b005b6101f17f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b381565b6040516101fe9190613e31565b60405180910390f35b6101c8610215366004613d1c565b610541565b61022360065481565b6040519081526020016101fe565b6101c861023f366004613d1c565b6106c6565b6101f17f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b6101c8610279366004613b1e565b610717565b61022360045481565b61029a610295366004613b1e565b610823565b60405190151581526020016101fe565b6101c86102b8366004613b1e565b610862565b6101c86102cb366004613d1c565b610a15565b610223600b5481565b6003546101f1906001600160a01b031681565b610223600a5481565b6101c8610b61565b6101c8610df9565b61030d610ec8565b6040516101fe9190613e66565b6101c8610ed9565b61032a610f15565b6040516101fe9190613e79565b6101c8610345366004613d4c565b610fa3565b6101c86111d8565b6101f17f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6002546101f1906001600160a01b031681565b61022360055481565b6101c86103a3366004613b1e565b611202565b6101c86103b6366004613b1e565b6114f4565b6102236116bd565b6101c86103d1366004613b1e565b6116c7565b6102236118e7565b6001546101f1906001600160a01b031681565b6001546001600160a01b03166101f1565b61032a60405180604001604052806005815260200164342e302e3160d81b81525081565b7f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561047f57600080fd5b505afa158015610493573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b79190613b3a565b6001600160a01b0316336001600160a01b0316146104f05760405162461bcd60e51b81526004016104e790613edc565b60405180910390fd5b6104fb60078261190f565b61053e5760405162461bcd60e51b81526020600482015260146024820152731c995b5bdd994b5ad9595c195c8b59985a5b195960621b60448201526064016104e7565b50565b7f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561059a57600080fd5b505afa1580156105ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d29190613b3a565b6001600160a01b0316336001600160a01b0316146106025760405162461bcd60e51b81526004016104e790613edc565b806106415760405162461bcd60e51b815260206004820152600f60248201526e64726970506572696f642d7a65726f60881b60448201526064016104e7565b600a548114156106855760405162461bcd60e51b815260206004820152600f60248201526e1cd85b594b591c9a5c14195c9a5bd9608a1b60448201526064016104e7565b600a5460408051918252602082018390527f6a4a78fe36e2d43bd20405835c6211b888cc77a834e32ddc9ac64ded78f4b328910160405180910390a1600a55565b337f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b03161461070e5760405162461bcd60e51b81526004016104e790613f13565b61053e81611924565b7f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561077057600080fd5b505afa158015610784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a89190613b3a565b6001600160a01b0316336001600160a01b0316146107d85760405162461bcd60e51b81526004016104e790613edc565b6107e36007826118f1565b61053e5760405162461bcd60e51b81526020600482015260116024820152701859190b5ad9595c195c8b59985a5b1959607a1b60448201526064016104e7565b60007f000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f26001600160a01b0316826001600160a01b03161490505b919050565b7f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156108bb57600080fd5b505afa1580156108cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f39190613b3a565b6001600160a01b0316336001600160a01b0316146109235760405162461bcd60e51b81526004016104e790613edc565b6001600160a01b03811661096e5760405162461bcd60e51b8152602060048201526012602482015271736d2d616464726573732d69732d7a65726f60701b60448201526064016104e7565b6003546001600160a01b03828116911614156109b95760405162461bcd60e51b815260206004820152600a602482015269736d2d69732d73616d6560b01b60448201526064016104e7565b6003546040516001600160a01b038084169216907f2d19927e7cac08ceb98b38898a4fdff6da6a27295b9a2d62fe250408ebe044e190600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b7f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6e57600080fd5b505afa158015610a82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa69190613b3a565b6001600160a01b0316336001600160a01b031614610ad65760405162461bcd60e51b81526004016104e790613edc565b612710811115610b215760405162461bcd60e51b8152602060048201526016602482015275696e76616c69642d736c6970706167652d76616c756560501b60448201526064016104e7565b60065460408051918252602082018390527ef1c5db862c7598b3b6765552ca951f498611e06412c2d57f8d0b58f82e7f82910160405180910390a1600655565b610b6e335b60079061199e565b610b8a5760405162461bcd60e51b81526004016104e790613eac565b60007f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316638bc6beb26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610be757600080fd5b505af1158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f9190613b3a565b90506000816001600160a01b031663e49e463b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c5c57600080fd5b505afa158015610c70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c949190613b3a565b90506001600160a01b03811615610df5577f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0857600080fd5b505afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d409190613b3a565b6001600160a01b031614610d8a5760405162461bcd60e51b81526020600482015260116024820152701a5b9d985b1a590b59dc9bddcb5c1bdbdb607a1b60448201526064016104e7565b610dbf6001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f168260006119c0565b610df56001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f16826000196119c0565b5050565b610e0233610b66565b610e1e5760405162461bcd60e51b81526004016104e790613eac565b6000806000610e2b611b17565b6040516302df682360e11b815260048101849052602481018390526044810182905292955090935091506001600160a01b037f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b316906305bed04690606401600060405180830381600087803b158015610ea357600080fd5b505af1158015610eb7573d6000803e3d6000fd5b50505050610ec3611c83565b505050565b6060610ed46007611da7565b905090565b610ee233610b66565b610efe5760405162461bcd60e51b81526004016104e790613eac565b610f086000611dbb565b610f13600019611dbb565b565b60098054610f2290614071565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4e90614071565b8015610f9b5780601f10610f7057610100808354040283529160200191610f9b565b820191906000526020600020905b815481529060010190602001808311610f7e57829003601f168201915b505050505081565b7f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610ffc57600080fd5b505afa158015611010573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110349190613b3a565b6001600160a01b0316336001600160a01b0316146110645760405162461bcd60e51b81526004016104e790613edc565b600360009054906101000a90046001600160a01b03166001600160a01b031663c2fba6676040518163ffffffff1660e01b815260040160206040518083038186803b1580156110b257600080fd5b505afa1580156110c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ea9190613d34565b811061112f5760405162461bcd60e51b81526020600482015260146024820152730d2dcecc2d8d2c85ae4deeae8cae45ad2dcc8caf60631b60448201526064016104e7565b8161113a5760045491505b603b82116111825760405162461bcd60e51b81526020600482015260156024820152741a5b9d985b1a590b5bdc9858db194b5c195c9a5bd9605a1b60448201526064016104e7565b6004546005546040805192835260208301859052820152606081018290527f83bc5ab8030537fcf1d29c2334f6d22c26c82dcbe5ff03923d2cff5c692c0a7f9060800160405180910390a1600491909155600555565b6111e133610b66565b6111fd5760405162461bcd60e51b81526004016104e790613eac565b610f13565b337f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b03161461124a5760405162461bcd60e51b81526004016104e790613f13565b6001600160a01b0381166112a05760405162461bcd60e51b815260206004820152601c60248201527f6e65772d73747261746567792d616464726573732d69732d7a65726f0000000060448201526064016104e7565b7f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316816001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561130357600080fd5b505afa158015611317573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133b9190613b3a565b6001600160a01b03161461138a5760405162461bcd60e51b81526020600482015260166024820152756e6f742d76616c69642d6e65772d737472617465677960501b60448201526064016104e7565b6001546040516370a0823160e01b81526114239183916001600160a01b03909116906370a08231906113c0903090600401613e31565b60206040518083038186803b1580156113d857600080fd5b505afa1580156113ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114109190613d34565b6001546001600160a01b03169190612063565b61053e817f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016114739190613e31565b60206040518083038186803b15801561148b57600080fd5b505afa15801561149f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c39190613d34565b6001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2169190612063565b7f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561154d57600080fd5b505afa158015611561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115859190613b3a565b6001600160a01b0316336001600160a01b0316146115b55760405162461bcd60e51b81526004016104e790613edc565b6001600160a01b03811661160b5760405162461bcd60e51b815260206004820152601d60248201527f6665652d636f6c6c6563746f722d616464726573732d69732d7a65726f00000060448201526064016104e7565b6002546001600160a01b03828116911614156116615760405162461bcd60e51b81526020600482015260156024820152746665652d636f6c6c6563746f722d69732d73616d6560581b60448201526064016104e7565b6002546040516001600160a01b038084169216907f0f06062680f9bd68e786e9980d9bb03d73d5620fc3b345e417b6eacb310b970690600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000610ed4612093565b6116d033610b66565b6116ec5760405162461bcd60e51b81526004016104e790613eac565b6002546001600160a01b031661173c5760405162461bcd60e51b81526020600482015260156024820152741999594b58dbdb1b1958dd1bdc8b5b9bdd0b5cd95d605a1b60448201526064016104e7565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316816001600160a01b031614156117be5760405162461bcd60e51b815260206004820152601f60248201527f6e6f742d616c6c6f7765642d746f2d73776565702d636f6c6c61746572616c0060448201526064016104e7565b6117c781610823565b1561180b5760405162461bcd60e51b815260206004820152601460248201527306e6f742d616c6c6f7765642d746f2d73776565760641b60448201526064016104e7565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561184b57600254611846906001600160a01b03164761227e565b61053e565b6040516370a0823160e01b81526000906001600160a01b038316906370a082319061187a903090600401613e31565b60206040518083038186803b15801561189257600080fd5b505afa1580156118a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ca9190613d34565b600254909150610df5906001600160a01b03848116911683612063565b6000610ed46116bd565b6000611906836001600160a01b038416612397565b90505b92915050565b6000611906836001600160a01b0384166123e6565b61192d81612503565b5061053e7f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b37f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016114739190613e31565b6001600160a01b03811660009081526001830160205260408120541515611906565b801580611a495750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015611a0f57600080fd5b505afa158015611a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a479190613d34565b155b611ab45760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016104e7565b6040516001600160a01b038316602482015260448101829052610ec390849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612527565b6000806000807f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b031663d53ddc26306040518263ffffffff1660e01b8152600401611b699190613e31565b60206040518083038186803b158015611b8157600080fd5b505afa158015611b95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bb99190613d34565b905060007f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316639f2b2833306040518263ffffffff1660e01b8152600401611c099190613e31565b60206040518083038186803b158015611c2157600080fd5b505afa158015611c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c599190613d34565b9050611c64816125f9565b9450611c6f81612660565b9350611c7a82612685565b92505050909192565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216906370a0823190611cd2903090600401613e31565b60206040518083038186803b158015611cea57600080fd5b505afa158015611cfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d229190613d34565b9050801561053e5760405163b6b55f2560e01b8152600481018290527f000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f26001600160a01b03169063b6b55f2590602401600060405180830381600087803b158015611d8c57600080fd5b505af1158015611da0573d6000803e3d6000fd5b5050505050565b60606000611db483612696565b9392505050565b611e0f6001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2167f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b3836119c0565b611e636001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2167f000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f2836119c0565b60005b600360009054906101000a90046001600160a01b03166001600160a01b031663c2fba6676040518163ffffffff1660e01b815260040160206040518083038186803b158015611eb457600080fd5b505afa158015611ec8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eec9190613d34565b811015610df557600354604051636e74a6f760e01b815260048101839052611fa2916001600160a01b031690636e74a6f79060240160206040518083038186803b158015611f3957600080fd5b505afa158015611f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f719190613b3a565b6001600160a01b037f0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e9984211690846119c0565b600354604051636e74a6f760e01b815260048101839052612051916001600160a01b031690636e74a6f79060240160206040518083038186803b158015611fe857600080fd5b505afa158015611ffc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120209190613b3a565b6001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21690846119c0565b8061205b816140a6565b915050611e66565b6040516001600160a01b038316602482015260448101829052610ec390849063a9059cbb60e01b90606401611ae0565b6000807f000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f26001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156120ef57600080fd5b505afa158015612103573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121279190613d34565b905080612135576000612278565b6040516370a0823160e01b815281906001600160a01b037f000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f216906370a0823190612183903090600401613e31565b60206040518083038186803b15801561219b57600080fd5b505afa1580156121af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d39190613d34565b7f000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f26001600160a01b031663d4c3eea06040518163ffffffff1660e01b815260040160206040518083038186803b15801561222c57600080fd5b505afa158015612240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122649190613d34565b61226e919061400f565b6122789190613fef565b91505090565b804710156122ce5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016104e7565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461231b576040519150601f19603f3d011682016040523d82523d6000602084013e612320565b606091505b5050905080610ec35760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016104e7565b60008181526001830160205260408120546123de57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611909565b506000611909565b600081815260018301602052604081205480156124f957600061240a60018361402e565b855490915060009061241e9060019061402e565b905081811461249f57600086600001828154811061244c57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508087600001848154811061247d57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b85548690806124be57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611909565b6000915050611909565b60008061250e612093565b9050611db48184106125205781612522565b835b6126f2565b600061257c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128c39092919063ffffffff16565b805190915015610ec3578080602001905181019061259a9190613c9d565b610ec35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104e7565b60006126247f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6128da565b600061262e612093565b90508281111561264757612645612522848361402e565b505b61264f6128e3565b61265761298d565b50600092915050565b60008061266b612093565b90508281101561267f57611db4818461402e565b50919050565b6000811561085d5761190982612503565b6060816000018054806020026020016040519081016040528092919081815260200182805480156126e657602002820191906000526020600020905b8154815260200190600101908083116126d2575b50505050509050919050565b6000807f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016127419190613e31565b60206040518083038186803b15801561275957600080fd5b505afa15801561276d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127919190613d34565b90507f000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f26001600160a01b031663ff643a7c6127cb85613014565b6040518263ffffffff1660e01b81526004016127e991815260200190565b600060405180830381600087803b15801561280357600080fd5b505af1158015612817573d6000803e3d6000fd5b50506040516370a0823160e01b81528392506001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21691506370a0823190612869903090600401613e31565b60206040518083038186803b15801561288157600080fd5b505afa158015612895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b99190613d34565b611db4919061402e565b60606128d2848460008561315c565b949350505050565b61053e81613284565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216906370a0823190612932903090600401613e31565b60206040518083038186803b15801561294a57600080fd5b505afa15801561295e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129829190613d34565b905061053e81613358565b60405163228bfd9f60e01b81526000906001600160a01b037f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b3169063228bfd9f906129dc903090600401613e31565b6101006040518083038186803b1580156129f557600080fd5b505afa158015612a09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a2d9190613cb7565b50505050505091505060007f000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b36001600160a01b0316638bc6beb26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612a9357600080fd5b505af1158015612aa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612acb9190613b3a565b905060007f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b1b9190613e31565b60206040518083038186803b158015612b3357600080fd5b505afa158015612b47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b6b9190613d34565b90508015610ec3576000826001600160a01b031663e49e463b6040518163ffffffff1660e01b815260040160206040518083038186803b158015612bae57600080fd5b505afa158015612bc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be69190613b3a565b905081600b6000828254612bfa9190613fd7565b90915550506001600160a01b03811615801590612cb857507f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612c7557600080fd5b505afa158015612c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cad9190613b3a565b6001600160a01b0316145b15612eec576040516370a0823160e01b81526000906001600160a01b038316906370a0823190612cec903090600401613e31565b60206040518083038186803b158015612d0457600080fd5b505afa158015612d18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d3c9190613d34565b60405163b6b55f2560e01b8152600481018590529091506001600160a01b0383169063b6b55f2590602401600060405180830381600087803b158015612d8157600080fd5b505af1158015612d95573d6000803e3d6000fd5b50505050600081836001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612dc89190613e31565b60206040518083038186803b158015612de057600080fd5b505afa158015612df4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e189190613d34565b612e22919061402e565b90506000612710612e33888461400f565b612e3d9190613fef565b90508015612e6c57600254612e5f906001600160a01b03868116911683612063565b612e69818361402e565b91505b612e806001600160a01b0385168784612063565b600a546040516328f362b160e21b81526001600160a01b0388169163a3cd8ac491612eb2918891879190600401613e45565b600060405180830381600087803b158015612ecc57600080fd5b505af1158015612ee0573d6000803e3d6000fd5b5050505050505061300e565b6000612710612efb868561400f565b612f059190613fef565b90508015612f5457600254612f47906001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f8116911683612063565b612f51818461402e565b92505b612f886001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f168585612063565b600a546040516328f362b160e21b81526001600160a01b0386169163a3cd8ac491612fda917f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f91889190600401613e45565b600060405180830381600087803b158015612ff457600080fd5b505af1158015613008573d6000803e3d6000fd5b50505050505b50505050565b6000807f000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f26001600160a01b031663d4c3eea06040518163ffffffff1660e01b815260040160206040518083038186803b15801561307057600080fd5b505afa158015613084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a89190613d34565b9050806130b6576000611db4565b807f000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f26001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561311057600080fd5b505afa158015613124573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131489190613d34565b613152908561400f565b611db49190613fef565b6060824710156131bd5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104e7565b843b61320b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104e7565b600080866001600160a01b031685876040516132279190613e15565b60006040518083038185875af1925050503d8060008114613264576040519150601f19603f3d011682016040523d82523d6000602084013e613269565b606091505b509150915061327982828661341f565b979650505050505050565b6040516370a0823160e01b81526000906001600160a01b037f0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e99842116906370a08231906132d3903090600401613e31565b60206040518083038186803b1580156132eb57600080fd5b505afa1580156132ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133239190613d34565b90508015610df557610df57f0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e99842183836001613458565b801561053e57600060065461271014156133735760016133d1565b6133d16133c96133c37f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc27f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f613619565b846137dd565b600654613908565b9050610df57f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc27f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f8484613458565b6060831561342e575081611db4565b82511561343e5782518084602001fd5b8160405162461bcd60e51b81526004016104e79190613e79565b600354604051631d1f307960e31b81526001600160a01b038681166004830152858116602483015260448201859052600092839283929091169063e8f983c89060640160006040518083038186803b1580156134b357600080fd5b505afa1580156134c7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526134ef9190810190613b56565b925092509250836000141561350357600193505b811561361057600354604051636e74a6f760e01b8152600481018390526001600160a01b0390911690636e74a6f79060240160206040518083038186803b15801561354d57600080fd5b505afa158015613561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135859190613b3a565b6001600160a01b03166338ed173986868630426040518663ffffffff1660e01b81526004016135b8959493929190613f46565b600060405180830381600087803b1580156135d257600080fd5b505af11580156135e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261360e9190810190613c0a565b505b50505050505050565b6000546060906001600160a01b038481169116148061364557506000546001600160a01b038381169116145b156136f3576040805160028082526060820183529091602083019080368337019050509050828160008151811061368c57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505081816001815181106136ce57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b031681525050611909565b604080516003808252608082019092529060208201606080368337019050509050828160008151811061373657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260005482519116908290600190811061377557634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505081816002815181106137b757634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505092915050565b600060018351116138265760405162461bcd60e51b81526020600482015260136024820152720d2dcecc2d8d2c85adee4c2c6d8ca5ae0c2e8d606b1b60448201526064016104e7565b50806000805b6001855161383a919061402e565b811015613900576138a685828151811061386457634e487b7160e01b600052603260045260246000fd5b60200260200101518683600161387a9190613fd7565b8151811061389857634e487b7160e01b600052603260045260246000fd5b60200260200101518561392b565b9093509150816138ee5760405162461bcd60e51b8152602060048201526013602482015272696e76616c69642d6f7261636c652d7261746560681b60448201526064016104e7565b806138f8816140a6565b91505061382c565b505092915050565b6000612710613917838261402e565b613921908561400f565b6119069190613fef565b60008060005b600360009054906101000a90046001600160a01b03166001600160a01b031663c2fba6676040518163ffffffff1660e01b815260040160206040518083038186803b15801561397f57600080fd5b505afa158015613993573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b79190613d34565b811015613afd57600354600454604080516001600160a01b038a811660208301528981168284015260608201899052608082019390935260a08082018690528251808303909101815260c0820190925260009384931691613a249163b67bb24d60e01b919060e001613de4565b60408051601f1981840301815290829052613a3e91613e15565b6000604051808303816000865af19150503d8060008114613a7b576040519150601f19603f3d011682016040523d82523d6000602084013e613a80565b606091505b50915091508115613ae85760008082806020019051810190613aa29190613d6d565b509150915060045442613ab5919061402e565b81118015613ac257508115155b15613ad75750945060019350613b0692505050565b600080965096505050505050613b06565b50508080613af5906140a6565b915050613931565b50600080915091505b935093915050565b8051801515811461085d57600080fd5b600060208284031215613b2f578081fd5b8135611db4816140ed565b600060208284031215613b4b578081fd5b8151611db4816140ed565b600080600060608486031215613b6a578182fd5b835167ffffffffffffffff811115613b80578283fd5b8401601f81018613613b90578283fd5b80516020613ba5613ba083613fb3565b613f82565b8083825282820191508285018a848660051b8801011115613bc4578788fd5b8795505b84861015613bef578051613bdb816140ed565b835260019590950194918301918301613bc8565b50918801516040909801519199979850909695505050505050565b60006020808385031215613c1c578182fd5b825167ffffffffffffffff811115613c32578283fd5b8301601f81018513613c42578283fd5b8051613c50613ba082613fb3565b80828252848201915084840188868560051b8701011115613c6f578687fd5b8694505b83851015613c91578051835260019490940193918501918501613c73565b50979650505050505050565b600060208284031215613cae578081fd5b61190682613b0e565b600080600080600080600080610100898b031215613cd3578384fd5b613cdc89613b0e565b97506020890151965060408901519550606089015194506080890151935060a0890151925060c0890151915060e089015190509295985092959890939650565b600060208284031215613d2d578081fd5b5035919050565b600060208284031215613d45578081fd5b5051919050565b60008060408385031215613d5e578182fd5b50508035926020909101359150565b600080600060608486031215613d81578283fd5b8351925060208401519150613d9860408501613b0e565b90509250925092565b6000815180845260208085019450808401835b83811015613dd95781516001600160a01b031687529582019590820190600101613db4565b509495945050505050565b6001600160e01b0319831681528151600090613e07816004850160208701614045565b919091016004019392505050565b60008251613e27818460208701614045565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039390931683526020830191909152604082015260600190565b6000602082526119066020830184613da1565b6000602082528251806020840152613e98816040850160208701614045565b601f01601f19169190910160400192915050565b60208082526016908201527531b0b63632b916b4b996b737ba16b096b5b2b2b832b960511b604082015260600190565b6020808252601a908201527f63616c6c65722d69732d6e6f742d7468652d676f7665726e6f72000000000000604082015260600190565b60208082526019908201527818d85b1b195c8b5a5ccb5b9bdd0b5d995cdc195c8b5c1bdbdb603a1b604082015260600190565b600086825285602083015260a06040830152613f6560a0830186613da1565b6001600160a01b0394909416606083015250608001529392505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715613fab57613fab6140d7565b604052919050565b600067ffffffffffffffff821115613fcd57613fcd6140d7565b5060051b60200190565b60008219821115613fea57613fea6140c1565b500190565b60008261400a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615614029576140296140c1565b500290565b600082821015614040576140406140c1565b500390565b60005b83811015614060578181015183820152602001614048565b8381111561300e5750506000910152565b600181811c9082168061408557607f821691505b6020821081141561267f57634e487b7160e01b600052602260045260246000fd5b60006000198214156140ba576140ba6140c1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461053e57600080fdfea26469706673582212203db8c7c483759a764517e81c528be29896b17e3281919d20d9a9d0fbb94e4c1664736f6c63430008030033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b3000000000000000000000000e382d9f2394a359b01006faa8a1864b8a60d2710000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e99842100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000184561726e56657370657253747261746567794554484441490000000000000000
-----Decoded View---------------
Arg [0] : _pool (address): 0xA89566489E932a2d334b9eFF7884Feb21a07d2B3
Arg [1] : _swapManager (address): 0xe382d9f2394A359B01006faa8A1864b8a60d2710
Arg [2] : _receiptToken (address): 0xd1C117319B3595fbc39b471AB1fd485629eb05F2
Arg [3] : _dripToken (address): 0x6B175474E89094C44Da98b954EedeAC495271d0F
Arg [4] : _vsp (address): 0x1b40183EFB4Dd766f11bDa7A7c3AD8982e998421
Arg [5] : _name (string): EarnVesperStrategyETHDAI
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000a89566489e932a2d334b9eff7884feb21a07d2b3
Arg [1] : 000000000000000000000000e382d9f2394a359b01006faa8a1864b8a60d2710
Arg [2] : 000000000000000000000000d1c117319b3595fbc39b471ab1fd485629eb05f2
Arg [3] : 0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
Arg [4] : 0000000000000000000000001b40183efb4dd766f11bda7a7c3ad8982e998421
Arg [5] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000018
Arg [7] : 4561726e56657370657253747261746567794554484441490000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.