Post
Topic
Board Archival
Re: [ANN] [ILT] Intellect | X11 | 3650% Annually
by
tryphe
on 06/03/2015, 18:19:51 UTC
I'm no expert, but looks like the problem is here:

https://github.com/intellect-project/intellect/blob/master/src/main.cpp#L1000

Code:
int64_t nSubsidy = nCoinAge * nRewardCoinYear / 365 / COIN;

It divides by COIN(/ COIN) and doesn't multiply (* COIN), putting the block subsidy in non satoshi format. nSubsidy is in satoshis.

If this is the case(99% sure it is), I suggest everyone simply stop running their wallets until a fork because your coin age will persist, and you will have "gained" block subsidy upon staking post-fork. Opposed to now at least.

Did you check this?
https://github.com/intellect-project/intellect/blob/master/src/main.h#L41:
Code:
static const int64_t MAX_MINT_PROOF_OF_STAKE = 36.50 * COIN; // 3650% annual interest
https://github.com/intellect-project/intellect/blob/master/src/main.cpp#L998:
Code:
   int64_t nRewardCoinYear;
    nRewardCoinYear = MAX_MINT_PROOF_OF_STAKE;
    int64_t nSubsidy = nCoinAge * nRewardCoinYear / 365 / COIN;

So,
nSubsidy == nCoinAge * (36.50 * COIN) / 365 / COIN == nCoinAge * 36.50 / 365

I think, *COIN and /COIN used for correct float-int conversion.

Honestly, I didn't look at this earlier because I looked who authored the github repo, and I know you are a decent dev. I've never seen the OP, so I'm to assume he bought the code from you? Or are you just answering for him?

In such a case, you missed the other post where I asked some rather basic questions, so I'll just ask these for everyone's sake:

Is the staking correct or not?

Did you run a testnet?

There is no reason to assign a const to a volatile variable that is left unchanged, and there is no reason to convert to satoshi, then back to COIN, then return the result. Besides wasting cpu cycles. Futhermore, if the value is already in satoshis, which is what nSubsidy is (satoshis, not a float), why the fuck are we then converting back to COIN format(/ COIN)? So, despite being some sloppy half-assed copy/paste code with no git history regarding what history the code has, is the staking correct or not?

We would prefer some real answers other than "I think the code is okay *presents 5th-grade arithmetic*"