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

protocol_fee package

Overview

Package protocol_fee manages fee collection and distribution for GnoSwap protocol operations.

This contract collects fees from various protocol operations (swaps, pool creation, withdrawals, staking claims) and distributes them to DevOps and Governance Stakers according to configurable percentages.

Distribution Targets:

  • DevOps: Development and operations fund (default 0%)
  • GovStaker: Governance stakers / xGNS holders (default 100%)

Key Functions:

  • DistributeProtocolFee: Distributes accumulated fees to recipients
  • SetDevOpsPct/SetGovStakerPct: Configure distribution percentages
  • AddToProtocolFee: Adds fees to the distribution queue

The contract uses a version manager pattern for upgradeable implementations.

Function

NewBPTreeN

func NewBPTreeN(fanout int) *bptree.BPTree

NewBPTreeN allocates a BP-tree under /r/gnoswap/protocol_fee's realm context so tree.Set leaf-slot writes clear the readonly-taint gate regardless of which realm (protocol_fee/v1, mock, tests) calls Set. Callers must allocate protocol_fee trees through here rather than bptree.NewBPTreeN directly.

Param

Command

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

Result