types.gno
2.83 Kb · 72 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 DistributeProtocolFeeByTokenPath(_ int, rlm realm, tokenPath string)
18 SetDevOpsPct(_ int, rlm realm, pct int64)
19 SetGovStakerPct(_ int, rlm realm, pct int64)
20 AddToProtocolFee(_ int, rlm realm, tokenPath string, amount int64) error
21}
22
23type IProtocolFeeGetter interface {
24 GetDevOpsPct() int64
25 GetGovStakerPct() int64
26 GetReservedTokens() []string
27 GetAccuTransfersToGovStaker() map[string]int64
28 GetAccuTransfersToDevOps() map[string]int64
29 GetAccuTransferToGovStakerByTokenPath(path string) int64
30 GetAccuTransferToDevOpsByTokenPath(path string) int64
31 GetActualDistributedToGovStaker() map[string]int64
32 GetActualDistributedToDevOps() map[string]int64
33 GetActualDistributedToGovStakerByTokenPath(path string) int64
34 GetActualDistributedToDevOpsByTokenPath(path string) int64
35}
36
37type IProtocolFeeStore interface {
38 HasDevOpsPctStoreKey() bool
39 InitializeDevOpsPct(_ int, rlm realm) error
40 GetDevOpsPct() int64
41 SetDevOpsPct(_ int, rlm realm, pct int64) error
42
43 HasAccuToGovStakerStoreKey() bool
44 InitializeAccuToGovStaker(_ int, rlm realm) error
45 GetAccuToGovStaker() *bptree.BPTree
46 GetAccuToGovStakerItem(tokenPath string) (int64, bool)
47 SetAccuToGovStakerItem(_ int, rlm realm, tokenPath string, amount int64) error
48
49 HasAccuToDevOpsStoreKey() bool
50 InitializeAccuToDevOps(_ int, rlm realm) error
51 GetAccuToDevOps() *bptree.BPTree
52 GetAccuToDevOpsItem(tokenPath string) (int64, bool)
53 SetAccuToDevOpsItem(_ int, rlm realm, tokenPath string, amount int64) error
54
55 HasDistributedToGovStakerHistoryStoreKey() bool
56 InitializeDistributedToGovStakerHistory(_ int, rlm realm) error
57 GetDistributedToGovStakerHistory() *bptree.BPTree
58 GetDistributedToGovStakerHistoryItem(tokenPath string) (int64, bool)
59 SetDistributedToGovStakerHistoryItem(_ int, rlm realm, tokenPath string, amount int64) error
60
61 HasDistributedToDevOpsHistoryStoreKey() bool
62 InitializeDistributedToDevOpsHistory(_ int, rlm realm) error
63 GetDistributedToDevOpsHistory() *bptree.BPTree
64 GetDistributedToDevOpsHistoryItem(tokenPath string) (int64, bool)
65 SetDistributedToDevOpsHistoryItem(_ int, rlm realm, tokenPath string, amount int64) error
66
67 HasReservedTokensStoreKey() bool
68 InitializeReservedTokens(_ int, rlm realm) error
69 GetReservedTokens() []string
70 SetReservedTokens(_ int, rlm realm, reservedTokens []string) error
71 AddReservedToken(_ int, rlm realm, tokenPath string) error
72}