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 source realm

Package whitelist manages the direct pools available to GnoSwap orders.

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

Constants 1

Functions 5

func AddWhitelistedPool

crossing Action
1func AddWhitelistedPool(cur realm, target, poolPath string)
source

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

func GetWhitelistedPools

Action
1func GetWhitelistedPools(target string) *rotree.ReadOnlyTree
source

GetWhitelistedPools returns only target's read-only poolPath -> true tree.

func HasWhitelistedPool

Action
1func HasWhitelistedPool(target, tokenIn, tokenOut string) bool
source

HasWhitelistedPool reports whether target allows an existing direct pool of the pair.

func RemoveWhitelistedPool

crossing Action
1func RemoveWhitelistedPool(cur realm, target, poolPath string)
source

RemoveWhitelistedPool stops only target's orders from using this pool. Existing orders remain cancellable. Authorization matches AddWhitelistedPool.

Dependencies

Source Files 9