Contracts, State machine defined