Consensys / Tokens

Ethereum Token Contracts
MIT License
2.06k stars 1.19k forks source link

Compiliation failed. Expected token LBrace got 'View' #95

Closed manxiaqu closed 6 years ago

manxiaqu commented 6 years ago

I got a problem(ParserError: Expected token LBrace got 'View') when compile the code(in HumanStandardTokenFactory.sol, StandardToken.sol, Token.sol) using "truffle compile" .

the output of error: /home/ubuntu/git/Tokens/contracts/HumanStandardTokenFactory.sol:19:70: ParserError: Expected token LBrace got 'View' function verifyHumanStandardToken(address _tokenContract) public view returns (bool) {

,/home/ubuntu/git/Tokens/contracts/StandardToken.sol:43:40: ParserError: Expected token LBrace got 'View' function balanceOf(address _owner) view public returns (uint256 balance) {

,/home/ubuntu/git/Tokens/contracts/Token.sol:20:47: ParserError: Expected token LBrace got 'View' function balanceOf(address _owner) public view returns (uint256 balance);

the output of "truffle version": Truffle v3.4.11 (core: 3.4.11) Solidity v0.4.15 (solc-js)

is there anything wrong with my environment?

maurelian commented 6 years ago

yes, the view keyword is from a feature of Solidity 0.4.16, you'll need to upgrade truffle.