Expected identifier, got 'Public'

by Ludwigthestud   Last Updated January 14, 2018 05:28 AM

I'm compiling a contract in Remix and am getting the error

ParserError: Expected identifier, got 'Public'

pragma solidity ^0.4.19; 

import "browser/ERC20.sol";
import "browser/SafeMath.sol";

contract TestCoin {
string public constant symbol = "TES";
string public constant name = "TestCoin";
uint8 public constant decimals = 18;

uint private constant __totalSupply = 100;
mapping (address => uint) private __balanceOf;
mapping (address => mapping (address => uint256)) internal allowed;

event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);

function public TestCoin() {
    __balanceOf[msg.sender] = __totalSupply;

function totalSupply() public constant returns (uint _totalSupply) {
    _totalSupply = __totalSupply;

Fairly new with this so any help would be greatly appreciated.

Tags : solidity

Answers 1

Modifiers go after the function name. This line:

function public TestCoin() {

should look like this:

function TestCoin() public {
January 14, 2018 05:22 AM

Related Questions

How to map an address with a string array in solidity?

Updated October 09, 2018 12:28 PM

How to transfer Ether to ERC20 token contract?

Updated July 23, 2018 00:28 AM

Help me code callback external

Updated October 16, 2018 09:28 AM

Solidity Token Sale?

Updated October 06, 2018 14:28 PM

I have a problem.. Please helpme

Updated October 17, 2018 13:28 PM