Awesome
Dynamic Voting System
Basic Idea
This is an exploratory project for working with hints/dictionaries in cairo. It is based on the code and idea given here. The main modification is around the processing of votes and maintaining the merkel tree. This system allows one to send multiple votes till voting is open. The process_vote function will not update state if new vote is same as previous vote. However, if the new vote is different compared to previous vote then yes/no votes are adjusted accordingly and the merkel tree maintaining state is changed. An important observation here comes from using the dictionary from starkware.cairo.common.dict. Specifically, the dictionary is represented as a chronological list of accesses (read/write/modify). So even a read access means the internal pointer gets updated. This reference is useful.