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 state

Back to all declarations

GetDomainPath

func() string

GetDomainPath returns the domain path of the protocol fee contract. Returns: - domainPath: protocol fee contract domain path

Open
OID
0c1c0f…3a8d:3
GetDomainPath details

Inspect func

GetVersionPackagePath

func() string

GetVersionPackagePath returns the current implementation package path. Returns: - packagePath: current implementation package path

Open
OID
0c1c0f…3a8d:5
GetVersionPackagePath details

Inspect func

cloneStringInt64Map

func(src map[string]int64) map[string]int64
Open
OID
0c1c0f…3a8d:6
cloneStringInt64Map details

Inspect func

cloneStringSlice

func(src []string) []string
Open
OID
0c1c0f…3a8d:8
cloneStringSlice details

Inspect func

cloneInt64Slice

func(src []int64) []int64
Open
OID
0c1c0f…3a8d:9
cloneInt64Slice details

Inspect func

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.

Open
OID
0c1c0f…3a8d:10
DistributeProtocolFee details

Inspect func

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.

Open
OID
0c1c0f…3a8d:12
DistributeProtocolFeeByTokenPath details

Inspect func

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.

Open
OID
0c1c0f…3a8d:13
SetDevOpsPct details

Inspect func

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.

Open
OID
0c1c0f…3a8d:14
SetGovStakerPct details

Inspect func

AddToProtocolFee

func(tokenPath string, amount int64) .uverse.error

AddToProtocolFee 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.

Open
OID
0c1c0f…3a8d:15
AddToProtocolFee details

Inspect func

AdvanceAccrualEpoch

func() int64

AdvanceAccrualEpoch 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

Open
OID
0c1c0f…3a8d:16
AdvanceAccrualEpoch details

Inspect func

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

Open
OID
0c1c0f…3a8d:17
ConsumeAccrualBuckets details

Inspect func

GetDevOpsPct

func() int64

GetDevOpsPct 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.

Open
OID
0c1c0f…3a8d:18
GetDevOpsPct details

Inspect func

GetGovStakerPct

func() int64

GetGovStakerPct returns the GovStaker fee allocation in basis-point units. Returns: - pct: configured GovStaker allocation from 0 through 10000 (10000 = 100%)

Open
OID
0c1c0f…3a8d:19
GetGovStakerPct details

Inspect func

GetAccrualEpoch

func() int64

GetAccrualEpoch 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.

Open
OID
0c1c0f…3a8d:20
GetAccrualEpoch details

Inspect func

GetAccrualPendingTokens

func() []string

GetAccrualPendingTokens returns token paths that still own accrual buckets. Returns: - tokenPaths: Token paths in the pending-accrual index, in BP-tree iteration order.

Open
OID
0c1c0f…3a8d:21
GetAccrualPendingTokens details

Inspect func

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].

Open
OID
0c1c0f…3a8d:22
GetAccrualBuckets details

Inspect func

GetReservedTokens

func() []string

GetReservedTokens returns all token paths currently reserved for distribution. Returns: - tokenPaths: Token paths present in the reserved-token index, in BP-tree iteration order.

Open
OID
0c1c0f…3a8d:23
GetReservedTokens details

Inspect func

GetAccuTransfersToGovStaker

func() map[string]int64

GetAccuTransfersToGovStaker returns accumulated transfers to GovStaker. Returns: - transfers: map of token paths to accumulated amounts

Open
OID
0c1c0f…3a8d:24
GetAccuTransfersToGovStaker details

Inspect func

GetAccuTransfersToDevOps

func() map[string]int64

GetAccuTransfersToDevOps returns accumulated transfers to DevOps. Returns: - transfers: map of token paths to accumulated amounts

Open
OID
0c1c0f…3a8d:25
GetAccuTransfersToDevOps details

Inspect func

GetAccuTransferToGovStakerByTokenPath

func(tokenPath string) int64

GetAccuTransferToGovStakerByTokenPath returns accumulated GovStaker transfer for a token. Parameters: - tokenPath: path of the token Returns: - amount: accumulated transfer amount

Open
OID
0c1c0f…3a8d:26
GetAccuTransferToGovStakerByTokenPath details

Inspect func

GetAccuTransferToDevOpsByTokenPath

func(tokenPath string) int64

GetAccuTransferToDevOpsByTokenPath returns accumulated DevOps transfer for a token. Parameters: - tokenPath: path of the token Returns: - amount: accumulated transfer amount

Open
OID
0c1c0f…3a8d:27
GetAccuTransferToDevOpsByTokenPath details

Inspect func

GetActualDistributedToGovStaker

func() map[string]int64

GetActualDistributedToGovStaker returns actual transfers completed to GovStaker. Returns: - transfers: map of token paths to actual distributed amounts

Open
OID
0c1c0f…3a8d:28
GetActualDistributedToGovStaker details

Inspect func

GetActualDistributedToDevOps

func() map[string]int64

GetActualDistributedToDevOps returns actual transfers completed to DevOps. Returns: - transfers: map of token paths to actual distributed amounts

Open
OID
0c1c0f…3a8d:29
GetActualDistributedToDevOps details

Inspect func

GetActualDistributedToGovStakerByTokenPath

func(tokenPath string) int64

GetActualDistributedToGovStakerByTokenPath returns actual GovStaker transfer for a token. Parameters: - tokenPath: path of the token Returns: - amount: actual distributed amount for the token

Open
OID
0c1c0f…3a8d:30
GetActualDistributedToGovStakerByTokenPath details

Inspect func

GetActualDistributedToDevOpsByTokenPath

func(tokenPath string) int64

GetActualDistributedToDevOpsByTokenPath returns actual DevOps transfer for a token. Parameters: - tokenPath: path of the token Returns: - amount: actual distributed amount for the token

Open
OID
0c1c0f…3a8d:31
GetActualDistributedToDevOpsByTokenPath details

Inspect func

Render

func(path string) string

Render delegates web rendering to the active implementation.

Open
OID
0c1c0f…3a8d:32
Render details

Inspect func

currentAddress

.uverse.address

Value

<gnolang.StringValue>

domainPath

string

Value

"gno.land/r/gnoswap/protocol_fee"

initializeDomainStore

func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...}
Open
OID
0c1c0f…3a8d:41
initializeDomainStore details

Inspect func

getImplementation

func() protocol_fee.IProtocolFee
Open
OID
0c1c0f…3a8d:42
getImplementation details

Inspect func

updateImplementation

func() .uverse.error
Open
OID
0c1c0f…3a8d:43
updateImplementation details

Inspect func

StoreKey

type

Value

protocol_fee.StoreKey

StoreKeyDevOpsPct

protocol_fee.StoreKey

Value

<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.StoreKey

Value

<gnolang.StringValue>

StoreKeyAccrualEpoch

protocol_fee.StoreKey

Value

<gnolang.StringValue>

StoreKeyAccrualBuckets

protocol_fee.StoreKey

// tokenPath -> (epoch -> amount)

Value

<gnolang.StringValue>

StoreKeyAccrualPendingTokens

protocol_fee.StoreKey

// tokenPath -> true

Value

<gnolang.StringValue>

defaultDevOpsPct

int64

Value

0

errSpoofedRealm

untyped string

Value

"rlm does not match the current crossing frame"

NewBPTreeN

func(fanout int) *v0.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. 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.

Open
OID
0c1c0f…3a8d:44
NewBPTreeN details

Inspect func

protocolFeeStore

type

Value

protocol_fee.protocolFeeStore

collectTreeKeys

func(tree *v0.BPTree) []string
Open
OID
0c1c0f…3a8d:46
collectTreeKeys details

Inspect func

encodeEpochKey

func(epoch int64) string
Open
OID
0c1c0f…3a8d:47
encodeEpochKey details

Inspect func

decodeEpochKey

func(key string) int64
Open
OID
0c1c0f…3a8d:48
decodeEpochKey details

Inspect func

NewProtocolFeeStore

func(kvStore v1.KVStore) protocol_fee.IProtocolFeeStore

NewProtocolFeeStore 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.

Open
OID
0c1c0f…3a8d:49
NewProtocolFeeStore details

Inspect func

IProtocolFee

type

Value

protocol_fee.IProtocolFee

IProtocolFeeManager

type

Value

protocol_fee.IProtocolFeeManager

IProtocolFeeGetter

type

Value

protocol_fee.IProtocolFeeGetter

IProtocolFeeStore

type

Value

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

Open
OID
0c1c0f…3a8d:50
RegisterInitializer details

Inspect func

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

Open
OID
0c1c0f…3a8d:52
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently active implementation. Returns: - packagePath: package path of the active implementation

Open
OID
0c1c0f…3a8d:53
GetImplementationPackagePath details

Inspect func
GetDomainPath : func() string Inspect
GetVersionPackagePath : func() string Inspect
cloneStringInt64Map : func(src map[string]int64) map[string]int64 Inspect
cloneStringSlice : func(src []string) []string Inspect
cloneInt64Slice : func(src []int64) []int64 Inspect
DistributeProtocolFee : func() Inspect
DistributeProtocolFeeByTokenPath : func(tokenPath string) Inspect
SetDevOpsPct : func(pct int64) Inspect
SetGovStakerPct : func(pct int64) Inspect
AddToProtocolFee : func(tokenPath string, amount int64) .uverse.error Inspect
AdvanceAccrualEpoch : func() int64 Inspect
ConsumeAccrualBuckets : func(tokenPath string, limit int) ([]int64, []int64) Inspect
GetDevOpsPct : func() int64 Inspect
GetGovStakerPct : func() int64 Inspect
GetAccrualEpoch : func() int64 Inspect
GetAccrualPendingTokens : func() []string Inspect
GetAccrualBuckets : func(tokenPath string, limit int) ([]int64, []int64) Inspect
GetReservedTokens : func() []string Inspect
GetAccuTransfersToGovStaker : func() map[string]int64 Inspect
GetAccuTransfersToDevOps : func() map[string]int64 Inspect
GetAccuTransferToGovStakerByTokenPath : func(tokenPath string) int64 Inspect
GetAccuTransferToDevOpsByTokenPath : func(tokenPath string) int64 Inspect
GetActualDistributedToGovStaker : func() map[string]int64 Inspect
GetActualDistributedToDevOps : func() map[string]int64 Inspect
GetActualDistributedToGovStakerByTokenPath : func(tokenPath string) int64 Inspect
GetActualDistributedToDevOpsByTokenPath : func(tokenPath string) int64 Inspect
Render : func(path string) string Inspect
currentAddress : .uverse.address =<gnolang.StringValue>
domainPath : string ="gno.land/r/gnoswap/protocol_fee"
kvStore : *v1.kvStore Inspect
versionManager : *v1.versionManager Inspect
implementation : *v1.protocolFeeV1 Inspect
init.32 : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...} Inspect
getImplementation : func() protocol_fee.IProtocolFee Inspect
updateImplementation : func() .uverse.error Inspect
StoreKey : type =protocol_fee.StoreKey
StoreKeyDevOpsPct : protocol_fee.StoreKey =<gnolang.StringValue>
StoreKeyAccuToGovStaker : protocol_fee.StoreKey =<gnolang.StringValue>
StoreKeyAccuToDevOps : protocol_fee.StoreKey =<gnolang.StringValue>
StoreKeyDistributedToGovStakerHistory : protocol_fee.StoreKey =<gnolang.StringValue>
StoreKeyDistributedToDevOpsHistory : protocol_fee.StoreKey =<gnolang.StringValue>
StoreKeyReservedTokens : protocol_fee.StoreKey =<gnolang.StringValue>
StoreKeyAccrualEpoch : protocol_fee.StoreKey =<gnolang.StringValue>
StoreKeyAccrualBuckets : protocol_fee.StoreKey =<gnolang.StringValue>
StoreKeyAccrualPendingTokens : protocol_fee.StoreKey =<gnolang.StringValue>
defaultDevOpsPct : int64 =0
errSpoofedRealm : untyped string ="rlm does not match the current crossing frame"
NewBPTreeN : func(fanout int) *v0.BPTree Inspect
protocolFeeStore : type =protocol_fee.protocolFeeStore
collectTreeKeys : func(tree *v0.BPTree) []string Inspect
encodeEpochKey : func(epoch int64) string Inspect
decodeEpochKey : func(key string) int64 Inspect
NewProtocolFeeStore : func(kvStore v1.KVStore) protocol_fee.IProtocolFeeStore Inspect
IProtocolFee : type =protocol_fee.IProtocolFee
IProtocolFeeManager : type =protocol_fee.IProtocolFeeManager
IProtocolFeeGetter : type =protocol_fee.IProtocolFeeGetter
IProtocolFeeStore : type =protocol_fee.IProtocolFeeStore
RegisterInitializer : func(initializer func(...)) Inspect
UpgradeImpl : func(packagePath string) Inspect
GetImplementationPackagePath : func() string Inspect