Mint a Position

Contract Git Source

Mint a new position using the specified handler.

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

Parameters

NameTypeDescription

_handler

IHandler

The address of the handler to use.

_mintPositionData

bytes

The data required to mint the position.

Returns

NameTypeDescription

sharesMinted

uint256

The 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

pool

IUniswapV3Pool

The Uniswap V3 pool contract

hook

address

The address of the hook contract

tickLower

int24

The lower tick of the position

tickUpper

int24

The upper tick of the position

liquidity

uint128

The amount of liquidity to mint

Last updated

Logo

Β© 2024 Stryke