I was going through the tutorial from DappUniversity on Youtube when I stumbled across with my enum
pragma solidity ^0.6.0;
contract HotelRoom {
address payable public owner; /*state variable, the payment is sent to this address*/
enum Statuses { Vacant, Occupied };
Statuses currentStatus;
event Occupy(address _occupant, uint _value);
constructor() public {
owner = msg.sender; /*this is the address of the user who calls this function*/
currentStatus = Statuses.Vacant;
}
modifier onlyWhileVacant {
require(currentStatus == Statuses.Vacant, "Currently occupied.");
_;
}
modifier costs (uint _amount) {
require(msg.value >= _amount, "Not enough Ether provided.")
}
receive() external payable onlyWhileVacant costs(2 ether) {
currentStatus = Statuses.Occupied;
owner.transfer(msg.value);
emit Occupy(msg.sender, msg.value);
}
}
and the error yields this
browser/mycontract14.sol:6:37: ParserError: Function, variable, struct or modifier declaration expected enum Statuses { Vacant, Occupied };
^
Like I said, this is not really my own code, I'm just following along a tutorial. And sorry if my format is messy, I'm new, but ambitious!