Search Apps Documentation Source Content File Folder Download Copy Actions Download

memba_points_migration_v1 package

Overview

Package memba_points_migration_v1 is a one-time, owner-gated importer of legacy backend XP into the soulbound memba_points_v1 ledger. It holds NO funds and mints NO points itself — it calls the audited awarder path (memba_points_v1.Award) so every migrated grant lands as a normal PointsAwarded event (source = this realm, reason = "xp_migration"). Idempotent per-address + permanently finalizable.

The parsing / validation / dedup logic lives in the pure, unit-tested p/samcrew/memba_points_migration_core_v1 package; this realm is the thin state + effect shell (owner gate, migrated set, finalize latch, the Award loop). It can't be unit-tested under bare `gno test` because it imports the unpublished points_v1 — its logic is covered by the core tests plus a test13 ceremony dry-run.

Rollout (owner ceremony, after points_v1 is deployed): points_v1.AddAwarder(this realm) → MigrateBatch × N → FinalizeMigration → points_v1.RemoveAwarder(this realm). See README.md.

Functions

FinalizeMigration

func FinalizeMigration(cur realm)

FinalizeMigration permanently closes the migration — no further MigrateBatch. Owner only, irreversible.

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_migration_v1" -func "FinalizeMigration" -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_migration_v1" -func "FinalizeMigration" -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
  

IsFinalized

func IsFinalized() bool

IsFinalized reports whether the migration is permanently closed.

Command

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

Result

IsMigrated

func IsMigrated(addr string) bool

IsMigrated reports whether an address has already been imported.

Param

Command

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

Result

MigrateBatch

func MigrateBatch(cur realm, entries string)

MigrateBatch imports a batch of legacy XP as points. Owner only. `entries` is "addr:amount,addr:amount" (≤ MaxBatch). Malformed input fails the whole tx (fail-fast); an already-migrated address is skipped; the call is refused once finalized. Each fresh entry is awarded through the audited memba_points_v1 awarder path.

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_migration_v1" -func "MigrateBatch" -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_migration_v1" -func "MigrateBatch" -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(_ string) string

Render — minimal gnoweb status (owner is a fixed const-derived address; no untrusted input).

Param

Command

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

Result