PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/gnoswap/gns

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
gns
Namespace
gnoswap
Files
12 (README)(gnomod.toml)
Exported functions
43
Module
gno.land/r/gnoswap/gns
gno
0.9

Files (12)

  • README.mdmarkdown
  • gnomod.tomltoml
  • consts.gnogno
  • doc.gnogno
  • emission_state.gnogno
  • emission.gnogno
  • errors.gnogno
  • getter.gnogno
  • gns.gnogno
  • halving.gnogno
  • setup.gnogno
  • utils.gnogno
README.mdPreviewRaw
# GNS

GnoSwap governance and utility token.

## Overview

GNS is the native governance token of GnoSwap, featuring a deflationary emission schedule with halvings every 2 years over 12 years total.

## Token Economics

- **Symbol**: GNS
- **Decimals**: 6
- **Max Supply**: 1,000,000,000 GNS
- **Initial Mint**: 100,000,000 GNS, pre-minted to the configured `ADMIN`
  role address during GNS realm initialization
- **Total Emission**: 900,000,000 GNS over 12 years

## Emission Schedule

| Years | Annual Emission | Rate  |
| ----- | --------------- | ----- |
| 1-2   | 225,000,000     | 100%  |
| 3-4   | 112,500,000     | 50%   |
| 5-6   | 56,250,000      | 25%   |
| 7-8   | 28,125,000      | 12.5% |
| 9-12  | 14,062,500      | 6.25% |

## Core Functions

### `Transfer`

Transfers tokens between addresses.

### `TransferFrom`

Transfers with allowance.

### `Approve`

Approves spending allowance.

### `InitEmissionState`

Initializes the emission schedule with start height and timestamp.
Sets up the 12-year emission schedule with halving periods.
Only callable by emission contract.

### `MintGns`

Mints new tokens per emission schedule. Only callable by emission contract.
Calculates tokens to mint based on elapsed time and updates halving year state.

## Usage

These snippets call the GNS realm from a realm function with a current `cur`
token. Import the package and qualify its function names in integrating code.

```go
// Transfer tokens
Transfer(cross(cur), to, amount)

// Approve and transfer
Approve(cross(cur), spender, amount)
TransferFrom(cross(cur), from, to, amount)

// Mint per emission schedule (called by emission contract)
MintGns(cross(cur), recipientAddress)
```

## Distribution

See [emission contract](../emission) for distribution details.

Functions

  • Allowance(owner string, spender string) int64

  • Approve(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, spender string, amount int64)

  • BalanceOf(owner string) int64

  • CalculateMintGnsAmount(fromTimestamp int64, toTimestamp int64) int64

  • Decimals() int

  • GetAmountPerSecondPerHalvingYear(year int64) int64

  • GetCurrentYear() int64

  • GetEmissionAccumulatedAmountByTimestamp(timestamp int64) int64

  • GetEmissionAmountPerSecondByTimestamp(timestamp int64) int64

  • GetEmissionAmountPerSecondInRange(fromTime int64, toTime int64) ([]int64, []int64)

  • GetEmissionCreatedHeight() int64

  • GetEmissionEndTimestamp() int64

  • GetEmissionLeftAmountByTimestamp(timestamp int64) int64

  • GetEmissionStartTimestamp() int64

  • GetHalvingAmountsPerYear(year int64) int64

  • GetHalvingInfo() *gno.land/r/gnoswap/gns.HalvingData

  • GetHalvingYear(timestamp int64) int64

  • GetHalvingYearEndTimestamp(year int64) int64

  • GetHalvingYearInfo(timestamp int64) (int64, int64, int64)

  • GetHalvingYearLeftAmount(year int64) int64

  • GetHalvingYearMaxAmount(year int64) int64

  • GetHalvingYearMintedAmount(year int64) int64

  • GetHalvingYearStartTimestamp(year int64) int64

  • GetInitialMintAmount() int64

  • GetMaxEmissionAmount() int64

  • GetMaximumSupply() int64

  • InitEmissionState(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, createdHeight int64, startTimestamp int64)

  • IsEmissionActive() bool

  • IsEmissionEnded() bool

  • IsEmissionInitialized() bool

  • KnownAccounts() int

  • LastMintedTimestamp() int64

  • LeftEmissionAmount() int64

  • MintedEmissionAmount() int64

  • MintGns(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, address string) int64

  • Name() string

  • NewEmissionState(createdHeight int64, startTimestamp int64) *gno.land/r/gnoswap/gns.EmissionState

  • NewHalvingData(startTimestamp int64) *gno.land/r/gnoswap/gns.HalvingData

  • Render(path string) string

  • Symbol() string

  • TotalSupply() int64

  • Transfer(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, to string, amount int64)

  • TransferFrom(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, from string, to string, amount int64)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗

vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.