Code Monkey home page Code Monkey logo

certification-votes's Introduction

certification-votes

V0

The current implementation allows us to have a fixed set of account for which an unlimited set of accounts can vote.

First one should create a few accounts which can be used in two ways:

  • to be included in the list of accounts available for voting for
  • to be used as accounts performing transactions against the smart contract, e.g. voting

In this document we assume that the reader is already familiar with the procedure of account creation.

To originate the contact, use a command similar to the following:

tezos-client -A alphanet.tzscan.io originate contract voting0 for genny transferring 0 from genny running certificationVotes.tz --init '{ Elt "tz1TZwcbYiqfsJH9XDbmzaocttwMwqi9QWLH" {} ; Elt "tz1VKAYh4nE92ugzdPxE1gDxvuWvjzwKGsDt" {} }' --burn-cap 0.612

A few notes:

  • voting0 is the alias of smart contract to be created.
  • genny is the alias of the account which originates the contract. Yours may be different.
  • The inital value of storage for the smart contract '{ Elt "…" {} ; Elt "…" {} }' sets up the contract to be used to vote for two accounts, whose addresses are included as keys in the map. Apparently the addresses should be ordered. For that one could use an online service.
  • --burn-cap may be adjusted if you get an error message saying that the operation is going to exceed the cap limit.

This example uses alphanet, but you could use zeronet.tzscan.io instead.

V1

In this version, we add the deadline for voting.

To originate the contact, use a command similar to the following:

tezos-client -A alphanet.tzscan.io originate contract voting1 for genny transferring 0 from genny running certificationVotes.tz --init '(Pair 1561734120 { Elt "tz1TZwcbYiqfsJH9XDbmzaocttwMwqi9QWLH" {} ; Elt "tz1VKAYh4nE92ugzdPxE1gDxvuWvjzwKGsDt" {} })' --burn-cap 0.612

A few notes:

  • Pair 1561734120 ...: 1561734120 is the timestamp

certification-votes's People

Contributors

mrkkrp avatar talbatz avatar vnea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.