{
    "Function": "ConvertCrvToCvx",
    "File": "contracts/CvxMining.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "ICvx",
        "ICvx",
        "ICvx",
        "ICvx"
    ],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function ConvertCrvToCvx(uint256 _amount) internal view returns (uint256) {\n        uint256 supply = cvx.totalSupply();\n        uint256 reductionPerCliff = cvx.reductionPerCliff();\n        uint256 totalCliffs = cvx.totalCliffs();\n        uint256 maxSupply = cvx.maxSupply();\n\n        uint256 cliff = supply / reductionPerCliff;\n        //mint if below total cliffs\n        if (cliff < totalCliffs) {\n            //for reduction% take inverse of current cliff\n            uint256 reduction = totalCliffs - cliff;\n            //reduce\n            _amount = (_amount * reduction) / totalCliffs;\n\n            //supply cap check\n            uint256 amtTillMax = maxSupply - supply;\n            if (_amount > amtTillMax) {\n                _amount = amtTillMax;\n            }\n\n            //mint\n            return _amount;\n        }\n        return 0;\n    }"
}