-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeemlev_pyinterface.py
352 lines (284 loc) · 9.92 KB
/
meemlev_pyinterface.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
from abc import ABC, abstractmethod
from typing import Dict, List, Any
class PublicCallablestInterface(ABC):
"""
Abstract base class defining interface for interacting with a token smart contract.
"""
@abstractmethod
def decimals(self) -> int:
"""
Retrieve the number of decimal places for the token.
"""
pass
@abstractmethod
def allowance(self, owner: str, spender: str) -> int:
"""
Retrieves the allowance granted by the owner to the spender.
"""
pass
@abstractmethod
def totalSupply(self) -> int:
"""
Retrieve the total supply of the token.
"""
pass
@abstractmethod
def balanceOf(self, account: str) -> int:
"""
Retrieves the balance of the specified account.
"""
pass
@abstractmethod
def burntTokens(self) -> int:
"""
Retrieve the total number of burnt tokens.
"""
pass
@abstractmethod
def circulatingSupply(self) -> int:
"""
Retrieve the circulating supply of the token.
"""
pass
@abstractmethod
def deployTimestamp(self) -> int:
"""
Get the timestamp when the contract was deployed.
"""
pass
@abstractmethod
def name(self) -> str:
"""
Retrieve the name of the token.
"""
pass
@abstractmethod
def owner(self) -> str:
"""
Retrieve the owner address of the contract.
"""
pass
@abstractmethod
def symbol(self) -> str:
"""
Retrieve the symbol of the token.
"""
pass
class PublicTransactablesInterface(ABC):
"""
Abstract class defining an interface for interacting with token smart contracts.
"""
@abstractmethod
def burn(self, amount: int) -> str:
"""
Burns a specified amount of tokens.
Parameters:
- amount (int): The amount of tokens to burn.
Returns:
- str: Transaction ID
"""
pass
@abstractmethod
def transfer(self, recipient: str, amount: int) -> str:
"""
Transfers tokens to a specified address.
Parameters:
- recipient (str): The address to transfer tokens to.
- amount (int): The amount of tokens to transfer.
Returns:
- str: Transaction ID
"""
pass
@abstractmethod
def approve(self, spender: str, amount: int) -> str:
"""
Approves a spender to spend a specified amount of tokens on behalf of the owner.
Parameters:
- spender (str): The address of the spender.
- amount (int): The amount of tokens to approve.
Returns:
- str: Transaction ID
"""
pass
@abstractmethod
def transferFrom(self, sender: str, recipient: str, amount: int) -> str:
"""
Transfers tokens from one account to another.
Parameters:
- sender (str): The address of the sender.
- recipient (str): The address of the recipient.
- amount (int): The amount of tokens to transfer.
Returns:
- str: Transaction ID
"""
pass
@abstractmethod
def decreaseAllowance(self, spender: str, subtracted_value: int) -> str:
"""
Decreases the allowance of a spender.
Parameters:
- spender (str): The address of the spender.
- subtracted_value (int): The amount by which to decrease the allowance.
Returns:
- str: Transaction ID
"""
pass
@abstractmethod
def increaseAllowance(self, spender: str, added_value: int) -> str:
"""
Increases the allowance of a spender.
Parameters:
- spender (str): The address of the spender.
- added_value (int): The amount by which to increase the allowance.
Returns:
- str: Transaction ID
"""
pass
@abstractmethod
def renounceOwnership(self) -> str:
"""
Renounces ownership of the contract.
Returns:
- str: Transaction ID
"""
pass
@abstractmethod
def transferOwnership(self, new_owner: str) -> str:
"""
Transfers ownership of the contract to a new owner.
Parameters:
- new_owner (str): The address of the new owner.
Returns:
- str: Transaction ID
"""
pass
class MeemLevCallablesInterface(ABC):
@abstractmethod
def zfc_config(self) -> Dict[str, Any]:
"""Retrieve configuration information about the ZFC token."""
pass
@abstractmethod
def ztc_vestingGrants(self) -> int:
"""Retrieve the vesting grants."""
pass
@abstractmethod
def ztc_getMember(self, member_address: str, secret: str) -> Dict[str, int]:
"""Retrieve information about a member."""
pass
@abstractmethod
def zrc_config(self) -> Dict[str, int]:
"""Retrieve configuration information about the ZRC token."""
pass
@abstractmethod
def zrc_scheduledRewardTimes(self) -> List[int]:
"""Retrieve scheduled reward times information from the ZRC token."""
pass
@abstractmethod
def zgc_categoryConfig(self, category: int=None) -> Dict[str, Any]:
"""Retrieve configuration information about a specific category."""
pass
@abstractmethod
def zgc_DAOconfig(self) -> Dict[str, int]:
"""Retrieve configuration information about the DAO."""
pass
@abstractmethod
def zgc_existingProposals(self) -> List[int]:
"""Retrieve existing proposals from the Governance contract."""
pass
@abstractmethod
def zgc_getProposalParameters(self, proposal_id: int) -> List[int]:
"""Retrieve parameters of a specific proposal from the Governance contract."""
pass
@abstractmethod
def zgc_proposals(self, proposal_id: int=None) -> Dict[str, Any]:
"""Retrieve information about a proposal."""
pass
@abstractmethod
def zgc_DAOstake(self, member_address: str) -> Dict[str, int]:
"""Retrieve stake information for a DAO member."""
pass
class MeemLevTransactablesInterface(ABC):
@abstractmethod
def initializeContract(self, founders: str, team: str, rewards: str, ecosystem: str, stake: str) -> str:
"""Initializes the contract with specified addresses."""
pass
@abstractmethod
def zfc_claimGrant(self, to_address: str) -> str:
"""Claims a grant for the specified address."""
pass
@abstractmethod
def zfc_updateConfig(self, proposal_id: int) -> str:
"""Updates the configuration."""
pass
@abstractmethod
def ztc_addMember(self, member_address: str, grant: int, round_target: int, frequency: int) -> Dict[str, str]:
"""Adds a new member to the contract."""
pass
@abstractmethod
def ztc_deleteMember(self, member_address: str) -> str:
"""Deletes a member from the contract."""
pass
@abstractmethod
def ztc_updateMember(self, member_address: str, grant: int, round_target: int, frequency: int) -> str:
"""Updates the details of a member in the contract."""
pass
@abstractmethod
def ztc_claimGrant(self) -> str:
"""Claims the grant for a member."""
pass
@abstractmethod
def zrc_setAnnualBudget(self) -> str:
"""Sets the annual budget for the current year."""
pass
@abstractmethod
def zrc_unlockRewards(self) -> str:
"""Unlocks rewards for the upcoming round."""
pass
@abstractmethod
def zrc_distributeRewards(self, to_address: str, amount: int) -> str:
"""Distributes rewards to a specified address."""
pass
@abstractmethod
def zrc_updateConfig(self, proposal_id: int) -> str:
"""Updates the configuration based on the proposal ID."""
pass
@abstractmethod
def zec_transferFunds(self, proposal_id: int, to_address: str) -> str:
"""Transfers funds to a specified address."""
pass
@abstractmethod
def zgc_createProposal(self, description: str, voting_duration: int, category: int, parameters: List[int]) -> str:
"""Creates a new proposal."""
pass
@abstractmethod
def zgc_vote(self, proposal_id: int, support: int) -> str:
"""Votes for a proposal."""
pass
@abstractmethod
def zgc_deleteProposal(self, proposal_id: int) -> str:
"""Deletes a proposal."""
pass
@abstractmethod
def zgc_executeProposal(self, proposal_id: int, category: int) -> List[int]:
"""Executes a proposal."""
pass
@abstractmethod
def zgc_setCategoryConfig(self, category: int, max_voting_duration: int, min_voting_duration: int, quorum: int) -> str:
"""Sets the configuration for a specific proposal category."""
pass
@abstractmethod
def zgc_setDAOConfig(self, max_active_proposals: int, min_voter_stake: int, min_proposer_stake: int,
min_staking_duration: int, staking_base_duration: int, duration_cap_factor: int) -> str:
"""Sets the configuration for DAO operations."""
pass
@abstractmethod
def zgc_stakeDAOTokens(self, amount: int) -> str:
"""Stakes DAO tokens."""
pass
@abstractmethod
def zgc_unstakeDAOTokens(self, amount: int) -> str:
"""Unstakes DAO tokens."""
pass
class MeemLevInterface(PublicCallablestInterface, PublicTransactablesInterface,
MeemLevCallablesInterface, MeemLevTransactablesInterface):
pass