From b8166c757ce76672a94ad5313347adc3fff81054 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 26 Mar 2019 20:33:59 -0700 Subject: [PATCH] Add script to simulate Hush supply --- contrib/hush_supply | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 contrib/hush_supply diff --git a/contrib/hush_supply b/contrib/hush_supply new file mode 100755 index 000000000..f85180814 --- /dev/null +++ b/contrib/hush_supply @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +use warnings; +use strict; + +my $supply = 0.0; +my $block = 0; +my $amount = 12.5; +my $halvings = 0; + +while ($supply <= 21_000_000) { +#while ($halvings <= 64 && $amount >= 1e-8) { + $block++; + if ($block < 5) { + $amount = 40_000; + } else { + # Halving every 840000 blocks + if ($block % 840_000 == 0) { + $amount /= 2; + $halvings++; + } + $amount = 12.5 / (2**$halvings); + } + $supply += $amount; + # block, current supply, block reward amount, number of halvings + print "$block,$supply,$amount,$halvings\n"; +}