Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

mandate package

Overview

Package mandate is capped, revocable direct debit on native GNOT, built on Gno session keys.

A payee publishes a plan ("1 GNOT every 7 days"). A payer subscribes with two things signed by the payer's own key:

  1. a session on chain for the payee's collector key, scoped to this realm only, with a spend limit of the plan's amount plus a small fee allowance per period, and an expiry;
  2. Subscribe here, which records the terms for that session.

The payee's collector then calls Pull once per period, signed with the session key on behalf of the payer and sending exactly the plan's amount. The realm is the rulebook: it checks who, how much and when, then forwards the coins to the payee in the same transaction. It never keeps funds.

Honest limits, also shown on the home page:

  • It is direct debit, not escrow. A payer can revoke the session, cancel, or empty the account at any time; the payee is then not paid.
  • The chain caps what the payer can lose per period at the session's spend limit: amount plus fee allowance. A hostile payee can burn the allowance as gas fees (it goes to the network, not to the payee).
  • The chain allows at most 16 sessions per account, so a wallet can have at most 16 mandates at a time.
  • A realm cannot see an on-chain session revoke. A service deciding whether someone has paid reads PaidThrough, which moves only when a payment succeeds; HasMandate is only the realm's view (recorded, not cancelled, not expired), and the chain's own view of the session is the free query auth/accounts/<payer>/session/<session address>.
  • A session scoped to vm/exec:<this realm> also allows every realm under this path (the chain's scope match is prefix-based). Nothing must ever be deployed under a sub-path of this realm. Pull also refuses any session whose allow list is not exactly this realm, but that cannot protect a payer from a sub-realm called directly.

There is no admin, owner, pause, upgrade or sweep.

Function

SupportersOf

func SupportersOf(planID uint64, page int) []MandateInfo
Ask AI Claude ChatGPT

SupportersOf lists a plan's active mandates (not cancelled, replaced or expired), oldest first. Page n covers entries (n-1)*PageSize to n*PageSize-1 of the plan's list, so a page may hold fewer rows than PageSize; inactive ones are on the payers' own pages.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1llc3lq3zmjtjdk29dk52munrzxt5ne746cl7r8/mandate.SupportersOf(,)"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g1llc3lq3zmjtjdk29dk52munrzxt5ne746cl7r8/mandate, for example a function call with arguments.