let cliffSize = 100000 * 1e18; //new cliff every 100,000 tokens
let cliffCount = 1000; // 1,000 cliffs
let maxSupply = 100000000 * 1e18; //100 mil max supply
uint GetCVXMintAmount( uint crvEarned ){
let cvxTotalSupply = await cvx.totalSupply();
let currentCliff = cvxTotalSupply / cliffSize;
//if current cliff is under the max
if(currentCliff < cliffCount ){
let remaining = cliffCount - currentCliff;
//multiply ratio of remaining cliffs to total cliffs against amount CRV received
var cvxEarned = crvEarned * remaining / cliffCount;
//double check we have not gone over the max supply
var amountTillMax = maxSupply - cvxTotalSupply;
if(cvxEarned > amountTillMax){
cvxEarned = amountTillMax;