ParserError: Expected identifier, got 'LParen' for emit and constructor parameters
See original GitHub issue- I’ve asked for help in the Truffle Gitter before filing this issue.
Issue
I am working on updating my contracts to solidity version 0.4.23. But I got the very annoying error ParserError: Expected identifier, got 'LParen'
. It comes with both constructor
and emit
keyword. When I switch my contracts to remix then it works fine without any error but in truffle, I am getting that wired error.
Steps to Reproduce
Install the latest version of truffle@4.1.7.
Change the pragma solidity ^0.4.18 to ^0.4.23.
Change the constructor function name with keyword constructor
.
Expected Behavior
It should work.
Actual Results
Environment
- Operating System:
MacOS Sierra
- Ethereum client:
Ganache
- Truffle version (
4.1.7
): - node version (
9.11.1
): - npm version (
5.6.0
):
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:27 (5 by maintainers)
Top Results From Across the Web
Solidity error: Expected identifier, got 'LParen' - Stack Overflow
I have faced this problem with the constructor in solidity too this can be solved really easily. if you are running your code...
Read more >ParserError: Expected identifier, got 'LParen' constructor() public
The code you provided works just fine, assuming you have the right compiler version. To verify, you can just copy+paste the code in...
Read more >I Get A Parser Error: Expected Identifier Got Lparen ... - ADocLib
I get a parser error: expected identifier got lparen constructor in remix. Following is the full code. Appreciate some advise to solve this....
Read more >Truffle Compile failing ParserError Expected token LParen got ...
truffle compile fails with the following error: Error parsing /Users/rdelrosario/ron-eth-pet-shop/test/TestAdoption.sol: ...
Read more >ParserError: Expected identifier but got '(' : r/ethdev - Reddit
receive function will only allow 2300 gas consumption for its execution, enough for a simple event emit, it will fail if you try...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@satyamakgec Could you see if this fixes the global installation for you?
Now this is interesting, shows a different version for
solc-js
. I guess my linter (which is showing this error) is using the version before and that standalone package isn’t updated.Reinstalling solc separately it mentions
0.4.23
thoughsolc --version
is still reporting0.4.21
.Ahh I need to rebuild
solc
from source.