-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathLifToken.sol
62 lines (48 loc) · 1.94 KB
/
LifToken.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
pragma solidity ^0.4.18;
import "zeppelin-solidity/contracts/token/ERC827/ERC827Token.sol";
import "zeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
import "zeppelin-solidity/contracts/token/ERC20/MintableToken.sol";
import "zeppelin-solidity/contracts/token/ERC20/PausableToken.sol";
/**
@title Líf, the Winding Tree token
Implementation of Líf, the ERC827 token for Winding Tree, an extension of the
ERC20 token with extra methods to transfer value and data to execute a call
on transfer.
Uses OpenZeppelin StandardToken, ERC827Token, MintableToken and PausableToken.
*/
contract LifToken is StandardToken, ERC827Token, MintableToken, PausableToken {
// Token Name
string public constant NAME = "Líf";
// Token Symbol
string public constant SYMBOL = "LIF";
// Token decimals
uint public constant DECIMALS = 18;
/**
* @dev Burns a specific amount of tokens.
*
* @param _value The amount of tokens to be burned.
*/
function burn(uint256 _value) public whenNotPaused {
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
// a Transfer event to 0x0 can be useful for observers to keep track of
// all the Lif by just looking at those events
Transfer(msg.sender, address(0), _value);
}
/**
* @dev Burns a specific amount of tokens of an address
* This function can be called only by the owner in the minting process
*
* @param _value The amount of tokens to be burned.
*/
function burn(address burner, uint256 _value) public onlyOwner {
require(!mintingFinished);
require(_value <= balances[burner]);
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
// a Transfer event to 0x0 can be useful for observers to keep track of
// all the Lif by just looking at those events
Transfer(burner, address(0), _value);
}
}