Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var networkWeightStart = networkWeight = 20000000;
- var balance0Start = balance0 = 1500000;
- var balance1Start = balance1 = 1000000;
- var balance2Start = balance2 = 100000;
- var balance3Start = balance3 = 10000;
- var balance4Start = balance4 = 1000;
- var blockReward = 2;
- var blocktime = 30; //seconds
- var blocksYear = 60 / blocktime * 60 * 24 * 365;
- var otherWeightStart = otherWeight = networkWeight - balance0 - balance1 - balance2 - balance3 - balance4
- var BiggerShare = 0.15; // Residual Network Share in the hand of more rich or lucky
- var BiggerWeightStart = BiggerWeight = otherWeight * BiggerShare;
- otherWeightStart = otherWeight -= BiggerWeightStart;
- for (var i=0; i<blocksYear; i++) {
- networkWeight += 2;
- if (i % (networkWeight/BiggerWeight) < 1) BiggerWeight += 2;
- else if (i % (networkWeight/balance0) < 1) balance0 += 2;
- else if (i % (networkWeight/balance1) < 1) balance1 += 2;
- else if (i % (networkWeight/balance2) < 1) balance2 += 2;
- else if (i % (networkWeight/balance3) < 1) balance3 += 2;
- else if (i % (networkWeight/balance4) < 1) balance4 += 2;
- else otherWeight += 2;
- }
- function Pad(S, w) // pad a string left o right(-w)
- {
- if ((w>0) && (S.length < w))
- return S + ' '.repeat(w - S.length);
- else if ((w<0) && (S.length < -w))
- return ' '.repeat(-w - S.length) + S;
- else
- return S;
- }
- function Idy(n, w, d) { return Pad(n.toFixed(d), w);}
- function ShowNeat(Item, Start, End)
- {
- return '| ' + Pad(Item, 16) + ' | ' + Idy(Start, -12, 0) + ' | ' + Idy(End, -12, 0) + ' | ' + Idy(((End/Start)-1)*100, -10, 2) + '% |';
- }
- console.log('|----------------------------------------------------------------|');
- console.log('| Staker |', 'Balance Start |', ' Balance End |', 'Percent Gain |');
- console.log('|----------------------------------------------------------------|');
- console.log(ShowNeat('Bigger('+BiggerShare*100+'%)', BiggerWeightStart, BiggerWeight));
- console.log(ShowNeat('balance0', balance0Start, balance0));
- console.log(ShowNeat('balance1', balance1Start, balance1));
- console.log(ShowNeat('balance2', balance2Start, balance2));
- console.log(ShowNeat('balance3', balance3Start, balance3));
- console.log(ShowNeat('balance4', balance4Start, balance4));
- console.log(ShowNeat('others weight', otherWeightStart, otherWeight));
- console.log(ShowNeat('network weight', networkWeightStart, networkWeight));
- console.log('|----------------------------------------------------------------|');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement