{
    "Function": "burn",
    "File": "contracts/external/UniswapV2Pair.sol",
    "Parent Contracts": [
        "contracts/external/UniswapV2ERC20.sol",
        "contracts/external/interfaces/IUniswapV2Pair.sol",
        "contracts/external/interfaces/IUniswapV2ERC20.sol"
    ],
    "High-Level Calls": [
        "IERC20",
        "IERC20",
        "IERC20",
        "IERC20"
    ],
    "Internal Calls": [
        "_mintFee",
        "_burn",
        "getReserves",
        "_update",
        "lock",
        "require(bool,string)",
        "_safeTransfer",
        "_safeTransfer"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function burn(address to)\n        external\n        lock\n        returns (uint256 amount0, uint256 amount1)\n    {\n        (uint112 _reserve0, uint112 _reserve1, ) = getReserves(); // gas savings\n        address _token0 = token0; // gas savings\n        address _token1 = token1; // gas savings\n        uint256 balance0 = IERC20(_token0).balanceOf(address(this));\n        uint256 balance1 = IERC20(_token1).balanceOf(address(this));\n        uint256 liquidity = balanceOf[address(this)];\n\n        bool feeOn = _mintFee(_reserve0, _reserve1);\n        uint256 _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee\n        amount0 = (liquidity * balance0) / _totalSupply; // using balances ensures pro-rata distribution\n        amount1 = (liquidity * balance1) / _totalSupply; // using balances ensures pro-rata distribution\n        require(\n            amount0 > 0 && amount1 > 0,\n            \"UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED\"\n        );\n        _burn(address(this), liquidity);\n        _safeTransfer(_token0, to, amount0);\n        _safeTransfer(_token1, to, amount1);\n        balance0 = IERC20(_token0).balanceOf(address(this));\n        balance1 = IERC20(_token1).balanceOf(address(this));\n\n        _update(balance0, balance1, _reserve0, _reserve1);\n        if (feeOn) kLast = uint256(reserve0) * reserve1; // reserve0 and reserve1 are up-to-date\n        emit Burn(msg.sender, amount0, amount1, to);\n    }"
}