static const int64_t MAX_MONEY = 150000000 * COIN;
static const int64_t POW_MAX_MONEY = 50000000 * COIN;
There is a huge misconception out there that MAX_MONEY sets the total coin count for a coin. This is false. MAX_MONEY sets the maximum amount of coins that can be sent in a single transaction over a network. It is customary to typically set this to the maximum coins that will be created but it is not necessary.
We have played around and tested this to verify it on the DigiByte testnet before. We made sure this was the case.
The actual reward is determined here between lines 1033 & 1082:
https://github.com/supercoinproject/supercoin/blob/master/src/main.cpp// miner's coin base reward
int64_t GetProofOfWorkReward(int nHeight, int64_t nFees, const CBlockIndex* pindex)
{
int64_t nSubsidy = 512 * COIN;
if(nHeight == 1)
nSubsidy = INITIAL_OFFERING_PERCENTAGE * POW_MAX_MONEY;
if(nHeight > LAST_POW_BLOCK)
return 0;
int nPoWHeight = GetPowHeight(pindex) + 1;
printf(">> nHeight = %d, nPoWHeight = %d\n", nHeight, nPoWHeight);
int nReduceFactor = 0;
if(nPoWHeight < SWITCHOVER_POW_BLOCK)
{
nReduceFactor = nPoWHeight / 43200;
if(nReduceFactor > 9)
nSubsidy = nMinSubsidy;
else
nSubsidy >>= nReduceFactor;
}
else
{
if(nPoWHeight < 19200)
nSubsidy = 512 * COIN;
else if(nPoWHeight < 28800)
nSubsidy = 256 * COIN;
else if(nPoWHeight < 38400)
nSubsidy = 128 * COIN;
else if(nPoWHeight < 48000)
nSubsidy = 64 * COIN;
else if(nPoWHeight < 57600)
nSubsidy = 32 * COIN;
else if(nPoWHeight < 67200)
nSubsidy = 16 * COIN;
else if(nPoWHeight < 76800)
nSubsidy = 8 * COIN;
else if(nPoWHeight < 86400)
nSubsidy = 4 * COIN;
else if(nPoWHeight < 96000)
nSubsidy = 2 * COIN;
else
nSubsidy = 1 * COIN;
}
return nSubsidy + nFees;
}
To find the exact coin coin count you would need to do the math and add everything up in there.
For a comparison this is where Bitcoins maximum coin supply is determined. Once again you have to calculate it out to prove it is 21 million.
int64_t GetBlockValue(int nHeight, int64_t nFees)
{
int64_t nSubsidy = 50 * COIN;
int halvings = nHeight / Params().SubsidyHalvingInterval();
// Force block reward to zero when right shift is undefined.
if (halvings >= 64)
return nFees;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy + nFees;
}
EDIT: We are not defending Supercoin (had never heard of them until this post) nor have we done the exact math in their code. We simply wanted to point out a common misconception to avoid future issues for everyone.