Why is the ; not required after the end of the enum enuContractStates {Ready, Active, Paused} statement. If I add the ; after this statement I get a compile error.

Thank you

contract Picard {
    string public constant strFullName = "Jean Luc Picard";
    enum enuContractStates {Ready, Active, Paused}
    enuContractStates public state;


For the same reasons as to why it shouldn't be used after functions.

; is used to end a statement. A statement is usually introducing a variable or assigning a value to a variable.

However the { } construct is to express a block. You shouldn't use semicolon ; to end a block.

  • Got it. Thank you – Picard78 Sep 29 '20 at 7:44

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.