We want to be able to asign a score to the posts. For that, let's work on the function `vote()` from which the users will be able to upvote or downvote each post. NOTE: this voting mechanism is very naive and we recomend that you do not use it in production because it is not Sybil resistant:
You'll notice that we're using a new feature of Solidity here: `revert with reason`, which makes it significantly easier to debug your smart contracts. It should be fairly self-evident: just pass in a string stating the reason this `require` statement might fail as the second parameter so that you can track it easily. For a full discussion of this, go [here](https://github.com/ethereum/solidity/issues/1686).
> Building a Sybil resistant voting mechanism using a Proof of Identity that takes into account the privacy of users is a great challenge. How would you solve this problem?
The users needs to know somehow if they're able to vote on a post or not. There are two scenarios where a user should not be able to vote: a) The post doesn't exist, and b) The user already voted. This logic should be developed inside `canVote()`:
It's possible that a user would like to be reminded about what was their choice was for a post they voted on previously. Implement this in `getVote()`.
> Notice that, in the last two functions, the input and output values related to votes are `uint8` instead of an `enum`. This is because `enum`s are not a valid input/output value for functions, at least in the current version of Solidity.