For example:
enum Stages {
AcceptingBookings,
StopAcceptingBookings,
Finished
}
Stages public stage = Stages.AcceptingBookings;
function rand ( uint256 param) atStage(Stages.AcceptingBookings) returns (uint256){}
In the above, when the contract is in state 'Stages.AcceptingBookings' only code within that function will run, pretty cool..
I just need to be able to access it via web3.eth though and I cant see clear explanation. If anyone knows please let me know I want to check what stage I am at from web3.eth if it is possible.
The above code is from the Solidity docs on State Machine: https://solidity.readthedocs.org/en/latest/common-patterns.html#state-machine
Works great from geth, just trying to work out the syntax for web3.eth