PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/moul/x/daily/governor/v0

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v0
Namespace
moul / x / daily / governor
Files
3 (README)(gnomod.toml)
Exported functions
5
Module
gno.land/r/moul/x/daily/governor/v0
gno
0.9

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • governor.gnogno
README.mdPreviewRaw
# Governor

> ⚠️ **Experimental — generated with no human supervision** by the daily MCP pipeline (Solidity→Gno port). Not audited. See [r/moul/x/daily](https://github.com/moul/gno-contracts/blob/main/r/moul/x/daily/README.md).

---


A simplified on-chain governance realm inspired by OpenZeppelin's `Governor`.
It ports the core proposal → vote → execute lifecycle to Gno: `Propose` records
a proposal's snapshot height and a deadline of `ChainHeight() + votingPeriod`,
`CastVote` gives every address a single equally-weighted vote (1 address = 1
vote, tracked in an avl voter set), and `State` computes `Active` / `Succeeded`
/ `Defeated` from the deadline versus the current chain height plus whether the
`for` tally beats `against`. `Execute` finalizes a `Succeeded` proposal.

Unlike the ERC20Votes-weighted original, voting power here is flat (one address,
one vote) and there is no timelock — the emphasis is on a clean, deterministic
state machine driven by block height.

## Example calls

```
# open a proposal (returns its id)
Propose("Fund the docs working group for Q3")

# vote: 0=against, 1=for, 2=abstain (one vote per address)
CastVote(1, 1)

# read the current state: Active | Succeeded | Defeated | Executed
State(1)

# once past the deadline with for > against, finalize it
Execute(1)
```

`Render("")` lists every proposal with its tally bars (`▓░`) and state.

<!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) -->

---

Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

**Dependency graph:**

![gno.land/r/moul/x/daily/governor/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/r/moul/x/daily/governor/v0/deps.png)

> 🧪 **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](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).

<!-- END GNOCONTRACTS FOOTER -->

Functions

  • CastVote(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id int64, support int)

  • Execute(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id int64)

  • Propose(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, description string) int64

  • Render(path string) string

  • State(id int64) string

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗

vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.