contract NeuroToken is Ownable {
    using SafeMath for uint256;
    
    mapping (address => uint256) private balances;
    
    mapping (address => mapping(address => uint256)) private allowed;
    
    string public constant name = "NeuroToken";
    string public constant symbol = "NRT";
    uint8 public constant decimal = 18;
    
    uint256 public totalSupply;
    
    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _from, address indexed _to, uint256 _value);
    
    // _value = n * 10**18 (1000000000000000000)
    function mint(address _to, uint256 _value) onlyOwner public {
        require(_to != address(0), "ERC20: mint to the zero address");
        
        balances[_to] = balances[_to].add(_value);
        totalSupply = totalSupply.add(_value);
        
        emit Transfer(address(0), _to, _value);
    }
    
    function balanceOf(address _owner) public view returns(uint256) {
        return balances[_owner];
    }
    
    function transfer(address _to, uint256 _value) public {
        require(_to != address(0), "ERC20: transfer to the zero address");
        require(balances[msg.sender] >= _value);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        
        emit Transfer(msg.sender, _to, _value);
    }
    
    function transferFrom(address _from, address _to, uint256 _value) public {
        require(_from != address(0), "ERC20: transfer from the zero address");
        require(_to != address(0), "ERC20: transfer to the zero address");
        
        require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value);
        
        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        
        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
        
        emit Transfer(_from, _to, _value);
        emit Approval(_from, _to, _value);
    }
    
    function allowance(address _owner, address _spender) public view returns(uint256) {
        return allowed[_owner][_spender];
    }
    
    function approve(address _spender, uint256 _value) public {
        require(msg.sender != address(0), "ERC20: approve from the zero address");
        require(_spender != address(0), "ERC20: approve from the zero address");
        
        allowed[msg.sender][_spender] = _value; 
        
        emit Approval(msg.sender, _spender, _value);
    }
}
function mint(address _to, uint256 _value) onlyOwner public {
        require(_to != address(0), "ERC20: mint to the zero address");
        
        balances[_to] = balances[_to].add(_value);
        totalSupply = totalSupply.add(_value);
        
        emit Transfer(address(0), _to, _value);
    }
// _value = n * 10**18 (1000000000000000000)