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

community_pool/v1 package

Overview

Package community_pool manages the GnoSwap community treasury.

This contract holds registered protocol-owned assets. The emission system routes its configured community-pool share here, and external governance may use proposal execution to authorize a spend. Proposal and voting state are outside this package: TransferToken is a direct admin-or-governance entry point subject to the withdrawal halt and token-transfer validation.

Governance is the recommended normal route. While governance is not yet mature, admin access is retained for emergency-only use as an operational policy. The contract does not verify an emergency or require proposal approval for admin calls, and admin access does not expire automatically.

Function

GetBalanceOf

func GetBalanceOf(tokenPath string) (int64, error)

GetBalanceOf returns the community pool's balance for a registered token.

Parameters:

  • tokenPath: registry key/path of the token contract whose balance is queried

Returns:

  • balance: token units held by the configured community-pool address, or 0 when validation fails
  • err: nil when tokenPath is valid and registered; non-nil for an invalid or unregistered tokenPath

Param

Command

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

Result