mirror of
https://github.com/chaintool-py/eth-erc20.git
synced 2024-11-22 01:36:46 +01:00
Rename total burned method
This commit is contained in:
parent
0937ecb8cd
commit
b5d3338f07
@ -1,3 +1,5 @@
|
|||||||
|
* 0.7.0
|
||||||
|
- Implement proper burner interface method
|
||||||
* 0.6.2
|
* 0.6.2
|
||||||
- Add Giftable Token contract metadata
|
- Add Giftable Token contract metadata
|
||||||
* 0.6.1
|
* 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
@ -127,7 +127,7 @@ class GiftableToken(ERC20):
|
|||||||
o = j.template()
|
o = j.template()
|
||||||
o['method'] = 'eth_call'
|
o['method'] = 'eth_call'
|
||||||
enc = ABIContractEncoder()
|
enc = ABIContractEncoder()
|
||||||
enc.method('burned')
|
enc.method('totalBurned')
|
||||||
data = add_0x(enc.get())
|
data = add_0x(enc.get())
|
||||||
tx = self.template(sender_address, contract_address)
|
tx = self.template(sender_address, contract_address)
|
||||||
tx = self.set_code(tx, data)
|
tx = self.set_code(tx, data)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = eth-erc20
|
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.
|
description = ERC20 interface and simple contract with deployment script that lets any address mint and gift itself tokens.
|
||||||
author = Louis Holbrook
|
author = Louis Holbrook
|
||||||
author_email = dev@holbrook.no
|
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
@ -25,7 +25,7 @@ contract GiftableToken {
|
|||||||
// Implements Burner
|
// Implements Burner
|
||||||
uint256 public totalMinted;
|
uint256 public totalMinted;
|
||||||
// Implements Burner
|
// Implements Burner
|
||||||
uint256 public burned;
|
uint256 public totalBurned;
|
||||||
|
|
||||||
// Implements expire
|
// Implements expire
|
||||||
uint256 public expires;
|
uint256 public expires;
|
||||||
@ -62,7 +62,7 @@ contract GiftableToken {
|
|||||||
|
|
||||||
// Implements ERC20
|
// Implements ERC20
|
||||||
function totalSupply() public view returns (uint256) {
|
function totalSupply() public view returns (uint256) {
|
||||||
return totalMinted - burned;
|
return totalMinted - totalBurned;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements Minter
|
// Implements Minter
|
||||||
@ -134,7 +134,7 @@ contract GiftableToken {
|
|||||||
require(balanceOf[msg.sender] >= _value, 'ERR_FUNDS');
|
require(balanceOf[msg.sender] >= _value, 'ERR_FUNDS');
|
||||||
|
|
||||||
balanceOf[msg.sender] -= _value;
|
balanceOf[msg.sender] -= _value;
|
||||||
burned += _value;
|
totalBurned += _value;
|
||||||
|
|
||||||
emit Burn(_value);
|
emit Burn(_value);
|
||||||
return true;
|
return true;
|
||||||
@ -172,7 +172,7 @@ contract GiftableToken {
|
|||||||
|
|
||||||
// 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 == 0xb61bc941) { // ERC20
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_sum == 0x449a52f8) { // Minter
|
if (_sum == 0x449a52f8) { // Minter
|
||||||
@ -187,7 +187,7 @@ contract GiftableToken {
|
|||||||
if (_sum == 0xabe1f1f5) { // Writer
|
if (_sum == 0xabe1f1f5) { // Writer
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_sum == 0xfccc2e79) { // Burner
|
if (_sum == 0xb1110c1b) { // Burner
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user