Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

pointsv2 source realm

Package pointsv2 is referral + check-in + trade/create points for gnomemepad.

Overview

Package pointsv2 is referral + check-in + trade/create points for gnomemepad.

Trade/create awards are pad-only: allowed pad packages call OnTrade / OnCreate after a successful user action. EOAs cannot self-award trade points.

Example
1SetReferrer / CheckIn / AwardPoints / Leaderboard — same as v1
2AllowPad / RevokePad — admin allowlist of pad package paths
3OnTrade / OnCreate — called by pad via cross(cur)
4ParamsInfo — extended for UI

Constants 1

const PointsReferrerBonus, PointsRefereeBonus, PointsCheckIn, CheckInIntervalH, PointsCreateBonus, PointsBuyBase, PointsSellBase, PointsPerGnotBuy, PointsPerGnotSell, MaxTradePtsPerHeight, UgnotPerGnot, LeaderboardMax, MaxLeaderboardReturn, MaxPadPathLen

 1const (
 2	PointsReferrerBonus int64 = 50
 3	PointsRefereeBonus  int64 = 25
 4	PointsCheckIn       int64 = 5
 5	CheckInIntervalH    int64 = 100
 6	// Trade / create (v2)
 7	PointsCreateBonus    int64 = 30  // creator on successful Create
 8	PointsBuyBase        int64 = 2   // base points per buy
 9	PointsSellBase       int64 = 1   // base points per sell
10	PointsPerGnotBuy     int64 = 10  // extra pts per full GNOT bought (volume)
11	PointsPerGnotSell    int64 = 3   // extra pts per full GNOT sold
12	MaxTradePtsPerHeight int64 = 200 // per-user per-height cap (anti-spam)
13	UgnotPerGnot         int64 = 1_000_000
14	LeaderboardMax       int   = 50
15	MaxLeaderboardReturn int   = 20
16	MaxPadPathLen        int   = 200
17)
source

Functions 19

func AllowPad

crossing Action
1func AllowPad(cur realm, padPkg string)
source

AllowPad registers a pad package path that may call OnTrade / OnCreate.

func AwardPoints

crossing Action
1func AwardPoints(cur realm, to address, amount int64)
source

AwardPoints is admin-only (campaigns / corrections).

func CheckIn

crossing Action
1func CheckIn(cur realm) int64
source

CheckIn grants PointsCheckIn if enough heights passed since last check-in.

func IsPadAllowed

Action
1func IsPadAllowed(padPkg string) bool
source

IsPadAllowed reports whether path may award trade points.

func OnCreate

crossing Action
1func OnCreate(cur realm, creator address, launchID string) int64
source

OnCreate awards create bonus to the launch creator (pad-only).

func OnTrade

crossing Action
1func OnTrade(cur realm, trader address, launchID string, side int64, volumeUgnot int64) int64
source

OnTrade awards points for a pad buy (side=0) or sell (side=1). volumeUgnot is the GNOT notional of the trade (sent in / received out). Returns points awarded (0 if capped).

func ParamsInfo

Action
1func ParamsInfo() string
source

ParamsInfo for UI:

Example
1referrer|referee|checkIn|interval|createBonus|buyBase|sellBase|ptsPerGnotBuy|ptsPerGnotSell|maxPerHeight|tradePtsTotal|createPtsTotal|v2

func RevokePad

crossing Action
1func RevokePad(cur realm, padPkg string)
source

RevokePad removes a pad from the allowlist.

func SetReferrer

crossing Action
1func SetReferrer(cur realm, referrer address)
source

SetReferrer binds caller to a referrer once. Self-referral rejected.

Imports 5

Source Files 2