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/v1.

Key components: - GRC20 Registry Helpers: convenient wrappers for GRC20 token operations - Coin Utilities: native coin handling and validation - Assertion Utilities: input validation for supported operations, including native-coin rejection

Function

ValidateRegistered

func ValidateRegistered(tokenKeys ...string) error

ValidateRegistered checks whether all provided tokens are registered, returning an error instead of panicking when a token is not registered.

Parameters:

  • tokenKeys: token registry keys to check; an empty list is valid.

Returns:

  • error: nil when every token is registered; otherwise the first registration failure.

Param

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/gnoswap/common.ValidateRegistered()"

Result