Code Monkey home page Code Monkey logo

tzvote's Introduction

TzVote

Oracle

The Oracle is here to store missing information of current voting period index

compile

TAQ_LIGO_IMAGE=ligolang/ligo:0.72.0 taq compile votingPeriodOracle.jsligo

Test

Dry run

taq simulate votingPeriodOracle.tz --param pokeGame.parameter.default_parameter.tz  --sender alice --protocol nairobi

Unit tests

taq test unit_votingPeriodOracle.jsligo

Deploy

taq deploy votingPeriodOracle.tz -e "testing" --storage votingPeriodOracle.storage.ghostnet.tz
taq deploy votingPeriodOracle.tz -e "production" --storage votingPeriodOracle.storage.mainnet.tz

ghostnet : KT1ACfH87dohx1bAVc4PigcNBAFSTdxrRwj7 mainnet : KT1C8Varn3RWkSk6jJBVSRUHkmmXArGefifp

initialize some data

taq call votingPeriodOracle --param pokeGame.parameter.default_parameter.tz  -e testing

Smart contract

Compile Tezos baker contract

TAQ_LIGO_IMAGE=ligolang/ligo:0.72.0 taq compile tezosTemplate3.jsligo

Unit tests

taq test unit_tezosTemplate3.jsligo

Deploy

taq deploy tezosTemplate3.tz -e "testing" --storage tezosTemplate3.storage.ghostnet.tz

KT1G4DCjT2SviF7T6Ji9zB5m65DR67Mw91nZ

taq deploy tezosTemplate3.tz -e "production" --storage tezosTemplate3.storage.mainnet.tz

KT1FohLnkN7zNk4fQy99D4TJoM83Ln8JJz4c

Compile permissioned Simple Poll contract

TAQ_LIGO_IMAGE=ligolang/ligo:0.72.0 taq compile permissionedSimplePoll.jsligo

Unit tests

taq test unit_permissionedSimplePoll.jsligo

Deploy

taq deploy permissionedSimplePoll.tz -e "testing" --storage permissionedSimplePoll.storage.ghostnet.tz

KT1ACfH87dohx1bAVc4PigcNBAFSTdxrRwj7

taq deploy permissionedSimplePoll.tz -e "production" --storage permissionedSimplePoll.storage.mainnet.tz

KT1CXVRgTKeEn2F2fqVX7tWcMrYRn8vaJwUa

App

Compile both for the frontend

TAQ_LIGO_IMAGE=ligolang/ligo:0.72.0 taq compile tezosTemplate3.jsligo --json && mv artifacts/tezosTemplate3.json ./app/src/contracttemplates/

TAQ_LIGO_IMAGE=ligolang/ligo:0.72.0 taq compile permissionedSimplePoll.jsligo --json && mv artifacts/permissionedSimplePoll.json ./app/src/contracttemplates/

Generate types

taq install @taqueria/plugin-contract-types
taq generate types ./app/src

Build

Install dependencies:

npm i
npm run local

Build for Android (linked to mainnet config by default on package.json)

ionic capacitor add android
ionic capacitor copy android
npm install -g cordova-res
cordova-res android --skip-config --copy
ionic capacitor sync android
ionic capacitor update android

TzCommunity

  • TzVote utilizes TzCommunity to retrieve people's profile data.

TIPS

Add one of my account alice as a baker

tezos-client register key alice as delegate

Docs

import git submodule and run doc locally

git submodule add https://github.com/marigold-dev/marigold-docs-theme.git docs/theme
git submodule update --init --recursive
mdbook serve --open --port 3003

tzvote's People

Contributors

cyrilevos avatar fraidev avatar omahs avatar zamrokk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tzvote's Issues

Add feature to share the poll

Is it possible to add a share option for the poll that has been created? I created a poll and added all my delegators as eligible to vote on. But they have to go on the site and manually search for name of the poll which i don't think is very efficient especially if more bakers start using this to ask the same questions

add "Permissioned Simple poll" voting template

MOTIVATION: propose other ways for user for creating polls

DETAILED DESIGN:

Implement other templates. Propose theses new template when creating a voting session and modify the way results are displayed

DRAWBACKS: some impacts on display and new smart contract templates to create. Big question : how to deal with old templates ? Normally, we should have no impact as these is new smart contracts. Just dapp and devops should be impacted

bulk add voter addresses

for Permissioned polls, would be very useful if the UI allowed us to add multiple addresses easily (csv file or any similar format pasted into a textarea)

Add "Samarkand" voting template

MOTIVATION: propose other ways for user for creating polls

DETAILED DESIGN:

Implement other templates. Propose theses new template when creating a voting session and modify the way results are displayed

DRAWBACKS: some impacts on display and new smart contract templates to create. Big question : how to deal with old templates ? Normally, we should have no impact as these is new smart contracts. Just dapp and devops should be impacted

Update DNS ans rename project

SUMMARY: Update DNS ans rename project

MOTIVATION: better maintenance and best marketing name

DETAILED DESIGN:

  • tzvote.marigold.dev => mainnet
  • hangzounet.tzvote.marigold.dev => hangzhounet
  • ithacanet.tzvote.marigold.dev => ithacanet

ALTERNATIVES: as we have today for hangzhou testnet

DRAWBACKS: renaming the git repo might have some impacts

Mainnet availability

SUMMARY: Mainnet availability

MOTIVATION: from testnet to public mainnet exposure

DETAILED DESIGN:

  • get a mainnet wallet with some tz
  • set the private key on k8s
  • deploy a voting session smartcontract with this wallet on mainnet
  • deploy the oracle smartcontract with this wallet on mainnet

DRAWBACKS: Have an admin account on mainnet that can initally deploy Smart contracts and then refresh the Oracle storage

create a template where the creator can choose a baker and all its delegators will be invited. Their votes will correspond to their voting power

Simple Permissioned Polls:
"Contract owner can add/remove permissioned addresses. Each address has 1 vote power. Period dates are free of choice"
this one, we are using it to ask our TTC $tedv delegators to signal their vote for TezosDomains DAO proposals. Would be nice if we could set the voting power of each address according to the voting power delegated to us TTC.

hum ... maybe it is feasible offchain so I need to provide an oracle for this. On the smartcontract it is only possible to get the baker voting power, not the details of delegators

Also this mean that the dates for the vote will be attached to a Tezos voting period (like the baker's template)

open source TzVote

SUMMARY: open source TzVote

MOTIVATION: expose it to outside Marigold

DETAILED DESIGN:

  • open source license ? MIT
  • version to release ? 0.0.1 ?

Block voting button if are on the last block of a period or on the first block

SUMMARY: Block voting button if are on the last block of a period or on the first block

IMPACT:

  • last block : vote will not be taken into account because when the block will be forged, it will appear on the next period and so, be rejected by the smart contract
  • first block : first block needs to be forged on tezos for the next period index to be display on the chain, then update of the oracle will appear on the second block (normally...if no delay), then when voting :
    • vote tx is also on 1st block => rejection
    • vote tx is also on oracle update or before => rejection
      Solution ? compare oracle index and tezos index, if different, not time to vote, if sync, then all is fine for voting. So VOTE button can be displayed

REPRODUCTION:

  • last block : vote on last block of voting period
  • first block :
    • vote on first block
    • vote before oracle is updated

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.