Skip to content

Commit

Permalink
Exemples started
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Azoulay committed Oct 11, 2018
1 parent 156b60a commit c4cdcd1
Showing 1 changed file with 15 additions and 30 deletions.
45 changes: 15 additions & 30 deletions docs/solidity-by-example.rst
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
###################
Solidity by Example
###################
######################
Solidity par l'Exemple
######################

.. index:: voting, ballot

.. _voting:

******
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 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.
****
Vote
****

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.

::

Expand Down

0 comments on commit c4cdcd1

Please sign in to comment.