gnobuilders_badges_v2 source realm
1
27
func AcceptOwnership
crossing ActionAcceptOwnership completes the handoff. Only the staged pendingOwner may call it. The successor becomes an admin and the former owner's admin grant is revoked in the same transaction. Other explicitly appointed admins remain.
func AddAdmin
crossing Actionfunc Approve
crossing Actionfunc BalanceOf
Actionfunc BurnBadge
crossing ActionBurnBadge permanently removes a badge. Admin-only for soulbound badges, owner or admin for transferable badges.
func CancelOwnershipTransfer
crossing ActionCancelOwnershipTransfer withdraws a staged handoff. Owner only.
func GetAdminCount
ActionGetAdminCount is a value-only governance readback. It lets a proposal freeze the exact admin capacity before voting and verify the count after dispatch.
func GetBadge
ActionGetBadge returns badge info as a pipe-delimited string.
func GetUserBadgeDetails
ActionGetUserBadgeDetails returns full badge details for a user as a multi-line string. Each line: tokenID|owner|questID|tokenURI|soulbound|mintedAt This avoids N+1 queries from the frontend — one call returns all badge data.
func GetUserBadges
ActionGetUserBadges returns all badge token IDs for a user as comma-separated string. Uses the ownerIndex for O(1) lookup instead of full table scan.
func IsAdmin
Actionfunc IsApprovedForAll
Actionfunc IsPaused
Actionfunc MintQuestBadge
crossing ActionMintQuestBadge mints a quest completion badge to a user. Token ID is "{address}:{questId}" to enforce one badge per quest per user. Quest badges are transferable by default.
func MintRankBadge
crossing ActionMintRankBadge mints a soulbound rank badge to a user. Token ID is "{address}:rank:{tier}" to enforce one rank badge per tier per user. Rank badges are NON-transferable (soulbound).
func Name
Actionfunc Pause
crossing Actionfunc RemoveAdmin
crossing Actionfunc Render
func SetApprovalForAll
crossing Actionfunc Symbol
Actionfunc TokenURI
Actionfunc TotalSupply
Actionfunc TransferFrom
crossing Actionfunc TransferOwnership
crossing ActionTransferOwnership stages a successor owner. Nothing moves until that address calls AcceptOwnership with its own transaction, so ownership can never land on an address that cannot act. A later call replaces the staged address; CancelOwnershipTransfer withdraws it.
func Unpause
crossing Actionfunc UpdateTokenURI
crossing ActionUpdateTokenURI allows an admin to update the metadata URI of a badge. This is critical because realm code is immutable once deployed — if badge metadata needs correction (e.g., broken IPFS CID), this is the only mechanism.
1
7
- chain stdlib
- chain/runtime stdlib
- chain/runtime/unsafe stdlib
- gno.land/p/nt/ufmt/v0 package
- gno.land/p/samcrew/avl package
- strconv stdlib
- strings stdlib