From a6f53e72789abdf7ed8a5049b4c5deeba4c27acf Mon Sep 17 00:00:00 2001 From: nolash Date: Sun, 4 Jul 2021 14:37:56 +0200 Subject: [PATCH] Correct demurrage emu minutes logline --- python/erc20_demurrage_token/demurrage.py | 2 +- python/erc20_demurrage_token/runnable/deploy.py | 6 +++++- python/setup.cfg | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/python/erc20_demurrage_token/demurrage.py b/python/erc20_demurrage_token/demurrage.py index 92c4e5d..52c9d7f 100644 --- a/python/erc20_demurrage_token/demurrage.py +++ b/python/erc20_demurrage_token/demurrage.py @@ -39,7 +39,7 @@ class DemurrageCalculator: remainder_minutes = math.floor(remainder / 60) adjusted_delta = adjusted_amount * ((1 - self.r_min) ** remainder_minutes) adjusted_amount -= (adjusted_amount - adjusted_delta) - logg.debug('adjusted for {} hours {} -> {} delta {}'.format(remainder_minutes, amount, adjusted_amount, adjusted_delta)) + logg.debug('adjusted for {} minutes {} -> {} delta {}'.format(remainder_minutes, amount, adjusted_amount, adjusted_delta)) return adjusted_amount diff --git a/python/erc20_demurrage_token/runnable/deploy.py b/python/erc20_demurrage_token/runnable/deploy.py index c2b9fd1..579eba3 100644 --- a/python/erc20_demurrage_token/runnable/deploy.py +++ b/python/erc20_demurrage_token/runnable/deploy.py @@ -60,6 +60,7 @@ argparser.add_argument('--nonce', type=int, help='Override transaction nonce') argparser.add_argument('--sink-address', dest='sink_address', default=ZERO_ADDRESS, type=str, help='demurrage level,ppm per minute') argparser.add_argument('--supply-limit', dest='supply_limit', type=int, help='token supply limit (0 = no limit)') argparser.add_argument('--redistribution-period', type=int, help='redistribution period, minutes (0 = deactivate)') # default 10080 = week +argparser.add_argument('--multi', action='store_true', help='automatic redistribution') argparser.add_argument('--env-prefix', default=os.environ.get('CONFINI_ENV_PREFIX'), dest='env_prefix', type=str, help='environment prefix for variables to overwrite configuration') argparser.add_argument('--symbol', type=str, help='Token symbol') argparser.add_argument('--demurrage-level', dest='demurrage_level', type=int, help='demurrage level, ppm per minute') @@ -136,6 +137,8 @@ token_name = args.name if token_name == None: token_name = args.symbol +multi = bool(args.multi) + def main(): c = DemurrageToken(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle) settings = DemurrageTokenSettings() @@ -149,7 +152,8 @@ def main(): (tx_hash_hex, o) = c.constructor( signer_address, settings, - redistribute=settings.period_minutes > 0, + #redistribute=settings.period_minutes > 0, + redistribute=multi, cap=int(config.get('TOKEN_SUPPLY_LIMIT')), ) if dummy: diff --git a/python/setup.cfg b/python/setup.cfg index 37d515f..568264e 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = erc20-demurrage-token -version = 0.0.2a2 +version = 0.0.2a3 description = ERC20 token with redistributed continual demurrage author = Louis Holbrook author_email = dev@holbrook.no