Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

whitelist package

Overview

Package whitelist manages the direct pools available to GnoSwap orders.

DCA and Limit have independent pool whitelists, selected by TargetDCA ("dca") and TargetLimit ("limit"). Adding or removing a pool affects only the selected target. Pools must exist before being added; removing one prevents that target's orders from trading on it, not from cancelling.

Admin, governance, or callers authorized by gno.land/r/gnoswap/order/keeper can update membership. At deployment, AddWhitelistedPool and RemoveWhitelistedPool are assigned to PoolManagerRole on this realm; the target argument selects the pool list, not the authorization policy. Queries expose membership, a read-only pool tree, and whether a pair has an existing whitelisted direct pool at any registered fee tier.

Files:

  • whitelist.gno: AddWhitelistedPool and RemoveWhitelistedPool
  • getters.gno: read-only queries
  • state.gno: independent DCA and Limit whitelist states
  • assert.gno: authorization, target, and pool validation
  • consts.gno: supported target names
  • emits.gno: pool membership events

Function

AddWhitelistedPool

func AddWhitelistedPool(cur realm, target, poolPath string)
Ask AI Claude ChatGPT

AddWhitelistedPool permits target's orders to trade on an existing pool. Admin, governance, or the role assigned to this selector may call it.

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/gnoswap/order/whitelist" -func "AddWhitelistedPool" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/order/whitelist" -func "AddWhitelistedPool" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/gnoswap/order/whitelist, for example a function call with arguments.