Timelock Trade LogoTimelock Protocol

Burn a Position

Burn an existing position using the specified handler.

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

Parameters

NameTypeDescription
_handlerIHandlerThe address of the handler to use.
_burnPositionDatabytesThe data required to burn the position.

Returns

NameTypeDescription
sharesBurneduint256The 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
poolIUniswapV3PoolThe Uniswap V3 pool contract
hookaddressThe address of the hook contract
tickLowerint24The lower tick of the position
tickUpperint24The upper tick of the position
sharesuint128The amount of shares to burn

On this page