{
    "Function": "_update",
    "File": "contracts/external/UniswapV2Pair.sol",
    "Parent Contracts": [
        "contracts/external/UniswapV2ERC20.sol",
        "contracts/interfaces/external/uniswap/IUniswapV2Pair.sol",
        "contracts/interfaces/external/uniswap/IUniswapV2ERC20.sol"
    ],
    "High-Level Calls": [
        "UQ112x112",
        "UQ112x112",
        "UQ112x112",
        "UQ112x112"
    ],
    "Internal Calls": [
        "require(bool,string)"
    ],
    "Library Calls": [
        "encode",
        "uqdiv",
        "uqdiv",
        "encode"
    ],
    "Low-Level Calls": [],
    "Code": "function _update(\n        uint256 balance0,\n        uint256 balance1,\n        uint112 _reserve0,\n        uint112 _reserve1\n    ) private {\n        require(\n            balance0 <= type(uint112).max && balance1 <= type(uint112).max,\n            \"UniswapV2: OVERFLOW\"\n        );\n        uint32 blockTimestamp = uint32(block.timestamp % 2**32);\n        uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired\n        if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {\n            // * never overflows, and + overflow is desired\n            price0CumulativeLast +=\n                uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) *\n                timeElapsed;\n            price1CumulativeLast +=\n                uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) *\n                timeElapsed;\n        }\n        reserve0 = uint112(balance0);\n        reserve1 = uint112(balance1);\n        blockTimestampLast = blockTimestamp;\n        emit Sync(reserve0, reserve1);\n    }"
}