← Back to Realms

Realm

gno.land/r/gnoswap/protocol_fee

Overview

Realm Path
gno.land/r/gnoswap/protocol_fee
Exported Functions
29
State Entries
22
Source Files
10
Total Package Entries
61

Exported Functions

29 exported functions

State

22 state entries

Source Code

FILES
doc.gno
go
1// Package protocol_fee manages fee collection and distribution for GnoSwap protocol operations.
2//
3// This contract collects authorized fees from protocol operations such as swaps,
4// pool creation, withdrawals, and staking claims, then accounts for their
5// distribution to DevOps and GovStaker according to configurable percentages.
6//
7// Distribution Targets:
8//   - DevOps: Development and operations fund (default 0%)
9//   - GovStaker: Governance-staker destination (default 100%)
10//
11// Accounting:
12//   - reservedTokens tracks token paths with collected fees awaiting distribution.
13//   - Per-token allocation accumulators and distribution-history trees distinguish
14//     amounts allocated from amounts actually transferred.
15//   - GovStaker allocations are bucketed by token path and accrual epoch.
16//
17// Key Functions:
18//   - DistributeProtocolFee: Distributes accumulated fees to recipients
19//   - SetDevOpsPct/SetGovStakerPct: Configure distribution percentages
20//   - AddToProtocolFee: Pulls an approved fee into the distribution queue
21//
22// The contract uses a version manager pattern for upgradeable implementations.
23package protocol_fee
24

Raw Package Data

Raw JSON data