function transfer(address _to, uint256 _value) public returns (bool success) {
    require(balances[msg.sender] >= _value);
    balances[msg.sender] -= _value;
    balances[_to] += _value;
    emit Transfer(msg.sender, _to, _value); //solhint-disable-line indent, no-unused-vars
    return true;

Error Message = ParserError: Expected Toke Semicolon got 'LParen' emit Transfer(msg.sender, _to, _value); //solhint-disable-line indent, no-unused-vars


You're likely using a very outdated version of the compiler. The emit keyboard was added in a later release of 0.4.x so would be invalid syntax in older versions. I would suggest using a version in 0.5.x.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.