-
Notifications
You must be signed in to change notification settings - Fork 0
/
Noso.Gvt.html
324 lines (311 loc) · 13.4 KB
/
Noso.Gvt.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>NosoNode: Noso.Gvt</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0-snapshot">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="tipuesearch/tipuesearch.css">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<div class="container"><div class="navigation">
<h2><a href="index.html">NosoNode</a></h2><ul><li><a href="AllUnits.html">Units</a></li><li><a href="ClassHierarchy.html">Class Hierarchy</a></li><li><a href="AllClasses.html">Classes, Interfaces, Objects and Records</a></li><li><a href="AllTypes.html">Types</a></li><li><a href="AllVariables.html">Variables</a></li><li><a href="AllConstants.html">Constants</a></li><li><a href="AllFunctions.html">Functions and Procedures</a></li><li><a href="AllIdentifiers.html">Identifiers</a></li><li><form class="search-form" action="tipue_results.html"><div class="search-input"><input type="text" name="q" id="tipue_search_input" pattern=".{1,}" title="At least 1 characters" required><div class="search-button"><input type="button" id="tipue_search_button" onclick="this.form.submit();"></div></div></form>
<div style="clear: both"></div>
</li></ul></div><div class="content">
<h1 class="unit">Unit Noso.Gvt</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Uses">Uses</a></div><div class="one_section"><a class="section" href="#PasDoc-Classes">Classes, Interfaces, Objects and Records</a></div><div class="one_section"><a class="section" href="#PasDoc-FuncsProcs">Functions and Procedures</a></div><div class="one_section">Types</div><div class="one_section"><a class="section" href="#PasDoc-Constants">Constants</a></div><div class="one_section"><a class="section" href="#PasDoc-Variables">Variables</a></div></div>
<span id="PasDoc-Description"></span><h2 class="description">Description</h2>
<p>
Unit for managing a GVT (Governance Token)</p>
<span id="PasDoc-Uses"></span><h2 class="uses">Uses</h2>
<ul class="useslist"><li>Classes</li><li><a href="Noso.Crypto.html">Noso.Crypto</a></li><li><a href="Noso.Debug.html">Noso.Debug</a></li><li>SysUtils</li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Classes"></span><h3 class="cio">Classes, Interfaces, Objects and Records</h3>
<table class="classestable wide_list">
<tr class="listheader">
<th class="itemname">Name</th>
<th class="itemdesc">Description</th>
</tr>
<tr class="list">
<td class="itemname">Packed Record <a class="bold" href="Noso.Gvt.TGovernanceToken.html"><code>TGovernanceToken</code></a></td>
<td class="itemdesc"> Record representing a Governance Token (GVT) </td>
</tr>
</table>
<span id="PasDoc-FuncsProcs"></span><h3 class="summary">Functions and Procedures</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code>function <strong><a href="Noso.Gvt.html#CalculateGVTPrice-Integer-Boolean-">CalculateGVTPrice</a></strong>(Available: Integer; ForSale: Boolean = False): Int64;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <strong><a href="Noso.Gvt.html#ChangeGVTOwner-Integer-String-String-">ChangeGVTOwner</a></strong>(Number: Integer; OldOwner, NewOwner: String): Integer;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <strong><a href="Noso.Gvt.html#CountAvailableGVTs">CountAvailableGVTs</a></strong>(): Integer;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <strong><a href="Noso.Gvt.html#CreateGVTFile">CreateGVTFile</a></strong>(): Boolean;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <strong><a href="Noso.Gvt.html#GetGVTAsStream-TMemoryStream-">GetGVTAsStream</a></strong>(out Stream: TMemoryStream): Int64;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <strong><a href="Noso.Gvt.html#GetGVTByIndex-Integer-">GetGVTByIndex</a></strong>(Index: Integer): <a href="Noso.Gvt.TGovernanceToken.html">TGovernanceToken</a>;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <strong><a href="Noso.Gvt.html#GetGVTCount">GetGVTCount</a></strong>: Integer;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>procedure <strong><a href="Noso.Gvt.html#LoadGVTsFileData">LoadGVTsFileData</a></strong>();</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>procedure <strong><a href="Noso.Gvt.html#SaveGVTsAsData">SaveGVTsAsData</a></strong>();</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <strong><a href="Noso.Gvt.html#SaveStreamAsGVTs-TMemoryStream-">SaveStreamAsGVTs</a></strong>(Stream: TMemoryStream): Boolean;</code></td>
</tr>
</table>
<span id="PasDoc-Constants"></span><h3 class="summary">Constants</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><strong><a href="Noso.Gvt.html#GVTBaseValue">GVTBaseValue</a></strong> = 70000000000;</code></td>
</tr>
</table>
<span id="PasDoc-Variables"></span><h3 class="summary">Variables</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><strong><a href="Noso.Gvt.html#GVTArray">GVTArray</a></strong>: array of <a href="Noso.Gvt.TGovernanceToken.html">TGovernanceToken</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><strong><a href="Noso.Gvt.html#GVTArrayLock">GVTArrayLock</a></strong>: TRTLCriticalSection;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><strong><a href="Noso.Gvt.html#GVTFile">GVTFile</a></strong>: file of <a href="Noso.Gvt.TGovernanceToken.html">TGovernanceToken</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><strong><a href="Noso.Gvt.html#GVTFileLock">GVTFileLock</a></strong>: TRTLCriticalSection;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><strong><a href="Noso.Gvt.html#GVTFilename">GVTFilename</a></strong>: String = 'NOSODATA' + DirectorySeparator + 'gvts.psk';</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><strong><a href="Noso.Gvt.html#GVTHashMD5">GVTHashMD5</a></strong>: String = '';</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Functions and Procedures</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="CalculateGVTPrice-Integer-Boolean-"></span><code>function <strong>CalculateGVTPrice</strong>(Available: Integer; ForSale: Boolean = False): Int64;</code></td>
</tr>
<tr><td colspan="1">
<p>
Calculates the price of a Governance Token based on the number of available GVTs. </p>
<p>
<p>
<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>Available</dt>
<dd>The number of GVTs available.</dd>
<dt>ForSale</dt>
<dd>Whether the price is for selling (<code>True</code>) or buying (<code>False</code>).</dd>
</dl>
<h6 class="description_section">Returns</h6>
<p class="return">The calculated price of the GVT.</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="ChangeGVTOwner-Integer-String-String-"></span><code>function <strong>ChangeGVTOwner</strong>(Number: Integer; OldOwner, NewOwner: String): Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
( Changes the owner of a Governance Token given its number. (
<p>
<p>
<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>Number</dt>
<dd>The number of the GVT to change.</dd>
<dt>OldOwner</dt>
<dd>The current owner's address.</dd>
<dt>NewOwner</dt>
<dd>The new owner's address.</dd>
</dl>
<h6 class="description_section">Returns</h6>
<p class="return">0 for success, or an error code (1, 2, 3).</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="CountAvailableGVTs"></span><code>function <strong>CountAvailableGVTs</strong>(): Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
Counts the number of available Governance Tokens (GVTs belonging to the development fund). </p>
<p>
</p>
<h6 class="description_section">Returns</h6>
<p class="return">The count of available GVTs.</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="CreateGVTFile"></span><code>function <strong>CreateGVTFile</strong>(): Boolean;</code></td>
</tr>
<tr><td colspan="1">
<p>
Creates an empty GVT file. If a file already exists, it is overwritten with an empty one. </p>
<p>
</p>
<h6 class="description_section">Returns</h6>
<p class="return"><code>True</code> if the file was successfully created; <code>False</code> otherwise.</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GetGVTAsStream-TMemoryStream-"></span><code>function <strong>GetGVTAsStream</strong>(out Stream: TMemoryStream): Int64;</code></td>
</tr>
<tr><td colspan="1">
<p>
Loads the GVT file into a memory stream. </p>
<p>
<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>Stream</dt>
<dd>The memory stream to load the GVT file into.</dd>
</dl>
<h6 class="description_section">Returns</h6>
<p class="return">Size of the loaded stream in bytes.</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GetGVTByIndex-Integer-"></span><code>function <strong>GetGVTByIndex</strong>(Index: Integer): <a href="Noso.Gvt.TGovernanceToken.html">TGovernanceToken</a>;</code></td>
</tr>
<tr><td colspan="1">
<p>
Retrieves a Governance Token record by its index in the array. </p>
<p>
<p> .</p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>Index</dt>
<dd>The index of the GVT to retrieve.</dd>
</dl>
<h6 class="description_section">Returns</h6>
<p class="return">The requested GVT record.</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GetGVTCount"></span><code>function <strong>GetGVTCount</strong>: Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
Returns the number of Governance Token records currently loaded in the array. </p>
<p>
</p>
<h6 class="description_section">Returns</h6>
<p class="return">The number of GVT records.</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="LoadGVTsFileData"></span><code>procedure <strong>LoadGVTsFileData</strong>();</code></td>
</tr>
<tr><td colspan="1">
<p>
Loads the GVT file data into an array. The array holds all GVT records from the file. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="SaveGVTsAsData"></span><code>procedure <strong>SaveGVTsAsData</strong>();</code></td>
</tr>
<tr><td colspan="1">
<p>
Saves the GVT array data back to the file. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="SaveStreamAsGVTs-TMemoryStream-"></span><code>function <strong>SaveStreamAsGVTs</strong>(Stream: TMemoryStream): Boolean;</code></td>
</tr>
<tr><td colspan="1">
<p>
Saves the provided memory stream as the GVT file. </p>
<p>
<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>Stream</dt>
<dd>The memory stream to save.</dd>
</dl>
<h6 class="description_section">Returns</h6>
<p class="return"><code>True</code> if the file was successfully saved; <code>False</code> otherwise.</p></td></tr>
</table>
<h3 class="detail">Constants</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GVTBaseValue"></span><code><strong>GVTBaseValue</strong> = 70000000000;</code></td>
</tr>
<tr><td colspan="1">
<p>
Base value of a Governance Token</p>
</td></tr>
</table>
<h3 class="detail">Variables</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GVTArray"></span><code><strong>GVTArray</strong>: array of <a href="Noso.Gvt.TGovernanceToken.html">TGovernanceToken</a>;</code></td>
</tr>
<tr><td colspan="1">
<p>
Array to hold loaded GVT records</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GVTArrayLock"></span><code><strong>GVTArrayLock</strong>: TRTLCriticalSection;</code></td>
</tr>
<tr><td colspan="1">
<p>
Critical section for synchronizing array access</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GVTFile"></span><code><strong>GVTFile</strong>: file of <a href="Noso.Gvt.TGovernanceToken.html">TGovernanceToken</a>;</code></td>
</tr>
<tr><td colspan="1">
<p>
File variable for GVT file handling</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GVTFileLock"></span><code><strong>GVTFileLock</strong>: TRTLCriticalSection;</code></td>
</tr>
<tr><td colspan="1">
<p>
Critical section for synchronizing file access</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GVTFilename"></span><code><strong>GVTFilename</strong>: String = 'NOSODATA' + DirectorySeparator + 'gvts.psk';</code></td>
</tr>
<tr><td colspan="1">
<p>
Filename for GVT storage</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="GVTHashMD5"></span><code><strong>GVTHashMD5</strong>: String = '';</code></td>
</tr>
<tr><td colspan="1">
<p>
MD5 hash of the Governance Token file</p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0-snapshot</a>. </em>
</span>
</div></div></body></html>