flâneur — a map of the web's best reading

Solidity by Example — Solidity 0.8.29 documentation

docs.soliditylang.org · 7,597 words · saved by 1 readers

The following contract is quite complex, but showcases a lot of Solidity’s features. It implements a voting contract. Of course, the main problems of electronic voting is how to assign voting rights to the correct persons and how to prevent manipulation. We will not solve all problems here, but at least we will show how delegated voting can be done so that vote counting is automatic and completely transparent at the same time. The idea is to create one contract per ballot, providing a short name for each option. Then the creator of the contract who serves as chairperson will give the right to vote to each address individually. The persons behind the addresses can then choose to either vote themselves or to delegate their vote to a person they trust. At the end of the voting time, winningProposal() will return the proposal with the largest number of votes. open in Remix Currently, many transactions are needed to assign the rights to vote to all participants. Moreover, if two or more pro

Solidity by Example - Solidity 0.8.37-develop documentation Solidity by Example Edit on GitHub Solidity by Example  Voting  The following contract is quite complex, but showcases a lot of Solidity’s features. It implements a voting contract. Of course, the main problems of electronic voting is how to assign voting rights to the correct persons and how to prevent manipulation. We will not solve all problems here, but at least we will show how delegated voting can be done so that vote counting is automatic and completely transparent at the same time. The idea is to create one contract per ball

Explore this link on the map →

related reading