GetDomainPath
func() stringGetDomainPath returns the domain path of the protocol fee contract. Returns: - domainPath: protocol fee contract domain path
- OID
- 0c1c0f…3a8d:3
GetDomainPath details
GetVersionPackagePath
func() stringGetVersionPackagePath returns the current implementation package path. Returns: - packagePath: current implementation package path
- OID
- 0c1c0f…3a8d:5
GetVersionPackagePath details
cloneStringInt64Map
func(src map[string]int64) map[string]int64- OID
- 0c1c0f…3a8d:6
cloneStringInt64Map details
cloneStringSlice
func(src []string) []string- OID
- 0c1c0f…3a8d:8
cloneStringSlice details
cloneInt64Slice
func(src []int64) []int64- OID
- 0c1c0f…3a8d:9
cloneInt64Slice details
DistributeProtocolFee
func()DistributeProtocolFee distributes accumulated protocol fees to DevOps and GovStaker, subject to the implementation's caller authorization and halt checks. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. Halt check: returns without distributing while the Withdraw halt scope is active.
- OID
- 0c1c0f…3a8d:10
DistributeProtocolFee details
DistributeProtocolFeeByTokenPath
func(tokenPath string)DistributeProtocolFeeByTokenPath distributes accumulated protocol fees reserved for one token path; an unreserved path has nothing to distribute. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - tokenPath: token contract path whose reserved fee balance should be distributed Halt check: returns without distributing while the Withdraw halt scope is active.
- OID
- 0c1c0f…3a8d:12
DistributeProtocolFeeByTokenPath details
SetDevOpsPct
func(pct int64)SetDevOpsPct persists the DevOps allocation percentage. Parameters: - \_: Crossing discriminator for the store operation; pass 0. - rlm: Propagated realm context for this store write; it must be current (\`rlm.IsCurrent()\`). - pct: DevOps share of protocol fees in basis points; the state layer constrains this value to 0 through 10000 before calling the store. Returns: - err: Nil when the percentage is persisted; otherwise the current-realm or KV-store write error.
- OID
- 0c1c0f…3a8d:13
SetDevOpsPct details
SetGovStakerPct
func(pct int64)SetGovStakerPct sets the share of protocol fees allocated to GovStaker. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - pct: GovStaker allocation in basis-point units, from 0 through 10000 inclusive (10000 = 100%) Halt check: reverts while the ProtocolFee halt scope is active.
- OID
- 0c1c0f…3a8d:14
SetGovStakerPct details
AddToProtocolFee
func(tokenPath string, amount int64) .uverse.errorAddToProtocolFee pulls an approved fee amount from an authorized protocol caller into protocol-fee accounting. Authorized callers are pool, position, router, and staker realms; direct transfers to this address do not register a fee. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - tokenPath: token contract path whose fee is being collected - amount: non-negative fee amount in the token's base units; zero performs no transfer Returns: - err: nil on success; errSpoofedRealm for a spoofed-realm call; errProtocolFeeHalted when protocol-fee collection is halted Halt check: returns errProtocolFeeHalted without transferring while the ProtocolFee halt scope is active.
- OID
- 0c1c0f…3a8d:15
AddToProtocolFee details
AdvanceAccrualEpoch
func() int64AdvanceAccrualEpoch closes the current accrual epoch and returns the new one. Fees arriving from now on are bucketed under the returned epoch. Only gov/staker may call it, on every stake change. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. Returns: - epoch: newly active non-negative accrual epoch used for subsequently collected GovStaker fees
- OID
- 0c1c0f…3a8d:16
AdvanceAccrualEpoch details
ConsumeAccrualBuckets
func(tokenPath string, limit int) ([]int64, []int64)ConsumeAccrualBuckets returns and clears up to limit of the oldest pending buckets of tokenPath as parallel epoch and amount slices. A limit of zero or less consumes every pending bucket. Only gov/staker may call it. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - tokenPath: token contract path whose pending GovStaker accrual buckets are consumed - limit: maximum number of oldest buckets to consume; zero or negative consumes all pending buckets Returns: - epochs: consumed accrual epoch numbers in ascending epoch order - amounts: GovStaker fee amounts corresponding positionally to epochs, in token base units
- OID
- 0c1c0f…3a8d:17
ConsumeAccrualBuckets details
GetDevOpsPct
func() int64GetDevOpsPct reads the persisted DevOps allocation percentage. Returns: - pct: The stored DevOps allocation percentage in basis points; the method panics if the key is missing or cannot be decoded as int64.
- OID
- 0c1c0f…3a8d:18
GetDevOpsPct details
GetGovStakerPct
func() int64GetGovStakerPct returns the GovStaker fee allocation in basis-point units. Returns: - pct: configured GovStaker allocation from 0 through 10000 (10000 = 100%)
- OID
- 0c1c0f…3a8d:19
GetGovStakerPct details
GetAccrualEpoch
func() int64GetAccrualEpoch reads the epoch under which new Gov/Staker accrual buckets are recorded. Returns: - epoch: The persisted current accrual epoch; the method panics if the key is missing or cannot be decoded as int64.
- OID
- 0c1c0f…3a8d:20
GetAccrualEpoch details
GetAccrualPendingTokens
func() []stringGetAccrualPendingTokens returns token paths that still own accrual buckets. Returns: - tokenPaths: Token paths in the pending-accrual index, in BP-tree iteration order.
- OID
- 0c1c0f…3a8d:21
GetAccrualPendingTokens details
GetAccrualBuckets
func(tokenPath string, limit int) ([]int64, []int64)GetAccrualBuckets returns up to limit of the oldest pending buckets of tokenPath in epoch order. A limit of zero or less returns every pending bucket. Parameters: - tokenPath: Token path whose pending Gov/Staker accrual buckets should be read. - limit: Maximum number of buckets to return; zero or a negative value returns all pending buckets. Returns: - epochs: Epoch numbers for the returned buckets, in ascending BP-tree iteration order. - amounts: Gov/Staker amounts for the returned epochs; amounts\[i] corresponds to epochs\[i].
- OID
- 0c1c0f…3a8d:22
GetAccrualBuckets details
GetReservedTokens
func() []stringGetReservedTokens returns all token paths currently reserved for distribution. Returns: - tokenPaths: Token paths present in the reserved-token index, in BP-tree iteration order.
- OID
- 0c1c0f…3a8d:23
GetReservedTokens details
GetAccuTransfersToGovStaker
func() map[string]int64GetAccuTransfersToGovStaker returns accumulated transfers to GovStaker. Returns: - transfers: map of token paths to accumulated amounts
- OID
- 0c1c0f…3a8d:24
GetAccuTransfersToGovStaker details
GetAccuTransfersToDevOps
func() map[string]int64GetAccuTransfersToDevOps returns accumulated transfers to DevOps. Returns: - transfers: map of token paths to accumulated amounts
- OID
- 0c1c0f…3a8d:25
GetAccuTransfersToDevOps details
GetAccuTransferToGovStakerByTokenPath
func(tokenPath string) int64GetAccuTransferToGovStakerByTokenPath returns accumulated GovStaker transfer for a token. Parameters: - tokenPath: path of the token Returns: - amount: accumulated transfer amount
- OID
- 0c1c0f…3a8d:26
GetAccuTransferToGovStakerByTokenPath details
GetAccuTransferToDevOpsByTokenPath
func(tokenPath string) int64GetAccuTransferToDevOpsByTokenPath returns accumulated DevOps transfer for a token. Parameters: - tokenPath: path of the token Returns: - amount: accumulated transfer amount
- OID
- 0c1c0f…3a8d:27
GetAccuTransferToDevOpsByTokenPath details
GetActualDistributedToGovStaker
func() map[string]int64GetActualDistributedToGovStaker returns actual transfers completed to GovStaker. Returns: - transfers: map of token paths to actual distributed amounts
- OID
- 0c1c0f…3a8d:28
GetActualDistributedToGovStaker details
GetActualDistributedToDevOps
func() map[string]int64GetActualDistributedToDevOps returns actual transfers completed to DevOps. Returns: - transfers: map of token paths to actual distributed amounts
- OID
- 0c1c0f…3a8d:29
GetActualDistributedToDevOps details
GetActualDistributedToGovStakerByTokenPath
func(tokenPath string) int64GetActualDistributedToGovStakerByTokenPath returns actual GovStaker transfer for a token. Parameters: - tokenPath: path of the token Returns: - amount: actual distributed amount for the token
- OID
- 0c1c0f…3a8d:30
GetActualDistributedToGovStakerByTokenPath details
GetActualDistributedToDevOpsByTokenPath
func(tokenPath string) int64GetActualDistributedToDevOpsByTokenPath returns actual DevOps transfer for a token. Parameters: - tokenPath: path of the token Returns: - amount: actual distributed amount for the token
- OID
- 0c1c0f…3a8d:31
GetActualDistributedToDevOpsByTokenPath details
Render
func(path string) stringRender delegates web rendering to the active implementation.
- OID
- 0c1c0f…3a8d:32
Render details
currentAddress
.uverse.addressValue
<gnolang.StringValue>
domainPath
stringValue
"gno.land/r/gnoswap/protocol_fee"
kvStore
*v1.kvStore- OID
- 0c1c0f…3a8d:56
kvStore details
versionManager
*v1.versionManager- OID
- 0c1c0f…3a8d:60
versionManager details
implementation
*v1.protocolFeeV1- OID
- 02af6e…7b3b:25
implementation details
init.32
func()- OID
- 0c1c0f…3a8d:39
init.32 details
initializeDomainStore
func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...}- OID
- 0c1c0f…3a8d:41
initializeDomainStore details
getImplementation
func() protocol_fee.IProtocolFee- OID
- 0c1c0f…3a8d:42
getImplementation details
updateImplementation
func() .uverse.error- OID
- 0c1c0f…3a8d:43
updateImplementation details
StoreKey
typeValue
protocol_fee.StoreKey
StoreKeyDevOpsPct
protocol_fee.StoreKeyValue
<gnolang.StringValue>
StoreKeyAccuToGovStaker
protocol_fee.StoreKey// tokenPath -> amount
Value
<gnolang.StringValue>
StoreKeyAccuToDevOps
protocol_fee.StoreKey// tokenPath -> amount
Value
<gnolang.StringValue>
StoreKeyDistributedToGovStakerHistory
protocol_fee.StoreKey// tokenPath -> amount
Value
<gnolang.StringValue>
StoreKeyDistributedToDevOpsHistory
protocol_fee.StoreKey// tokenPath -> amount
Value
<gnolang.StringValue>
StoreKeyReservedTokens
protocol_fee.StoreKeyValue
<gnolang.StringValue>
StoreKeyAccrualEpoch
protocol_fee.StoreKeyValue
<gnolang.StringValue>
StoreKeyAccrualBuckets
protocol_fee.StoreKey// tokenPath -> (epoch -> amount)
Value
<gnolang.StringValue>
StoreKeyAccrualPendingTokens
protocol_fee.StoreKey// tokenPath -> true
Value
<gnolang.StringValue>
defaultDevOpsPct
int64Value
0
errSpoofedRealm
untyped stringValue
"rlm does not match the current crossing frame"
NewBPTreeN
func(fanout int) *v0.BPTreeNewBPTreeN 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. Parameters: - fanout: Branching factor passed to the BP-tree constructor. Returns: - tree: A new BP-tree configured with fanout and allocated in the protocol-fee realm context.
- OID
- 0c1c0f…3a8d:44
NewBPTreeN details
protocolFeeStore
typeValue
protocol_fee.protocolFeeStore
collectTreeKeys
func(tree *v0.BPTree) []string- OID
- 0c1c0f…3a8d:46
collectTreeKeys details
encodeEpochKey
func(epoch int64) string- OID
- 0c1c0f…3a8d:47
encodeEpochKey details
decodeEpochKey
func(key string) int64- OID
- 0c1c0f…3a8d:48
decodeEpochKey details
NewProtocolFeeStore
func(kvStore v1.KVStore) protocol_fee.IProtocolFeeStoreNewProtocolFeeStore creates a protocol-fee store backed by the provided KV store. This function is used by the upgrade system to create storage instances for each implementation. Parameters: - kvStore: Domain KV store used to persist protocol-fee state. Returns: - protocolFeeStore: An IProtocolFeeStore implementation backed by kvStore.
- OID
- 0c1c0f…3a8d:49
NewProtocolFeeStore details
IProtocolFee
typeValue
protocol_fee.IProtocolFee
IProtocolFeeManager
typeValue
protocol_fee.IProtocolFeeManager
IProtocolFeeGetter
typeValue
protocol_fee.IProtocolFeeGetter
IProtocolFeeStore
typeValue
protocol_fee.IProtocolFeeStore
RegisterInitializer
func(initializer func(...))RegisterInitializer registers a new protocol fee implementation version. This function is called by each version (v1, v2, etc.) during initialization to register their implementation with the proxy system. The initializer function creates a new instance of the implementation using the provided protocolFeeStore interface. It receives a realm value that resolves to the protocol\_fee proxy realm — the only address with write permission on the shared KV store — so any per-version store bootstrapping performed inside the initializer passes the proxy's authorization check. Security: Only contracts within the domain path can register initializers. Each package path can only register once to prevent duplicate registrations. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - initializer: callback that receives the proxy realm context and protocol-fee store, initializes version-specific state, and returns the implementation instance
- OID
- 0c1c0f…3a8d:50
RegisterInitializer details
UpgradeImpl
func(packagePath string)UpgradeImpl switches the active protocol fee implementation to a different version. This function allows seamless upgrades from one version to another without data migration or downtime. Security: Only admin or governance can perform upgrades. The new implementation must have been previously registered via RegisterInitializer. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - packagePath: registered implementation package path to activate
- OID
- 0c1c0f…3a8d:52
UpgradeImpl details
GetImplementationPackagePath
func() stringGetImplementationPackagePath returns the package path of the currently active implementation. Returns: - packagePath: package path of the active implementation
- OID
- 0c1c0f…3a8d:53