I'm trying to compile a contract in the solidity browser compiler
and get this error:
Untitled:19:9: Error: Expected primary expression.
}
^
Is this due to the throw;
statement?
contract user {
address public owner;
function user(){
owner = msg.sender;
}
function kill(){
suicide(owner);
}
modifier onlyOwner{
if (msg.sender != owner){
throw;
}else{
-
}
}
}
Best Answer
Here's your modified code:
The only problem with your code is that I had to replace your
-
with a_;
. See Are underscores `_` in modifiers code or are they just meant to look cool? for more information on the_
modifiers.Your modified code then compiles perfectly in the Solidity realtime compiler and runtime: