Search Apps Documentation Source Content File Folder Download Copy Actions Download

memba_appstore_v2 package

Overview

Package memba_appstore_v2 is a curated App Store for gno.land dApps: publishers pay a flat listing fee to register an app; a curator flips it live.

MONEY PATH (the only one): RegisterApp collects a flat `registrationFee` in ugnot and forwards 100% to the treasury in the SAME call — nothing is ever custodied. The safety contract mirrors memba_token_otc_v1 + the O-13 lesson:

  1. IsUserCall() guard BEFORE reading OriginSend — an ephemeral `maketx run` realm can never attach unrecoverable coins (the guard agent_registry missed).
  2. exact-coin via unsafe.OriginSend() (the coins on THIS call, not the wallet balance) — closes the overpay-trap and the wallet-balance bypass.
  3. treasury-misconfig is fail-closed: an unset treasury panics (→ tx reverts → coins refunded), never silent custody.
  4. CEI: state is written before the banker moves funds.
  5. NewBanker(RealmSend, cur) sends the fee from the realm's own address to the treasury — no custody, no escrow (which is why no escrow is needed to be safe).

TREASURY: stored LOCALLY (admin-settable, 2-step handoff, defaults to the samcrew multisig) rather than read from memba_market_config — this keeps the realm self-contained so the whole money path is unit-tested locally. Keep it in sync with memba_market_config.GetTreasury(); a future version may read the fee spine directly (which makes the realm non-locally-testable — a deliberate later trade-off).

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_appstore_v2" -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_appstore_v2" -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
  

AddCurator

func AddCurator(cur realm, addr address)

AddCurator grants the curate role (approve pending listings). 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_appstore_v2" -func "AddCurator" -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_appstore_v2" -func "AddCurator" -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
  

AppCount

func AppCount() int

AppCount returns the total number of registered listings (any status).

Command

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

Result

ApproveApp

func ApproveApp(cur realm, pkgPath string)

ApproveApp flips a pending listing live. Curator-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_appstore_v2" -func "ApproveApp" -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_appstore_v2" -func "ApproveApp" -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
  

DelistApp

func DelistApp(cur realm, pkgPath string)

DelistApp removes a listing from public view. The publisher or a curator may do it.

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_appstore_v2" -func "DelistApp" -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_appstore_v2" -func "DelistApp" -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
  

FlagApp

func FlagApp(cur realm, pkgPath string)

FlagApp lets any user flag a LIVE listing once. At FlagHideThreshold distinct flags the listing stops appearing live; a curator then DelistApp's it or leaves it for review (a delisted app can be brought back with RestoreApp).

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_appstore_v2" -func "FlagApp" -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_appstore_v2" -func "FlagApp" -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
  

GetListingJSON

func GetListingJSON(pkgPath string) string

GetListingJSON returns a single listing (any status) with its description, or the JSON literal `null` if the package path is not registered.

Param

Command

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

Result

GetRegistrationFee

func GetRegistrationFee() int64

GetRegistrationFee returns the current flat listing fee in ugnot.

Command

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

Result

GetStatsJSON

func GetStatsJSON() string

GetStatsJSON returns a small stats object for a status header.

Command

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

Result

ListLiveJSON

func ListLiveJSON(offset, limit int) string

ListLiveJSON returns a bounded JSON array of the visible (live, un-hidden) listings: skip `offset`, take up to clamped `limit`. Iteration stops as soon as the window is filled, so the scan is bounded by offset+limit regardless of catalog size.

Params

Command

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

Result

Pause

func Pause(cur realm, state bool)

Pause is the kill switch: while paused, RegisterApp aborts (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_appstore_v2" -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_appstore_v2" -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
  

RegisterApp

func RegisterApp( cur realm, pkgPath, name, tagline, descr, category, iconCID, appURL string, ) uint64

RegisterApp lists a new app. The caller pays EXACTLY registrationFee ugnot with the call; the whole fee is forwarded to the treasury (no custody). The listing starts `pending` and is not shown live until a curator approves it.

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_appstore_v2" -func "RegisterApp" -args $'' -args $'' -args $'' -args $'' -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_appstore_v2" -func "RegisterApp" -args $'' -args $'' -args $'' -args $'' -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
  

RemoveCurator

func RemoveCurator(cur realm, addr address)

RemoveCurator revokes the curate role. 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_appstore_v2" -func "RemoveCurator" -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_appstore_v2" -func "RemoveCurator" -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 shows the live catalog (bounded) — a read-only trust surface for gnoweb. The frontend reads structured data via the getters, not this markdown.

Param

Command

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

Result

RestoreApp

func RestoreApp(cur realm, pkgPath string)

RestoreApp brings a delisted app back to `pending` (re-curation required before it shows live again). Curator-only — this is the reverse of DelistApp, so a mistaken or contested delist is recoverable.

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_appstore_v2" -func "RestoreApp" -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_appstore_v2" -func "RestoreApp" -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
  

SetRegistrationFee

func SetRegistrationFee(cur realm, fee int64)

SetRegistrationFee sets the flat listing fee in ugnot (0..MaxRegistrationFee). Zero is allowed (a fee waiver). 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_appstore_v2" -func "SetRegistrationFee" -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_appstore_v2" -func "SetRegistrationFee" -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
  

SetTreasury

func SetTreasury(cur realm, addr address)

SetTreasury repoints the fee recipient. Must be non-empty (an empty treasury would fail-close RegisterApp). Owner only. Keep this in sync with memba_market_config.GetTreasury().

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_appstore_v2" -func "SetTreasury" -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_appstore_v2" -func "SetTreasury" -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
  

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_appstore_v2" -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_appstore_v2" -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