Fix burn interface implementation

This commit is contained in:
lash 2023-03-22 07:58:25 +00:00
parent 1d93ece13e
commit f052529935
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,5 @@
- 0.4.2
* Correct burn interface implementation
- 0.4.1 - 0.4.1
* Eliminate solidity compiler warnings * Eliminate solidity compiler warnings
- 0.4.0 - 0.4.0

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = erc20-demurrage-token name = erc20-demurrage-token
version = 0.4.1 version = 0.4.2
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

View File

@ -668,7 +668,7 @@ contract DemurrageTokenSingleNocap {
// Explicitly and irretrievably burn tokens // Explicitly and irretrievably burn tokens
// Only token minters can burn tokens // Only token minters can burn tokens
function burn(uint256 _value) public { function burn(uint256 _value) public returns (bool) {
require(applyExpiry() == 0); require(applyExpiry() == 0);
require(minter[msg.sender]); require(minter[msg.sender]);
require(_value <= account[msg.sender]); require(_value <= account[msg.sender]);
@ -678,6 +678,7 @@ contract DemurrageTokenSingleNocap {
decreaseBaseBalance(msg.sender, _delta); decreaseBaseBalance(msg.sender, _delta);
burned += _value; burned += _value;
emit Burn(msg.sender, _value); emit Burn(msg.sender, _value);
return true;
} }
// Implements ERC20 // Implements ERC20
@ -690,6 +691,12 @@ contract DemurrageTokenSingleNocap {
return burned; return burned;
} }
// Return total number of tokens ever minted
function totalMinted() public view returns (uint256) {
return supply;
}
// Implements EIP165 // Implements EIP165
function supportsInterface(bytes4 _sum) public pure returns (bool) { function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0xc6bb4b70) { // ERC20 if (_sum == 0xc6bb4b70) { // ERC20