evm-tokenvote

Voting machine using ERC20 tokens as votes.
Info | Log | Files | Refs | README

proposal.texi (2309B)


      1 @node proposal
      2 @chapter Proposal
      3 
      4 Proposals are created with a 32-byte description.
      5 
      6 How the description should be interpreted is up to the client application.
      7 
      8 A proposal may be a binary (yes or no) vote, or define a number of different options to choose from.
      9 
     10 
     11 @section Parameters
     12 
     13 The arguments required to create a proposal depends on the type of proposal to create.
     14 
     15 
     16 @subsection Deadline
     17 
     18 The deadline must be defined for all proposals.
     19 
     20 It is defined as a period of number of blocks during which votes may be made.
     21 
     22 If a vote has been completed before the deadline is over, the result will be available immediately.
     23 
     24 The contract does not check the sanity of the deadline value. For example, setting the deadline to @code{1} block wait will be useless as voting will expire immediately.
     25 
     26 
     27 @section Target vote
     28 
     29 The target vote must be defined for all proposals.
     30 
     31 This defines the minimum participation in the vote. It is defined as parts-per-million of the total supply of tokens.
     32 
     33 For example. a value of @code{500000} will require 50% of all tokens in the vote. A value of @code{1000000} will require the full supply.
     34 
     35 
     36 @section Options
     37 
     38 A proposal may define one or more options for voters to choose between.
     39 
     40 Options are defined as 32-byte hexadecimal values. As with the description, it is up to the client application to decide how to interpret the values.
     41 
     42 
     43 @section Creating a proposal
     44 
     45 To create a proposal without options:
     46 
     47 @verbatim
     48 # solidity:
     49 function propose(bytes32 _description, uint256 _blockWait, uint24 _targetVotePpm) public returns (uint256);
     50 
     51 # chainlib-python:
     52 def propose(self, contract_address, sender_address, description, block_deadline, tx_format=TxFormat.JSONRPC, id_generator=None)
     53 
     54 # eth-encode CLI:
     55 $ eth-encode --mode tx --signature propose -e <voter_contract_address> -y <keyfile_json> a:<token_address> u:<blocks_until_deadline> u:<target_vote_ppm>
     56 @end verbatim
     57 
     58 
     59 To create a proposal with options:
     60 
     61 
     62 @verbatim
     63 solidity:
     64 function proposeMulti(bytes32 _description, uint256 _blockWait, uint24 _targetVotePpm) public returns (uint256);
     65 
     66 chainlib-python:
     67 def propose(self, contract_address, sender_address, description, block_deadline, options=[<options_hex>, ...])
     68 @end verbatim
     69 
     70 (Unfortunately, @code{eth-encode} does not currently support dynamic array arguments.)