const MaxPolls, MaxQuestionLen, MaxOptions, MaxOptionLen, IndexRecent
The bounds on what a creator may store. Anyone may create a poll, and the root page renders the newest ones.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package polls is an on-chain poll / voting realm for gno.land.
⚠️ Experimental — generated with no human supervision. This realm was produced automatically by an MCP-driven agent to exercise the gno MCP server and tooling, and to generate test content for gno compilers, linters and formatters. Not audited. Not for production. Full context & folder README: r/moul/x/daily
An on-chain poll and voting realm for gno.land (gno 0.9). Anyone can
create a poll with a question and a comma-separated set of options; every caller
address may cast exactly one vote per poll. The realm's Render page lists each
poll with its options, live tallies drawn as ▓░ bar charts, per-option
percentages, and the total number of votes.
gno.land/r/nym-moultest123/x/daily/polls/v1
CreatePoll(question string, options string) int — create a poll. options
is a comma-separated list (blank entries are dropped; at least 2 required).
Returns the new poll's id.Vote(pollID int, optionIndex int) — cast one vote for optionIndex on poll
pollID. One vote per caller address per poll; a second vote aborts.Both are gno 0.9 crossing functions (first parameter cur realm); the caller
address is read via runtime.PreviousRealm().Address().
Render("") — index of all polls with bar-chart tallies.Render("<id>") — a single poll by id. 1# create a poll (returns its id, e.g. 0)
2gnokey maketx call -pkgpath "gno.land/r/nym-moultest123/x/daily/polls/v1" \
3 -func CreatePoll -args "Best L1 for smart contracts?" -args "gno,eth,sol" \
4 -gas-fee 20000ugnot -gas-wanted 2000000 -broadcast -chainid onyx-1 -remote https://rpc.onyx.testnets.gno.land:443 mykey
5
6# vote for option index 0 on poll 0
7gnokey maketx call -pkgpath "gno.land/r/nym-moultest123/x/daily/polls/v1" \
8 -func Vote -args 0 -args 0 \
9 -gas-fee 20000ugnot -gas-wanted 2000000 -broadcast -chainid onyx-1 -remote https://rpc.onyx.testnets.gno.land:443 mykey
10
11# view results in gnoweb
12# https://gno.land/r/nym-moultest123/x/daily/polls/v1
13# https://gno.land/r/nym-moultest123/x/daily/polls/v1:0
1gno test .
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
Dependency graph:

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.
Package polls is an on-chain poll / voting realm for gno.land.
Anyone can create a poll with a question and a comma-separated list of options. Each caller address may cast exactly one vote per poll. Render draws every poll with its options, tallies as ▓░ bar charts, percentages and the total vote count.
The bounds on what a creator may store. Anyone may create a poll, and the root page renders the newest ones.
CreatePoll registers a new poll. options is a comma-separated list; blank entries are dropped. Returns the new poll's id. Crossing function: an EOA invokes it via MsgCall; another realm via polls.CreatePoll(cross, q, opts).
PollCount returns the number of polls created so far (read-only helper).
Render produces the Markdown page for gnoweb. It is NOT a crossing function.
Vote casts one vote for optionIndex on poll pollID. Each caller address may vote at most once per poll. Crossing function.
Poll is a single question with its options and per-address vote tracking.