mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
added _createAndInitializePoolIfNecessary
This commit is contained in:
parent
7156ef0210
commit
d6066bec9e
|
@ -66,6 +66,27 @@ abstract contract Helpers is DSMath, Basic {
|
|||
}
|
||||
}
|
||||
|
||||
function _createAndInitializePoolIfNecessary (
|
||||
address tokenA,
|
||||
address tokenB,
|
||||
uint24 fee,
|
||||
int24 initialTick
|
||||
) internal returns (address pool) {
|
||||
(TokenInterface token0Contract_, TokenInterface token1Contract_) = changeEthAddress(
|
||||
tokenA,
|
||||
tokenB
|
||||
);
|
||||
|
||||
(address token0_, address token1_) = sortTokenAddress(address(token0Contract_), address(token1Contract_));
|
||||
|
||||
return nftManager.createAndInitializePoolIfNecessary(
|
||||
token0_,
|
||||
token1_,
|
||||
fee,
|
||||
TickMath.getSqrtRatioAtTick(initialTick)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Mint function which interact with Uniswap v3
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user