erc20-demurrage-token

ERC20 token with redistributed continual demurrage
Log | Files | Refs | README

commit 50405b5cf6c9dbea206c2c4b2c7b76621be9e9d1
parent 74c0bfe43ef9334bd1f0be39c4180da2c4f82242
Author: lash <dev@holbrook.no>
Date:   Wed,  8 Mar 2023 07:55:52 +0000

Add expiration, supply cap, mutability to readme

Diffstat:
MREADME.md | 28++++++++++++++++++++++++++++
Msolidity/DemurrageTokenSingleNocap.sol | 6+++---
2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md @@ -85,6 +85,34 @@ Token parameters are truncated when calculating demurrage and redistribution: * Demurrage modifier: 64 bits +## Expiration + +A token may set to expire at a certain point in time. After the expiry, no more transfers may be executed. From that point on, balances are frozen and demurrage is halted. + +Expiration may be set in terms of redistribution periods. + +Unless sealed (see below), expiration may be changed at any time to any future redistribution period. However, once expired, expiration may not be changed further. + + +## Supply + +Unless sealed (see below), Supply limit may be set and change at any time. Supply may never be directly set to less than the current supply. However, contract _writers_ may burn tokens in their possession using the `burn()` method, which will effectively reduce the supply. + + +## Mutability + +The following parameters may not be changed after contract is published: + +* Demurrage level +* Redistribution period + +The contract provides a sealing feature which prohibits further changes to parameters that can initially be edited. These include: + +* Adding and removing writers (addresses that may mint tokens) +* Sink addres +* Expiry period +* Supply limit + ## Gas usage diff --git a/solidity/DemurrageTokenSingleNocap.sol b/solidity/DemurrageTokenSingleNocap.sol @@ -121,7 +121,7 @@ contract DemurrageTokenSingleNocap { // Implements Sealer uint256 public sealState; - uint8 constant MINTER_STATE = 1; + uint8 constant WRITER_STATE = 1; uint8 constant SINK_STATE = 2; uint8 constant EXPIRY_STATE = 4; uint8 constant CAP_STATE = 8; @@ -223,7 +223,7 @@ contract DemurrageTokenSingleNocap { // Given address will be allowed to call the mintTo() function function addWriter(address _minter) public returns (bool) { - require(!isSealed(MINTER_STATE)); + require(!isSealed(WRITER_STATE)); require(msg.sender == owner); minter[_minter] = true; return true; @@ -231,7 +231,7 @@ contract DemurrageTokenSingleNocap { // Given address will no longer be allowed to call the mintTo() function function deleteWriter(address _minter) public returns (bool) { - require(!isSealed(MINTER_STATE)); + require(!isSealed(WRITER_STATE)); require(msg.sender == owner || _minter == msg.sender); minter[_minter] = false; return true;