Let's upgrade our smart contract to a commercial one. To vote, the voter needs to pay a small amount of money. This is similar to American Idol, in which people vote for who they want to win by text-messaging their choice.
Go back to the voting_project directory and open a new file in the contracts directory and name this CommercialVoting.vy. Refer to the code file in the following GitLab link for the full code of this code block: https://gitlab.com/arjunaskykok/hands-on-blockchain-for-python-developers/blob/master/chapter_06/voting_project/contracts/CommercialVoting.vy:
struct Proposal: name: bytes32 vote_count: int128proposals: public(map(int128, Proposal))voters_voted: public(map(address, int128)) ...