{
    "Function": "createPair",
    "File": "contracts/mocks/MockUniswapV2Factory.sol",
    "Parent Contracts": [
        "contracts/external/interfaces/IUniswapV2Factory.sol"
    ],
    "High-Level Calls": [
        "IUniswapV2Pair"
    ],
    "Internal Calls": [
        "create2(uint256,uint256,uint256,uint256)",
        "require(bool,string)",
        "abi.encodePacked()",
        "require(bool,string)",
        "mload(uint256)",
        "keccak256(bytes)",
        "type()",
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function createPair(address tokenA, address tokenB)\n        external\n        returns (address pair)\n    {\n        require(tokenA != tokenB, \"UniswapV2: IDENTICAL_ADDRESSES\");\n        (address token0, address token1) = tokenA < tokenB\n            ? (tokenA, tokenB)\n            : (tokenB, tokenA);\n        require(token0 != address(0), \"UniswapV2: ZERO_ADDRESS\");\n        require(\n            getPair[token0][token1] == address(0),\n            \"UniswapV2: PAIR_EXISTS\"\n        ); // single check is sufficient\n        bytes memory bytecode = type(UniswapV2Pair).creationCode;\n        bytes32 salt = keccak256(abi.encodePacked(token0, token1));\n        assembly {\n            pair := create2(0, add(bytecode, 32), mload(bytecode), salt)\n        }\n        IUniswapV2Pair(pair).initialize(token0, token1);\n        getPair[token0][token1] = pair;\n        getPair[token1][token0] = pair; // populate mapping in the reverse direction\n        allPairs.push(pair);\n        emit PairCreated(token0, token1, pair, allPairs.length);\n    }"
}