Add ExpiryChange event

This commit is contained in:
lash 2023-03-26 08:03:44 +01:00
parent f2648dfb68
commit 8242d3a62f
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
5 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,6 @@
- 0.5.2
* Update ERC165 interface response for Expire
* Add ExpiryChange event
- 0.5.1
* Update ERC165 interface responses
- 0.5.0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -116,6 +116,9 @@ contract DemurrageTokenSingleNocap {
// Implements Expire
event Expired(uint256 _timestamp);
// Implements Expire
event ExpiryChange(uint256 indexed _oldTimestamp, uint256 _newTimestamp);
event Cap(uint256 indexed _oldCap, uint256 _newCap);
// Implements Seal
@ -180,13 +183,16 @@ contract DemurrageTokenSingleNocap {
// Cannot be set to a time in the past.
function setExpirePeriod(uint256 _expirePeriod) public {
uint256 r;
uint256 oldTimestamp;
require(!isSealed(EXPIRY_STATE));
require(!expired);
require(msg.sender == owner);
r = periodStart + (_expirePeriod * periodDuration);
require(r > expires);
oldTimestamp = expires;
expires = r;
emit ExpiryChange(oldTimestamp, expires);
}
// Change max token supply.