Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

qvote/v0 package

Overview

Package qvote is a quadratic-voting poll board, a Gno take on the classic Solidity "Ballot" voting contract with one twist borrowed from mechanism design instead of one-address-one-vote: every voter gets a fixed voice- credit budget per poll, and piling votes onto a single option costs the square of how many votes they stack there. Buying your 1st vote on an option costs 1 credit, the 2nd costs 3 more (4 total), the 3rd costs 5 more (9 total) -- so spreading conviction across options is cheap, but dominating one option gets expensive fast. Votes can also be pulled back for a matching credit refund.

Function

CreatePoll

func CreatePoll(cur realm, question string, optionsCSV string) string

CreatePoll opens a new poll with the given question and comma-separated options (at least 2, at most 8), returning its ID.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/daily/qvote/v0" -func "CreatePoll" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/daily/qvote/v0" -func "CreatePoll" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx