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

common package

Overview

Package common provides shared realm utilities for GnoSwap protocol contracts.

The package contains helpers that must keep a realm boundary, including GRC20 token operations and native coin validation. AMM math lives in gno.land/p/gnoswap/gnsmath.

Key components: - GRC20 Registry Helpers: convenient wrappers for GRC20 token operations - Coin Utilities: native coin handling and validation - Assertion Utilities: input validation and authorization checks

Function

GetToken

func GetToken(tokenKey string) *grc20.Token

GetToken returns a grc20.Token instance for the specified tokenKey, panicking if not registered.

Parameters:

  • tokenKey: GRC20 registry key

Returns a pointer to the grc20.Token instance.

Panics if the token is not registered in grc20reg.

Param

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/gnoswap/common.GetToken()"

Result