2

My modifiers are throwing internal compilation errors: Internal compiler error: Identifier type not expected in expression context.

modifier critical {
    if (mutex) throw;
    mutex = true;
    _;
    mutex = false;
}

function createPlayer() {
    critical; 
    var player = players[msg.sender];
    if (player.ready) { throw; }
    player.ethaddress = msg.sender;
    player.creationdate = block.timestamp; 
    player.balance += msg.value;
}
1
function createPlayer() critical {
// Not
function createPlayer() {
    critical; 
| improve this answer | |
1

Modifiers are specified after the function, like:

function createPlayer() critical {
    ...
} 
| improve this answer | |

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.