{
    "Function": "swapTokensForExactTokens",
    "File": "contracts/mocks/MockUniswapV2Router.sol",
    "Parent Contracts": [
        "contracts/interfaces/external/uniswap/IUniswapV2Router02.sol",
        "contracts/interfaces/external/uniswap/IUniswapV2Router01.sol"
    ],
    "High-Level Calls": [
        "UniswapV2Library",
        "TransferHelper",
        "UniswapV2Library"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "ensure",
        "_swap"
    ],
    "Library Calls": [
        "pairFor",
        "safeTransferFrom",
        "getAmountsIn"
    ],
    "Low-Level Calls": [],
    "Code": "function swapTokensForExactTokens(\n        uint256 amountOut,\n        uint256 amountInMax,\n        address[] calldata path,\n        address to,\n        uint256 deadline\n    )\n        external\n        virtual\n        override\n        ensure(deadline)\n        returns (uint256[] memory amounts)\n    {\n        amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path);\n        require(\n            amounts[0] <= amountInMax,\n            \"UniswapV2Router: EXCESSIVE_INPUT_AMOUNT\"\n        );\n        TransferHelper.safeTransferFrom(\n            path[0],\n            msg.sender,\n            UniswapV2Library.pairFor(factory, path[0], path[1]),\n            amounts[0]\n        );\n        _swap(amounts, path, to);\n    }"
}