getter.gno
3.24 Kb · 104 lines
1package v1
2
3// GetDevOpsPct returns the percentage allocated to devOps.
4func (pf *protocolFeeV1) GetDevOpsPct() int64 {
5 return pf.getProtocolFeeState().DevOpsPct()
6}
7
8// GetGovStakerPct returns the percentage allocated to gov/staker.
9func (pf *protocolFeeV1) GetGovStakerPct() int64 {
10 return pf.getProtocolFeeState().GovStakerPct()
11}
12
13// GetReservedTokens returns token paths reserved for distribution.
14func (pf *protocolFeeV1) GetReservedTokens() []string {
15 return pf.getProtocolFeeState().ReservedTokens()
16}
17
18// GetAccuTransfersToGovStaker returns all accumulated transfers to gov/staker.
19func (pf *protocolFeeV1) GetAccuTransfersToGovStaker() map[string]int64 {
20 accuTransfers := make(map[string]int64)
21
22 pf.getProtocolFeeState().AccuToGovStaker().Iterate("", "", func(key string, value any) bool {
23 amount, ok := value.(int64)
24 if !ok {
25 return false
26 }
27
28 accuTransfers[key] = amount
29 return false
30 })
31
32 return accuTransfers
33}
34
35// GetAccuTransfersToDevOps returns all accumulated transfers to devOps.
36func (pf *protocolFeeV1) GetAccuTransfersToDevOps() map[string]int64 {
37 accuTransfers := make(map[string]int64)
38
39 pf.getProtocolFeeState().AccuToDevOps().Iterate("", "", func(key string, value any) bool {
40 amount, ok := value.(int64)
41 if !ok {
42 return false
43 }
44
45 accuTransfers[key] = amount
46 return false
47 })
48
49 return accuTransfers
50}
51
52// GetAccuTransferToGovStakerByTokenPath returns the accumulated transfer to gov/staker by token path.
53func (pf *protocolFeeV1) GetAccuTransferToGovStakerByTokenPath(path string) int64 {
54 return pf.getProtocolFeeState().GetAccuTransferToGovStakerByTokenPath(path)
55}
56
57// GetAccuTransferToDevOpsByTokenPath returns the accumulated transfer to devOps by token path.
58func (pf *protocolFeeV1) GetAccuTransferToDevOpsByTokenPath(path string) int64 {
59 return pf.getProtocolFeeState().GetAccuTransferToDevOpsByTokenPath(path)
60}
61
62// GetActualDistributedToGovStaker returns all actual transfers to gov/staker.
63func (pf *protocolFeeV1) GetActualDistributedToGovStaker() map[string]int64 {
64 actualDistributed := make(map[string]int64)
65
66 pf.getProtocolFeeState().ActualDistributedToGovStaker().Iterate("", "", func(key string, value any) bool {
67 amount, ok := value.(int64)
68 if !ok {
69 return false
70 }
71
72 actualDistributed[key] = amount
73 return false
74 })
75
76 return actualDistributed
77}
78
79// GetActualDistributedToDevOps returns all actual transfers to devOps.
80func (pf *protocolFeeV1) GetActualDistributedToDevOps() map[string]int64 {
81 actualDistributed := make(map[string]int64)
82
83 pf.getProtocolFeeState().ActualDistributedToDevOps().Iterate("", "", func(key string, value any) bool {
84 amount, ok := value.(int64)
85 if !ok {
86 return false
87 }
88
89 actualDistributed[key] = amount
90 return false
91 })
92
93 return actualDistributed
94}
95
96// GetActualDistributedToGovStakerByTokenPath returns the actual transfer to gov/staker by token path.
97func (pf *protocolFeeV1) GetActualDistributedToGovStakerByTokenPath(path string) int64 {
98 return pf.getProtocolFeeState().GetActualDistributedToGovStakerByTokenPath(path)
99}
100
101// GetActualDistributedToDevOpsByTokenPath returns the actual transfer to devOps by token path.
102func (pf *protocolFeeV1) GetActualDistributedToDevOpsByTokenPath(path string) int64 {
103 return pf.getProtocolFeeState().GetActualDistributedToDevOpsByTokenPath(path)
104}