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

gnomic package

Overview

Parametric GRC20 realm for gno.land.

All configuration (name, symbol, decimals, supply, metadata) lives in config.gno. This file holds only the logic, which is not meant to be edited.

The realm:

  • creates a GRC20 token through gno.land/p/nt/grc20/v0
  • registers it with gno.land/r/nt/grc20reg/v0 (required to be discoverable by GnoSwap, wallets and explorers)
  • mints the initial supply to the deploying address
  • exposes the GRC20 methods as top-level functions callable via MsgCall
  • enforces a hard ceiling (maxSupply) on minting
  • lets the owner give up minting forever (DropOwnership)

Functions

Allowance

func Allowance(owner, spender address) int64

Allowance returns how much spender may draw from owner.

Params

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.Allowance(,)"

Result

Approve

func Approve(cur realm, spender address, amount int64)

Approve authorises spender to draw up to amount from the caller.

Params

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/nym-thegnomic001/gnomic" -func "Approve" -args $'' -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/nym-thegnomic001/gnomic" -func "Approve" -args $'' -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
  

BalanceOf

func BalanceOf(owner address) int64

BalanceOf returns the balance of owner in base units.

Param

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.BalanceOf()"

Result

Burn

func Burn(cur realm, amount int64)

Burn destroys amount of the caller's tokens, reducing the supply.

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/nym-thegnomic001/gnomic" -func "Burn" -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/nym-thegnomic001/gnomic" -func "Burn" -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
  

Burned

func Burned() int64

Burned returns the total destroyed: cumulative minted minus circulating.

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.Burned()"

Result

Decimals

func Decimals() int

Decimals returns the precision.

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.Decimals()"

Result

DropOwnership

func DropOwnership(cur realm)

DropOwnership gives up administration for good: no future mint will ever be possible. The operation cannot be undone.

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/nym-thegnomic001/gnomic" -func "DropOwnership" -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/nym-thegnomic001/gnomic" -func "DropOwnership" -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
  

Holders

func Holders() int

Holders returns the number of addresses with a non-zero balance.

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.Holders()"

Result

MaxSupply

func MaxSupply() int64

MaxSupply returns the hard ceiling in base units: it caps the cumulative amount ever minted, not the circulating supply.

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.MaxSupply()"

Result

Mint

func Mint(cur realm, to address, amount int64)

Mint creates amount (base units) in favour of to. Owner only, and never beyond maxSupply. After DropOwnership this function is unusable forever: the supply becomes immutable upwards.

Params

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/nym-thegnomic001/gnomic" -func "Mint" -args $'' -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/nym-thegnomic001/gnomic" -func "Mint" -args $'' -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
  

Name

func Name() string

Name returns the token name.

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.Name()"

Result

Render

func Render(path string) string

Param

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.Render()"

Result

Symbol

func Symbol() string

Symbol returns the ticker.

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.Symbol()"

Result

TokenKey

func TokenKey() string

TokenKey returns the token's key in the GRC20 registry ("<pkgpath>.<SYMBOL>"), to be used with r/nt/grc20reg and with GnoSwap.

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.TokenKey()"

Result

TotalMinted

func TotalMinted() int64

TotalMinted returns the cumulative amount ever minted. It never goes down, not even after a Burn: hardCap - TotalMinted() is the remaining headroom.

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.TotalMinted()"

Result

TotalSupply

func TotalSupply() int64

TotalSupply returns the circulating supply in base units.

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/nym-thegnomic001/gnomic.TotalSupply()"

Result

Transfer

func Transfer(cur realm, to address, amount int64)

Transfer sends amount (base units) from the caller to to.

Params

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/nym-thegnomic001/gnomic" -func "Transfer" -args $'' -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/nym-thegnomic001/gnomic" -func "Transfer" -args $'' -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
  

TransferFrom

func TransferFrom(cur realm, from, to address, amount int64)

TransferFrom moves amount from from to to, consuming the caller's allowance.

Params

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/nym-thegnomic001/gnomic" -func "TransferFrom" -args $'' -args $'' -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/nym-thegnomic001/gnomic" -func "TransferFrom" -args $'' -args $'' -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
  

TransferOwnership

func TransferOwnership(cur realm, newOwner address)

TransferOwnership hands administration over to newOwner.

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/nym-thegnomic001/gnomic" -func "TransferOwnership" -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/nym-thegnomic001/gnomic" -func "TransferOwnership" -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