Correct demurrage emu minutes logline

This commit is contained in:
nolash 2021-07-04 14:37:56 +02:00
parent 98c460dc2f
commit a6f53e7278
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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:

View File

@ -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