```\nif (getCancelled(\_proposalID)) {\n    // Cancelled by the proposer?\n    return ProposalState.Cancelled;\n    // Has it been executed?\n} else if (getExecuted(\_proposalID)) {\n    return ProposalState.Executed;\n    // Has it expired?\n} else if (block.number >= getExpires(\_proposalID)) {\n    return ProposalState.Expired;\n    // Vote was successful, is now awaiting execution\n} else if (votesFor >= getVotesRequired(\_proposalID)) {\n    return ProposalState.Succeeded;\n    // Is the proposal pending? Eg. waiting to be voted on\n} else if (block.number <= getStart(\_proposalID)) {\n    return ProposalState.Pending;\n    // The proposal is active and can be voted on\n} else if (block.number <= getEnd(\_proposalID)) {\n    return ProposalState.Active;\n} else {\n    // Check the votes, was it defeated?\n    // if (votesFor <= votesAgainst || votesFor < getVotesRequired(\_proposalID))\n    return ProposalState.Defeated;\n}\n```\n