pragma solidity ^0.4.24;
contract MyToken {
address public owner;
string public name;
uint256 public decimals;
uint256 public totalSupply;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
constructor (uint256 _initialSupply, string _name, uint256 _decimals) public {
require(_initialSupply > 0);
require(_decimals == 0);
owner = msg.sender;
totalSupply = _initialSupply;
name = _name;
decimals = _decimals;
balances[owner] = _initialSupply;
}
function transfer (address _to, uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value);
require(_to != address(0));
balances[msg.sender] -= _value;
balances[_to] += _value;
emit Transfer(msg.sender, _to, _value);
return true;
}
event Transfer (address indexed _from, address indexed _to, uint256 _value);
}