added _createAndInitializePoolIfNecessary

This commit is contained in:
Thrilok kumar 2022-10-31 06:08:30 +05:30 committed by GitHub
parent 7156ef0210
commit d6066bec9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
*/