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

bond source realm

Package bond is the create-bond policy for gnomemepad — separate from pad so promo schedules can change without redep...

Overview

Package bond is the create-bond policy for gnomemepad — separate from pad so promo schedules can change without redeploying the pad realm.

Pad calls CurrentBondUgnot() at Create time. This package owns:

  • normal bond (default 2 GNOT)
  • promo bond (default ~$20 in ugnot at a fixed GNOT rate, admin-adjustable)
  • 10-day window OR admin EndPromo → back to normal

USD is not on-chain: promo amount is ugnot. Admin sets PromoBondUgnot to approximate $20 (e.g. at $1/GNOT → 20e6 ugnot; at $0.5/GNOT → 40e6).

Constants 1

Functions 17

func BondInfo

Action
1func BondInfo() string
source

BondInfo: status|currentUgnot|normalUgnot|promoUgnot|endsAt|secondsLeft|admin

func CurrentBondUgnot

Action
1func CurrentBondUgnot() int64
source

CurrentBondUgnot is the create bond pad must require (cross-safe read). Pad: if sent < CurrentBondUgnot() → panic underpaid.

func EndPromo

crossing Action
1func EndPromo(cur realm)
source

EndPromo forces normal bond immediately (deploy admin).

func ExtendPromo

crossing Action
1func ExtendPromo(cur realm, extraSec int64)
source

ExtendPromo adds seconds to the current end (or starts from now if inactive).

func Init

crossing Action
1func Init(cur realm)
source

Init sets admin (deploy EOA) and default bond amounts. Call once.

func SetNormalBond

crossing Action
1func SetNormalBond(cur realm, ugnot int64)
source

SetNormalBond updates the post-promo bond (default 2 GNOT).

func SetPromoBond

crossing Action
1func SetPromoBond(cur realm, ugnot int64)
source

SetPromoBond updates promo amount without restarting the clock. Use to re-target ~$20 when GNOT price moves during the window.

func StartPromo

crossing Action
1func StartPromo(cur realm, promoUgnot, durationSec int64)
source

StartPromo begins a promo window from now. promoUgnot: bond during promo (e.g. 20e6 ≈ $20 at $1/GNOT). 0 → keep current promoBondUgnot. durationSec: window length. 0 → DefaultPromoDuration (10 days).

func TransferAdmin

crossing Action
1func TransferAdmin(cur realm, newAdmin address)
source

TransferAdmin rotates admin (current admin only).

Imports 4

Source Files 3