Burn a Position

Contract Git Source

Burn an existing position using the specified handler.

function burnPosition(IHandler _handler, bytes calldata _burnPositionData)
    external
    onlyWhitelistedHandlers(_handler)
    nonReentrant
    returns (uint256 sharesBurned);

Parameters

NameTypeDescription

_handler

IHandler

The address of the handler to use.

_burnPositionData

bytes

The data required to burn the position.

Returns

NameTypeDescription

sharesBurned

uint256

The number of shares burned.

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

struct BurnPositionParams {
    IUniswapV3Pool pool;
    address hook;
    int24 tickLower;
    int24 tickUpper;
    uint128 shares;
}

bytes memory _burnPositionData = abi.encode(
    _params.pool,
    _params.hook,
    _params.tickLower,
    _params.tickUpper,
    _params.shares
);

// To decode:
BurnPositionParams memory decodedParams = abi.decode(encodedData, (BurnPositionParams));

BurnPositionParams 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

shares

uint128

The amount of shares to burn

Last updated

Logo

Β© 2024 Stryke