Add proper Token contract
This commit is contained in:
33
contracts/Token.sol
Normal file
33
contracts/Token.sol
Normal file
@@ -0,0 +1,33 @@
|
||||
pragma solidity ^0.4.18;
|
||||
|
||||
import 'zeppelin-solidity/contracts/token/ERC20/BasicToken.sol';
|
||||
import './upgradeable/Upgradeable.sol';
|
||||
|
||||
contract Token is Upgradeable, BasicToken {
|
||||
string public name;
|
||||
string public symbol;
|
||||
uint8 public decimals;
|
||||
|
||||
event LogMint(address indexed recipient, uint256 amount, string reference);
|
||||
|
||||
modifier requireRegistry() {
|
||||
require(address(registry) != 0x0);
|
||||
_;
|
||||
}
|
||||
|
||||
function initialize(address sender) public payable {
|
||||
require(msg.sender == address(registry));
|
||||
name = 'Kredits';
|
||||
symbol = 'K';
|
||||
decimals = 18;
|
||||
}
|
||||
|
||||
function mintFor(address _recipient, uint256 _amount, string _reference) requireRegistry returns (bool success) {
|
||||
totalSupply_ = totalSupply_.add(_amount);
|
||||
balances[_recipient] = balances[_recipient].add(_amount);
|
||||
|
||||
LogMint(_recipient, _amount, _reference);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user