{
    "Function": "totalSupply",
    "File": "contracts/VE3DLocker.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol",
        "node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol"
    ],
    "High-Level Calls": [
        "BoringMath",
        "BoringMath",
        "BoringMath",
        "BoringMath"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "mul",
        "add",
        "div",
        "sub"
    ],
    "Low-Level Calls": [],
    "Code": "function totalSupply() external view returns (uint256 supply) {\n        uint256 currentEpoch = block.timestamp.div(rewardsDuration).mul(rewardsDuration);\n        uint256 cutoffEpoch = currentEpoch.sub(lockDuration);\n        uint256 epochindex = epochs.length;\n\n        //do not include next epoch's supply\n        if (uint256(epochs[epochindex - 1].date) > currentEpoch) {\n            epochindex--;\n        }\n\n        //traverse inversely to make more current queries more gas efficient\n        for (uint256 i = epochindex - 1; i + 1 != 0; i--) {\n            Epoch storage e = epochs[i];\n            if (uint256(e.date) <= cutoffEpoch) {\n                break;\n            }\n            supply = supply.add(e.supply);\n        }\n\n        return supply;\n    }"
}