Rename total burned method

This commit is contained in:
lash 2023-03-21 20:28:39 +00:00
parent 0937ecb8cd
commit b5d3338f07
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
9 changed files with 14 additions and 12 deletions

View File

@ -1,3 +1,5 @@
* 0.7.0
- Implement proper burner interface method
* 0.6.2
- Add Giftable Token contract metadata
* 0.6.1

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

@ -127,7 +127,7 @@ class GiftableToken(ERC20):
o = j.template()
o['method'] = 'eth_call'
enc = ABIContractEncoder()
enc.method('burned')
enc.method('totalBurned')
data = add_0x(enc.get())
tx = self.template(sender_address, contract_address)
tx = self.set_code(tx, data)

View File

@ -1,6 +1,6 @@
[metadata]
name = eth-erc20
version = 0.6.2
version = 0.7.0
description = ERC20 interface and simple contract with deployment script that lets any address mint and gift itself tokens.
author = Louis Holbrook
author_email = dev@holbrook.no

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,7 @@ contract GiftableToken {
// Implements Burner
uint256 public totalMinted;
// Implements Burner
uint256 public burned;
uint256 public totalBurned;
// Implements expire
uint256 public expires;
@ -62,7 +62,7 @@ contract GiftableToken {
// Implements ERC20
function totalSupply() public view returns (uint256) {
return totalMinted - burned;
return totalMinted - totalBurned;
}
// Implements Minter
@ -134,7 +134,7 @@ contract GiftableToken {
require(balanceOf[msg.sender] >= _value, 'ERR_FUNDS');
balanceOf[msg.sender] -= _value;
burned += _value;
totalBurned += _value;
emit Burn(_value);
return true;
@ -172,7 +172,7 @@ contract GiftableToken {
// Implements EIP165
function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0xc6bb4b70) { // ERC20
if (_sum == 0xb61bc941) { // ERC20
return true;
}
if (_sum == 0x449a52f8) { // Minter
@ -187,7 +187,7 @@ contract GiftableToken {
if (_sum == 0xabe1f1f5) { // Writer
return true;
}
if (_sum == 0xfccc2e79) { // Burner
if (_sum == 0xb1110c1b) { // Burner
return true;
}
return false;