More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 10 from a total of 10 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Strategist | 14931559 | 976 days ago | IN | 0 ETH | 0.00131105 | ||||
Set Keeper | 11790641 | 1466 days ago | IN | 0 ETH | 0.00923918 | ||||
Set Debt Thresho... | 11769441 | 1469 days ago | IN | 0 ETH | 0.00277138 | ||||
Harvest | 11744241 | 1473 days ago | IN | 0 ETH | 0.07262696 | ||||
Set Max Report D... | 11718551 | 1477 days ago | IN | 0 ETH | 0.00165218 | ||||
Harvest | 11714188 | 1478 days ago | IN | 0 ETH | 0.08382931 | ||||
Set Keeper | 11714015 | 1478 days ago | IN | 0 ETH | 0.0014854 | ||||
Set Debt Thresho... | 11714008 | 1478 days ago | IN | 0 ETH | 0.00217855 | ||||
Set Profit Facto... | 11713997 | 1478 days ago | IN | 0 ETH | 0.00148252 | ||||
Harvest | 11713164 | 1478 days ago | IN | 0 ETH | 0.04280897 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
11790502 | 1466 days ago | 0.00101069 ETH | ||||
11790502 | 1466 days ago | 0.00006193 ETH | ||||
11790502 | 1466 days ago | 0.00094875 ETH | ||||
11787760 | 1466 days ago | 1.59740081 ETH | ||||
11787760 | 1466 days ago | 0.08687348 ETH | ||||
11787760 | 1466 days ago | 1.51052732 ETH | ||||
11787254 | 1466 days ago | 9.2546254 ETH | ||||
11787254 | 1466 days ago | 0.51207924 ETH | ||||
11787254 | 1466 days ago | 8.74254615 ETH | ||||
11784023 | 1467 days ago | 4.89554705 ETH | ||||
11784023 | 1467 days ago | 4.89554705 ETH | ||||
11784023 | 1467 days ago | 0.53268729 ETH | ||||
11784023 | 1467 days ago | 9.25840681 ETH | ||||
11780765 | 1467 days ago | 8.3293846 ETH | ||||
11780765 | 1467 days ago | 0.40985539 ETH | ||||
11780765 | 1467 days ago | 7.9195292 ETH | ||||
11778053 | 1468 days ago | 5.47075364 ETH | ||||
11778053 | 1468 days ago | 5.47075364 ETH | ||||
11778053 | 1468 days ago | 0.52227702 ETH | ||||
11778053 | 1468 days ago | 10.41923026 ETH | ||||
11774832 | 1468 days ago | 6.39264831 ETH | ||||
11774832 | 1468 days ago | 6.39264831 ETH | ||||
11774832 | 1468 days ago | 0.63224415 ETH | ||||
11774832 | 1468 days ago | 12.15305248 ETH | ||||
11771548 | 1469 days ago | 11.6217775 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Strategy
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-01-22 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 rateLimit; uint256 lastReport; uint256 totalDebt; uint256 totalGain; uint256 totalLoss; } // Part: Gauge interface Gauge { function deposit(uint256) external; function balanceOf(address) external view returns (uint256); function claim_rewards() external; function claimable_reward(address, address) external view returns (uint256); function withdraw(uint256) external; } // Part: ICurveFi interface ICurveFi { function get_virtual_price() external view returns (uint256); function add_liquidity( // sBTC pool uint256[3] calldata amounts, uint256 min_mint_amount ) external; function add_liquidity( // bUSD pool uint256[4] calldata amounts, uint256 min_mint_amount ) external; function add_liquidity( // stETH pool uint256[2] calldata amounts, uint256 min_mint_amount ) external payable; function remove_liquidity_imbalance(uint256[4] calldata amounts, uint256 max_burn_amount) external; function remove_liquidity(uint256 _amount, uint256[4] calldata amounts) external; function remove_liquidity_one_coin( uint256 _token_amount, int128 i, uint256 min_amount ) external; function exchange( int128 from, int128 to, uint256 _from_amount, uint256 _min_to_amount ) external payable; function balances(int128) external view returns (uint256); function get_dy( int128 from, int128 to, uint256 _from_amount ) external view returns (uint256); function calc_token_amount( uint256[2] calldata amounts, bool is_deposit) external view returns (uint256); } // Part: IMinter interface IMinter { function mint(address) external; } // Part: IUniswapV2Router01 interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns ( uint256 amountA, uint256 amountB, uint256 liquidity ); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); function removeLiquidity( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETH( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETHWithPermit( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountToken, uint256 amountETH); function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactETHForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function swapTokensForExactETH( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapETHForExactTokens( uint256 amountOut, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) external pure returns (uint256 amountB); function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountOut); function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountIn); function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts); function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts); } // Part: OpenZeppelin/[email protected]/Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // Part: OpenZeppelin/[email protected]/IERC20 /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // Part: OpenZeppelin/[email protected]/Math /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } } // Part: OpenZeppelin/[email protected]/SafeMath /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // Part: ICrvV3 interface ICrvV3 is IERC20 { function minter() external view returns (address); } // Part: ISteth interface ISteth is IERC20 { function submit(address) external payable returns (uint256); } // Part: IUniswapV2Router02 interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } // Part: OpenZeppelin/[email protected]/SafeERC20 /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // Part: iearn-finance/[email protected]/VaultAPI interface VaultAPI is IERC20 { function apiVersion() external view returns (string memory); function withdraw(uint256 shares, address recipient) external; function token() external view returns (address); function strategies(address _strategy) external view returns (StrategyParams memory); /** * View how much the Vault would increase this Strategy's borrow limit, * based on its present performance (since its last report). Can be used to * determine expectedReturn in your Strategy. */ function creditAvailable() external view returns (uint256); /** * View how much the Vault would like to pull back from the Strategy, * based on its present performance (since its last report). Can be used to * determine expectedReturn in your Strategy. */ function debtOutstanding() external view returns (uint256); /** * View how much the Vault expect this Strategy to return at the current * block, based on its present performance (since its last report). Can be * used to determine expectedReturn in your Strategy. */ function expectedReturn() external view returns (uint256); /** * This is the main contact point where the Strategy interacts with the * Vault. It is critical that this call is handled as intended by the * Strategy. Therefore, this function will be called by BaseStrategy to * make sure the integration is correct. */ function report( uint256 _gain, uint256 _loss, uint256 _debtPayment ) external returns (uint256); /** * This function should only be used in the scenario where the Strategy is * being retired but no migration of the positions are possible, or in the * extreme scenario that the Strategy needs to be put into "Emergency Exit" * mode in order for it to exit as quickly as possible. The latter scenario * could be for any reason that is considered "critical" that the Strategy * exits its position as fast as possible, such as a sudden change in * market conditions leading to losses, or an imminent failure in an * external dependency. */ function revokeStrategy() external; /** * View the governance address of the Vault to assert privileged functions * can only be called by governance. The Strategy serves the Vault, so it * is subject to governance defined by the Vault. */ function governance() external view returns (address); } // Part: iearn-finance/[email protected]/BaseStrategy /** * @title Yearn Base Strategy * @author yearn.finance * @notice * BaseStrategy implements all of the required functionality to interoperate * closely with the Vault contract. This contract should be inherited and the * abstract methods implemented to adapt the Strategy to the particular needs * it has to create a return. * * Of special interest is the relationship between `harvest()` and * `vault.report()'. `harvest()` may be called simply because enough time has * elapsed since the last report, and not because any funds need to be moved * or positions adjusted. This is critical so that the Vault may maintain an * accurate picture of the Strategy's performance. See `vault.report()`, * `harvest()`, and `harvestTrigger()` for further details. */ abstract contract BaseStrategy { using SafeMath for uint256; /** * @notice * Used to track which version of `StrategyAPI` this Strategy * implements. * @dev The Strategy's version must match the Vault's `API_VERSION`. * @return A string which holds the current API version of this contract. */ function apiVersion() public pure returns (string memory) { return "0.3.0"; } /** * @notice This Strategy's name. * @dev * You can use this field to manage the "version" of this Strategy, e.g. * `StrategySomethingOrOtherV1`. However, "API Version" is managed by * `apiVersion()` function above. * @return This Strategy's name. */ function name() external virtual view returns (string memory); /** * @notice * The amount (priced in want) of the total assets managed by this strategy should not count * towards Yearn's TVL calculations. * @dev * You can override this field to set it to a non-zero value if some of the assets of this * Strategy is somehow delegated inside another part of of Yearn's ecosystem e.g. another Vault. * Note that this value must be strictly less than or equal to the amount provided by * `estimatedTotalAssets()` below, as the TVL calc will be total assets minus delegated assets. * @return * The amount of assets this strategy manages that should not be included in Yearn's Total Value * Locked (TVL) calculation across it's ecosystem. */ function delegatedAssets() external virtual view returns (uint256) { return 0; } VaultAPI public vault; address public strategist; address public rewards; address public keeper; IERC20 public want; // So indexers can keep track of this event Harvested(uint256 profit, uint256 loss, uint256 debtPayment, uint256 debtOutstanding); event UpdatedStrategist(address newStrategist); event UpdatedKeeper(address newKeeper); event UpdatedRewards(address rewards); event UpdatedReportDelay(uint256 delay); event UpdatedProfitFactor(uint256 profitFactor); event UpdatedDebtThreshold(uint256 debtThreshold); event EmergencyExitEnabled(); // The maximum number of seconds between harvest calls. See // `setMaxReportDelay()` for more details. uint256 public maxReportDelay = 86400; // ~ once a day // The minimum multiple that `callCost` must be above the credit/profit to // be "justifiable". See `setProfitFactor()` for more details. uint256 public profitFactor = 100; // Use this to adjust the threshold at which running a debt causes a // harvest trigger. See `setDebtThreshold()` for more details. uint256 public debtThreshold = 0; // See note on `setEmergencyExit()`. bool public emergencyExit; // modifiers modifier onlyAuthorized() { require(msg.sender == strategist || msg.sender == governance(), "!authorized"); _; } modifier onlyStrategist() { require(msg.sender == strategist, "!strategist"); _; } modifier onlyGovernance() { require(msg.sender == governance(), "!authorized"); _; } modifier onlyKeepers() { require(msg.sender == keeper || msg.sender == strategist || msg.sender == governance(), "!authorized"); _; } /** * @notice * Initializes the Strategy, this is called only once, when the * contract is deployed. * @dev `_vault` should implement `VaultAPI`. * @param _vault The address of the Vault responsible for this Strategy. */ constructor(address _vault) public { vault = VaultAPI(_vault); want = IERC20(vault.token()); want.approve(_vault, uint256(-1)); // Give Vault unlimited access (might save gas) strategist = msg.sender; rewards = msg.sender; keeper = msg.sender; } /** * @notice * Used to change `strategist`. * * This may only be called by governance or the existing strategist. * @param _strategist The new address to assign as `strategist`. */ function setStrategist(address _strategist) external onlyAuthorized { require(_strategist != address(0)); strategist = _strategist; emit UpdatedStrategist(_strategist); } /** * @notice * Used to change `keeper`. * * `keeper` is the only address that may call `tend()` or `harvest()`, * other than `governance()` or `strategist`. However, unlike * `governance()` or `strategist`, `keeper` may *only* call `tend()` * and `harvest()`, and no other authorized functions, following the * principle of least privilege. * * This may only be called by governance or the strategist. * @param _keeper The new address to assign as `keeper`. */ function setKeeper(address _keeper) external onlyAuthorized { require(_keeper != address(0)); keeper = _keeper; emit UpdatedKeeper(_keeper); } /** * @notice * Used to change `rewards`. Any distributed rewards will cease flowing * to the old address and begin flowing to this address once the change * is in effect. * * This may only be called by the strategist. * @param _rewards The address to use for collecting rewards. */ function setRewards(address _rewards) external onlyStrategist { require(_rewards != address(0)); rewards = _rewards; emit UpdatedRewards(_rewards); } /** * @notice * Used to change `maxReportDelay`. `maxReportDelay` is the maximum number * of blocks that should pass for `harvest()` to be called. * * For external keepers (such as the Keep3r network), this is the maximum * time between jobs to wait. (see `harvestTrigger()` * for more details.) * * This may only be called by governance or the strategist. * @param _delay The maximum number of seconds to wait between harvests. */ function setMaxReportDelay(uint256 _delay) external onlyAuthorized { maxReportDelay = _delay; emit UpdatedReportDelay(_delay); } /** * @notice * Used to change `profitFactor`. `profitFactor` is used to determine * if it's worthwhile to harvest, given gas costs. (See `harvestTrigger()` * for more details.) * * This may only be called by governance or the strategist. * @param _profitFactor A ratio to multiply anticipated * `harvest()` gas cost against. */ function setProfitFactor(uint256 _profitFactor) external onlyAuthorized { profitFactor = _profitFactor; emit UpdatedProfitFactor(_profitFactor); } /** * @notice * Sets how far the Strategy can go into loss without a harvest and report * being required. * * By default this is 0, meaning any losses would cause a harvest which * will subsequently report the loss to the Vault for tracking. (See * `harvestTrigger()` for more details.) * * This may only be called by governance or the strategist. * @param _debtThreshold How big of a loss this Strategy may carry without * being required to report to the Vault. */ function setDebtThreshold(uint256 _debtThreshold) external onlyAuthorized { debtThreshold = _debtThreshold; emit UpdatedDebtThreshold(_debtThreshold); } /** * Resolve governance address from Vault contract, used to make assertions * on protected functions in the Strategy. */ function governance() internal view returns (address) { return vault.governance(); } /** * @notice * Provide an accurate estimate for the total amount of assets * (principle + return) that this Strategy is currently managing, * denominated in terms of `want` tokens. * * This total should be "realizable" e.g. the total value that could * *actually* be obtained from this Strategy if it were to divest its * entire position based on current on-chain conditions. * @dev * Care must be taken in using this function, since it relies on external * systems, which could be manipulated by the attacker to give an inflated * (or reduced) value produced by this function, based on current on-chain * conditions (e.g. this function is possible to influence through * flashloan attacks, oracle manipulations, or other DeFi attack * mechanisms). * * It is up to governance to use this function to correctly order this * Strategy relative to its peers in the withdrawal queue to minimize * losses for the Vault based on sudden withdrawals. This value should be * higher than the total debt of the Strategy and higher than its expected * value to be "safe". * @return The estimated total assets in this Strategy. */ function estimatedTotalAssets() public virtual view returns (uint256); /* * @notice * Provide an indication of whether this strategy is currently "active" * in that it is managing an active position, or will manage a position in * the future. This should correlate to `harvest()` activity, so that Harvest * events can be tracked externally by indexing agents. * @return True if the strategy is actively managing a position. */ function isActive() public view returns (bool) { return vault.strategies(address(this)).debtRatio > 0 || estimatedTotalAssets() > 0; } /** * Perform any Strategy unwinding or other calls necessary to capture the * "free return" this Strategy has generated since the last time its core * position(s) were adjusted. Examples include unwrapping extra rewards. * This call is only used during "normal operation" of a Strategy, and * should be optimized to minimize losses as much as possible. * * This method returns any realized profits and/or realized losses * incurred, and should return the total amounts of profits/losses/debt * payments (in `want` tokens) for the Vault's accounting (e.g. * `want.balanceOf(this) >= _debtPayment + _profit - _loss`). * * `_debtOutstanding` will be 0 if the Strategy is not past the configured * debt limit, otherwise its value will be how far past the debt limit * the Strategy is. The Strategy's debt limit is configured in the Vault. * * NOTE: `_debtPayment` should be less than or equal to `_debtOutstanding`. * It is okay for it to be less than `_debtOutstanding`, as that * should only used as a guide for how much is left to pay back. * Payments should be made to minimize loss from slippage, debt, * withdrawal fees, etc. * * See `vault.debtOutstanding()`. */ function prepareReturn(uint256 _debtOutstanding) internal virtual returns ( uint256 _profit, uint256 _loss, uint256 _debtPayment ); /** * Perform any adjustments to the core position(s) of this Strategy given * what change the Vault made in the "investable capital" available to the * Strategy. Note that all "free capital" in the Strategy after the report * was made is available for reinvestment. Also note that this number * could be 0, and you should handle that scenario accordingly. * * See comments regarding `_debtOutstanding` on `prepareReturn()`. */ function adjustPosition(uint256 _debtOutstanding) internal virtual; /** * Liquidate up to `_amountNeeded` of `want` of this strategy's positions, * irregardless of slippage. Any excess will be re-invested with `adjustPosition()`. * This function should return the amount of `want` tokens made available by the * liquidation. If there is a difference between them, `_loss` indicates whether the * difference is due to a realized loss, or if there is some other sitution at play * (e.g. locked funds). This function is used during emergency exit instead of * `prepareReturn()` to liquidate all of the Strategy's positions back to the Vault. * * NOTE: The invariant `_amountFreed + _loss <= _amountNeeded` should always be maintained */ function liquidatePosition(uint256 _amountNeeded) internal virtual returns (uint256 _liquidatedAmount, uint256 _loss); /** * `Harvest()` calls this function after shares are created during * `vault.report()`. You can customize this function to any share * distribution mechanism you want. * * See `vault.report()` for further details. */ function distributeRewards() internal virtual { // Transfer 100% of newly-minted shares awarded to this contract to the rewards address. uint256 balance = vault.balanceOf(address(this)); if (balance > 0) { vault.transfer(rewards, balance); } } /** * @notice * Provide a signal to the keeper that `tend()` should be called. The * keeper will provide the estimated gas cost that they would pay to call * `tend()`, and this function should use that estimate to make a * determination if calling it is "worth it" for the keeper. This is not * the only consideration into issuing this trigger, for example if the * position would be negatively affected if `tend()` is not called * shortly, then this can return `true` even if the keeper might be * "at a loss" (keepers are always reimbursed by Yearn). * @dev * `callCost` must be priced in terms of `want`. * * This call and `harvestTrigger()` should never return `true` at the same * time. * @param callCost The keeper's estimated cast cost to call `tend()`. * @return `true` if `tend()` should be called, `false` otherwise. */ function tendTrigger(uint256 callCost) public virtual view returns (bool) { // We usually don't need tend, but if there are positions that need // active maintainence, overriding this function is how you would // signal for that. return false; } /** * @notice * Adjust the Strategy's position. The purpose of tending isn't to * realize gains, but to maximize yield by reinvesting any returns. * * See comments on `adjustPosition()`. * * This may only be called by governance, the strategist, or the keeper. */ function tend() external onlyKeepers { // Don't take profits with this call, but adjust for better gains adjustPosition(vault.debtOutstanding()); } /** * @notice * Provide a signal to the keeper that `harvest()` should be called. The * keeper will provide the estimated gas cost that they would pay to call * `harvest()`, and this function should use that estimate to make a * determination if calling it is "worth it" for the keeper. This is not * the only consideration into issuing this trigger, for example if the * position would be negatively affected if `harvest()` is not called * shortly, then this can return `true` even if the keeper might be "at a * loss" (keepers are always reimbursed by Yearn). * @dev * `callCost` must be priced in terms of `want`. * * This call and `tendTrigger` should never return `true` at the * same time. * * See `maxReportDelay`, `profitFactor`, `debtThreshold` to adjust the * strategist-controlled parameters that will influence whether this call * returns `true` or not. These parameters will be used in conjunction * with the parameters reported to the Vault (see `params`) to determine * if calling `harvest()` is merited. * * It is expected that an external system will check `harvestTrigger()`. * This could be a script run off a desktop or cloud bot (e.g. * https://github.com/iearn-finance/yearn-vaults/blob/master/scripts/keep.py), * or via an integration with the Keep3r network (e.g. * https://github.com/Macarse/GenericKeep3rV2/blob/master/contracts/keep3r/GenericKeep3rV2.sol). * @param callCost The keeper's estimated cast cost to call `harvest()`. * @return `true` if `harvest()` should be called, `false` otherwise. */ function harvestTrigger(uint256 callCost) public virtual view returns (bool) { StrategyParams memory params = vault.strategies(address(this)); // Should not trigger if Strategy is not activated if (params.activation == 0) return false; // Should trigger if hasn't been called in a while if (block.timestamp.sub(params.lastReport) >= maxReportDelay) return true; // If some amount is owed, pay it back // NOTE: Since debt is based on deposits, it makes sense to guard against large // changes to the value from triggering a harvest directly through user // behavior. This should ensure reasonable resistance to manipulation // from user-initiated withdrawals as the outstanding debt fluctuates. uint256 outstanding = vault.debtOutstanding(); if (outstanding > debtThreshold) return true; // Check for profits and losses uint256 total = estimatedTotalAssets(); // Trigger if we have a loss to report if (total.add(debtThreshold) < params.totalDebt) return true; uint256 profit = 0; if (total > params.totalDebt) profit = total.sub(params.totalDebt); // We've earned a profit! // Otherwise, only trigger if it "makes sense" economically (gas cost // is <N% of value moved) uint256 credit = vault.creditAvailable(); return (profitFactor.mul(callCost) < credit.add(profit)); } /** * @notice * Harvests the Strategy, recognizing any profits or losses and adjusting * the Strategy's position. * * In the rare case the Strategy is in emergency shutdown, this will exit * the Strategy's position. * * This may only be called by governance, the strategist, or the keeper. * @dev * When `harvest()` is called, the Strategy reports to the Vault (via * `vault.report()`), so in some cases `harvest()` must be called in order * to take in profits, to borrow newly available funds from the Vault, or * otherwise adjust its position. In other cases `harvest()` must be * called to report to the Vault on the Strategy's position, especially if * any losses have occurred. */ function harvest() external onlyKeepers { uint256 profit = 0; uint256 loss = 0; uint256 debtOutstanding = vault.debtOutstanding(); uint256 debtPayment = 0; if (emergencyExit) { // Free up as much capital as possible uint256 totalAssets = estimatedTotalAssets(); // NOTE: use the larger of total assets or debt outstanding to book losses properly (debtPayment, loss) = liquidatePosition(totalAssets > debtOutstanding ? totalAssets : debtOutstanding); // NOTE: take up any remainder here as profit if (debtPayment > debtOutstanding) { profit = debtPayment.sub(debtOutstanding); debtPayment = debtOutstanding; } } else { // Free up returns for Vault to pull (profit, loss, debtPayment) = prepareReturn(debtOutstanding); } // Allow Vault to take up to the "harvested" balance of this contract, // which is the amount it has earned since the last time it reported to // the Vault. debtOutstanding = vault.report(profit, loss, debtPayment); // Distribute any reward shares earned by the strategy on this report distributeRewards(); // Check if free returns are left, and re-invest them adjustPosition(debtOutstanding); emit Harvested(profit, loss, debtPayment, debtOutstanding); } /** * @notice * Withdraws `_amountNeeded` to `vault`. * * This may only be called by the Vault. * @param _amountNeeded How much `want` to withdraw. * @return _loss Any realized losses */ function withdraw(uint256 _amountNeeded) external returns (uint256 _loss) { require(msg.sender == address(vault), "!vault"); // Liquidate as much as possible to `want`, up to `_amount` uint256 amountFreed; (amountFreed, _loss) = liquidatePosition(_amountNeeded); // Send it directly back (NOTE: Using `msg.sender` saves some gas here) want.transfer(msg.sender, amountFreed); // NOTE: Reinvest anything leftover on next `tend`/`harvest` } /** * Do anything necessary to prepare this Strategy for migration, such as * transferring any reserve or LP tokens, CDPs, or other tokens or stores of * value. */ function prepareMigration(address _newStrategy) internal virtual; /** * @notice * Transfers all `want` from this Strategy to `_newStrategy`. * * This may only be called by governance or the Vault. * @dev * The new Strategy's Vault must be the same as this Strategy's Vault. * @param _newStrategy The Strategy to migrate to. */ function migrate(address _newStrategy) external { require(msg.sender == address(vault) || msg.sender == governance()); require(BaseStrategy(_newStrategy).vault() == vault); prepareMigration(_newStrategy); want.transfer(_newStrategy, want.balanceOf(address(this))); } /** * @notice * Activates emergency exit. Once activated, the Strategy will exit its * position upon the next harvest, depositing all funds into the Vault as * quickly as is reasonable given on-chain conditions. * * This may only be called by governance or the strategist. * @dev * See `vault.setEmergencyShutdown()` and `harvest()` for further details. */ function setEmergencyExit() external onlyAuthorized { emergencyExit = true; vault.revokeStrategy(); emit EmergencyExitEnabled(); } /** * Override this to add all tokens/tokenized positions this contract * manages on a *persistent* basis (e.g. not just for swapping back to * want ephemerally). * * NOTE: Do *not* include `want`, already included in `sweep` below. * * Example: * * function protectedTokens() internal override view returns (address[] memory) { * address[] memory protected = new address[](3); * protected[0] = tokenA; * protected[1] = tokenB; * protected[2] = tokenC; * return protected; * } */ function protectedTokens() internal virtual view returns (address[] memory); /** * @notice * Removes tokens from this Strategy that are not the type of tokens * managed by this Strategy. This may be used in case of accidentally * sending the wrong kind of token to this Strategy. * * Tokens will be sent to `governance()`. * * This will fail if an attempt is made to sweep `want`, or any tokens * that are protected by this Strategy. * * This may only be called by governance. * @dev * Implement `protectedTokens()` to specify any additional tokens that * should be protected from sweeping in addition to `want`. * @param _token The token to transfer out of this vault. */ function sweep(address _token) external onlyGovernance { require(_token != address(want), "!want"); require(_token != address(vault), "!shares"); address[] memory _protectedTokens = protectedTokens(); for (uint256 i; i < _protectedTokens.length; i++) require(_token != _protectedTokens[i], "!protected"); IERC20(_token).transfer(governance(), IERC20(_token).balanceOf(address(this))); } } // File: Strategy.sol // Import interfaces for many popular DeFi projects, or add your own! //import "../interfaces/<protocol>/<Interface>.sol"; contract Strategy is BaseStrategy { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; address private uniswapRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address private sushiswapRouter = 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F; address public ldoRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address[] public ldoPath; address public crvRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address[] public crvPath; Gauge public LiquidityGaugeV2 = Gauge(address(0x182B723a58739a9c974cFDB385ceaDb237453c28)); ICurveFi public StableSwapSTETH = ICurveFi(address(0xDC24316b9AE028F1497c275EB9192a3Ea0f67022)); // IMinter public CrvMinter = IMinter(address(0xd061D61a4d941c39E5453435B6345Dc261C2fcE0)); address public constant weth = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); ISteth public stETH = ISteth(address(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84)); IERC20 public LDO = IERC20(address(0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32)); ICrvV3 public CRV = ICrvV3(address(0xD533a949740bb3306d119CC777fa900bA034cd52)); constructor(address _vault) public BaseStrategy(_vault) { // You can set these parameters on deployment to whatever you want // maxReportDelay = 6300; // profitFactor = 100; // debtThreshold = 0; want.safeApprove(address(LiquidityGaugeV2), uint256(-1)); stETH.approve(address(StableSwapSTETH), uint256(-1)); LDO.safeApprove(ldoRouter, uint256(-1)); CRV.approve(crvRouter, uint256(-1)); ldoPath = new address[](2); ldoPath[0] = address(LDO); ldoPath[1] = weth; crvPath = new address[](2); crvPath[0] = address(CRV); crvPath[1] = weth; } //we get eth receive() external payable {} // ******** OVERRIDE THESE METHODS FROM BASE CONTRACT ************ function setLDORouter(bool isUniswap, address[] calldata _path) public onlyGovernance { if(isUniswap){ ldoRouter = uniswapRouter; }else{ ldoRouter = sushiswapRouter; } ldoPath = _path; LDO.safeApprove(ldoRouter, uint256(-1)); } function setCRVRouter(bool isUniswap, address[] calldata _path) public onlyGovernance { if(isUniswap){ crvRouter = uniswapRouter; }else{ crvRouter = sushiswapRouter; } crvPath = _path; CRV.approve(crvRouter, uint256(-1)); } function name() external override view returns (string memory) { // Add your own name here, suggestion e.g. "StrategyCreamYFI" return "StrategystETHCurve"; } function estimatedTotalAssets() public override view returns (uint256) { return LiquidityGaugeV2.balanceOf(address(this)); } function prepareReturn(uint256 _debtOutstanding) internal override returns ( uint256 _profit, uint256 _loss, uint256 _debtPayment ) { // TODO: Do stuff here to free up any returns back into `want` // NOTE: Return `_profit` which is value generated by all positions, priced in `want` // NOTE: Should try to free up at least `_debtOutstanding` of underlying position uint256 guageTokens = LiquidityGaugeV2.balanceOf(address(this)); if(guageTokens > 0){ LiquidityGaugeV2.claim_rewards(); IMinter(CRV.minter()).mint(address(LiquidityGaugeV2)); uint256 ldo_balance = LDO.balanceOf(address(this)); if(ldo_balance > 0){ _sell(address(LDO), ldo_balance); } uint256 crv_balance = CRV.balanceOf(address(this)); if(crv_balance > 0){ _sell(address(CRV), crv_balance); } uint256 balance = address(this).balance; uint256 halfBal = balance.div(2); uint256 out = StableSwapSTETH.get_dy(0,1,halfBal); if(out < halfBal){ stETH.submit{value: halfBal}(strategist); } balance = address(this).balance; uint256 balance2 = stETH.balanceOf(address(this)); StableSwapSTETH.add_liquidity{value: balance}([balance, balance2], 0); _profit = want.balanceOf(address(this)); } if(_debtOutstanding > 0){ if(_debtOutstanding > _profit){ uint256 stakedBal = LiquidityGaugeV2.balanceOf(address(this)); LiquidityGaugeV2.withdraw(Math.min(stakedBal,_debtOutstanding - _profit)); } _debtPayment = Math.min(_debtOutstanding, want.balanceOf(address(this)).sub(_profit)); } } function adjustPosition(uint256 _debtOutstanding) internal override { uint256 _toInvest = want.balanceOf(address(this)); LiquidityGaugeV2.deposit(_toInvest); } function liquidatePosition(uint256 _amountNeeded) internal override returns (uint256 _liquidatedAmount, uint256 _loss) { uint256 wantBal = want.balanceOf(address(this)); uint256 stakedBal = LiquidityGaugeV2.balanceOf(address(this)); if(_amountNeeded > wantBal){ LiquidityGaugeV2.withdraw(Math.min(stakedBal, _amountNeeded - wantBal)); } _liquidatedAmount = Math.min(_amountNeeded, want.balanceOf(address(this))); } // NOTE: Can override `tendTrigger` and `harvestTrigger` if necessary function prepareMigration(address _newStrategy) internal override { prepareReturn(LiquidityGaugeV2.balanceOf(address(this))); } //sell all function function _sell(address currency, uint256 amount) internal { if(currency == address(LDO)){ IUniswapV2Router02(ldoRouter).swapExactTokensForETH(amount, uint256(0), ldoPath, address(this), now); } else if(currency == address(CRV)){ IUniswapV2Router02(crvRouter).swapExactTokensForETH(amount, uint256(0), crvPath, address(this), now); }else{ require(false, "BAD SELL"); } } // Override this to add all tokens/tokenized positions this contract manages // on a *persistent* basis (e.g. not just for swapping back to want ephemerally) // NOTE: Do *not* include `want`, already included in `sweep` below // // Example: // // function protectedTokens() internal override view returns (address[] memory) { // address[] memory protected = new address[](3); // protected[0] = tokenA; // protected[1] = tokenB; // protected[2] = tokenC; // return protected; // } function protectedTokens() internal override view returns (address[] memory) { address[] memory protected = new address[](1); protected[0] = address(LiquidityGaugeV2); return protected; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"EmergencyExitEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"profit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loss","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"debtPayment","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"debtOutstanding","type":"uint256"}],"name":"Harvested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"debtThreshold","type":"uint256"}],"name":"UpdatedDebtThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newKeeper","type":"address"}],"name":"UpdatedKeeper","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"profitFactor","type":"uint256"}],"name":"UpdatedProfitFactor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"delay","type":"uint256"}],"name":"UpdatedReportDelay","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"rewards","type":"address"}],"name":"UpdatedRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newStrategist","type":"address"}],"name":"UpdatedStrategist","type":"event"},{"inputs":[],"name":"CRV","outputs":[{"internalType":"contract ICrvV3","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LDO","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LiquidityGaugeV2","outputs":[{"internalType":"contract Gauge","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"StableSwapSTETH","outputs":[{"internalType":"contract ICurveFi","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"apiVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"crvPath","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crvRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debtThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delegatedAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyExit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"estimatedTotalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"callCost","type":"uint256"}],"name":"harvestTrigger","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keeper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ldoPath","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ldoRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxReportDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newStrategy","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"profitFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isUniswap","type":"bool"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"setCRVRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_debtThreshold","type":"uint256"}],"name":"setDebtThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setEmergencyExit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_keeper","type":"address"}],"name":"setKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isUniswap","type":"bool"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"setLDORouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_delay","type":"uint256"}],"name":"setMaxReportDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_profitFactor","type":"uint256"}],"name":"setProfitFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewards","type":"address"}],"name":"setRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategist","type":"address"}],"name":"setStrategist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stETH","outputs":[{"internalType":"contract ISteth","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"strategist","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tend","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"callCost","type":"uint256"}],"name":"tendTrigger","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract VaultAPI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"want","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountNeeded","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"_loss","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052620151806005556064600655600060075560088054747a250d5630b4cf539739df2c5dacb4c659f2488d00610100600160a81b0319909116179055600980546001600160a01b031990811673d9e1ce17f2641f24ae83637ab66a2cca9c378b9f17909155600a80548216737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155600c805483169091179055600e8054821673182b723a58739a9c974cfdb385ceadb237453c28179055600f8054821673dc24316b9ae028f1497c275eb9192a3ea0f6702217905560108054821673ae7ab96520de3a18e5e111b5eaab095312d7fe84179055601180548216735a98fcbea516cf06857215779fd812ca3bef1b321790556012805490911673d533a949740bb3306d119cc777fa900ba034cd521790553480156200013857600080fd5b5060405162003df038038062003df08339810160408190526200015b9162000941565b600080546001600160a01b0319166001600160a01b03838116919091179182905560408051637e062a3560e11b8152905184939092169163fc0c546a91600480820192602092909190829003018186803b158015620001b957600080fd5b505afa158015620001ce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f4919062000941565b600480546001600160a01b0319166001600160a01b039283161780825560405163095ea7b360e01b815292169163095ea7b391620002399185916000199101620009e4565b602060405180830381600087803b1580156200025457600080fd5b505af115801562000269573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200028f919062000971565b505060018054336001600160a01b0319918216811790925560028054821683179055600380549091169091179055600e54600454620002ea916001600160a01b039182169116600019620005de602090811b6200196a17901c565b601054600f5460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392620003249291169060001990600401620009e4565b602060405180830381600087803b1580156200033f57600080fd5b505af115801562000354573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200037a919062000971565b50600a54601154620003a8916001600160a01b039182169116600019620005de602090811b6200196a17901c565b601254600c5460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392620003e29291169060001990600401620009e4565b602060405180830381600087803b158015620003fd57600080fd5b505af115801562000412573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000438919062000971565b506040805160028082526060820183529091602083019080368337505081516200046a92600b925060200190620008b6565b50601154600b80546001600160a01b03909216916000906200048857fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2600b600181548110620004da57fe5b600091825260209091200180546001600160a01b03929092166001600160a01b03199092169190911790556040805160028082526060820190925290816020016020820280368337505081516200053992600d925060200190620008b6565b50601254600d80546001600160a01b03909216916000906200055757fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2600d600181548110620005a957fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505062000b43565b8015806200066d5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e90620006179030908690600401620009ca565b60206040518083038186803b1580156200063057600080fd5b505afa15801562000645573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200066b919062000993565b155b620006955760405162461bcd60e51b81526004016200068c9062000ab3565b60405180910390fd5b620006f08363095ea7b360e01b8484604051602401620006b7929190620009e4565b60408051808303601f190181529190526020810180516001600160e01b0319939093166001600160e01b0393841617905290620006f516565b505050565b606062000751826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166200079160201b62001a64179092919060201c565b805190915015620006f0578080602001905181019062000772919062000971565b620006f05760405162461bcd60e51b81526004016200068c9062000a69565b6060620007a28484600085620007aa565b949350505050565b6060620007b7856200087c565b620007d65760405162461bcd60e51b81526004016200068c9062000a32565b60006060866001600160a01b03168587604051620007f59190620009ac565b60006040518083038185875af1925050503d806000811462000834576040519150601f19603f3d011682016040523d82523d6000602084013e62000839565b606091505b509150915081156200084f579150620007a29050565b805115620008605780518082602001fd5b8360405162461bcd60e51b81526004016200068c9190620009fd565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590620007a2575050151592915050565b8280548282559060005260206000209081019282156200090e579160200282015b828111156200090e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620008d7565b506200091c92915062000920565b5090565b5b808211156200091c5780546001600160a01b031916815560010162000921565b60006020828403121562000953578081fd5b81516001600160a01b03811681146200096a578182fd5b9392505050565b60006020828403121562000983578081fd5b815180151581146200096a578182fd5b600060208284031215620009a5578081fd5b5051919050565b60008251620009c081846020870162000b10565b9190910192915050565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b600060208252825180602084015262000a1e81604085016020870162000b10565b601f01601f19169190910160400192915050565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000606082015260800190565b60005b8381101562000b2d57818101518382015260200162000b13565b8381111562000b3d576000848401525b50505050565b61329d8062000b536000396000f3fe60806040526004361061023f5760003560e01c8063801492d71161012e578063c1fe3e48116100ab578063ed882c2b1161006f578063ed882c2b146105f8578063efbb5cb014610618578063f017c92f1461062d578063fbfa77cf1461064d578063fcf2d0ad1461066257610246565b8063c1fe3e481461056e578063c7b9d53014610583578063ce5494bb146105a3578063d88bba11146105c3578063ec38a862146105d857610246565b80639ec5a894116100f25780639ec5a894146104ef578063a488ca2914610504578063a639841114610524578063aced166114610539578063ad4095001461054e57610246565b8063801492d71461047b5780638cdfe166146104905780638e6350e2146104a557806391397ab4146104ba578063945c9142146104da57610246565b806328b7ccf7116101bc5780634641257d116101805780634641257d146103fc5780635641ec0314610411578063650d188014610426578063748747e6146104465780637f1735591461046657610246565b806328b7ccf71461037d5780632c4f93f9146103925780632e1a7d4d146103b25780633fc8cef3146103d2578063440368a3146103e757610246565b80631ed042d6116102035780631ed042d6146102fa5780631f1fcd511461031c5780631fe4a6861461033157806322f3e2d414610346578063258294101461036857610246565b806301681a621461024b57806306fdde031461026d5780630b201eb1146102985780630f969b87146102b85780631d12f28b146102d857610246565b3661024657005b600080fd5b34801561025757600080fd5b5061026b610266366004612be1565b610677565b005b34801561027957600080fd5b50610282610881565b60405161028f9190612eb2565b60405180910390f35b3480156102a457600080fd5b5061026b6102b3366004612cca565b6108ad565b3480156102c457600080fd5b5061026b6102d3366004612dbe565b6109d8565b3480156102e457600080fd5b506102ed610a65565b60405161028f9190613124565b34801561030657600080fd5b5061030f610a6b565b60405161028f9190612e0a565b34801561032857600080fd5b5061030f610a7a565b34801561033d57600080fd5b5061030f610a89565b34801561035257600080fd5b5061035b610a98565b60405161028f9190612e89565b34801561037457600080fd5b50610282610b36565b34801561038957600080fd5b506102ed610b55565b34801561039e57600080fd5b5061030f6103ad366004612dbe565b610b5b565b3480156103be57600080fd5b506102ed6103cd366004612dbe565b610b82565b3480156103de57600080fd5b5061030f610c48565b3480156103f357600080fd5b5061026b610c60565b34801561040857600080fd5b5061026b610d47565b34801561041d57600080fd5b5061035b610f76565b34801561043257600080fd5b5061035b610441366004612dbe565b610f7f565b34801561045257600080fd5b5061026b610461366004612be1565b610f87565b34801561047257600080fd5b5061030f611032565b34801561048757600080fd5b5061030f611041565b34801561049c57600080fd5b506102ed611050565b3480156104b157600080fd5b506102ed611056565b3480156104c657600080fd5b5061026b6104d5366004612dbe565b61105b565b3480156104e657600080fd5b5061030f6110dd565b3480156104fb57600080fd5b5061030f6110ec565b34801561051057600080fd5b5061026b61051f366004612cca565b6110fb565b34801561053057600080fd5b5061030f6111b5565b34801561054557600080fd5b5061030f6111c4565b34801561055a57600080fd5b5061030f610569366004612dbe565b6111d3565b34801561057a57600080fd5b5061030f6111e0565b34801561058f57600080fd5b5061026b61059e366004612be1565b6111ef565b3480156105af57600080fd5b5061026b6105be366004612be1565b61129a565b3480156105cf57600080fd5b5061030f61147a565b3480156105e457600080fd5b5061026b6105f3366004612be1565b611489565b34801561060457600080fd5b5061035b610613366004612dbe565b611511565b34801561062457600080fd5b506102ed61177a565b34801561063957600080fd5b5061026b610648366004612dbe565b6117fb565b34801561065957600080fd5b5061030f61187d565b34801561066e57600080fd5b5061026b61188c565b61067f611a7b565b6001600160a01b0316336001600160a01b0316146106b85760405162461bcd60e51b81526004016106af90613019565b60405180910390fd5b6004546001600160a01b03828116911614156106e65760405162461bcd60e51b81526004016106af90612f0a565b6000546001600160a01b03828116911614156107145760405162461bcd60e51b81526004016106af90612fc1565b606061071e611b02565b905060005b81518110156107795781818151811061073857fe5b60200260200101516001600160a01b0316836001600160a01b031614156107715760405162461bcd60e51b81526004016106af90613088565b600101610723565b50816001600160a01b031663a9059cbb610791611a7b565b6040516370a0823160e01b81526001600160a01b038616906370a08231906107bd903090600401612e0a565b60206040518083038186803b1580156107d557600080fd5b505afa1580156107e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080d9190612dd6565b6040518363ffffffff1660e01b815260040161082a929190612e1e565b602060405180830381600087803b15801561084457600080fd5b505af1158015610858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087c9190612cae565b505050565b60408051808201909152601281527153747261746567797374455448437572766560701b602082015290565b6108b5611a7b565b6001600160a01b0316336001600160a01b0316146108e55760405162461bcd60e51b81526004016106af90613019565b821561091857600854600c80546101009092046001600160a01b03166001600160a01b031990921691909117905561093b565b600954600c80546001600160a01b0319166001600160a01b039092169190911790555b610947600d8383612b1a565b50601254600c5460405163095ea7b360e01b81526001600160a01b039283169263095ea7b3926109809291169060001990600401612e1e565b602060405180830381600087803b15801561099a57600080fd5b505af11580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d29190612cae565b50505050565b6001546001600160a01b0316331480610a0957506109f4611a7b565b6001600160a01b0316336001600160a01b0316145b610a255760405162461bcd60e51b81526004016106af90613019565b60078190556040517fa68ba126373d04c004c5748c300c9fca12bd444b3d4332e261f3bd2bac4a860090610a5a908390613124565b60405180910390a150565b60075481565b600e546001600160a01b031681565b6004546001600160a01b031681565b6001546001600160a01b031681565b600080546040516339ebf82360e01b815282916001600160a01b0316906339ebf82390610ac9903090600401612e0a565b6101006040518083038186803b158015610ae257600080fd5b505afa158015610af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1a9190612d4c565b604001511180610b3157506000610b2f61177a565b115b905090565b6040805180820190915260058152640302e332e360dc1b602082015290565b60055481565b600b8181548110610b6857fe5b6000918252602090912001546001600160a01b0316905081565b600080546001600160a01b03163314610bad5760405162461bcd60e51b81526004016106af90612fa1565b6000610bb883611b5e565b6004805460405163a9059cbb60e01b81529295509293506001600160a01b039092169163a9059cbb91610bef913391869101612e1e565b602060405180830381600087803b158015610c0957600080fd5b505af1158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c419190612cae565b5050919050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6003546001600160a01b0316331480610c8357506001546001600160a01b031633145b80610ca65750610c91611a7b565b6001600160a01b0316336001600160a01b0316145b610cc25760405162461bcd60e51b81526004016106af90613019565b6000546040805163bf3759b560e01b81529051610d45926001600160a01b03169163bf3759b5916004808301926020929190829003018186803b158015610d0857600080fd5b505afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d409190612dd6565b611d71565b565b6003546001600160a01b0316331480610d6a57506001546001600160a01b031633145b80610d8d5750610d78611a7b565b6001600160a01b0316336001600160a01b0316145b610da95760405162461bcd60e51b81526004016106af90613019565b60008060008060009054906101000a90046001600160a01b03166001600160a01b031663bf3759b56040518163ffffffff1660e01b815260040160206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190612dd6565b60085490915060009060ff1615610e89576000610e4e61177a565b9050610e67838211610e605783610e62565b815b611b5e565b9450915082821115610e8357610e7d8284611e5a565b94508291505b50610e9a565b610e9282611ea5565b919550935090505b6000546040516328766ebf60e21b81526001600160a01b039091169063a1d9bafc90610ece908790879086906004016131a0565b602060405180830381600087803b158015610ee857600080fd5b505af1158015610efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f209190612dd6565b9150610f2a612617565b610f3382611d71565b7f4c0f499ffe6befa0ca7c826b0916cf87bea98de658013e76938489368d60d50984848385604051610f6894939291906131b6565b60405180910390a150505050565b60085460ff1681565b60005b919050565b6001546001600160a01b0316331480610fb85750610fa3611a7b565b6001600160a01b0316336001600160a01b0316145b610fd45760405162461bcd60e51b81526004016106af90613019565b6001600160a01b038116610fe757600080fd5b600380546001600160a01b0319166001600160a01b0383161790556040517f2f202ddb4a2e345f6323ed90f8fc8559d770a7abbbeee84dde8aca3351fe715490610a5a908390612e0a565b600c546001600160a01b031681565b600f546001600160a01b031681565b60065481565b600090565b6001546001600160a01b031633148061108c5750611077611a7b565b6001600160a01b0316336001600160a01b0316145b6110a85760405162461bcd60e51b81526004016106af90613019565b60068190556040517fd94596337df4c2f0f44d30a7fc5db1c7bb60d9aca4185ed77c6fd96eb45ec29890610a5a908390613124565b6012546001600160a01b031681565b6002546001600160a01b031681565b611103611a7b565b6001600160a01b0316336001600160a01b0316146111335760405162461bcd60e51b81526004016106af90613019565b821561116657600854600a80546101009092046001600160a01b03166001600160a01b0319909216919091179055611189565b600954600a80546001600160a01b0319166001600160a01b039092169190911790555b611195600b8383612b1a565b50600a5460115461087c916001600160a01b03918216911660001961196a565b600a546001600160a01b031681565b6003546001600160a01b031681565b600d8181548110610b6857fe5b6010546001600160a01b031681565b6001546001600160a01b0316331480611220575061120b611a7b565b6001600160a01b0316336001600160a01b0316145b61123c5760405162461bcd60e51b81526004016106af90613019565b6001600160a01b03811661124f57600080fd5b600180546001600160a01b0319166001600160a01b0383161790556040517f352ececae6d7d1e6d26bcf2c549dfd55be1637e9b22dc0cf3b71ddb36097a6b490610a5a908390612e0a565b6000546001600160a01b03163314806112cb57506112b6611a7b565b6001600160a01b0316336001600160a01b0316145b6112d457600080fd5b60008054906101000a90046001600160a01b03166001600160a01b0316816001600160a01b031663fbfa77cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561132a57600080fd5b505afa15801561133e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113629190612bfd565b6001600160a01b03161461137557600080fd5b61137e816126d9565b600480546040516370a0823160e01b81526001600160a01b039091169163a9059cbb91849184916370a08231916113b791309101612e0a565b60206040518083038186803b1580156113cf57600080fd5b505afa1580156113e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114079190612dd6565b6040518363ffffffff1660e01b8152600401611424929190612e1e565b602060405180830381600087803b15801561143e57600080fd5b505af1158015611452573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114769190612cae565b5050565b6011546001600160a01b031681565b6001546001600160a01b031633146114b35760405162461bcd60e51b81526004016106af90612ee5565b6001600160a01b0381166114c657600080fd5b600280546001600160a01b0319166001600160a01b0383161790556040517fafbb66abf8f3b719799940473a4052a3717cdd8e40fb6c8a3faadab316b1a06990610a5a908390612e0a565b600061151b612b7d565b6000546040516339ebf82360e01b81526001600160a01b03909116906339ebf8239061154b903090600401612e0a565b6101006040518083038186803b15801561156457600080fd5b505afa158015611578573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159c9190612d4c565b90508060200151600014156115b5576000915050610f82565b60055460808201516115c8904290611e5a565b106115d7576001915050610f82565b60008060009054906101000a90046001600160a01b03166001600160a01b031663bf3759b56040518163ffffffff1660e01b815260040160206040518083038186803b15801561162657600080fd5b505afa15801561163a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165e9190612dd6565b905060075481111561167557600192505050610f82565b600061167f61177a565b90508260a0015161169b6007548361276090919063ffffffff16565b10156116ad5760019350505050610f82565b60008360a001518211156116ce5760a08401516116cb908390611e5a565b90505b60008060009054906101000a90046001600160a01b03166001600160a01b031663112c1f9b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561171d57600080fd5b505afa158015611731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117559190612dd6565b90506117618183612760565b60065461176e9089612785565b10979650505050505050565b600e546040516370a0823160e01b81526000916001600160a01b0316906370a08231906117ab903090600401612e0a565b60206040518083038186803b1580156117c357600080fd5b505afa1580156117d7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b319190612dd6565b6001546001600160a01b031633148061182c5750611817611a7b565b6001600160a01b0316336001600160a01b0316145b6118485760405162461bcd60e51b81526004016106af90613019565b60058190556040517f4aaf232568bff365c53cad69bdb6e83014e79df80216ceba8ee01769723dfd6890610a5a908390613124565b6000546001600160a01b031681565b6001546001600160a01b03163314806118bd57506118a8611a7b565b6001600160a01b0316336001600160a01b0316145b6118d95760405162461bcd60e51b81526004016106af90613019565b6008805460ff19166001179055600080546040805163507257cd60e11b815290516001600160a01b039092169263a0e4af9a9260048084019382900301818387803b15801561192757600080fd5b505af115801561193b573d6000803e3d6000fd5b50506040517f97e963041e952738788b9d4871d854d282065b8f90a464928d6528f2e9a4fd0b925060009150a1565b8015806119f25750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e906119a09030908690600401612e37565b60206040518083038186803b1580156119b857600080fd5b505afa1580156119cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f09190612dd6565b155b611a0e5760405162461bcd60e51b81526004016106af906130ce565b61087c8363095ea7b360e01b8484604051602401611a2d929190612e1e565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526127bf565b6060611a73848460008561284e565b949350505050565b60008060009054906101000a90046001600160a01b03166001600160a01b0316635aa6e6756040518163ffffffff1660e01b815260040160206040518083038186803b158015611aca57600080fd5b505afa158015611ade573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b319190612bfd565b604080516001808252818301909252606091829190602080830190803683375050600e5482519293506001600160a01b031691839150600090611b4157fe5b6001600160a01b0390921660209283029190910190910152905090565b600480546040516370a0823160e01b8152600092839283926001600160a01b03909116916370a0823191611b9491309101612e0a565b60206040518083038186803b158015611bac57600080fd5b505afa158015611bc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be49190612dd6565b600e546040516370a0823160e01b81529192506000916001600160a01b03909116906370a0823190611c1a903090600401612e0a565b60206040518083038186803b158015611c3257600080fd5b505afa158015611c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6a9190612dd6565b905081851115611ce057600e546001600160a01b0316632e1a7d4d611c9183858903612912565b6040518263ffffffff1660e01b8152600401611cad9190613124565b600060405180830381600087803b158015611cc757600080fd5b505af1158015611cdb573d6000803e3d6000fd5b505050505b600480546040516370a0823160e01b8152611d689288926001600160a01b0316916370a0823191611d1391309101612e0a565b60206040518083038186803b158015611d2b57600080fd5b505afa158015611d3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d639190612dd6565b612912565b93505050915091565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191611da391309101612e0a565b60206040518083038186803b158015611dbb57600080fd5b505afa158015611dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df39190612dd6565b600e5460405163b6b55f2560e01b81529192506001600160a01b03169063b6b55f2590611e24908490600401613124565b600060405180830381600087803b158015611e3e57600080fd5b505af1158015611e52573d6000803e3d6000fd5b505050505050565b6000611e9c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612928565b90505b92915050565b600e546040516370a0823160e01b81526000918291829182916001600160a01b03909116906370a0823190611ede903090600401612e0a565b60206040518083038186803b158015611ef657600080fd5b505afa158015611f0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2e9190612dd6565b9050801561247c57600e60009054906101000a90046001600160a01b03166001600160a01b031663e6f1daf26040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611f8657600080fd5b505af1158015611f9a573d6000803e3d6000fd5b50505050601260009054906101000a90046001600160a01b03166001600160a01b031663075461726040518163ffffffff1660e01b815260040160206040518083038186803b158015611fec57600080fd5b505afa158015612000573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120249190612bfd565b600e546040516335313c2160e11b81526001600160a01b0392831692636a6278429261205592911690600401612e0a565b600060405180830381600087803b15801561206f57600080fd5b505af1158015612083573d6000803e3d6000fd5b50506011546040516370a0823160e01b8152600093506001600160a01b0390911691506370a08231906120ba903090600401612e0a565b60206040518083038186803b1580156120d257600080fd5b505afa1580156120e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210a9190612dd6565b9050801561212857601154612128906001600160a01b031682612954565b6012546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612159903090600401612e0a565b60206040518083038186803b15801561217157600080fd5b505afa158015612185573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121a99190612dd6565b905080156121c7576012546121c7906001600160a01b031682612954565b4760006121d5826002612a68565b600f54604051635e0d443f60e01b81529192506000916001600160a01b0390911690635e0d443f906122109084906001908790600401612e94565b60206040518083038186803b15801561222857600080fd5b505afa15801561223c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122609190612dd6565b9050818110156122f55760105460015460405163a1903eab60e01b81526001600160a01b039283169263a1903eab9286926122a19290911690600401612e0a565b6020604051808303818588803b1580156122ba57600080fd5b505af11580156122ce573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906122f39190612dd6565b505b6010546040516370a0823160e01b81524794506000916001600160a01b0316906370a0823190612329903090600401612e0a565b60206040518083038186803b15801561234157600080fd5b505afa158015612355573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123799190612dd6565b600f54604080518082018252878152602081018490529051630b4c7e4d60e01b81529293506001600160a01b0390911691630b4c7e4d9187916123c29190600090600401612e51565b6000604051808303818588803b1580156123db57600080fd5b505af11580156123ef573d6000803e3d6000fd5b5050600480546040516370a0823160e01b81526001600160a01b0390911694506370a0823193506124239250309101612e0a565b60206040518083038186803b15801561243b57600080fd5b505afa15801561244f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124739190612dd6565b99505050505050505b841561260f578385111561257b57600e546040516370a0823160e01b81526000916001600160a01b0316906370a08231906124bb903090600401612e0a565b60206040518083038186803b1580156124d357600080fd5b505afa1580156124e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250b9190612dd6565b600e549091506001600160a01b0316632e1a7d4d61252b83888a03612912565b6040518263ffffffff1660e01b81526004016125479190613124565b600060405180830381600087803b15801561256157600080fd5b505af1158015612575573d6000803e3d6000fd5b50505050505b600480546040516370a0823160e01b815261260c928892611d639289926001600160a01b03909216916370a08231916125b691309101612e0a565b60206040518083038186803b1580156125ce57600080fd5b505afa1580156125e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126069190612dd6565b90611e5a565b91505b509193909250565b600080546040516370a0823160e01b81526001600160a01b03909116906370a0823190612648903090600401612e0a565b60206040518083038186803b15801561266057600080fd5b505afa158015612674573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126989190612dd6565b905080156126d65760005460025460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92611424929116908590600401612e1e565b50565b600e546040516370a0823160e01b81526109d2916001600160a01b0316906370a082319061270b903090600401612e0a565b60206040518083038186803b15801561272357600080fd5b505afa158015612737573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061275b9190612dd6565b611ea5565b600082820183811015611e9c5760405162461bcd60e51b81526004016106af90612f29565b60008261279457506000611e9f565b828202828482816127a157fe5b0414611e9c5760405162461bcd60e51b81526004016106af90612f60565b6060612814826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a649092919063ffffffff16565b80519091501561087c57808060200190518101906128329190612cae565b61087c5760405162461bcd60e51b81526004016106af9061303e565b606061285985612aaa565b6128755760405162461bcd60e51b81526004016106af90612fe2565b60006060866001600160a01b031685876040516128929190612dee565b60006040518083038185875af1925050503d80600081146128cf576040519150601f19603f3d011682016040523d82523d6000602084013e6128d4565b606091505b509150915081156128e8579150611a739050565b8051156128f85780518082602001fd5b8360405162461bcd60e51b81526004016106af9190612eb2565b60008183106129215781611e9c565b5090919050565b6000818484111561294c5760405162461bcd60e51b81526004016106af9190612eb2565b505050900390565b6011546001600160a01b0383811691161415612a0057600a546040516318cbafe560e01b81526001600160a01b03909116906318cbafe5906129a4908490600090600b903090429060040161312d565b600060405180830381600087803b1580156129be57600080fd5b505af11580156129d2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526129fa9190810190612c19565b50611476565b6012546001600160a01b0383811691161415612a5057600c546040516318cbafe560e01b81526001600160a01b03909116906318cbafe5906129a4908490600090600d903090429060040161312d565b60405162461bcd60e51b81526004016106af906130ac565b6000611e9c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ae3565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611a73575050151592915050565b60008183612b045760405162461bcd60e51b81526004016106af9190612eb2565b506000838581612b1057fe5b0495945050505050565b828054828255906000526020600020908101928215612b6d579160200282015b82811115612b6d5781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190612b3a565b50612b79929150612bc2565b5090565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b5b80821115612b795780546001600160a01b0319168155600101612bc3565b600060208284031215612bf2578081fd5b8135611e9c81613244565b600060208284031215612c0e578081fd5b8151611e9c81613244565b60006020808385031215612c2b578182fd5b825167ffffffffffffffff811115612c41578283fd5b8301601f81018513612c51578283fd5b8051612c64612c5f826131f8565b6131d1565b8181528381019083850185840285018601891015612c80578687fd5b8694505b83851015612ca2578051835260019490940193918501918501612c84565b50979650505050505050565b600060208284031215612cbf578081fd5b8151611e9c81613259565b600080600060408486031215612cde578182fd5b8335612ce981613259565b9250602084013567ffffffffffffffff80821115612d05578384fd5b818601915086601f830112612d18578384fd5b813581811115612d26578485fd5b8760208083028501011115612d39578485fd5b6020830194508093505050509250925092565b6000610100808385031215612d5f578182fd5b612d68816131d1565b9050825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201528091505092915050565b600060208284031215612dcf578081fd5b5035919050565b600060208284031215612de7578081fd5b5051919050565b60008251612e00818460208701613218565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b60608101818460005b6002811015612e79578151835260209283019290910190600101612e5a565b5050508260408301529392505050565b901515815260200190565b600f93840b81529190920b6020820152604081019190915260600190565b6000602082528251806020840152612ed1816040850160208701613218565b601f01601f19169190910160400192915050565b6020808252600b908201526a085cdd1c985d1959da5cdd60aa1b604082015260600190565b602080825260059082015264085dd85b9d60da1b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b6020808252600790820152662173686172657360c81b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252600b908201526a08585d5d1a1bdc9a5e995960aa1b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252600a9082015269085c1c9bdd1958dd195960b21b604082015260600190565b6020808252600890820152671090510814d1531360c21b604082015260600190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b90815260200190565b600060a082018783526020878185015260a0604085015281875480845260c0860191508885528285209350845b8181101561317f5784546001600160a01b03168352600194850194928401920161315a565b50506001600160a01b03969096166060850152505050608001529392505050565b9283526020830191909152604082015260600190565b93845260208401929092526040830152606082015260800190565b60405181810167ffffffffffffffff811182821017156131f057600080fd5b604052919050565b600067ffffffffffffffff82111561320e578081fd5b5060209081020190565b60005b8381101561323357818101518382015260200161321b565b838111156109d25750506000910152565b6001600160a01b03811681146126d657600080fd5b80151581146126d657600080fdfea26469706673582212209f0ac8bf6913916506f1d06f98c61ff52f2aa75363bfde34cfa911df59b2dc9f64736f6c634300060c0033000000000000000000000000dcd90c7f6324cfa40d7169ef80b12031770b4325
Deployed Bytecode
0x60806040526004361061023f5760003560e01c8063801492d71161012e578063c1fe3e48116100ab578063ed882c2b1161006f578063ed882c2b146105f8578063efbb5cb014610618578063f017c92f1461062d578063fbfa77cf1461064d578063fcf2d0ad1461066257610246565b8063c1fe3e481461056e578063c7b9d53014610583578063ce5494bb146105a3578063d88bba11146105c3578063ec38a862146105d857610246565b80639ec5a894116100f25780639ec5a894146104ef578063a488ca2914610504578063a639841114610524578063aced166114610539578063ad4095001461054e57610246565b8063801492d71461047b5780638cdfe166146104905780638e6350e2146104a557806391397ab4146104ba578063945c9142146104da57610246565b806328b7ccf7116101bc5780634641257d116101805780634641257d146103fc5780635641ec0314610411578063650d188014610426578063748747e6146104465780637f1735591461046657610246565b806328b7ccf71461037d5780632c4f93f9146103925780632e1a7d4d146103b25780633fc8cef3146103d2578063440368a3146103e757610246565b80631ed042d6116102035780631ed042d6146102fa5780631f1fcd511461031c5780631fe4a6861461033157806322f3e2d414610346578063258294101461036857610246565b806301681a621461024b57806306fdde031461026d5780630b201eb1146102985780630f969b87146102b85780631d12f28b146102d857610246565b3661024657005b600080fd5b34801561025757600080fd5b5061026b610266366004612be1565b610677565b005b34801561027957600080fd5b50610282610881565b60405161028f9190612eb2565b60405180910390f35b3480156102a457600080fd5b5061026b6102b3366004612cca565b6108ad565b3480156102c457600080fd5b5061026b6102d3366004612dbe565b6109d8565b3480156102e457600080fd5b506102ed610a65565b60405161028f9190613124565b34801561030657600080fd5b5061030f610a6b565b60405161028f9190612e0a565b34801561032857600080fd5b5061030f610a7a565b34801561033d57600080fd5b5061030f610a89565b34801561035257600080fd5b5061035b610a98565b60405161028f9190612e89565b34801561037457600080fd5b50610282610b36565b34801561038957600080fd5b506102ed610b55565b34801561039e57600080fd5b5061030f6103ad366004612dbe565b610b5b565b3480156103be57600080fd5b506102ed6103cd366004612dbe565b610b82565b3480156103de57600080fd5b5061030f610c48565b3480156103f357600080fd5b5061026b610c60565b34801561040857600080fd5b5061026b610d47565b34801561041d57600080fd5b5061035b610f76565b34801561043257600080fd5b5061035b610441366004612dbe565b610f7f565b34801561045257600080fd5b5061026b610461366004612be1565b610f87565b34801561047257600080fd5b5061030f611032565b34801561048757600080fd5b5061030f611041565b34801561049c57600080fd5b506102ed611050565b3480156104b157600080fd5b506102ed611056565b3480156104c657600080fd5b5061026b6104d5366004612dbe565b61105b565b3480156104e657600080fd5b5061030f6110dd565b3480156104fb57600080fd5b5061030f6110ec565b34801561051057600080fd5b5061026b61051f366004612cca565b6110fb565b34801561053057600080fd5b5061030f6111b5565b34801561054557600080fd5b5061030f6111c4565b34801561055a57600080fd5b5061030f610569366004612dbe565b6111d3565b34801561057a57600080fd5b5061030f6111e0565b34801561058f57600080fd5b5061026b61059e366004612be1565b6111ef565b3480156105af57600080fd5b5061026b6105be366004612be1565b61129a565b3480156105cf57600080fd5b5061030f61147a565b3480156105e457600080fd5b5061026b6105f3366004612be1565b611489565b34801561060457600080fd5b5061035b610613366004612dbe565b611511565b34801561062457600080fd5b506102ed61177a565b34801561063957600080fd5b5061026b610648366004612dbe565b6117fb565b34801561065957600080fd5b5061030f61187d565b34801561066e57600080fd5b5061026b61188c565b61067f611a7b565b6001600160a01b0316336001600160a01b0316146106b85760405162461bcd60e51b81526004016106af90613019565b60405180910390fd5b6004546001600160a01b03828116911614156106e65760405162461bcd60e51b81526004016106af90612f0a565b6000546001600160a01b03828116911614156107145760405162461bcd60e51b81526004016106af90612fc1565b606061071e611b02565b905060005b81518110156107795781818151811061073857fe5b60200260200101516001600160a01b0316836001600160a01b031614156107715760405162461bcd60e51b81526004016106af90613088565b600101610723565b50816001600160a01b031663a9059cbb610791611a7b565b6040516370a0823160e01b81526001600160a01b038616906370a08231906107bd903090600401612e0a565b60206040518083038186803b1580156107d557600080fd5b505afa1580156107e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080d9190612dd6565b6040518363ffffffff1660e01b815260040161082a929190612e1e565b602060405180830381600087803b15801561084457600080fd5b505af1158015610858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087c9190612cae565b505050565b60408051808201909152601281527153747261746567797374455448437572766560701b602082015290565b6108b5611a7b565b6001600160a01b0316336001600160a01b0316146108e55760405162461bcd60e51b81526004016106af90613019565b821561091857600854600c80546101009092046001600160a01b03166001600160a01b031990921691909117905561093b565b600954600c80546001600160a01b0319166001600160a01b039092169190911790555b610947600d8383612b1a565b50601254600c5460405163095ea7b360e01b81526001600160a01b039283169263095ea7b3926109809291169060001990600401612e1e565b602060405180830381600087803b15801561099a57600080fd5b505af11580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d29190612cae565b50505050565b6001546001600160a01b0316331480610a0957506109f4611a7b565b6001600160a01b0316336001600160a01b0316145b610a255760405162461bcd60e51b81526004016106af90613019565b60078190556040517fa68ba126373d04c004c5748c300c9fca12bd444b3d4332e261f3bd2bac4a860090610a5a908390613124565b60405180910390a150565b60075481565b600e546001600160a01b031681565b6004546001600160a01b031681565b6001546001600160a01b031681565b600080546040516339ebf82360e01b815282916001600160a01b0316906339ebf82390610ac9903090600401612e0a565b6101006040518083038186803b158015610ae257600080fd5b505afa158015610af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1a9190612d4c565b604001511180610b3157506000610b2f61177a565b115b905090565b6040805180820190915260058152640302e332e360dc1b602082015290565b60055481565b600b8181548110610b6857fe5b6000918252602090912001546001600160a01b0316905081565b600080546001600160a01b03163314610bad5760405162461bcd60e51b81526004016106af90612fa1565b6000610bb883611b5e565b6004805460405163a9059cbb60e01b81529295509293506001600160a01b039092169163a9059cbb91610bef913391869101612e1e565b602060405180830381600087803b158015610c0957600080fd5b505af1158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c419190612cae565b5050919050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6003546001600160a01b0316331480610c8357506001546001600160a01b031633145b80610ca65750610c91611a7b565b6001600160a01b0316336001600160a01b0316145b610cc25760405162461bcd60e51b81526004016106af90613019565b6000546040805163bf3759b560e01b81529051610d45926001600160a01b03169163bf3759b5916004808301926020929190829003018186803b158015610d0857600080fd5b505afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d409190612dd6565b611d71565b565b6003546001600160a01b0316331480610d6a57506001546001600160a01b031633145b80610d8d5750610d78611a7b565b6001600160a01b0316336001600160a01b0316145b610da95760405162461bcd60e51b81526004016106af90613019565b60008060008060009054906101000a90046001600160a01b03166001600160a01b031663bf3759b56040518163ffffffff1660e01b815260040160206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190612dd6565b60085490915060009060ff1615610e89576000610e4e61177a565b9050610e67838211610e605783610e62565b815b611b5e565b9450915082821115610e8357610e7d8284611e5a565b94508291505b50610e9a565b610e9282611ea5565b919550935090505b6000546040516328766ebf60e21b81526001600160a01b039091169063a1d9bafc90610ece908790879086906004016131a0565b602060405180830381600087803b158015610ee857600080fd5b505af1158015610efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f209190612dd6565b9150610f2a612617565b610f3382611d71565b7f4c0f499ffe6befa0ca7c826b0916cf87bea98de658013e76938489368d60d50984848385604051610f6894939291906131b6565b60405180910390a150505050565b60085460ff1681565b60005b919050565b6001546001600160a01b0316331480610fb85750610fa3611a7b565b6001600160a01b0316336001600160a01b0316145b610fd45760405162461bcd60e51b81526004016106af90613019565b6001600160a01b038116610fe757600080fd5b600380546001600160a01b0319166001600160a01b0383161790556040517f2f202ddb4a2e345f6323ed90f8fc8559d770a7abbbeee84dde8aca3351fe715490610a5a908390612e0a565b600c546001600160a01b031681565b600f546001600160a01b031681565b60065481565b600090565b6001546001600160a01b031633148061108c5750611077611a7b565b6001600160a01b0316336001600160a01b0316145b6110a85760405162461bcd60e51b81526004016106af90613019565b60068190556040517fd94596337df4c2f0f44d30a7fc5db1c7bb60d9aca4185ed77c6fd96eb45ec29890610a5a908390613124565b6012546001600160a01b031681565b6002546001600160a01b031681565b611103611a7b565b6001600160a01b0316336001600160a01b0316146111335760405162461bcd60e51b81526004016106af90613019565b821561116657600854600a80546101009092046001600160a01b03166001600160a01b0319909216919091179055611189565b600954600a80546001600160a01b0319166001600160a01b039092169190911790555b611195600b8383612b1a565b50600a5460115461087c916001600160a01b03918216911660001961196a565b600a546001600160a01b031681565b6003546001600160a01b031681565b600d8181548110610b6857fe5b6010546001600160a01b031681565b6001546001600160a01b0316331480611220575061120b611a7b565b6001600160a01b0316336001600160a01b0316145b61123c5760405162461bcd60e51b81526004016106af90613019565b6001600160a01b03811661124f57600080fd5b600180546001600160a01b0319166001600160a01b0383161790556040517f352ececae6d7d1e6d26bcf2c549dfd55be1637e9b22dc0cf3b71ddb36097a6b490610a5a908390612e0a565b6000546001600160a01b03163314806112cb57506112b6611a7b565b6001600160a01b0316336001600160a01b0316145b6112d457600080fd5b60008054906101000a90046001600160a01b03166001600160a01b0316816001600160a01b031663fbfa77cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561132a57600080fd5b505afa15801561133e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113629190612bfd565b6001600160a01b03161461137557600080fd5b61137e816126d9565b600480546040516370a0823160e01b81526001600160a01b039091169163a9059cbb91849184916370a08231916113b791309101612e0a565b60206040518083038186803b1580156113cf57600080fd5b505afa1580156113e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114079190612dd6565b6040518363ffffffff1660e01b8152600401611424929190612e1e565b602060405180830381600087803b15801561143e57600080fd5b505af1158015611452573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114769190612cae565b5050565b6011546001600160a01b031681565b6001546001600160a01b031633146114b35760405162461bcd60e51b81526004016106af90612ee5565b6001600160a01b0381166114c657600080fd5b600280546001600160a01b0319166001600160a01b0383161790556040517fafbb66abf8f3b719799940473a4052a3717cdd8e40fb6c8a3faadab316b1a06990610a5a908390612e0a565b600061151b612b7d565b6000546040516339ebf82360e01b81526001600160a01b03909116906339ebf8239061154b903090600401612e0a565b6101006040518083038186803b15801561156457600080fd5b505afa158015611578573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159c9190612d4c565b90508060200151600014156115b5576000915050610f82565b60055460808201516115c8904290611e5a565b106115d7576001915050610f82565b60008060009054906101000a90046001600160a01b03166001600160a01b031663bf3759b56040518163ffffffff1660e01b815260040160206040518083038186803b15801561162657600080fd5b505afa15801561163a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165e9190612dd6565b905060075481111561167557600192505050610f82565b600061167f61177a565b90508260a0015161169b6007548361276090919063ffffffff16565b10156116ad5760019350505050610f82565b60008360a001518211156116ce5760a08401516116cb908390611e5a565b90505b60008060009054906101000a90046001600160a01b03166001600160a01b031663112c1f9b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561171d57600080fd5b505afa158015611731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117559190612dd6565b90506117618183612760565b60065461176e9089612785565b10979650505050505050565b600e546040516370a0823160e01b81526000916001600160a01b0316906370a08231906117ab903090600401612e0a565b60206040518083038186803b1580156117c357600080fd5b505afa1580156117d7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b319190612dd6565b6001546001600160a01b031633148061182c5750611817611a7b565b6001600160a01b0316336001600160a01b0316145b6118485760405162461bcd60e51b81526004016106af90613019565b60058190556040517f4aaf232568bff365c53cad69bdb6e83014e79df80216ceba8ee01769723dfd6890610a5a908390613124565b6000546001600160a01b031681565b6001546001600160a01b03163314806118bd57506118a8611a7b565b6001600160a01b0316336001600160a01b0316145b6118d95760405162461bcd60e51b81526004016106af90613019565b6008805460ff19166001179055600080546040805163507257cd60e11b815290516001600160a01b039092169263a0e4af9a9260048084019382900301818387803b15801561192757600080fd5b505af115801561193b573d6000803e3d6000fd5b50506040517f97e963041e952738788b9d4871d854d282065b8f90a464928d6528f2e9a4fd0b925060009150a1565b8015806119f25750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e906119a09030908690600401612e37565b60206040518083038186803b1580156119b857600080fd5b505afa1580156119cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f09190612dd6565b155b611a0e5760405162461bcd60e51b81526004016106af906130ce565b61087c8363095ea7b360e01b8484604051602401611a2d929190612e1e565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526127bf565b6060611a73848460008561284e565b949350505050565b60008060009054906101000a90046001600160a01b03166001600160a01b0316635aa6e6756040518163ffffffff1660e01b815260040160206040518083038186803b158015611aca57600080fd5b505afa158015611ade573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b319190612bfd565b604080516001808252818301909252606091829190602080830190803683375050600e5482519293506001600160a01b031691839150600090611b4157fe5b6001600160a01b0390921660209283029190910190910152905090565b600480546040516370a0823160e01b8152600092839283926001600160a01b03909116916370a0823191611b9491309101612e0a565b60206040518083038186803b158015611bac57600080fd5b505afa158015611bc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be49190612dd6565b600e546040516370a0823160e01b81529192506000916001600160a01b03909116906370a0823190611c1a903090600401612e0a565b60206040518083038186803b158015611c3257600080fd5b505afa158015611c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6a9190612dd6565b905081851115611ce057600e546001600160a01b0316632e1a7d4d611c9183858903612912565b6040518263ffffffff1660e01b8152600401611cad9190613124565b600060405180830381600087803b158015611cc757600080fd5b505af1158015611cdb573d6000803e3d6000fd5b505050505b600480546040516370a0823160e01b8152611d689288926001600160a01b0316916370a0823191611d1391309101612e0a565b60206040518083038186803b158015611d2b57600080fd5b505afa158015611d3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d639190612dd6565b612912565b93505050915091565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191611da391309101612e0a565b60206040518083038186803b158015611dbb57600080fd5b505afa158015611dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df39190612dd6565b600e5460405163b6b55f2560e01b81529192506001600160a01b03169063b6b55f2590611e24908490600401613124565b600060405180830381600087803b158015611e3e57600080fd5b505af1158015611e52573d6000803e3d6000fd5b505050505050565b6000611e9c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612928565b90505b92915050565b600e546040516370a0823160e01b81526000918291829182916001600160a01b03909116906370a0823190611ede903090600401612e0a565b60206040518083038186803b158015611ef657600080fd5b505afa158015611f0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2e9190612dd6565b9050801561247c57600e60009054906101000a90046001600160a01b03166001600160a01b031663e6f1daf26040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611f8657600080fd5b505af1158015611f9a573d6000803e3d6000fd5b50505050601260009054906101000a90046001600160a01b03166001600160a01b031663075461726040518163ffffffff1660e01b815260040160206040518083038186803b158015611fec57600080fd5b505afa158015612000573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120249190612bfd565b600e546040516335313c2160e11b81526001600160a01b0392831692636a6278429261205592911690600401612e0a565b600060405180830381600087803b15801561206f57600080fd5b505af1158015612083573d6000803e3d6000fd5b50506011546040516370a0823160e01b8152600093506001600160a01b0390911691506370a08231906120ba903090600401612e0a565b60206040518083038186803b1580156120d257600080fd5b505afa1580156120e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210a9190612dd6565b9050801561212857601154612128906001600160a01b031682612954565b6012546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612159903090600401612e0a565b60206040518083038186803b15801561217157600080fd5b505afa158015612185573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121a99190612dd6565b905080156121c7576012546121c7906001600160a01b031682612954565b4760006121d5826002612a68565b600f54604051635e0d443f60e01b81529192506000916001600160a01b0390911690635e0d443f906122109084906001908790600401612e94565b60206040518083038186803b15801561222857600080fd5b505afa15801561223c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122609190612dd6565b9050818110156122f55760105460015460405163a1903eab60e01b81526001600160a01b039283169263a1903eab9286926122a19290911690600401612e0a565b6020604051808303818588803b1580156122ba57600080fd5b505af11580156122ce573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906122f39190612dd6565b505b6010546040516370a0823160e01b81524794506000916001600160a01b0316906370a0823190612329903090600401612e0a565b60206040518083038186803b15801561234157600080fd5b505afa158015612355573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123799190612dd6565b600f54604080518082018252878152602081018490529051630b4c7e4d60e01b81529293506001600160a01b0390911691630b4c7e4d9187916123c29190600090600401612e51565b6000604051808303818588803b1580156123db57600080fd5b505af11580156123ef573d6000803e3d6000fd5b5050600480546040516370a0823160e01b81526001600160a01b0390911694506370a0823193506124239250309101612e0a565b60206040518083038186803b15801561243b57600080fd5b505afa15801561244f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124739190612dd6565b99505050505050505b841561260f578385111561257b57600e546040516370a0823160e01b81526000916001600160a01b0316906370a08231906124bb903090600401612e0a565b60206040518083038186803b1580156124d357600080fd5b505afa1580156124e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250b9190612dd6565b600e549091506001600160a01b0316632e1a7d4d61252b83888a03612912565b6040518263ffffffff1660e01b81526004016125479190613124565b600060405180830381600087803b15801561256157600080fd5b505af1158015612575573d6000803e3d6000fd5b50505050505b600480546040516370a0823160e01b815261260c928892611d639289926001600160a01b03909216916370a08231916125b691309101612e0a565b60206040518083038186803b1580156125ce57600080fd5b505afa1580156125e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126069190612dd6565b90611e5a565b91505b509193909250565b600080546040516370a0823160e01b81526001600160a01b03909116906370a0823190612648903090600401612e0a565b60206040518083038186803b15801561266057600080fd5b505afa158015612674573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126989190612dd6565b905080156126d65760005460025460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92611424929116908590600401612e1e565b50565b600e546040516370a0823160e01b81526109d2916001600160a01b0316906370a082319061270b903090600401612e0a565b60206040518083038186803b15801561272357600080fd5b505afa158015612737573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061275b9190612dd6565b611ea5565b600082820183811015611e9c5760405162461bcd60e51b81526004016106af90612f29565b60008261279457506000611e9f565b828202828482816127a157fe5b0414611e9c5760405162461bcd60e51b81526004016106af90612f60565b6060612814826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a649092919063ffffffff16565b80519091501561087c57808060200190518101906128329190612cae565b61087c5760405162461bcd60e51b81526004016106af9061303e565b606061285985612aaa565b6128755760405162461bcd60e51b81526004016106af90612fe2565b60006060866001600160a01b031685876040516128929190612dee565b60006040518083038185875af1925050503d80600081146128cf576040519150601f19603f3d011682016040523d82523d6000602084013e6128d4565b606091505b509150915081156128e8579150611a739050565b8051156128f85780518082602001fd5b8360405162461bcd60e51b81526004016106af9190612eb2565b60008183106129215781611e9c565b5090919050565b6000818484111561294c5760405162461bcd60e51b81526004016106af9190612eb2565b505050900390565b6011546001600160a01b0383811691161415612a0057600a546040516318cbafe560e01b81526001600160a01b03909116906318cbafe5906129a4908490600090600b903090429060040161312d565b600060405180830381600087803b1580156129be57600080fd5b505af11580156129d2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526129fa9190810190612c19565b50611476565b6012546001600160a01b0383811691161415612a5057600c546040516318cbafe560e01b81526001600160a01b03909116906318cbafe5906129a4908490600090600d903090429060040161312d565b60405162461bcd60e51b81526004016106af906130ac565b6000611e9c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ae3565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611a73575050151592915050565b60008183612b045760405162461bcd60e51b81526004016106af9190612eb2565b506000838581612b1057fe5b0495945050505050565b828054828255906000526020600020908101928215612b6d579160200282015b82811115612b6d5781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190612b3a565b50612b79929150612bc2565b5090565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b5b80821115612b795780546001600160a01b0319168155600101612bc3565b600060208284031215612bf2578081fd5b8135611e9c81613244565b600060208284031215612c0e578081fd5b8151611e9c81613244565b60006020808385031215612c2b578182fd5b825167ffffffffffffffff811115612c41578283fd5b8301601f81018513612c51578283fd5b8051612c64612c5f826131f8565b6131d1565b8181528381019083850185840285018601891015612c80578687fd5b8694505b83851015612ca2578051835260019490940193918501918501612c84565b50979650505050505050565b600060208284031215612cbf578081fd5b8151611e9c81613259565b600080600060408486031215612cde578182fd5b8335612ce981613259565b9250602084013567ffffffffffffffff80821115612d05578384fd5b818601915086601f830112612d18578384fd5b813581811115612d26578485fd5b8760208083028501011115612d39578485fd5b6020830194508093505050509250925092565b6000610100808385031215612d5f578182fd5b612d68816131d1565b9050825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201528091505092915050565b600060208284031215612dcf578081fd5b5035919050565b600060208284031215612de7578081fd5b5051919050565b60008251612e00818460208701613218565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b60608101818460005b6002811015612e79578151835260209283019290910190600101612e5a565b5050508260408301529392505050565b901515815260200190565b600f93840b81529190920b6020820152604081019190915260600190565b6000602082528251806020840152612ed1816040850160208701613218565b601f01601f19169190910160400192915050565b6020808252600b908201526a085cdd1c985d1959da5cdd60aa1b604082015260600190565b602080825260059082015264085dd85b9d60da1b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b6020808252600790820152662173686172657360c81b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252600b908201526a08585d5d1a1bdc9a5e995960aa1b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252600a9082015269085c1c9bdd1958dd195960b21b604082015260600190565b6020808252600890820152671090510814d1531360c21b604082015260600190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b90815260200190565b600060a082018783526020878185015260a0604085015281875480845260c0860191508885528285209350845b8181101561317f5784546001600160a01b03168352600194850194928401920161315a565b50506001600160a01b03969096166060850152505050608001529392505050565b9283526020830191909152604082015260600190565b93845260208401929092526040830152606082015260800190565b60405181810167ffffffffffffffff811182821017156131f057600080fd5b604052919050565b600067ffffffffffffffff82111561320e578081fd5b5060209081020190565b60005b8381101561323357818101518382015260200161321b565b838111156109d25750506000910152565b6001600160a01b03811681146126d657600080fd5b80151581146126d657600080fdfea26469706673582212209f0ac8bf6913916506f1d06f98c61ff52f2aa75363bfde34cfa911df59b2dc9f64736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000dcd90c7f6324cfa40d7169ef80b12031770b4325
-----Decoded View---------------
Arg [0] : _vault (address): 0xdCD90C7f6324cfa40d7169ef80b12031770B4325
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000dcd90c7f6324cfa40d7169ef80b12031770b4325
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $1.51 | 169.3395 | $255.7 |
Loading...
Loading
[ Download: CSV Export ]
[ 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.