Skip to content

Commit d567741

Browse files
committed
Make LifToken burnable, remove copied code
1 parent 1b900a8 commit d567741

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

contracts/LifToken.sol

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pragma solidity ^0.4.15;
22

33
import "./SmartToken.sol";
44
import "zeppelin-solidity/contracts/token/MintableToken.sol";
5+
import "zeppelin-solidity/contracts/token/BurnableToken.sol";
56
import "zeppelin-solidity/contracts/lifecycle/Pausable.sol";
67

78
/**
@@ -11,7 +12,7 @@ import "zeppelin-solidity/contracts/lifecycle/Pausable.sol";
1112
to transfer value and data to execute a call on transfer.
1213
Uses OpenZeppelin MintableToken and Pausable.
1314
*/
14-
contract LifToken is SmartToken, MintableToken, Pausable {
15+
contract LifToken is SmartToken, BurnableToken, MintableToken, Pausable {
1516
// Token Name
1617
string public constant NAME = "Líf";
1718

@@ -51,18 +52,11 @@ contract LifToken is SmartToken, MintableToken, Pausable {
5152
@param _value The amount of tokens to be burned.
5253
*/
5354
function burn(uint256 _value) public whenNotPaused {
54-
require(_value > 0);
55-
56-
address burner = msg.sender;
57-
balances[burner] = balances[burner].sub(_value);
58-
totalSupply = totalSupply.sub(_value);
59-
Burn(burner, _value);
55+
super.burn(_value);
6056

6157
// a Transfer event to 0x0 can be useful for observers to keep track of
6258
// all the Lif by just looking at those events
63-
Transfer(burner, address(0), _value);
59+
Transfer(msg.sender, address(0), _value);
6460
}
6561

66-
event Burn(address indexed burner, uint value);
67-
6862
}

0 commit comments

Comments
 (0)