Search Apps Documentation Source Content File Folder Download Copy Actions Download

memba_points_v1 package

Overview

Package memba_points_v1 is a soulbound (non-transferable), no-banker on-chain reputation ledger for the Memba ecosystem. Addresses accrue non-transferable "Memba Points" (MP) via authorized awarders (the owner or whitelisted awarder realms); MP is READ by other surfaces for status tiers, feature gating, and leaderboards.

SAFETY: there is NO transfer, NO banker, and NO OriginSend anywhere — the entire fund-drain risk class (the OriginSend/IsUserCall/F-1 family) simply does not apply. The ONLY trust boundary is who may Award/Revoke (the owner ∪ whitelisted awarder realms); every mint/burn emits an event. Non-transferability is by construction: there is no Transfer/Send/Approve, so points can never be bought, sold, or wash-traded — MP is reputation, not money ($MEMBA is the money).

Functions

AcceptOwnership

func AcceptOwnership(cur realm)

AcceptOwnership completes the handoff. Only the staged pendingOwner may call it.

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/samcrew/memba_points_v1" -func "AcceptOwnership" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_points_v1" -func "AcceptOwnership" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

AddAwarder

func AddAwarder(cur realm, pkgpath string)

AddAwarder whitelists a realm pkgpath as an authorized points source (it may call Award/Revoke). Owner only. An awarder is another realm whose OWN verified flow decides who earns; this realm only trusts that the source is on the list.

Param

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/samcrew/memba_points_v1" -func "AddAwarder" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_points_v1" -func "AddAwarder" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

Award

func Award(cur realm, to address, amount int64, reason string)

Award grants `amount` non-transferable points to `to`. Owner or a whitelisted awarder realm only. Bounded amount + int64 overflow guard. Emits PointsAwarded (with the awarding source realm).

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/samcrew/memba_points_v1" -func "Award" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_points_v1" -func "Award" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

BalanceJSON

func BalanceJSON(addr string) string

BalanceJSON returns one account's balance (incl. its on-chain tier) as JSON, or the zero record if the address is unknown. Tier is canonical here — read from the on-chain band ladder — so consumers must NOT re-derive it client-side (see ProfileJSON for points+tier+rank in one call).

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.BalanceJSON()"

Result

GetAwardersJSON

func GetAwardersJSON() string

GetAwardersJSON returns the whitelisted awarder realm pkgpaths as a JSON string array (bounded — the whitelist is small + owner-managed). Public "who may mint points" transparency.

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.GetAwardersJSON()"

Result

GetPoints

func GetPoints(a string) int64

GetPoints returns an address's current points (0 if unknown). Pure.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.GetPoints()"

Result

HolderCount

func HolderCount() int

HolderCount returns the number of accounts with a positive balance (O(1)).

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.HolderCount()"

Result

IsPaused

func IsPaused() bool

IsPaused reports whether Award/Revoke are frozen.

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.IsPaused()"

Result

Pause

func Pause(cur realm, state bool)

Pause freezes Award/Revoke (reads stay available). Owner only.

Param

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/samcrew/memba_points_v1" -func "Pause" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_points_v1" -func "Pause" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

ProfileJSON

func ProfileJSON(addr string) string

ProfileJSON returns points + tier + rank + holders in ONE call (frontend profile, one round-trip).

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.ProfileJSON()"

Result

RankOf

func RankOf(addr string) string

RankOf returns {"addr","points","rank","holders"}; rank/points are 0 if the address holds none.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.RankOf()"

Result

RemoveAwarder

func RemoveAwarder(cur realm, pkgpath string)

RemoveAwarder revokes an awarder realm's authority. Owner only.

Param

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/samcrew/memba_points_v1" -func "RemoveAwarder" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_points_v1" -func "RemoveAwarder" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

Render

func Render(path string) string

Render — human gnoweb view. "" → home (totals + owner + awarders); "a/<addr>" → one balance.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.Render()"

Result

Revoke

func Revoke(cur realm, from address, amount int64, reason string)

Revoke removes up to `amount` points from `from`, clamped at zero (never negative). Owner or a whitelisted awarder realm only — moderation / clawback. A no-op on a zero balance. Emits PointsRevoked with the amount actually removed.

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/samcrew/memba_points_v1" -func "Revoke" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_points_v1" -func "Revoke" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

SetTierBands

func SetTierBands(cur realm, spec string)

SetTierBands replaces the tier ladder. Owner only. spec is "Name:Min,Name:Min,..." with strictly ascending Min, the first Min == 0, 1..MaxBands entries, non-empty unique names. Emits TierBandsSet.

Param

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/samcrew/memba_points_v1" -func "SetTierBands" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_points_v1" -func "SetTierBands" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

TierBandsJSON

func TierBandsJSON() string

TierBandsJSON exposes the ladder: [{"name":"Bronze","minPoints":0},...]

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.TierBandsJSON()"

Result

TierOf

func TierOf(addr string) string

TierOf returns the tier name for an address's current points ("" if no bands are configured). Pure.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.TierOf()"

Result

TopN

func TopN(n int) string

TopN returns up to min(n, MaxTopN) leaders (points-descending) as JSON: [{"rank":1,"addr":"g1..","points":123,"tier":"Gold"},...]

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.TopN()"

Result

TopNPage

func TopNPage(offset, count int) string

TopNPage returns a page of the leaderboard from offset (0-based), up to min(count, MaxTopN).

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.TopNPage(,)"

Result

TotalPoints

func TotalPoints() int64

TotalPoints returns the sum of all current points across every account (O(1)).

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/samcrew/memba_points_v1.TotalPoints()"

Result

TransferOwnership

func TransferOwnership(cur realm, newOwner address)

TransferOwnership stages a new owner; it takes effect only after AcceptOwnership is called BY that address (2-step, so a typo can't brick admin).

Param

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/samcrew/memba_points_v1" -func "TransferOwnership" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_points_v1" -func "TransferOwnership" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx