mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
219 lines
5.1 KiB
Solidity
219 lines
5.1 KiB
Solidity
pragma solidity ^0.7.6;
|
|
|
|
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
|
|
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
|
|
|
interface IERC20Permit {
|
|
/**
|
|
* @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,
|
|
* given `owner`'s signed approval.
|
|
*
|
|
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
|
|
* ordering also apply here.
|
|
*
|
|
* Emits an {Approval} event.
|
|
*
|
|
* Requirements:
|
|
*
|
|
* - `spender` cannot be the zero address.
|
|
* - `deadline` must be a timestamp in the future.
|
|
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
|
|
* over the EIP712-formatted function arguments.
|
|
* - the signature must use ``owner``'s current nonce (see {nonces}).
|
|
*
|
|
* For more information on the signature format, see the
|
|
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
|
|
* section].
|
|
*/
|
|
function permit(
|
|
address owner,
|
|
address spender,
|
|
uint256 value,
|
|
uint256 deadline,
|
|
uint8 v,
|
|
bytes32 r,
|
|
bytes32 s
|
|
) external;
|
|
|
|
/**
|
|
* @dev Returns the current nonce for `owner`. This value must be
|
|
* included whenever a signature is generated for {permit}.
|
|
*
|
|
* Every successful call to {permit} increases ``owner``'s nonce by one. This
|
|
* prevents a signature from being used multiple times.
|
|
*/
|
|
function nonces(address owner) external view returns (uint256);
|
|
|
|
/**
|
|
* @dev Returns the domain separator used in the encoding of the signature for `permit`, as defined by {EIP712}.
|
|
*/
|
|
// solhint-disable-next-line func-name-mixedcase
|
|
function DOMAIN_SEPARATOR() external view returns (bytes32);
|
|
}
|
|
|
|
interface ILixirVaultToken is IERC20, IERC20Permit {
|
|
}
|
|
|
|
interface ILixirVault is ILixirVaultToken {
|
|
function initialize(
|
|
string memory name,
|
|
string memory symbol,
|
|
address _token0,
|
|
address _token1,
|
|
address _strategist,
|
|
address _keeper,
|
|
address _strategy
|
|
) external;
|
|
|
|
function token0() external view returns (IERC20);
|
|
|
|
function token1() external view returns (IERC20);
|
|
|
|
function activeFee() external view returns (uint24);
|
|
|
|
function activePool() external view returns (IUniswapV3Pool);
|
|
|
|
function performanceFee() external view returns (uint24);
|
|
|
|
function strategist() external view returns (address);
|
|
|
|
function strategy() external view returns (address);
|
|
|
|
function keeper() external view returns (address);
|
|
|
|
function setKeeper(address _keeper) external;
|
|
|
|
function setStrategist(address _strategist) external;
|
|
|
|
function setStrategy(address _strategy) external;
|
|
|
|
function setPerformanceFee(uint24 newFee) external;
|
|
|
|
function mainPosition()
|
|
external
|
|
view
|
|
returns (int24 tickLower, int24 tickUpper);
|
|
|
|
function rangePosition()
|
|
external
|
|
view
|
|
returns (int24 tickLower, int24 tickUpper);
|
|
|
|
function rebalance(
|
|
int24 mainTickLower,
|
|
int24 mainTickUpper,
|
|
int24 rangeTickLower0,
|
|
int24 rangeTickUpper0,
|
|
int24 rangeTickLower1,
|
|
int24 rangeTickUpper1,
|
|
uint24 fee
|
|
) external;
|
|
|
|
function withdraw(
|
|
uint256 shares,
|
|
uint256 amount0Min,
|
|
uint256 amount1Min,
|
|
address receiver,
|
|
uint256 deadline
|
|
) external returns (uint256 amount0Out, uint256 amount1Out);
|
|
|
|
function withdrawFrom(
|
|
address withdrawer,
|
|
uint256 shares,
|
|
uint256 amount0Min,
|
|
uint256 amount1Min,
|
|
address recipient,
|
|
uint256 deadline
|
|
) external returns (uint256 amount0Out, uint256 amount1Out);
|
|
|
|
function deposit(
|
|
uint256 amount0Desired,
|
|
uint256 amount1Desired,
|
|
uint256 amount0Min,
|
|
uint256 amount1Min,
|
|
address recipient,
|
|
uint256 deadline
|
|
)
|
|
external
|
|
returns (
|
|
uint256 shares,
|
|
uint256 amount0,
|
|
uint256 amount1
|
|
);
|
|
|
|
function calculateTotals()
|
|
external
|
|
view
|
|
returns (
|
|
uint256 total0,
|
|
uint256 total1,
|
|
uint128 mL,
|
|
uint128 rL
|
|
);
|
|
|
|
function calculateTotalsFromTick(int24 virtualTick)
|
|
external
|
|
view
|
|
returns (
|
|
uint256 total0,
|
|
uint256 total1,
|
|
uint128 mL,
|
|
uint128 rL
|
|
);
|
|
}
|
|
|
|
interface ILixirVaultETH is ILixirVault {
|
|
|
|
enum TOKEN {ZERO, ONE}
|
|
|
|
function WETH_TOKEN() external view returns (TOKEN);
|
|
|
|
function depositETH(
|
|
uint256 amountDesired,
|
|
uint256 amountEthMin,
|
|
uint256 amountMin,
|
|
address recipient,
|
|
uint256 deadline
|
|
)
|
|
external
|
|
payable
|
|
returns (
|
|
uint256 shares,
|
|
uint256 amountEthIn,
|
|
uint256 amountIn
|
|
);
|
|
|
|
function withdrawETHFrom(
|
|
address withdrawer,
|
|
uint256 shares,
|
|
uint256 amountEthMin,
|
|
uint256 amountMin,
|
|
address payable recipient,
|
|
uint256 deadline
|
|
) external returns (uint256 amountEthOut, uint256 amountOut);
|
|
|
|
function withdrawETH(
|
|
uint256 shares,
|
|
uint256 amountEthMin,
|
|
uint256 amountMin,
|
|
address payable recipient,
|
|
uint256 deadline
|
|
) external returns (uint256 amountEthOut, uint256 amountOut);
|
|
|
|
receive() external payable;
|
|
}
|
|
|
|
interface ILixirFactory { // is LixirBase // don't think we need this
|
|
function vault(
|
|
address token0,
|
|
address token1,
|
|
uint256 index
|
|
) external view returns (address);
|
|
|
|
function vaultsLengthForPair(address token0, address token1)
|
|
external
|
|
view
|
|
returns (uint256);
|
|
}
|
|
|