commit f0525299358b2b6362ad0fc41cf00d6777a0eb17
parent 1d93ece13e04b5a040dc087a9d5220151ea144bb
Author: lash <dev@holbrook.no>
Date: Wed, 22 Mar 2023 07:58:25 +0000
Fix burn interface implementation
Diffstat:
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/python/CHANGELOG b/python/CHANGELOG
@@ -1,3 +1,5 @@
+- 0.4.2
+ * Correct burn interface implementation
- 0.4.1
* Eliminate solidity compiler warnings
- 0.4.0
diff --git a/python/setup.cfg b/python/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = erc20-demurrage-token
-version = 0.4.1
+version = 0.4.2
description = ERC20 token with redistributed continual demurrage
author = Louis Holbrook
author_email = dev@holbrook.no
diff --git a/solidity/DemurrageTokenSingleNocap.sol b/solidity/DemurrageTokenSingleNocap.sol
@@ -668,7 +668,7 @@ contract DemurrageTokenSingleNocap {
// Explicitly and irretrievably burn tokens
// Only token minters can burn tokens
- function burn(uint256 _value) public {
+ function burn(uint256 _value) public returns (bool) {
require(applyExpiry() == 0);
require(minter[msg.sender]);
require(_value <= account[msg.sender]);
@@ -678,6 +678,7 @@ contract DemurrageTokenSingleNocap {
decreaseBaseBalance(msg.sender, _delta);
burned += _value;
emit Burn(msg.sender, _value);
+ return true;
}
// Implements ERC20
@@ -690,6 +691,12 @@ contract DemurrageTokenSingleNocap {
return burned;
}
+ // Return total number of tokens ever minted
+ function totalMinted() public view returns (uint256) {
+ return supply;
+ }
+
+
// Implements EIP165
function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0xc6bb4b70) { // ERC20