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

emission package

Overview

Package emission manages GNS token emission and distribution for GnoSwap.

The emission system controls creation and distribution of new GNS tokens with a deflationary model featuring periodic halvings over 12 years.

Emission Schedule:

  • Year 1-2: 100% emission rate (225,000,000 GNS/year)
  • Year 3-4: 50% emission rate (112,500,000 GNS/year)
  • Year 5-6: 25% emission rate (56,250,000 GNS/year)
  • Year 7-8: 12.5% emission rate (28,125,000 GNS/year)
  • Year 9-12: 6.25% emission rate (14,062,500 GNS/year)

Distribution Targets (configurable via admin or governance):

  • LIQUIDITY_STAKER: Rewards for LP providers (default 75%)
  • DEVOPS: Development and operations fund (default 20%)
  • COMMUNITY_POOL: Community treasury (default 5%)
  • GOV_STAKER: GNS staking rewards (default 0%)

Key Functions:

  • MintAndDistributeGns: Mints and distributes GNS per emission schedule; returns false only when emission is halted.
  • SetDistributionStartTime: Sets or reschedules the start timestamp while it is still in the future; the timestamp is immutable once active.
  • ChangeDistributionPct: Updates distribution percentages
  • ClearDistributedToStaker/GovStaker: Resets pending distribution amounts

Function

SetOnDistributionPctChangeCallback

func SetOnDistributionPctChangeCallback(cur realm, callback func(cur realm, emissionAmountPerSecond int64))

SetOnDistributionPctChangeCallback registers the optional callback invoked when distribution percentages change. A nil callback clears the registration. This allows external contracts (like staker) to update their internal caches when governance or admin changes emission rates.

Parameters:

  • cur: Current realm context; callers use cross(cur) when crossing into this realm.
  • callback: nil to clear the callback, or a function receiving its callback realm context and the current staker GNS emission rate per second; a nonnil callback is invoked immediately after registration.

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/gnoswap/emission" -func "SetOnDistributionPctChangeCallback" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "http://127.0.0.1:26657" ADDRESSgnokey query -remote "http://127.0.0.1:26657" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "SetOnDistributionPctChangeCallback" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "http://127.0.0.1:26657" call.tx