-
Notifications
You must be signed in to change notification settings - Fork 1
/
planning.txt
296 lines (200 loc) · 9.76 KB
/
planning.txt
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
'''
TEMPLATE FOR SECOND STAGE AFTER INPUT CLASSIFIER
IF BLOCK If the output of input classifier is tokensystem-C,
JUST LINEARLY START BUILDING IT
then first start building the known outputs
// outputreturn('token_incorporation',f"{flodata}", f"{tokenname}", f"{tokenamount}")
f"{flodata} = rawstring
f"{tokenname}" = wordlist entry
tokensystem-C-resolved = Output of second stage classification
f"{tokenamount}" = find_number_function
'''
'''
The problem we are facing:
* Token transactions don't have * or @ symbols
* Smart Contract transactions have * , @ , # symbols
* Smart Contract transaction of the type one time event have 1 # before colon
* Smart Contract transaction of the type continuous event has 2 # after colon
* So we are checking for hashes based on the type of smart contract(identified by *)
* But the above check disregards checking hashes in token transactions
'''
# Write down all the possible flodata( with all combinations possible) for
'''
Token creation
create 500 million rmt#
['#']
Token transfer
transfer 200 rmt#
['#']
One time event userchoice creation
Create Smart Contract with the name India-elections-2019@ of the type one-time-event* using the asset rmt# at the address F7osBpjDDV1mSSnMNrLudEQQ3cwDJ2dPR1$ with contract-conditions: (1) contractAmount=0.001rmt (2) userChoices=Narendra Modi wins| Narendra Modi loses (3) expiryTime= Wed May 22 2019 21:00:00 GMT+0530
['@','*','#','$',':']
['@','*','#','$',':','#']
One time event userchoice participation
send 0.001 rmt# to india-elections-2019@ to FLO address F7osBpjDDV1mSSnMNrLudEQQ3cwDJ2dPR1 with the userchoice:'narendra modi wins'
['#','@',':']
['#','@','$',':']
One time event userchoice trigger
india-elections-2019@ winning-choice:'narendra modi wins'
['@',':']
One time event timeevent creation
Create Smart Contract with the name India-elections-2019@ of the type one-time-event* using the asset rmt# at the address F7osBpjDDV1mSSnMNrLudEQQ3cwDJ2dPR1$ with contract-conditions: (1) contractAmount=0.001rmt (2) expiryTime= Wed May 22 2019 21:00:00 GMT+0530
['@','*','#','$',':']
['@','*','#','$',':','#']
One time event timeevent participation
send 0.001 rmt# to india-elections-2019@ to FLO address F7osBpjDDV1mSSnMNrLudEQQ3cwDJ2dPR1
['#','@']
['#','@','$']
Continuos event token swap creation
Create Smart Contract with the name swap-rupee-bioscope@ of the type continuous-event* at the address oRRCHWouTpMSPuL6yZRwFCuh87ZhuHoL78$ with contract-conditions :
(1) subtype = tokenswap
(2) accepting_token = rupee#
(3) selling_token = bioscope#
(4) price = '15'
(5) priceType = ‘predetermined’
(6) direction = oneway
['@','*','$',':','#','#']
Continuos event tokenswap deposit
Deposit 15 bioscope# to swap-rupee-bioscope@ its FLO address being oRRCHWouTpMSPuL6yZRwFCuh87ZhuHoL78$ with deposit-conditions: (1) expiryTime= Wed Nov 17 2021 21:00:00 GMT+0530
['#','@',':']
['#','@','$',':']
Continuos event tokenswap participation
Send 15 rupee# to swap-rupee-article@ its FLO address being FJXw6QGVVaZVvqpyF422Aj4FWQ6jm8p2dL$
['#','@']
['#','@','$']
'''
'''
['#'] - Token creation
['#'] - Token particiation
['@','*','#','$',':'] - Smart contract creation user-choice
['@','*','#','$',':','#']
['#','@',':'] - Smart contract participation user-choice
['#','@','$',':']
['@',':'] - Smart contract trigger user-choice
['@','*','#','$',':'] - Smart contract creation - ote-timebased
['@','*','#','$',':','#']
['#','@'] - Smart contract particiation - ote-timebased
['#','@','$']
['@','*','$',':','#','#'] - Smart contract creation - continuos event - tokenswap
['#','@',':'] - Smart contract deposit - continuos event - tokenswap
['#','@','$',':']
['#','@'] - Smart contract participation - continuos event - tokenswap
['#','@','$'] - Smart contract participation - continuos event - tokenswap
'''
'''
['#'] - Token creation
['#'] - Token particiation
['@','*','#','$',':'] - Smart contract creation ote-userchoice
['@','*','#','$',':','#']
['@','*','#','$',':'] - Smart contract creation - ote-timebased
['@','*','#','$',':','#']
['#','@',':'] - Smart contract participation user-choice
['#','@','$',':']
['#','@',':'] - Smart contract deposit - continuos event - tokenswap
['#','@','$',':']
['@',':'] - Smart contract trigger user-choice
['#','@'] - Smart contract particiation - ote-timebased
['#','@','$']
['#','@'] - Smart contract participation - continuos event - tokenswap
['#','@','$'] - Smart contract participation - continuos event - tokenswap
['@','*','$',':','#','#'] - Smart contract creation - continuos event - tokenswap
'''
'''
Conflicts -
1. Token creation | Token participation
2. Smart contract CREATION of the type one-time-event-userchoice | one-time-event-timebased
3. Smart contract PARTICIPATION user-choice | Smart contract DEPOSIT continuos-event token-swap
4. Smart contract PARTICIPATION one-time-event-timebased | Smart contract participation - continuos event - tokenswap
'''
'''
Emerging parser design
Phase 1 - Input processing | Special character position based classification and noise detection (FINISHED)
Phase 2 - Conflict recognition (FINISHED)
Phase 3 - Category based keyword checks
Phase 4 - Parser rules for finding data
Phase 5 - Rules for applying parser rules
Phase 6 - Category based data field extraction
Phase 7 - Output formatting and return (FINISHED)
'''
'''
Allowed formats of Smart Contract and token names
1. First character should always be an Alphabet, lower case or upper case
2. The last character should always be an Alphabet, lower case or upper case
3. The middle characters can be a - or _
Check for FLO Address
Write checks for conditions inside contract conditions
Serious error handling for contract-conditions
* 2222:00 gives error
* contractAmount = 0.022rt gives error | check if space is allowed between 0.022 rt
'''
'''
What we need for NFT contract code
1. NFT-address mapping table in system.db
2. New main transaction category class
3. New sub-category for transfer category class ie. NFT transfer
NFT Smart Contract end cases
1. NFT against an address
2. NFT against another NFT
3.
flodata format for NFT
Create 1000 NFT with bioscope# with nft-details: (1) name = 'bioscope' (2) hash =
Create 100 albumname# as NFT with 2CF24DBA5FB0A30E26E83B2AC5B9E29E1B161E5C1FA7425E73043362938B9824 as asset hash
[#]
Rules
-----
DIFFERENT BETWEEN TOKEN AND NFT
System.db will have a differnent entry
in creation nft word will be extra
NFT Hash must be present
Creation and transfer amount .. only integer parts will be taken
Keyword nft must be present in both creation and transfer
'''
'''
Need infinite tokens to create stable coins, so they can be created without worrying about the upper limit of the coins
'''
'''
Create another table in system.db, it simply writes what is every database in one place
Database_name Database type
'''
'''
IDEA FOR NEW ROLLBACK SYSTEM - 24 Jan 2022
-------------------------------------------
245436
[
tx1 - rmt - 245436 - send 10 rmt#
tx2 - rmt - 245436 - send 4 rmt#
tx3 - rmt - 245436 - send 1 rmt#
tx4 - rmt - 245436 - send 100 rmt#
tx5 - rmt trigger(5) - 245436 - trigger
]
banana - txhash
orange - entries in activepid table
mangoes - entries in transaction history table
CURRENT SYSTEM
given a block , find out all the oranges in the block
given a block, find out all the bananas in the block and
for each banana, find corresponding databases( found through parsing of banana flodata and banana txdata)
- if token database then rollback, if contractDatabase then delete entry
NEW SYSTEM
give a block , find out all the oranges in the block
given a block, find out all the bananas in the block and their corresponding databases( found through parsing of banana flodata and banana txdata)
- start opening all those databases one by one | if token database then rollback, if contractDatabase then delete entry
send transaction -> receive the databases associated with it
'''
'''
Step 1
The block that we are rolling back into is earlier than the database creation blockNumber, then delete the whole database without rolling back. Do this for both token databases and smart contract databases
Step 2
If the rolling back block is later than database creation blockNumber, then invoke rollback a database function( rollback_database )
Step 3
Create a list of databases to be opened, and creation date (creation date is block number). This will exclude the token and smart contract databases which are already deleted
Step 4
For each of the database to be opened, rollback the database to rollback point
rollback_database will take 2 inputs, a block number to which it has to rollback to and the name of the database
Step 5
Create a delete function, which will delete from transactionHistory, latestCache and contractDatabase
To-do
------
* Integrate all the functions in the following order:
1 , 2 , 3 , 4 , 5 | That will finish the operation of taking the block number as input and the roll back function will rollback upto the block number specified for all kinds of databases and all kinds of transactions
'''