types.gno
2.76 Kb · 71 lines
1package protocol_fee
2
3import bptree "gno.land/p/nt/bptree/v0"
4
5type IProtocolFee interface {
6 IProtocolFeeManager
7 IProtocolFeeGetter
8}
9
10type IProtocolFeeManager interface {
11 // Mutating methods take `_ int, rlm realm` so the realm token is threaded
12 // from the proxy entry points down to the cross-realm token transfers and
13 // store writes performed inside each implementation. The `_ int` sentinel
14 // surfaces at every call site as a literal `0`, making the realm threading
15 // visible to readers.
16 DistributeProtocolFee(_ int, rlm realm)
17 SetDevOpsPct(_ int, rlm realm, pct int64)
18 SetGovStakerPct(_ int, rlm realm, pct int64)
19 AddToProtocolFee(_ int, rlm realm, tokenPath string, amount int64) error
20}
21
22type IProtocolFeeGetter interface {
23 GetDevOpsPct() int64
24 GetGovStakerPct() int64
25 GetReservedTokens() []string
26 GetAccuTransfersToGovStaker() map[string]int64
27 GetAccuTransfersToDevOps() map[string]int64
28 GetAccuTransferToGovStakerByTokenPath(path string) int64
29 GetAccuTransferToDevOpsByTokenPath(path string) int64
30 GetActualDistributedToGovStaker() map[string]int64
31 GetActualDistributedToDevOps() map[string]int64
32 GetActualDistributedToGovStakerByTokenPath(path string) int64
33 GetActualDistributedToDevOpsByTokenPath(path string) int64
34}
35
36type IProtocolFeeStore interface {
37 HasDevOpsPctStoreKey() bool
38 InitializeDevOpsPct(_ int, rlm realm) error
39 GetDevOpsPct() int64
40 SetDevOpsPct(_ int, rlm realm, pct int64) error
41
42 HasAccuToGovStakerStoreKey() bool
43 InitializeAccuToGovStaker(_ int, rlm realm) error
44 GetAccuToGovStaker() *bptree.BPTree
45 GetAccuToGovStakerItem(tokenPath string) (int64, bool)
46 SetAccuToGovStakerItem(_ int, rlm realm, tokenPath string, amount int64) error
47
48 HasAccuToDevOpsStoreKey() bool
49 InitializeAccuToDevOps(_ int, rlm realm) error
50 GetAccuToDevOps() *bptree.BPTree
51 GetAccuToDevOpsItem(tokenPath string) (int64, bool)
52 SetAccuToDevOpsItem(_ int, rlm realm, tokenPath string, amount int64) error
53
54 HasDistributedToGovStakerHistoryStoreKey() bool
55 InitializeDistributedToGovStakerHistory(_ int, rlm realm) error
56 GetDistributedToGovStakerHistory() *bptree.BPTree
57 GetDistributedToGovStakerHistoryItem(tokenPath string) (int64, bool)
58 SetDistributedToGovStakerHistoryItem(_ int, rlm realm, tokenPath string, amount int64) error
59
60 HasDistributedToDevOpsHistoryStoreKey() bool
61 InitializeDistributedToDevOpsHistory(_ int, rlm realm) error
62 GetDistributedToDevOpsHistory() *bptree.BPTree
63 GetDistributedToDevOpsHistoryItem(tokenPath string) (int64, bool)
64 SetDistributedToDevOpsHistoryItem(_ int, rlm realm, tokenPath string, amount int64) error
65
66 HasReservedTokensStoreKey() bool
67 InitializeReservedTokens(_ int, rlm realm) error
68 GetReservedTokens() []string
69 SetReservedTokens(_ int, rlm realm, reservedTokens []string) error
70 AddReservedToken(_ int, rlm realm, tokenPath string) error
71}