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

ballot/v0 package

Overview

Package ballot is a Gno port of the classic Solidity "Ballot" voting contract from the Solidity docs. A chairperson seeds a fixed list of proposals and grants specific addresses the right to vote; each voter can either cast a direct vote or delegate their weight to another voter, and delegation follows a chain so a delegate who later delegates further still carries every accumulated weight. The winning proposal is whichever has the most accumulated weight at query time.

Function

WinnerName

func WinnerName() string

WinnerName returns the name of the current winning proposal, or "" if the ballot hasn't been initialized.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/daily/ballot/v0.WinnerName()"

Result