1

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.

2

Modifiers go after the function name. This line:

function public TestCoin() {

should look like this:

function TestCoin() public {

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.