{
    "Function": "uniswapV3SwapCallback",
    "File": "contracts/SemiFungiblePositionManager.sol",
    "Parent Contracts": [
        "contracts/multicall/Multicall.sol",
        "contracts/tokens/ERC1155Minimal.sol"
    ],
    "High-Level Calls": [
        "SafeTransferLib",
        "CallbackLib"
    ],
    "Internal Calls": [
        "abi.decode()"
    ],
    "Library Calls": [
        "validateCallback",
        "safeTransferFrom"
    ],
    "Low-Level Calls": [],
    "Code": "function uniswapV3SwapCallback(\n        int256 amount0Delta,\n        int256 amount1Delta,\n        bytes calldata data\n    ) external {\n        // Decode the swap callback data, checks that the UniswapV3Pool has the correct address.\n        CallbackLib.CallbackData memory decoded = abi.decode(data, (CallbackLib.CallbackData));\n        // Validate caller to ensure we got called from the AMM pool\n        CallbackLib.validateCallback(msg.sender, address(FACTORY), decoded.poolFeatures);\n\n        // Extract the address of the token to be sent (amount0 -> token0, amount1 -> token1)\n        address token = amount0Delta > 0\n            ? address(decoded.poolFeatures.token0)\n            : address(decoded.poolFeatures.token1);\n\n        // Transform the amount to pay to uint256 (take positive one from amount0 and amount1)\n        uint256 amountToPay = amount0Delta > 0 ? uint256(amount0Delta) : uint256(amount1Delta);\n\n        // Pay the required token from the payer to the caller of this contract\n        SafeTransferLib.safeTransferFrom(token, decoded.payer, msg.sender, amountToPay);\n    }"
}