Fix bogus demurrage calculation in publish script

This commit is contained in:
lash 2023-02-12 13:53:36 +00:00
parent fab1b2d4b8
commit cf1e716b5a
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 3 additions and 2 deletions

View File

@ -68,10 +68,11 @@ def process_config_local(config, arg, args, flags):
config.add(sink_address, 'TOKEN_SINK_ADDRESS') config.add(sink_address, 'TOKEN_SINK_ADDRESS')
config.add(args.redistribution_period, 'TOKEN_REDISTRIBUTION_PERIOD') config.add(args.redistribution_period, 'TOKEN_REDISTRIBUTION_PERIOD')
v = args.demurrage_level / 1000000 v = (1 - (args.demurrage_level / 1000000)) ** (1 / config.get('TOKEN_REDISTRIBUTION_PERIOD'))
if v >= 1.0: if v >= 1.0:
raise ValueError('demurrage level must be less than 100%') raise ValueError('demurrage level must be less than 100%')
demurrage_level = to_fixed(v) demurrage_level = to_fixed(v)
logg.info('v {} demurrage level {}'.format(v, demurrage_level))
config.add(demurrage_level, 'TOKEN_DEMURRAGE_LEVEL') config.add(demurrage_level, 'TOKEN_DEMURRAGE_LEVEL')
return config return config

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = erc20-demurrage-token name = erc20-demurrage-token
version = 0.3.3 version = 0.3.4
description = ERC20 token with redistributed continual demurrage description = ERC20 token with redistributed continual demurrage
author = Louis Holbrook author = Louis Holbrook
author_email = dev@holbrook.no author_email = dev@holbrook.no