{
    "Function": "_checkpoint_total_supply",
    "File": "contracts/contracts/RewardsDistributor.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IVotingEscrow",
        "IVotingEscrow",
        "Math"
    ],
    "Internal Calls": [
        "_find_timestamp_epoch"
    ],
    "Library Calls": [
        "max"
    ],
    "Low-Level Calls": [],
    "Code": "function _checkpoint_total_supply() internal {\n        address ve = voting_escrow;\n        uint t = time_cursor;\n        uint rounded_timestamp = block.timestamp / WEEK * WEEK;\n        IVotingEscrow(ve).checkpoint();\n\n        for (uint i = 0; i < 20; i++) {\n            if (t > rounded_timestamp) {\n                break;\n            } else {\n                uint epoch = _find_timestamp_epoch(ve, t);\n                IVotingEscrow.Point memory pt = IVotingEscrow(ve).point_history(epoch);\n                int128 dt = 0;\n                if (t > pt.ts) {\n                    dt = int128(int256(t - pt.ts));\n                }\n                ve_supply[t] = Math.max(uint(int256(pt.bias - pt.slope * dt)), 0);\n            }\n            t += WEEK;\n        }\n        time_cursor = t;\n    }"
}