evm-tokenvote

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

overview.texi (1283B)


      1 @node overview
      2 @chapter Overview
      3 
      4 This smart contract enables voting on proposals using ERC20 tokens.
      5 
      6 
      7 @section Tooling
      8 
      9 Tests and tools are implemented using the @url{https://pypi.org/project/chainlib-eth, chainlib-eth} python package.
     10 
     11 To learn more about the individual CLI tools mentioned in this document, please refer to their individual man pages. The man pages should be installed as part of the python packages.
     12 
     13 
     14 @section Interoperability
     15 
     16 The @code{evm-tokenvote} contract implements the @code{cic-contracts:TokenVote} interface.
     17 
     18 
     19 @section Publishing the contract
     20 
     21 In python, the smart contract can be published using the @code{constructor} method of the @code{evm_tokenvote.Voter} class.
     22 
     23 Also, constructor bytecode can be generated on the command-line using @code{chainlib-gen}. Thereafter, @code{eth-gen} can be used to publish the contract through an rpc endpoint:
     24 
     25 @example
     26 # Make sure evm_tokenvote is in your PYTHONPATH
     27 $ chainlib-gen evm_tokenvote create --token_address <token_address> > data.bin
     28 $ eth-gas -p <rpc_url> -y <json_keyfile> [ --passphrase-file <file_with_keyfile_passphrase> ] --data data.bin -i <evm:chain:chain_id:common_name> -s -w 0
     29 @end example
     30 
     31 The @code{token_address} argument @strong{MUST} be an existing and valid @code{ERC20} contract.