{
    "Function": "_addReserveSnapshot",
    "File": "contracts/AMM.sol",
    "Parent Contracts": [
        "contracts/legos/Governable.sol",
        "node_modules/@openzeppelin/contracts/proxy/utils/Initializable.sol",
        "contracts/legos/Governable.sol",
        "contracts/Interfaces.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "_blockTimestamp"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _addReserveSnapshot(uint256 price)\n        internal\n    {\n        uint256 currentBlock = block.number;\n        uint256 blockTimestamp = _blockTimestamp();\n\n        if (reserveSnapshots.length == 0) {\n            reserveSnapshots.push(\n                ReserveSnapshot(price, blockTimestamp, currentBlock)\n            );\n            return;\n        }\n\n        ReserveSnapshot storage latestSnapshot = reserveSnapshots[reserveSnapshots.length - 1];\n        // update values in snapshot if in the same block\n        if (currentBlock == latestSnapshot.blockNumber) {\n            latestSnapshot.lastPrice = price;\n        } else {\n            reserveSnapshots.push(\n                ReserveSnapshot(price, blockTimestamp, currentBlock)\n            );\n        }\n    }"
}