|
| 1 | +pragma solidity ^0.4.15; |
| 2 | + |
| 3 | +import "./SmartToken.sol"; |
| 4 | +import "zeppelin-solidity/contracts/token/BurnableToken.sol"; |
| 5 | +import "zeppelin-solidity/contracts/token/PausableToken.sol"; |
| 6 | + |
| 7 | +/** |
| 8 | + @title Líf, the Winding Tree token |
| 9 | +
|
| 10 | + Implementation of Líf, the ERC20 token for Winding Tree, with extra methods |
| 11 | + to transfer value and data to execute a call on transfer. |
| 12 | + This version of the token is used in test networks, it allows anyone to claim |
| 13 | + tokens. |
| 14 | + Uses OpenZeppelin Pausable. |
| 15 | + */ |
| 16 | +contract LifTokenTest is SmartToken, BurnableToken, PausableToken { |
| 17 | + // Token Name |
| 18 | + string public constant NAME = "Líf"; |
| 19 | + |
| 20 | + // Token Symbol |
| 21 | + string public constant SYMBOL = "LIF"; |
| 22 | + |
| 23 | + // Token decimals |
| 24 | + uint public constant DECIMALS = 18; |
| 25 | + |
| 26 | + // Max Lif faucet (50 tokens) |
| 27 | + uint256 public constant MAX_LIF_FAUCET = 50000000000000000000; |
| 28 | + |
| 29 | + function approveData(address spender, uint256 value, bytes data) public whenNotPaused returns (bool) { |
| 30 | + return super.approveData(spender, value, data); |
| 31 | + } |
| 32 | + |
| 33 | + function transferData(address to, uint256 value, bytes data) public whenNotPaused returns (bool) { |
| 34 | + return super.transferData(to, value, data); |
| 35 | + } |
| 36 | + |
| 37 | + function transferDataFrom(address from, address to, uint256 value, bytes data) public whenNotPaused returns (bool) { |
| 38 | + return super.transferDataFrom(from, to, value, data); |
| 39 | + } |
| 40 | + |
| 41 | + /** |
| 42 | + @dev Burns a specific amount of tokens. |
| 43 | +
|
| 44 | + @param _value The amount of tokens to be burned. |
| 45 | + */ |
| 46 | + function burn(uint256 _value) public whenNotPaused { |
| 47 | + super.burn(_value); |
| 48 | + |
| 49 | + // a Transfer event to 0x0 can be useful for observers to keep track of |
| 50 | + // all the Lif by just looking at those events |
| 51 | + Transfer(msg.sender, address(0), _value); |
| 52 | + } |
| 53 | + |
| 54 | + /** |
| 55 | + * @dev Function to create tokens, it will issue tokens to the tx sender |
| 56 | + */ |
| 57 | + function faucetLif() public { |
| 58 | + uint256 amount = MAX_LIF_FAUCET.sub(balances[msg.sender]); |
| 59 | + totalSupply = totalSupply.add(amount); |
| 60 | + balances[msg.sender] = balances[msg.sender].add(amount); |
| 61 | + Transfer(0x0, msg.sender, amount); |
| 62 | + } |
| 63 | + |
| 64 | +} |
0 commit comments