Timelock Trade LogoTimelock Protocol

Mint a Position

Mint a new position using the specified handler.

function mintPosition(IHandler _handler, bytes calldata _mintPositionData)
    external
    onlyWhitelistedHandlers(_handler)
    nonReentrant
    returns (uint256 sharesMinted);

Parameters

NameTypeDescription
_handlerIHandlerThe address of the handler to use.
_mintPositionDatabytesThe data required to mint the position.

Returns

NameTypeDescription
sharesMinteduint256The number of shares minted.

The `_mintPositionData` parameter has to be constructed the following way:

struct MintPositionParams {
    IUniswapV3Pool pool;
    address hook;
    int24 tickLower;
    int24 tickUpper;
    uint128 liquidity;
}
 
bytes memory _mintPositionParams = abi.encode(
    _params.pool,
    _params.hook,
    _params.tickLower,
    _params.tickUpper,
    _params.liquidity
);
 
// To decode:
MintPositionParams memory decodedParams = abi.decode(encodedData, (MintPositionParams));

MintPositionParams Struct

Field NameTypeDescription
poolIUniswapV3PoolThe Uniswap V3 pool contract
hookaddressThe address of the hook contract
tickLowerint24The lower tick of the position
tickUpperint24The upper tick of the position
liquidityuint128The amount of liquidity to mint

On this page