mirror of
git://holbrook.no/erc20-demurrage-token
synced 2024-11-22 00:06:46 +01:00
Add expiration, supply cap, mutability to readme
This commit is contained in:
parent
74c0bfe43e
commit
50405b5cf6
28
README.md
28
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
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user