tx · C6SXkLNGTKA1vfzzZVy9qK9W7MrDUyE3LgE6DEFxQS3P 3Mp3nG9T5fKGziHW8mcCqx3jMFx3towh3WA: -0.02300000 Waves 2023.03.06 16:58 [2478322] smart account 3Mp3nG9T5fKGziHW8mcCqx3jMFx3towh3WA > SELF 0.00000000 Waves
{ "type": 13, "id": "C6SXkLNGTKA1vfzzZVy9qK9W7MrDUyE3LgE6DEFxQS3P", "fee": 2300000, "feeAssetId": null, "timestamp": 1678111132033, "version": 2, "chainId": 84, "sender": "3Mp3nG9T5fKGziHW8mcCqx3jMFx3towh3WA", "senderPublicKey": "D46gQxzmdzdCTYRg6dMcwFoUrc6ZmxF6GKd5ZoTkvzp1", "proofs": [ "4smgc5yGeNTwwJdZchnKZTgv6Vxs3sBjpD3jXkjuNeJV7Yyxrnf8dhP5wQgyLXRmgJSY3TzPDMsfj6DCyF5tcdwU" ], "script": "base64:BgLEFQgCEgMKAQgSABIECgIIARIHCgUICAgIARIECgIICBIFCgMICAESBAoCCAgSAwoBARIDCgEBEgQKAggIEgQKAggEEgASAwoBARIAEgQKAggIEgQKAggIEgQKAggIIglzZXBhcmF0b3IiDnBvb2xXZWlnaHRNdWx0Ig9tYXhEZXB0aERlZmF1bHQiFmZpbmFsaXphdGlvblN0YWdlVG90YWwiF2ZpbmFsaXphdGlvblN0YWdlU2hhcmVzIg5rZXlFcG9jaExlbmd0aCIRa2V5RXBvY2hMZW5ndGhOZXciFWtleUVwb2NoTGVuZ3RoQnlFcG9jaCIFZXBvY2giD2tleUN1cnJlbnRFcG9jaCILa2V5TWF4RGVwdGgiImtleVZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QiEmtleUZhY3RvcnlDb250cmFjdCITa2V5Qm9vc3RpbmdDb250cmFjdCISa2V5U3Rha2luZ0NvbnRyYWN0IhRrZXlGaW5hbGl6YXRpb25TdGFnZSILa2V5TmV4dFBvb2wiC2tleU5leHRVc2VyIg5rZXlTdGFydEhlaWdodCIRa2V5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GVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmN0CWJvZHlCeXRlcwkAkQMCCAUCY3QGcHJvb2ZzAAAFAmN2kCt4wA==", "height": 2478322, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E7CQSQMXjfFp8F6XpfFC3ntKsHHUSUUM79JVTsDc1ptZ Next: A4Y8NgoKZAi6bn8LtwQQ2u2MaLzM4gE5GEyU9V4s5CAm Diff:
Old | New | Differences | |
---|---|---|---|
517 | 517 | if ((checkTargetEpoch == checkTargetEpoch)) | |
518 | 518 | then { | |
519 | 519 | let pool = stringToPool(poolStr) | |
520 | - | let $ | |
521 | - | let amountAssetId = $ | |
522 | - | let priceAssetId = $ | |
520 | + | let $t01798418024 = pool | |
521 | + | let amountAssetId = $t01798418024._1 | |
522 | + | let priceAssetId = $t01798418024._2 | |
523 | 523 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
524 | 524 | let gwxAmountAtEndTotal = { | |
525 | 525 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeight], nil) | |
578 | 578 | if ((checkTargetEpoch == checkTargetEpoch)) | |
579 | 579 | then { | |
580 | 580 | let pool = stringToPool(poolStr) | |
581 | - | let $ | |
582 | - | let amountAssetId = $ | |
583 | - | let priceAssetId = $ | |
581 | + | let $t02036620406 = pool | |
582 | + | let amountAssetId = $t02036620406._1 | |
583 | + | let priceAssetId = $t02036620406._2 | |
584 | 584 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
585 | 585 | let factoryContract = addressFromStringValue(getStrOrFail(this, keyFactoryContract)) | |
586 | 586 | let lpAssetId = getLpAssetByPoolAssets(amountAssetId, priceAssetId) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let poolWeightMult = 100000000 | |
7 | 7 | ||
8 | 8 | let maxDepthDefault = 10 | |
9 | 9 | ||
10 | 10 | let finalizationStageTotal = 0 | |
11 | 11 | ||
12 | 12 | let finalizationStageShares = 1 | |
13 | 13 | ||
14 | 14 | let keyEpochLength = makeString(["%s", "epochLength"], separator) | |
15 | 15 | ||
16 | 16 | let keyEpochLengthNew = makeString(["%s%s", "epochLength__new"], separator) | |
17 | 17 | ||
18 | 18 | func keyEpochLengthByEpoch (epoch) = makeString(["%s%d", "epochLength", toString(epoch)], separator) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | let keyCurrentEpoch = makeString(["%s", "currentEpoch"], separator) | |
22 | 22 | ||
23 | 23 | let keyMaxDepth = makeString(["%s", "maxDepth"], separator) | |
24 | 24 | ||
25 | 25 | let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], separator) | |
26 | 26 | ||
27 | 27 | let keyFactoryContract = makeString(["%s", "factoryContract"], separator) | |
28 | 28 | ||
29 | 29 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
30 | 30 | ||
31 | 31 | let keyStakingContract = makeString(["%s", "stakingContract"], separator) | |
32 | 32 | ||
33 | 33 | let keyFinalizationStage = makeString(["%s", "finalizationStage"], separator) | |
34 | 34 | ||
35 | 35 | let keyNextPool = makeString(["%s", "nextPool"], separator) | |
36 | 36 | ||
37 | 37 | let keyNextUser = makeString(["%s", "nextUser"], separator) | |
38 | 38 | ||
39 | 39 | let keyStartHeight = makeString(["%s", "startHeight"], separator) | |
40 | 40 | ||
41 | 41 | let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], separator) | |
42 | 42 | ||
43 | 43 | let keyStartHeightUi = makeString(["%s", "startHeightUi"], separator) | |
44 | 44 | ||
45 | 45 | let keyFinalizationShouldBeForced = makeString(["%s", "force"], separator) | |
46 | 46 | ||
47 | 47 | func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], separator) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyFinalized (epoch) = makeString(["%s%d", "finalized", toString(epoch)], separator) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func keyInList (pool) = { | |
54 | 54 | let $t016931733 = pool | |
55 | 55 | let amountAssetId = $t016931733._1 | |
56 | 56 | let priceAssetId = $t016931733._2 | |
57 | 57 | makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator) | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyUsed (address,epoch) = makeString(["%s%s%d", "used", toString(address), toString(epoch)], separator) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func keyVote (pool,address,epoch) = { | |
65 | 65 | let $t020072047 = pool | |
66 | 66 | let amountAssetId = $t020072047._1 | |
67 | 67 | let priceAssetId = $t020072047._2 | |
68 | 68 | makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], separator) | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyVotingResult (pool,epoch) = { | |
73 | 73 | let $t022292269 = pool | |
74 | 74 | let amountAssetId = $t022292269._1 | |
75 | 75 | let priceAssetId = $t022292269._2 | |
76 | 76 | makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], separator) | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], separator) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keyPoolShare (pool,epoch) = { | |
84 | 84 | let $t025902630 = pool | |
85 | 85 | let amountAssetId = $t025902630._1 | |
86 | 86 | let priceAssetId = $t025902630._2 | |
87 | 87 | makeString(["%s%s%s%d", "poolShare", amountAssetId, priceAssetId, toString(epoch)], separator) | |
88 | 88 | } | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func keyTotalVotes (epoch) = makeString(["%s%d", "totalVotes", toString(epoch)], separator) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func keyStakedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], separator) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func wrapErr (msg) = makeString(["voting_emission.ride:", msg], " ") | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func throwErr (msg) = throw(wrapErr(msg)) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func getValueOrFail (address,key,type) = { | |
104 | 104 | let error = makeString(["mandatory ", toString(address), ".", key, " is not defined"], "") | |
105 | 105 | valueOrErrorMessage( match type { | |
106 | 106 | case str: String => | |
107 | 107 | getString(address, key) | |
108 | 108 | case int: Int => | |
109 | 109 | getInteger(address, key) | |
110 | 110 | case _ => | |
111 | 111 | throw("invalid entry type") | |
112 | 112 | }, error) | |
113 | 113 | } | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func getStrOrFail (address,key) = { | |
117 | 117 | let @ = getValueOrFail(address, key, "") | |
118 | 118 | if ($isInstanceOf(@, "String")) | |
119 | 119 | then @ | |
120 | 120 | else throw(($getType(@) + " couldn't be cast to String")) | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getIntOrFail (address,key) = { | |
125 | 125 | let @ = getValueOrFail(address, key, 0) | |
126 | 126 | if ($isInstanceOf(@, "Int")) | |
127 | 127 | then @ | |
128 | 128 | else throw(($getType(@) + " couldn't be cast to Int")) | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func poolToString (pool) = ((pool._1 + separator) + pool._2) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func stringToPool (str) = { | |
136 | 136 | let parts = split(str, separator) | |
137 | 137 | if ((size(parts) == 2)) | |
138 | 138 | then $Tuple2(parts[0], parts[1]) | |
139 | 139 | else throw("invalid pool string") | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getLpAssetByPoolAssets (amountAssetId,priceAssetId) = { | |
144 | 144 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
145 | 145 | ||
146 | 146 | func keyMappingPoolAssetsToPoolContractAddress (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + toString(internalAmountAssetIdStr)) + "__") + toString(internalPriceAssetIdStr)) + "__mappings__poolAssets2PoolContract") | |
147 | 147 | ||
148 | 148 | func keyMappingPoolContractToLPAsset (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
149 | 149 | ||
150 | 150 | let factoryContract = addressFromStringValue(getStrOrFail(this, keyFactoryContract)) | |
151 | 151 | let amountAssetInternalId = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amountAssetId)) | |
152 | 152 | let priceAssetInternalId = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAssetId)) | |
153 | 153 | let poolContractAddress = getStrOrFail(factoryContract, keyMappingPoolAssetsToPoolContractAddress(amountAssetInternalId, priceAssetInternalId)) | |
154 | 154 | let lpAssetId = getStrOrFail(factoryContract, keyMappingPoolContractToLPAsset(poolContractAddress)) | |
155 | 155 | lpAssetId | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func checkWxEmissionPoolLabel (pool) = { | |
160 | 160 | let $t051525192 = pool | |
161 | 161 | let amountAssetId = $t051525192._1 | |
162 | 162 | let priceAssetId = $t051525192._2 | |
163 | 163 | let factoryContract = addressFromStringValue(getStrOrFail(this, keyFactoryContract)) | |
164 | 164 | let @ = invoke(factoryContract, "checkWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil) | |
165 | 165 | if ($isInstanceOf(@, "Boolean")) | |
166 | 166 | then @ | |
167 | 167 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | let poolsListName = "pools" | |
172 | 172 | ||
173 | 173 | func getVotesListName (pool) = { | |
174 | 174 | let $t054935533 = pool | |
175 | 175 | let amountAssetId = $t054935533._1 | |
176 | 176 | let priceAssetId = $t054935533._2 | |
177 | 177 | makeString(["votes", amountAssetId, priceAssetId], separator) | |
178 | 178 | } | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | func keyListHead (listName) = { | |
182 | 182 | let meta = if ((listName == poolsListName)) | |
183 | 183 | then "%s%s" | |
184 | 184 | else "%s%s%s%s" | |
185 | 185 | makeString([meta, listName, "head"], separator) | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func keyListSize (listName) = { | |
190 | 190 | let meta = if ((listName == poolsListName)) | |
191 | 191 | then "%s%s" | |
192 | 192 | else "%s%s%s%s" | |
193 | 193 | makeString([meta, listName, "size"], separator) | |
194 | 194 | } | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func keyListPrev (listName,id) = { | |
198 | 198 | let meta = if ((listName == poolsListName)) | |
199 | 199 | then "%s%s%s%s" | |
200 | 200 | else "%s%s%s%s%s" | |
201 | 201 | makeString([meta, listName, id, "prev"], separator) | |
202 | 202 | } | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func keyListNext (listName,id) = { | |
206 | 206 | let meta = if ((listName == poolsListName)) | |
207 | 207 | then "%s%s%s%s" | |
208 | 208 | else "%s%s%s%s%s" | |
209 | 209 | makeString([meta, listName, id, "next"], separator) | |
210 | 210 | } | |
211 | 211 | ||
212 | 212 | ||
213 | 213 | func containsNode (listName,id) = { | |
214 | 214 | let headOrUnit = getString(this, keyListHead(listName)) | |
215 | 215 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
216 | 216 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
217 | 217 | if (if ((id == valueOrElse(headOrUnit, ""))) | |
218 | 218 | then true | |
219 | 219 | else (prevOrUnit != unit)) | |
220 | 220 | then true | |
221 | 221 | else (nextOrUnit != unit) | |
222 | 222 | } | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | func insertNodeActions (listName,id) = { | |
226 | 226 | let headOrUnit = getString(this, keyListHead(listName)) | |
227 | 227 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
228 | 228 | let checkNode = if (!(containsNode(listName, id))) | |
229 | 229 | then true | |
230 | 230 | else throw("Node exists") | |
231 | 231 | if ((checkNode == checkNode)) | |
232 | 232 | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
233 | 233 | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
234 | 234 | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
235 | 235 | else throw("Strict value is not equal to itself.") | |
236 | 236 | } | |
237 | 237 | ||
238 | 238 | ||
239 | 239 | func deleteNodeActions (listName,id) = { | |
240 | 240 | let headOrUnit = getString(this, keyListHead(listName)) | |
241 | 241 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
242 | 242 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
243 | 243 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
244 | 244 | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
245 | 245 | then (nextOrUnit != unit) | |
246 | 246 | else false) | |
247 | 247 | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
248 | 248 | else if ((nextOrUnit != unit)) | |
249 | 249 | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
250 | 250 | else if ((prevOrUnit != unit)) | |
251 | 251 | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
252 | 252 | else if ((id == valueOrElse(headOrUnit, ""))) | |
253 | 253 | then [DeleteEntry(keyListHead(listName))] | |
254 | 254 | else throw(((("invalid node: " + listName) + ".") + id)))) | |
255 | 255 | } | |
256 | 256 | ||
257 | 257 | ||
258 | 258 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
265 | 265 | case s: String => | |
266 | 266 | fromBase58String(s) | |
267 | 267 | case _: Unit => | |
268 | 268 | unit | |
269 | 269 | case _ => | |
270 | 270 | throw("Match error") | |
271 | 271 | } | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
275 | 275 | case s: String => | |
276 | 276 | fromBase58String(s) | |
277 | 277 | case _: Unit => | |
278 | 278 | unit | |
279 | 279 | case _ => | |
280 | 280 | throw("Match error") | |
281 | 281 | } | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | let permissionDeniedError = throw("Permission denied") | |
285 | 285 | ||
286 | 286 | func mustThis (i) = if ((i.caller == this)) | |
287 | 287 | then true | |
288 | 288 | else permissionDeniedError | |
289 | 289 | ||
290 | 290 | ||
291 | 291 | func mustManager (i) = match managerPublicKeyOrUnit() { | |
292 | 292 | case pk: ByteVector => | |
293 | 293 | if ((i.callerPublicKey == pk)) | |
294 | 294 | then true | |
295 | 295 | else permissionDeniedError | |
296 | 296 | case _: Unit => | |
297 | 297 | mustThis(i) | |
298 | 298 | case _ => | |
299 | 299 | throw("Match error") | |
300 | 300 | } | |
301 | 301 | ||
302 | 302 | ||
303 | 303 | @Callable(i) | |
304 | 304 | func setManager (pendingManagerPublicKey) = { | |
305 | 305 | let checkCaller = mustManager(i) | |
306 | 306 | if ((checkCaller == checkCaller)) | |
307 | 307 | then { | |
308 | 308 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
309 | 309 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
310 | 310 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
311 | 311 | else throw("Strict value is not equal to itself.") | |
312 | 312 | } | |
313 | 313 | else throw("Strict value is not equal to itself.") | |
314 | 314 | } | |
315 | 315 | ||
316 | 316 | ||
317 | 317 | ||
318 | 318 | @Callable(i) | |
319 | 319 | func confirmManager () = { | |
320 | 320 | let pm = pendingManagerPublicKeyOrUnit() | |
321 | 321 | let hasPM = if (isDefined(pm)) | |
322 | 322 | then true | |
323 | 323 | else throw("No pending manager") | |
324 | 324 | if ((hasPM == hasPM)) | |
325 | 325 | then { | |
326 | 326 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
327 | 327 | then true | |
328 | 328 | else throw("You are not pending manager") | |
329 | 329 | if ((checkPM == checkPM)) | |
330 | 330 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
331 | 331 | else throw("Strict value is not equal to itself.") | |
332 | 332 | } | |
333 | 333 | else throw("Strict value is not equal to itself.") | |
334 | 334 | } | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | ||
338 | 338 | @Callable(i) | |
339 | 339 | func getUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
340 | 340 | let boostingContractAddress = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyBoostingContract)), "invalid boosting contract address") | |
341 | 341 | $Tuple2(nil, { | |
342 | 342 | let @ = invoke(boostingContractAddress, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil) | |
343 | 343 | if ($isInstanceOf(@, "Int")) | |
344 | 344 | then @ | |
345 | 345 | else throw(($getType(@) + " couldn't be cast to Int")) | |
346 | 346 | }) | |
347 | 347 | } | |
348 | 348 | ||
349 | 349 | ||
350 | 350 | ||
351 | 351 | @Callable(i) | |
352 | 352 | func constructor (factoryContract,votingEmissionCandidateContract,boostingContract,stakingContract,epochLength) = { | |
353 | 353 | let checks = [mustManager(i), if ((addressFromString(factoryContract) != unit)) | |
354 | 354 | then true | |
355 | 355 | else "invalid factory contract address", if ((addressFromString(votingEmissionCandidateContract) != unit)) | |
356 | 356 | then true | |
357 | 357 | else "invalid voting emission candidate contract address", if ((addressFromString(boostingContract) != unit)) | |
358 | 358 | then true | |
359 | 359 | else "invalid boosting contract address", if ((addressFromString(stakingContract) != unit)) | |
360 | 360 | then true | |
361 | 361 | else "invalid staking contract address", if ((epochLength > 0)) | |
362 | 362 | then true | |
363 | 363 | else throw("invalid epoch length")] | |
364 | 364 | if ((checks == checks)) | |
365 | 365 | then $Tuple2([StringEntry(keyFactoryContract, factoryContract), StringEntry(keyVotingEmissionCandidateContract, votingEmissionCandidateContract), StringEntry(keyBoostingContract, boostingContract), StringEntry(keyStakingContract, stakingContract), IntegerEntry(keyEpochLength, epochLength)], unit) | |
366 | 366 | else throw("Strict value is not equal to itself.") | |
367 | 367 | } | |
368 | 368 | ||
369 | 369 | ||
370 | 370 | ||
371 | 371 | @Callable(i) | |
372 | 372 | func create (amountAssetId,priceAssetId) = { | |
373 | 373 | let checks = [if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionCandidateContract), ""))) | |
374 | 374 | then true | |
375 | 375 | else mustManager(i)] | |
376 | 376 | if ((checks == checks)) | |
377 | 377 | then { | |
378 | 378 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
379 | 379 | let inListActions = ([BooleanEntry(keyInList(pool), true)] ++ insertNodeActions(poolsListName, poolToString(pool))) | |
380 | 380 | let currentEpochIsNotDefined = (getInteger(this, keyCurrentEpoch) == unit) | |
381 | 381 | let startHeightActions = if (currentEpochIsNotDefined) | |
382 | 382 | then { | |
383 | 383 | let epoch = 0 | |
384 | 384 | [IntegerEntry(keyCurrentEpoch, epoch), IntegerEntry(keyStartHeightByEpoch(epoch), height), IntegerEntry(keyStartHeight, height), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, height)] | |
385 | 385 | } | |
386 | 386 | else nil | |
387 | 387 | $Tuple2((inListActions ++ startHeightActions), unit) | |
388 | 388 | } | |
389 | 389 | else throw("Strict value is not equal to itself.") | |
390 | 390 | } | |
391 | 391 | ||
392 | 392 | ||
393 | 393 | ||
394 | 394 | @Callable(i) | |
395 | 395 | func vote (amountAssetId,priceAssetId,amount) = { | |
396 | 396 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
397 | 397 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
398 | 398 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
399 | 399 | let epochLength = getIntOrFail(this, keyEpochLength) | |
400 | 400 | let endHeight = (startHeight + epochLength) | |
401 | 401 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
402 | 402 | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
403 | 403 | let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0) | |
404 | 404 | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
405 | 405 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
406 | 406 | let gwxAmountAtEndTotal = { | |
407 | 407 | let @ = invoke(this, "getUserGwxAmountAtHeight", [toBase58String(i.caller.bytes), endHeight], nil) | |
408 | 408 | if ($isInstanceOf(@, "Int")) | |
409 | 409 | then @ | |
410 | 410 | else throw(($getType(@) + " couldn't be cast to Int")) | |
411 | 411 | } | |
412 | 412 | let available = (gwxAmountAtEndTotal - used) | |
413 | 413 | let newVote = (vote + amount) | |
414 | 414 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
415 | 415 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
416 | 416 | then true | |
417 | 417 | else throw("invalid assets"), if ((endHeight > height)) | |
418 | 418 | then true | |
419 | 419 | else throw("invalid height"), if ((finalizationStageOrUnit == unit)) | |
420 | 420 | then true | |
421 | 421 | else throw("finalization in progress"), if ((gwxAmountAtEndTotal > 0)) | |
422 | 422 | then true | |
423 | 423 | else throw("you do not have gWX"), if (if ((amount > 0)) | |
424 | 424 | then (available >= amount) | |
425 | 425 | else false) | |
426 | 426 | then true | |
427 | 427 | else throw("invalid amount"), if (wxEmission) | |
428 | 428 | then true | |
429 | 429 | else throw("pool hasn't WX_EMISSION label")] | |
430 | 430 | if ((checks == checks)) | |
431 | 431 | then { | |
432 | 432 | let votesListName = getVotesListName(pool) | |
433 | 433 | let userAddressStr = toString(i.caller) | |
434 | 434 | let votesListActions = if (containsNode(votesListName, userAddressStr)) | |
435 | 435 | then nil | |
436 | 436 | else insertNodeActions(votesListName, userAddressStr) | |
437 | 437 | $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), (used + amount)), IntegerEntry(keyVote(pool, i.caller, epoch), newVote), IntegerEntry(keyVotingResult(pool, epoch), (poolResult + amount)), IntegerEntry(keyTotalVotes(epoch), (totalVotes + amount))] ++ votesListActions), unit) | |
438 | 438 | } | |
439 | 439 | else throw("Strict value is not equal to itself.") | |
440 | 440 | } | |
441 | 441 | ||
442 | 442 | ||
443 | 443 | ||
444 | 444 | @Callable(i) | |
445 | 445 | func cancelVote (amountAssetId,priceAssetId) = { | |
446 | 446 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
447 | 447 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
448 | 448 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
449 | 449 | let epochLength = getIntOrFail(this, keyEpochLength) | |
450 | 450 | let endHeight = (startHeight + epochLength) | |
451 | 451 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
452 | 452 | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
453 | 453 | let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0) | |
454 | 454 | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
455 | 455 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
456 | 456 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
457 | 457 | then true | |
458 | 458 | else throw("invalid assets"), if ((endHeight > height)) | |
459 | 459 | then true | |
460 | 460 | else throw("invalid height"), if ((finalizationStageOrUnit == unit)) | |
461 | 461 | then true | |
462 | 462 | else throw("finalization in progress"), if ((vote > 0)) | |
463 | 463 | then true | |
464 | 464 | else throw("no vote")] | |
465 | 465 | if ((checks == checks)) | |
466 | 466 | then { | |
467 | 467 | let votesListName = getVotesListName(pool) | |
468 | 468 | let userAddressStr = toString(i.caller) | |
469 | 469 | $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), max([(used - vote), 0])), DeleteEntry(keyVote(pool, i.caller, epoch)), IntegerEntry(keyVotingResult(pool, epoch), (poolResult - vote)), IntegerEntry(keyTotalVotes(epoch), (totalVotes - vote))] ++ deleteNodeActions(votesListName, userAddressStr)), unit) | |
470 | 470 | } | |
471 | 471 | else throw("Strict value is not equal to itself.") | |
472 | 472 | } | |
473 | 473 | ||
474 | 474 | ||
475 | 475 | ||
476 | 476 | @Callable(i) | |
477 | 477 | func setEpochLength (newEpochLength) = { | |
478 | 478 | let checks = [mustManager(i), if ((newEpochLength > 0)) | |
479 | 479 | then true | |
480 | 480 | else throw("invalid epoch length")] | |
481 | 481 | if ((checks == checks)) | |
482 | 482 | then $Tuple2([IntegerEntry(keyEpochLengthNew, newEpochLength)], unit) | |
483 | 483 | else throw("Strict value is not equal to itself.") | |
484 | 484 | } | |
485 | 485 | ||
486 | 486 | ||
487 | 487 | ||
488 | 488 | @Callable(i) | |
489 | 489 | func setMaxDepth (newMaxDepth) = { | |
490 | 490 | let checks = [mustManager(i), if ((newMaxDepth > 0)) | |
491 | 491 | then true | |
492 | 492 | else throw("invalid max depth")] | |
493 | 493 | if ((checks == checks)) | |
494 | 494 | then $Tuple2([IntegerEntry(keyMaxDepth, newMaxDepth)], unit) | |
495 | 495 | else throw("Strict value is not equal to itself.") | |
496 | 496 | } | |
497 | 497 | ||
498 | 498 | ||
499 | 499 | ||
500 | 500 | @Callable(i) | |
501 | 501 | func processVoteINTERNAL (poolStr,userAddressStr) = { | |
502 | 502 | let checkCaller = mustThis(i) | |
503 | 503 | if ((checkCaller == checkCaller)) | |
504 | 504 | then { | |
505 | 505 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), ("processVoteINTERNAL: invalid user address " + userAddressStr)) | |
506 | 506 | let epoch = getIntOrFail(this, keyCurrentEpoch) | |
507 | 507 | let epochPrevious = (epoch - 1) | |
508 | 508 | let epochLength = getIntOrFail(this, keyEpochLength) | |
509 | 509 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
510 | 510 | let endHeight = (startHeight + epochLength) | |
511 | 511 | let startHeightPrevious = getIntOrFail(this, keyStartHeightByEpoch(epochPrevious)) | |
512 | 512 | let epochLengthPrevious = getIntOrFail(this, keyEpochLengthByEpoch(epochPrevious)) | |
513 | 513 | let endHeightPrevious = (startHeightPrevious + epochLengthPrevious) | |
514 | 514 | let checkTargetEpoch = if ((epochPrevious >= 0)) | |
515 | 515 | then true | |
516 | 516 | else throw("processVoteINTERNAL: invalid previous epoch") | |
517 | 517 | if ((checkTargetEpoch == checkTargetEpoch)) | |
518 | 518 | then { | |
519 | 519 | let pool = stringToPool(poolStr) | |
520 | - | let $ | |
521 | - | let amountAssetId = $ | |
522 | - | let priceAssetId = $ | |
520 | + | let $t01798418024 = pool | |
521 | + | let amountAssetId = $t01798418024._1 | |
522 | + | let priceAssetId = $t01798418024._2 | |
523 | 523 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
524 | 524 | let gwxAmountAtEndTotal = { | |
525 | 525 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeight], nil) | |
526 | 526 | if ($isInstanceOf(@, "Int")) | |
527 | 527 | then @ | |
528 | 528 | else throw(($getType(@) + " couldn't be cast to Int")) | |
529 | 529 | } | |
530 | 530 | let gwxAmountAtEndTotalPrevious = { | |
531 | 531 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeightPrevious], nil) | |
532 | 532 | if ($isInstanceOf(@, "Int")) | |
533 | 533 | then @ | |
534 | 534 | else throw(($getType(@) + " couldn't be cast to Int")) | |
535 | 535 | } | |
536 | 536 | let totalVotes = valueOrElse(getInteger(keyTotalVotes(epoch)), 0) | |
537 | 537 | let votingResult = valueOrElse(getInteger(keyVotingResult(pool, epoch)), 0) | |
538 | 538 | let votePrevious = valueOrErrorMessage(getInteger(keyVote(pool, userAddress, epochPrevious)), (((("processVoteINTERNAL " + poolStr) + " ") + userAddressStr) + ": no previous vote")) | |
539 | 539 | let used = valueOrElse(getInteger(this, keyUsed(userAddress, epoch)), 0) | |
540 | 540 | let lpAssetIdStr = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
541 | 541 | let votingResultStakedPrevious = valueOrElse(getInteger(keyVotingResultStaked(lpAssetIdStr, epochPrevious)), 0) | |
542 | 542 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
543 | 543 | let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(lpAssetIdStr, userAddressStr)), 0) | |
544 | 544 | let votingResultStakedActions = if ((stakedByUser == 0)) | |
545 | 545 | then nil | |
546 | 546 | else [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, epochPrevious), (votingResultStakedPrevious + votePrevious))] | |
547 | 547 | let newVote = if ((gwxAmountAtEndTotalPrevious > 0)) | |
548 | 548 | then fraction(votePrevious, gwxAmountAtEndTotal, gwxAmountAtEndTotalPrevious) | |
549 | 549 | else 0 | |
550 | 550 | let actions = if (if ((newVote > 0)) | |
551 | 551 | then wxEmission | |
552 | 552 | else false) | |
553 | 553 | then [IntegerEntry(keyVote(pool, userAddress, epoch), newVote), IntegerEntry(keyTotalVotes(epoch), (totalVotes + newVote)), IntegerEntry(keyVotingResult(pool, epoch), (votingResult + newVote)), IntegerEntry(keyUsed(userAddress, epoch), (used + newVote))] | |
554 | 554 | else deleteNodeActions(getVotesListName(pool), userAddressStr) | |
555 | 555 | $Tuple2((actions ++ votingResultStakedActions), unit) | |
556 | 556 | } | |
557 | 557 | else throw("Strict value is not equal to itself.") | |
558 | 558 | } | |
559 | 559 | else throw("Strict value is not equal to itself.") | |
560 | 560 | } | |
561 | 561 | ||
562 | 562 | ||
563 | 563 | ||
564 | 564 | @Callable(i) | |
565 | 565 | func processPoolINTERNAL (poolStr,force) = { | |
566 | 566 | let checkCaller = mustThis(i) | |
567 | 567 | if ((checkCaller == checkCaller)) | |
568 | 568 | then { | |
569 | 569 | let targetEpoch = { | |
570 | 570 | let currentEpoch = getIntOrFail(this, keyCurrentEpoch) | |
571 | 571 | if (force) | |
572 | 572 | then currentEpoch | |
573 | 573 | else (currentEpoch - 1) | |
574 | 574 | } | |
575 | 575 | let checkTargetEpoch = if ((targetEpoch >= 0)) | |
576 | 576 | then true | |
577 | 577 | else throw("processPoolINTERNAL: invalid target epoch") | |
578 | 578 | if ((checkTargetEpoch == checkTargetEpoch)) | |
579 | 579 | then { | |
580 | 580 | let pool = stringToPool(poolStr) | |
581 | - | let $ | |
582 | - | let amountAssetId = $ | |
583 | - | let priceAssetId = $ | |
581 | + | let $t02036620406 = pool | |
582 | + | let amountAssetId = $t02036620406._1 | |
583 | + | let priceAssetId = $t02036620406._2 | |
584 | 584 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
585 | 585 | let factoryContract = addressFromStringValue(getStrOrFail(this, keyFactoryContract)) | |
586 | 586 | let lpAssetId = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
587 | 587 | let r = { | |
588 | 588 | let @ = invoke(stakingContract, "usersListTraversal", [lpAssetId], nil) | |
589 | 589 | if ($isInstanceOf(@, "Boolean")) | |
590 | 590 | then @ | |
591 | 591 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
592 | 592 | } | |
593 | 593 | if ((r == r)) | |
594 | 594 | then if (r) | |
595 | 595 | then $Tuple2(nil, true) | |
596 | 596 | else { | |
597 | 597 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
598 | 598 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(targetEpoch)), 0) | |
599 | 599 | let votingResult = valueOrElse(getInteger(this, keyVotingResult(pool, targetEpoch)), 0) | |
600 | 600 | let share = if (if ((totalVotes == 0)) | |
601 | 601 | then true | |
602 | 602 | else !(wxEmission)) | |
603 | 603 | then 0 | |
604 | 604 | else fraction(votingResult, poolWeightMult, totalVotes) | |
605 | 605 | let modifyWeightInv = invoke(factoryContract, "modifyWeight", [lpAssetId, share], nil) | |
606 | 606 | if ((modifyWeightInv == modifyWeightInv)) | |
607 | 607 | then { | |
608 | 608 | let poolsListActions = if (if (wxEmission) | |
609 | 609 | then true | |
610 | 610 | else force) | |
611 | 611 | then nil | |
612 | 612 | else ([DeleteEntry(keyInList(pool))] ++ deleteNodeActions(poolsListName, poolStr)) | |
613 | 613 | $Tuple2(([IntegerEntry(keyPoolShare(pool, targetEpoch), share)] ++ poolsListActions), false) | |
614 | 614 | } | |
615 | 615 | else throw("Strict value is not equal to itself.") | |
616 | 616 | } | |
617 | 617 | else throw("Strict value is not equal to itself.") | |
618 | 618 | } | |
619 | 619 | else throw("Strict value is not equal to itself.") | |
620 | 620 | } | |
621 | 621 | else throw("Strict value is not equal to itself.") | |
622 | 622 | } | |
623 | 623 | ||
624 | 624 | ||
625 | 625 | ||
626 | 626 | @Callable(i) | |
627 | 627 | func finalizeHelper () = { | |
628 | 628 | let force = valueOrElse(getBoolean(keyFinalizationShouldBeForced), false) | |
629 | 629 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
630 | 630 | let previousEpoch = (epoch - 1) | |
631 | 631 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
632 | 632 | let epochLength = getIntOrFail(this, keyEpochLength) | |
633 | 633 | let endHeight = (startHeight + epochLength) | |
634 | 634 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
635 | 635 | if (if (if ((height >= endHeight)) | |
636 | 636 | then (finalizationStageOrUnit == unit) | |
637 | 637 | else false) | |
638 | 638 | then !(force) | |
639 | 639 | else false) | |
640 | 640 | then { | |
641 | 641 | let newEpoch = (epoch + 1) | |
642 | 642 | let newEpochLengthOption = getInteger(this, keyEpochLengthNew) | |
643 | 643 | let newEpochLengthActions = match newEpochLengthOption { | |
644 | 644 | case newEpochLength: Int => | |
645 | 645 | [IntegerEntry(keyEpochLength, newEpochLength), DeleteEntry(keyEpochLengthNew)] | |
646 | 646 | case _: Unit => | |
647 | 647 | nil | |
648 | 648 | case _ => | |
649 | 649 | throw("Match error") | |
650 | 650 | } | |
651 | 651 | $Tuple2(([IntegerEntry(keyStartHeightByEpoch(newEpoch), height), IntegerEntry(keyStartHeight, height), IntegerEntry(keyCurrentEpoch, newEpoch), IntegerEntry(keyFinalizationStage, finalizationStageTotal), IntegerEntry(keyEpochLengthByEpoch(epoch), epochLength)] ++ newEpochLengthActions), true) | |
652 | 652 | } | |
653 | 653 | else if (if (force) | |
654 | 654 | then (finalizationStageOrUnit == unit) | |
655 | 655 | else false) | |
656 | 656 | then $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares)], true) | |
657 | 657 | else if ((finalizationStageOrUnit == unit)) | |
658 | 658 | then $Tuple2(nil, false) | |
659 | 659 | else if ((finalizationStageOrUnit == finalizationStageTotal)) | |
660 | 660 | then { | |
661 | 661 | let poolOrUnit = getString(keyNextPool) | |
662 | 662 | let userOrUnit = getString(keyNextUser) | |
663 | 663 | match poolOrUnit { | |
664 | 664 | case _: Unit => | |
665 | 665 | match getString(keyListHead(poolsListName)) { | |
666 | 666 | case _: Unit => | |
667 | 667 | $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares), DeleteEntry(keyNextPool), DeleteEntry(keyNextUser)], true) | |
668 | 668 | case poolsHeadStr: String => | |
669 | 669 | $Tuple2([StringEntry(keyNextPool, poolsHeadStr)], true) | |
670 | 670 | case _ => | |
671 | 671 | throw("Match error") | |
672 | 672 | } | |
673 | 673 | case poolStr: String => | |
674 | 674 | let pool = stringToPool(poolStr) | |
675 | 675 | let nextUserOrUnit = match userOrUnit { | |
676 | 676 | case _: Unit => | |
677 | 677 | getString(keyListHead(getVotesListName(pool))) | |
678 | 678 | case user: String => | |
679 | 679 | let next = getString(keyListNext(getVotesListName(pool), user)) | |
680 | 680 | if ((next == next)) | |
681 | 681 | then { | |
682 | 682 | let processVoteInv = invoke(this, "processVoteINTERNAL", [poolStr, user], nil) | |
683 | 683 | if ((processVoteInv == processVoteInv)) | |
684 | 684 | then next | |
685 | 685 | else throw("Strict value is not equal to itself.") | |
686 | 686 | } | |
687 | 687 | else throw("Strict value is not equal to itself.") | |
688 | 688 | case _ => | |
689 | 689 | throw("Match error") | |
690 | 690 | } | |
691 | 691 | match nextUserOrUnit { | |
692 | 692 | case _: Unit => | |
693 | 693 | let nextPoolOrUnit = getString(keyListNext(poolsListName, poolStr)) | |
694 | 694 | match nextPoolOrUnit { | |
695 | 695 | case _: Unit => | |
696 | 696 | $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares), DeleteEntry(keyNextPool), DeleteEntry(keyNextUser)], true) | |
697 | 697 | case s: String => | |
698 | 698 | $Tuple2([StringEntry(keyNextPool, s), DeleteEntry(keyNextUser)], true) | |
699 | 699 | case _ => | |
700 | 700 | throw("Match error") | |
701 | 701 | } | |
702 | 702 | case nextUser: String => | |
703 | 703 | $Tuple2([StringEntry(keyNextUser, nextUser)], true) | |
704 | 704 | case _ => | |
705 | 705 | throw("Match error") | |
706 | 706 | } | |
707 | 707 | case _ => | |
708 | 708 | throw("Match error") | |
709 | 709 | } | |
710 | 710 | } | |
711 | 711 | else if ((finalizationStageOrUnit == finalizationStageShares)) | |
712 | 712 | then { | |
713 | 713 | let poolOrUnit = getString(keyNextPool) | |
714 | 714 | match poolOrUnit { | |
715 | 715 | case _: Unit => | |
716 | 716 | match getString(keyListHead(poolsListName)) { | |
717 | 717 | case _: Unit => | |
718 | 718 | let actions = if (force) | |
719 | 719 | then [DeleteEntry(keyFinalizationStage), DeleteEntry(keyFinalizationShouldBeForced)] | |
720 | 720 | else [DeleteEntry(keyFinalizationStage), BooleanEntry(keyFinalized(previousEpoch), true), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, startHeight)] | |
721 | 721 | $Tuple2(actions, true) | |
722 | 722 | case nextPoolStr: String => | |
723 | 723 | $Tuple2([StringEntry(keyNextPool, nextPoolStr)], true) | |
724 | 724 | case _ => | |
725 | 725 | throw("Match error") | |
726 | 726 | } | |
727 | 727 | case poolStr: String => | |
728 | 728 | let nextPoolOrUnit = getString(keyListNext(poolsListName, poolStr)) | |
729 | 729 | if ((nextPoolOrUnit == nextPoolOrUnit)) | |
730 | 730 | then { | |
731 | 731 | let r = { | |
732 | 732 | let @ = invoke(this, "processPoolINTERNAL", [poolStr, force], nil) | |
733 | 733 | if ($isInstanceOf(@, "Boolean")) | |
734 | 734 | then @ | |
735 | 735 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
736 | 736 | } | |
737 | 737 | if ((r == r)) | |
738 | 738 | then if (r) | |
739 | 739 | then $Tuple2(nil, true) | |
740 | 740 | else match nextPoolOrUnit { | |
741 | 741 | case _: Unit => | |
742 | 742 | let actions = if (force) | |
743 | 743 | then [DeleteEntry(keyFinalizationStage), DeleteEntry(keyFinalizationShouldBeForced), DeleteEntry(keyNextPool)] | |
744 | 744 | else [DeleteEntry(keyFinalizationStage), BooleanEntry(keyFinalized(previousEpoch), true), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, startHeight), DeleteEntry(keyNextPool)] | |
745 | 745 | $Tuple2(actions, true) | |
746 | 746 | case nextPoolStr: String => | |
747 | 747 | $Tuple2([StringEntry(keyNextPool, nextPoolStr)], true) | |
748 | 748 | case _ => | |
749 | 749 | throw("Match error") | |
750 | 750 | } | |
751 | 751 | else throw("Strict value is not equal to itself.") | |
752 | 752 | } | |
753 | 753 | else throw("Strict value is not equal to itself.") | |
754 | 754 | case _ => | |
755 | 755 | throw("Match error") | |
756 | 756 | } | |
757 | 757 | } | |
758 | 758 | else throw("finalization is broken") | |
759 | 759 | } | |
760 | 760 | ||
761 | 761 | ||
762 | 762 | ||
763 | 763 | @Callable(i) | |
764 | 764 | func finalizeWrapper (counter) = { | |
765 | 765 | let result = { | |
766 | 766 | let @ = invoke(this, "finalizeHelper", nil, nil) | |
767 | 767 | if ($isInstanceOf(@, "Boolean")) | |
768 | 768 | then @ | |
769 | 769 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
770 | 770 | } | |
771 | 771 | if ((result == result)) | |
772 | 772 | then if (!(result)) | |
773 | 773 | then if ((counter == 0)) | |
774 | 774 | then throw("Current voting is not over yet") | |
775 | 775 | else $Tuple2(nil, unit) | |
776 | 776 | else { | |
777 | 777 | let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault) | |
778 | 778 | if ((maxDepth > counter)) | |
779 | 779 | then { | |
780 | 780 | let inv = invoke(this, "finalizeWrapper", [(counter + 1)], nil) | |
781 | 781 | if ((inv == inv)) | |
782 | 782 | then $Tuple2(nil, unit) | |
783 | 783 | else throw("Strict value is not equal to itself.") | |
784 | 784 | } | |
785 | 785 | else $Tuple2(nil, unit) | |
786 | 786 | } | |
787 | 787 | else throw("Strict value is not equal to itself.") | |
788 | 788 | } | |
789 | 789 | ||
790 | 790 | ||
791 | 791 | ||
792 | 792 | @Callable(i) | |
793 | 793 | func finalize () = { | |
794 | 794 | let inv = invoke(this, "finalizeWrapper", [0], nil) | |
795 | 795 | if ((inv == inv)) | |
796 | 796 | then $Tuple2(nil, unit) | |
797 | 797 | else throw("Strict value is not equal to itself.") | |
798 | 798 | } | |
799 | 799 | ||
800 | 800 | ||
801 | 801 | ||
802 | 802 | @Callable(i) | |
803 | 803 | func containsNodeREADONLY (listName,id) = $Tuple2(nil, containsNode(listName, id)) | |
804 | 804 | ||
805 | 805 | ||
806 | 806 | ||
807 | 807 | @Callable(i) | |
808 | 808 | func insertNode (listName,id) = { | |
809 | 809 | let checkCaller = mustManager(i) | |
810 | 810 | if ((checkCaller == checkCaller)) | |
811 | 811 | then $Tuple2(insertNodeActions(listName, id), unit) | |
812 | 812 | else throw("Strict value is not equal to itself.") | |
813 | 813 | } | |
814 | 814 | ||
815 | 815 | ||
816 | 816 | ||
817 | 817 | @Callable(i) | |
818 | 818 | func deleteNode (listName,id) = { | |
819 | 819 | let checkCaller = mustManager(i) | |
820 | 820 | if ((checkCaller == checkCaller)) | |
821 | 821 | then $Tuple2(deleteNodeActions(listName, id), unit) | |
822 | 822 | else throw("Strict value is not equal to itself.") | |
823 | 823 | } | |
824 | 824 | ||
825 | 825 | ||
826 | 826 | @Verifier(tx) | |
827 | 827 | func verify () = { | |
828 | 828 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
829 | 829 | case pk: ByteVector => | |
830 | 830 | pk | |
831 | 831 | case _: Unit => | |
832 | 832 | tx.senderPublicKey | |
833 | 833 | case _ => | |
834 | 834 | throw("Match error") | |
835 | 835 | } | |
836 | 836 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
837 | 837 | } | |
838 | 838 |
github/deemru/w8io/026f985 79.43 ms ◑