tx · BUmFL7AhWAMqPs2ZDzCJU3pUQEcqXue4wuk1TD7XwrRh 3Mp3nG9T5fKGziHW8mcCqx3jMFx3towh3WA: -0.02200000 Waves 2023.05.02 09:54 [2559810] smart account 3Mp3nG9T5fKGziHW8mcCqx3jMFx3towh3WA > SELF 0.00000000 Waves
{ "type": 13, "id": "BUmFL7AhWAMqPs2ZDzCJU3pUQEcqXue4wuk1TD7XwrRh", "fee": 2200000, "feeAssetId": null, "timestamp": 1683010517576, "version": 2, "chainId": 84, "sender": "3Mp3nG9T5fKGziHW8mcCqx3jMFx3towh3WA", "senderPublicKey": "D46gQxzmdzdCTYRg6dMcwFoUrc6ZmxF6GKd5ZoTkvzp1", "proofs": [ "HBS71e9yXwcdDXKpZ5EMTvJ8LN7iwy6ctetrQcf8UK3vqeQpTyB8MaiobtPEa21qXA4xXecCQcPfxVYiajg67JP" ], "script": "base64:BgL4FAgCEgQKAggBEgcKBQgICAgBEgQKAggIEgUKAwgIARIECgIICBIDCgEBEgMKAQESBAoCCAgSBAoCCAQSABIDCgEBEgASBAoCCAgSBAoCCAgSBAoCCAgiCXNlcGFyYXRvciIOcG9vbFdlaWdodE11bHQiD21heERlcHRoRGVmYXVsdCIWZmluYWxpemF0aW9uU3RhZ2VUb3RhbCIXZmluYWxpemF0aW9uU3RhZ2VTaGFyZXMiDmtleUVwb2NoTGVuZ3RoIhFrZXlFcG9jaExlbmd0aE5ldyIVa2V5RXBvY2hMZW5ndGhCeUVwb2NoIgVlcG9jaCIPa2V5Q3VycmVudEVwb2NoIgtrZXlNYXhEZXB0aCIia2V5Vm90aW5nRW1pc3Npb25DYW5kaWRhdGVDb250cmFjdCISa2V5RmFjdG9yeUNvbnRyYWN0IhNrZXlCb29zdGluZ0NvbnRyYWN0IhJrZXlTdGFraW5nQ29udHJhY3QiFGtleUZpbmFsaXphdGlvblN0YWdlIgtrZXlOZXh0UG9vbCILa2V5TmV4dFVzZXIiDmtleVN0YXJ0SGVpZ2h0IhFrZXlDdXJ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wJhVAEKaW5zZXJ0Tm9kZQICYXkCYUMEAmJ6CQECYVYBBQJhVAMJAAACBQJiegUCYnoJAJQKAgkBAmFJAgUCYXkFAmFDBQR1bml0CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmFUAQpkZWxldGVOb2RlAgJheQJhQwQCYnoJAQJhVgEFAmFUAwkAAAIFAmJ6BQJiegkAlAoCCQECYUwCBQJheQUCYUMFBHVuaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAmNwAQJjcQAEAmNyBAFYCQECYVAAAwkAAQIFAVgCCkJ5dGVWZWN0b3IEAmFVBQFYBQJhVQMJAAECBQFYAgRVbml0CAUCY3APc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmNwCWJvZHlCeXRlcwkAkQMCCAUCY3AGcHJvb2ZzAAAFAmNyux0CGA==", "height": 2559810, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9wpdk4byjjczyCk8ae3Qjn5T6SnhRiwLnaUGxYbeng3a Next: none Diff:
Old | New | Differences | |
---|---|---|---|
255 | 255 | } | |
256 | 256 | ||
257 | 257 | ||
258 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
259 | + | ||
260 | + | ||
258 | 261 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
259 | 262 | ||
260 | 263 | ||
261 | - | func | |
264 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
262 | 265 | ||
263 | 266 | ||
264 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
265 | - | case s: String => | |
266 | - | fromBase58String(s) | |
267 | + | func managerPublicKeyOrUnit () = { | |
268 | + | let managerVaultAddress = getManagerAddressOrFail() | |
269 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
270 | + | case s: String => | |
271 | + | fromBase58String(s) | |
272 | + | case _: Unit => | |
273 | + | unit | |
274 | + | case _ => | |
275 | + | throw("Match error") | |
276 | + | } | |
277 | + | } | |
278 | + | ||
279 | + | ||
280 | + | func isManager (i) = match managerPublicKeyOrUnit() { | |
281 | + | case pk: ByteVector => | |
282 | + | (i.callerPublicKey == pk) | |
267 | 283 | case _: Unit => | |
268 | - | | |
284 | + | (i.caller == this) | |
269 | 285 | case _ => | |
270 | 286 | throw("Match error") | |
271 | 287 | } | |
272 | 288 | ||
273 | 289 | ||
274 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
275 | - | case s: String => | |
276 | - | fromBase58String(s) | |
277 | - | case _: Unit => | |
278 | - | unit | |
279 | - | case _ => | |
280 | - | throw("Match error") | |
281 | - | } | |
290 | + | func mustManager (i) = if (isManager(i)) | |
291 | + | then true | |
292 | + | else throw("permission denied") | |
282 | 293 | ||
283 | - | ||
284 | - | let permissionDeniedError = throwErr("Permission denied") | |
285 | 294 | ||
286 | 295 | func mustThis (i) = if ((i.caller == this)) | |
287 | 296 | then true | |
288 | - | else permissionDeniedError | |
289 | - | ||
290 | - | ||
291 | - | func mustManager (i) = match managerPublicKeyOrUnit() { | |
292 | - | case pk: ByteVector => | |
293 | - | if ((i.callerPublicKey == pk)) | |
294 | - | then true | |
295 | - | else permissionDeniedError | |
296 | - | case _: Unit => | |
297 | - | mustThis(i) | |
298 | - | case _ => | |
299 | - | throw("Match error") | |
300 | - | } | |
301 | - | ||
302 | - | ||
303 | - | @Callable(i) | |
304 | - | func setManager (pendingManagerPublicKey) = { | |
305 | - | let checkCaller = mustManager(i) | |
306 | - | if ((checkCaller == checkCaller)) | |
307 | - | then { | |
308 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
309 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
310 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
311 | - | else throw("Strict value is not equal to itself.") | |
312 | - | } | |
313 | - | else throw("Strict value is not equal to itself.") | |
314 | - | } | |
315 | - | ||
316 | - | ||
317 | - | ||
318 | - | @Callable(i) | |
319 | - | func confirmManager () = { | |
320 | - | let pm = pendingManagerPublicKeyOrUnit() | |
321 | - | let hasPM = if (isDefined(pm)) | |
322 | - | then true | |
323 | - | else throwErr("No pending manager") | |
324 | - | if ((hasPM == hasPM)) | |
325 | - | then { | |
326 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
327 | - | then true | |
328 | - | else throwErr("You are not pending manager") | |
329 | - | if ((checkPM == checkPM)) | |
330 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
331 | - | else throw("Strict value is not equal to itself.") | |
332 | - | } | |
333 | - | else throw("Strict value is not equal to itself.") | |
334 | - | } | |
335 | - | ||
297 | + | else throw("permission denied") | |
336 | 298 | ||
337 | 299 | ||
338 | 300 | @Callable(i) | |
517 | 479 | if ((checkTargetEpoch == checkTargetEpoch)) | |
518 | 480 | then { | |
519 | 481 | let pool = stringToPool(poolStr) | |
520 | - | let $ | |
521 | - | let amountAssetId = $ | |
522 | - | let priceAssetId = $ | |
482 | + | let $t01748817528 = pool | |
483 | + | let amountAssetId = $t01748817528._1 | |
484 | + | let priceAssetId = $t01748817528._2 | |
523 | 485 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
524 | 486 | let gwxAmountAtEndTotal = { | |
525 | 487 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeight], nil) | |
578 | 540 | if ((checkTargetEpoch == checkTargetEpoch)) | |
579 | 541 | then { | |
580 | 542 | let pool = stringToPool(poolStr) | |
581 | - | let $ | |
582 | - | let amountAssetId = $ | |
583 | - | let priceAssetId = $ | |
543 | + | let $t01988519925 = pool | |
544 | + | let amountAssetId = $t01988519925._1 | |
545 | + | let priceAssetId = $t01988519925._2 | |
584 | 546 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
585 | 547 | let factoryContract = addressFromStringValue(getStrOrFail(this, keyFactoryContract)) | |
586 | 548 | 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 = wrapErr(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 | throwErr("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 throwErr("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 $t051685208 = pool | |
161 | 161 | let amountAssetId = $t051685208._1 | |
162 | 162 | let priceAssetId = $t051685208._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 $t055095549 = pool | |
175 | 175 | let amountAssetId = $t055095549._1 | |
176 | 176 | let priceAssetId = $t055095549._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 throwErr("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 throwErr(((("invalid node: " + listName) + ".") + id)))) | |
255 | 255 | } | |
256 | 256 | ||
257 | 257 | ||
258 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
259 | + | ||
260 | + | ||
258 | 261 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
259 | 262 | ||
260 | 263 | ||
261 | - | func | |
264 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
262 | 265 | ||
263 | 266 | ||
264 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
265 | - | case s: String => | |
266 | - | fromBase58String(s) | |
267 | + | func managerPublicKeyOrUnit () = { | |
268 | + | let managerVaultAddress = getManagerAddressOrFail() | |
269 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
270 | + | case s: String => | |
271 | + | fromBase58String(s) | |
272 | + | case _: Unit => | |
273 | + | unit | |
274 | + | case _ => | |
275 | + | throw("Match error") | |
276 | + | } | |
277 | + | } | |
278 | + | ||
279 | + | ||
280 | + | func isManager (i) = match managerPublicKeyOrUnit() { | |
281 | + | case pk: ByteVector => | |
282 | + | (i.callerPublicKey == pk) | |
267 | 283 | case _: Unit => | |
268 | - | | |
284 | + | (i.caller == this) | |
269 | 285 | case _ => | |
270 | 286 | throw("Match error") | |
271 | 287 | } | |
272 | 288 | ||
273 | 289 | ||
274 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
275 | - | case s: String => | |
276 | - | fromBase58String(s) | |
277 | - | case _: Unit => | |
278 | - | unit | |
279 | - | case _ => | |
280 | - | throw("Match error") | |
281 | - | } | |
290 | + | func mustManager (i) = if (isManager(i)) | |
291 | + | then true | |
292 | + | else throw("permission denied") | |
282 | 293 | ||
283 | - | ||
284 | - | let permissionDeniedError = throwErr("Permission denied") | |
285 | 294 | ||
286 | 295 | func mustThis (i) = if ((i.caller == this)) | |
287 | 296 | then true | |
288 | - | else permissionDeniedError | |
289 | - | ||
290 | - | ||
291 | - | func mustManager (i) = match managerPublicKeyOrUnit() { | |
292 | - | case pk: ByteVector => | |
293 | - | if ((i.callerPublicKey == pk)) | |
294 | - | then true | |
295 | - | else permissionDeniedError | |
296 | - | case _: Unit => | |
297 | - | mustThis(i) | |
298 | - | case _ => | |
299 | - | throw("Match error") | |
300 | - | } | |
301 | - | ||
302 | - | ||
303 | - | @Callable(i) | |
304 | - | func setManager (pendingManagerPublicKey) = { | |
305 | - | let checkCaller = mustManager(i) | |
306 | - | if ((checkCaller == checkCaller)) | |
307 | - | then { | |
308 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
309 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
310 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
311 | - | else throw("Strict value is not equal to itself.") | |
312 | - | } | |
313 | - | else throw("Strict value is not equal to itself.") | |
314 | - | } | |
315 | - | ||
316 | - | ||
317 | - | ||
318 | - | @Callable(i) | |
319 | - | func confirmManager () = { | |
320 | - | let pm = pendingManagerPublicKeyOrUnit() | |
321 | - | let hasPM = if (isDefined(pm)) | |
322 | - | then true | |
323 | - | else throwErr("No pending manager") | |
324 | - | if ((hasPM == hasPM)) | |
325 | - | then { | |
326 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
327 | - | then true | |
328 | - | else throwErr("You are not pending manager") | |
329 | - | if ((checkPM == checkPM)) | |
330 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
331 | - | else throw("Strict value is not equal to itself.") | |
332 | - | } | |
333 | - | else throw("Strict value is not equal to itself.") | |
334 | - | } | |
335 | - | ||
297 | + | else throw("permission denied") | |
336 | 298 | ||
337 | 299 | ||
338 | 300 | @Callable(i) | |
339 | 301 | func getUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
340 | 302 | let boostingContractAddress = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyBoostingContract)), wrapErr("invalid boosting contract address")) | |
341 | 303 | $Tuple2(nil, { | |
342 | 304 | let @ = invoke(boostingContractAddress, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil) | |
343 | 305 | if ($isInstanceOf(@, "Int")) | |
344 | 306 | then @ | |
345 | 307 | else throw(($getType(@) + " couldn't be cast to Int")) | |
346 | 308 | }) | |
347 | 309 | } | |
348 | 310 | ||
349 | 311 | ||
350 | 312 | ||
351 | 313 | @Callable(i) | |
352 | 314 | func constructor (factoryContract,votingEmissionCandidateContract,boostingContract,stakingContract,epochLength) = { | |
353 | 315 | let checks = [mustManager(i), if ((addressFromString(factoryContract) != unit)) | |
354 | 316 | then true | |
355 | 317 | else "invalid factory contract address", if ((addressFromString(votingEmissionCandidateContract) != unit)) | |
356 | 318 | then true | |
357 | 319 | else "invalid voting emission candidate contract address", if ((addressFromString(boostingContract) != unit)) | |
358 | 320 | then true | |
359 | 321 | else "invalid boosting contract address", if ((addressFromString(stakingContract) != unit)) | |
360 | 322 | then true | |
361 | 323 | else "invalid staking contract address", if ((epochLength > 0)) | |
362 | 324 | then true | |
363 | 325 | else throwErr("invalid epoch length")] | |
364 | 326 | if ((checks == checks)) | |
365 | 327 | then $Tuple2([StringEntry(keyFactoryContract, factoryContract), StringEntry(keyVotingEmissionCandidateContract, votingEmissionCandidateContract), StringEntry(keyBoostingContract, boostingContract), StringEntry(keyStakingContract, stakingContract), IntegerEntry(keyEpochLength, epochLength)], unit) | |
366 | 328 | else throw("Strict value is not equal to itself.") | |
367 | 329 | } | |
368 | 330 | ||
369 | 331 | ||
370 | 332 | ||
371 | 333 | @Callable(i) | |
372 | 334 | func create (amountAssetId,priceAssetId) = { | |
373 | 335 | let checks = [if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionCandidateContract), ""))) | |
374 | 336 | then true | |
375 | 337 | else mustManager(i)] | |
376 | 338 | if ((checks == checks)) | |
377 | 339 | then { | |
378 | 340 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
379 | 341 | let inListActions = ([BooleanEntry(keyInList(pool), true)] ++ insertNodeActions(poolsListName, poolToString(pool))) | |
380 | 342 | let currentEpochIsNotDefined = (getInteger(this, keyCurrentEpoch) == unit) | |
381 | 343 | let startHeightActions = if (currentEpochIsNotDefined) | |
382 | 344 | then { | |
383 | 345 | let epoch = 0 | |
384 | 346 | [IntegerEntry(keyCurrentEpoch, epoch), IntegerEntry(keyStartHeightByEpoch(epoch), height), IntegerEntry(keyStartHeight, height), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, height)] | |
385 | 347 | } | |
386 | 348 | else nil | |
387 | 349 | $Tuple2((inListActions ++ startHeightActions), unit) | |
388 | 350 | } | |
389 | 351 | else throw("Strict value is not equal to itself.") | |
390 | 352 | } | |
391 | 353 | ||
392 | 354 | ||
393 | 355 | ||
394 | 356 | @Callable(i) | |
395 | 357 | func vote (amountAssetId,priceAssetId,amount) = { | |
396 | 358 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
397 | 359 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
398 | 360 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
399 | 361 | let epochLength = getIntOrFail(this, keyEpochLength) | |
400 | 362 | let endHeight = (startHeight + epochLength) | |
401 | 363 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
402 | 364 | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
403 | 365 | let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0) | |
404 | 366 | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
405 | 367 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
406 | 368 | let gwxAmountAtEndTotal = { | |
407 | 369 | let @ = invoke(this, "getUserGwxAmountAtHeight", [toBase58String(i.caller.bytes), endHeight], nil) | |
408 | 370 | if ($isInstanceOf(@, "Int")) | |
409 | 371 | then @ | |
410 | 372 | else throw(($getType(@) + " couldn't be cast to Int")) | |
411 | 373 | } | |
412 | 374 | let available = (gwxAmountAtEndTotal - used) | |
413 | 375 | let newVote = (vote + amount) | |
414 | 376 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
415 | 377 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
416 | 378 | then true | |
417 | 379 | else throwErr("invalid assets"), if ((endHeight > height)) | |
418 | 380 | then true | |
419 | 381 | else throwErr("invalid height"), if ((finalizationStageOrUnit == unit)) | |
420 | 382 | then true | |
421 | 383 | else throwErr("finalization in progress"), if ((gwxAmountAtEndTotal > 0)) | |
422 | 384 | then true | |
423 | 385 | else throwErr("you do not have gWX"), if (if ((amount > 0)) | |
424 | 386 | then (available >= amount) | |
425 | 387 | else false) | |
426 | 388 | then true | |
427 | 389 | else throwErr("invalid amount"), if (wxEmission) | |
428 | 390 | then true | |
429 | 391 | else throwErr("pool hasn't WX_EMISSION label")] | |
430 | 392 | if ((checks == checks)) | |
431 | 393 | then { | |
432 | 394 | let votesListName = getVotesListName(pool) | |
433 | 395 | let userAddressStr = toString(i.caller) | |
434 | 396 | let votesListActions = if (containsNode(votesListName, userAddressStr)) | |
435 | 397 | then nil | |
436 | 398 | else insertNodeActions(votesListName, userAddressStr) | |
437 | 399 | $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 | 400 | } | |
439 | 401 | else throw("Strict value is not equal to itself.") | |
440 | 402 | } | |
441 | 403 | ||
442 | 404 | ||
443 | 405 | ||
444 | 406 | @Callable(i) | |
445 | 407 | func cancelVote (amountAssetId,priceAssetId) = { | |
446 | 408 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
447 | 409 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
448 | 410 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
449 | 411 | let epochLength = getIntOrFail(this, keyEpochLength) | |
450 | 412 | let endHeight = (startHeight + epochLength) | |
451 | 413 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
452 | 414 | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
453 | 415 | let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0) | |
454 | 416 | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
455 | 417 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
456 | 418 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
457 | 419 | then true | |
458 | 420 | else throwErr("invalid assets"), if ((endHeight > height)) | |
459 | 421 | then true | |
460 | 422 | else throwErr("invalid height"), if ((finalizationStageOrUnit == unit)) | |
461 | 423 | then true | |
462 | 424 | else throwErr("finalization in progress"), if ((vote > 0)) | |
463 | 425 | then true | |
464 | 426 | else throwErr("no vote")] | |
465 | 427 | if ((checks == checks)) | |
466 | 428 | then { | |
467 | 429 | let votesListName = getVotesListName(pool) | |
468 | 430 | let userAddressStr = toString(i.caller) | |
469 | 431 | $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 | 432 | } | |
471 | 433 | else throw("Strict value is not equal to itself.") | |
472 | 434 | } | |
473 | 435 | ||
474 | 436 | ||
475 | 437 | ||
476 | 438 | @Callable(i) | |
477 | 439 | func setEpochLength (newEpochLength) = { | |
478 | 440 | let checks = [mustManager(i), if ((newEpochLength > 0)) | |
479 | 441 | then true | |
480 | 442 | else throwErr("invalid epoch length")] | |
481 | 443 | if ((checks == checks)) | |
482 | 444 | then $Tuple2([IntegerEntry(keyEpochLengthNew, newEpochLength)], unit) | |
483 | 445 | else throw("Strict value is not equal to itself.") | |
484 | 446 | } | |
485 | 447 | ||
486 | 448 | ||
487 | 449 | ||
488 | 450 | @Callable(i) | |
489 | 451 | func setMaxDepth (newMaxDepth) = { | |
490 | 452 | let checks = [mustManager(i), if ((newMaxDepth > 0)) | |
491 | 453 | then true | |
492 | 454 | else throwErr("invalid max depth")] | |
493 | 455 | if ((checks == checks)) | |
494 | 456 | then $Tuple2([IntegerEntry(keyMaxDepth, newMaxDepth)], unit) | |
495 | 457 | else throw("Strict value is not equal to itself.") | |
496 | 458 | } | |
497 | 459 | ||
498 | 460 | ||
499 | 461 | ||
500 | 462 | @Callable(i) | |
501 | 463 | func processVoteINTERNAL (poolStr,userAddressStr) = { | |
502 | 464 | let checkCaller = mustThis(i) | |
503 | 465 | if ((checkCaller == checkCaller)) | |
504 | 466 | then { | |
505 | 467 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr(("processVoteINTERNAL: invalid user address " + userAddressStr))) | |
506 | 468 | let epoch = getIntOrFail(this, keyCurrentEpoch) | |
507 | 469 | let epochPrevious = (epoch - 1) | |
508 | 470 | let epochLength = getIntOrFail(this, keyEpochLength) | |
509 | 471 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
510 | 472 | let endHeight = (startHeight + epochLength) | |
511 | 473 | let startHeightPrevious = getIntOrFail(this, keyStartHeightByEpoch(epochPrevious)) | |
512 | 474 | let epochLengthPrevious = getIntOrFail(this, keyEpochLengthByEpoch(epochPrevious)) | |
513 | 475 | let endHeightPrevious = (startHeightPrevious + epochLengthPrevious) | |
514 | 476 | let checkTargetEpoch = if ((epochPrevious >= 0)) | |
515 | 477 | then true | |
516 | 478 | else throwErr("processVoteINTERNAL: invalid previous epoch") | |
517 | 479 | if ((checkTargetEpoch == checkTargetEpoch)) | |
518 | 480 | then { | |
519 | 481 | let pool = stringToPool(poolStr) | |
520 | - | let $ | |
521 | - | let amountAssetId = $ | |
522 | - | let priceAssetId = $ | |
482 | + | let $t01748817528 = pool | |
483 | + | let amountAssetId = $t01748817528._1 | |
484 | + | let priceAssetId = $t01748817528._2 | |
523 | 485 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
524 | 486 | let gwxAmountAtEndTotal = { | |
525 | 487 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeight], nil) | |
526 | 488 | if ($isInstanceOf(@, "Int")) | |
527 | 489 | then @ | |
528 | 490 | else throw(($getType(@) + " couldn't be cast to Int")) | |
529 | 491 | } | |
530 | 492 | let gwxAmountAtEndTotalPrevious = { | |
531 | 493 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeightPrevious], nil) | |
532 | 494 | if ($isInstanceOf(@, "Int")) | |
533 | 495 | then @ | |
534 | 496 | else throw(($getType(@) + " couldn't be cast to Int")) | |
535 | 497 | } | |
536 | 498 | let totalVotes = valueOrElse(getInteger(keyTotalVotes(epoch)), 0) | |
537 | 499 | let votingResult = valueOrElse(getInteger(keyVotingResult(pool, epoch)), 0) | |
538 | 500 | let votePrevious = valueOrErrorMessage(getInteger(keyVote(pool, userAddress, epochPrevious)), wrapErr((((("processVoteINTERNAL " + poolStr) + " ") + userAddressStr) + ": no previous vote"))) | |
539 | 501 | let used = valueOrElse(getInteger(this, keyUsed(userAddress, epoch)), 0) | |
540 | 502 | let lpAssetIdStr = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
541 | 503 | let votingResultStakedPrevious = valueOrElse(getInteger(keyVotingResultStaked(lpAssetIdStr, epochPrevious)), 0) | |
542 | 504 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
543 | 505 | let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(lpAssetIdStr, userAddressStr)), 0) | |
544 | 506 | let votingResultStakedActions = if ((stakedByUser == 0)) | |
545 | 507 | then nil | |
546 | 508 | else [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, epochPrevious), (votingResultStakedPrevious + votePrevious))] | |
547 | 509 | let newVote = if ((gwxAmountAtEndTotalPrevious > 0)) | |
548 | 510 | then fraction(votePrevious, gwxAmountAtEndTotal, gwxAmountAtEndTotalPrevious) | |
549 | 511 | else 0 | |
550 | 512 | let actions = if (if ((newVote > 0)) | |
551 | 513 | then wxEmission | |
552 | 514 | else false) | |
553 | 515 | 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 | 516 | else deleteNodeActions(getVotesListName(pool), userAddressStr) | |
555 | 517 | $Tuple2((actions ++ votingResultStakedActions), unit) | |
556 | 518 | } | |
557 | 519 | else throw("Strict value is not equal to itself.") | |
558 | 520 | } | |
559 | 521 | else throw("Strict value is not equal to itself.") | |
560 | 522 | } | |
561 | 523 | ||
562 | 524 | ||
563 | 525 | ||
564 | 526 | @Callable(i) | |
565 | 527 | func processPoolINTERNAL (poolStr,force) = { | |
566 | 528 | let checkCaller = mustThis(i) | |
567 | 529 | if ((checkCaller == checkCaller)) | |
568 | 530 | then { | |
569 | 531 | let targetEpoch = { | |
570 | 532 | let currentEpoch = getIntOrFail(this, keyCurrentEpoch) | |
571 | 533 | if (force) | |
572 | 534 | then currentEpoch | |
573 | 535 | else (currentEpoch - 1) | |
574 | 536 | } | |
575 | 537 | let checkTargetEpoch = if ((targetEpoch >= 0)) | |
576 | 538 | then true | |
577 | 539 | else throwErr("processPoolINTERNAL: invalid target epoch") | |
578 | 540 | if ((checkTargetEpoch == checkTargetEpoch)) | |
579 | 541 | then { | |
580 | 542 | let pool = stringToPool(poolStr) | |
581 | - | let $ | |
582 | - | let amountAssetId = $ | |
583 | - | let priceAssetId = $ | |
543 | + | let $t01988519925 = pool | |
544 | + | let amountAssetId = $t01988519925._1 | |
545 | + | let priceAssetId = $t01988519925._2 | |
584 | 546 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
585 | 547 | let factoryContract = addressFromStringValue(getStrOrFail(this, keyFactoryContract)) | |
586 | 548 | let lpAssetId = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
587 | 549 | let r = { | |
588 | 550 | let @ = invoke(stakingContract, "usersListTraversal", [lpAssetId], nil) | |
589 | 551 | if ($isInstanceOf(@, "Boolean")) | |
590 | 552 | then @ | |
591 | 553 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
592 | 554 | } | |
593 | 555 | if ((r == r)) | |
594 | 556 | then if (r) | |
595 | 557 | then $Tuple2(nil, true) | |
596 | 558 | else { | |
597 | 559 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
598 | 560 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(targetEpoch)), 0) | |
599 | 561 | let votingResult = valueOrElse(getInteger(this, keyVotingResult(pool, targetEpoch)), 0) | |
600 | 562 | let share = if (if ((totalVotes == 0)) | |
601 | 563 | then true | |
602 | 564 | else !(wxEmission)) | |
603 | 565 | then 0 | |
604 | 566 | else fraction(votingResult, poolWeightMult, totalVotes) | |
605 | 567 | let modifyWeightInv = invoke(factoryContract, "modifyWeight", [lpAssetId, share], nil) | |
606 | 568 | if ((modifyWeightInv == modifyWeightInv)) | |
607 | 569 | then { | |
608 | 570 | let poolsListActions = if (if (wxEmission) | |
609 | 571 | then true | |
610 | 572 | else force) | |
611 | 573 | then nil | |
612 | 574 | else ([DeleteEntry(keyInList(pool))] ++ deleteNodeActions(poolsListName, poolStr)) | |
613 | 575 | $Tuple2(([IntegerEntry(keyPoolShare(pool, targetEpoch), share)] ++ poolsListActions), false) | |
614 | 576 | } | |
615 | 577 | else throw("Strict value is not equal to itself.") | |
616 | 578 | } | |
617 | 579 | else throw("Strict value is not equal to itself.") | |
618 | 580 | } | |
619 | 581 | else throw("Strict value is not equal to itself.") | |
620 | 582 | } | |
621 | 583 | else throw("Strict value is not equal to itself.") | |
622 | 584 | } | |
623 | 585 | ||
624 | 586 | ||
625 | 587 | ||
626 | 588 | @Callable(i) | |
627 | 589 | func finalizeHelper () = { | |
628 | 590 | let force = valueOrElse(getBoolean(keyFinalizationShouldBeForced), false) | |
629 | 591 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
630 | 592 | let previousEpoch = (epoch - 1) | |
631 | 593 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
632 | 594 | let epochLength = getIntOrFail(this, keyEpochLength) | |
633 | 595 | let endHeight = (startHeight + epochLength) | |
634 | 596 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
635 | 597 | if (if (if ((height >= endHeight)) | |
636 | 598 | then (finalizationStageOrUnit == unit) | |
637 | 599 | else false) | |
638 | 600 | then !(force) | |
639 | 601 | else false) | |
640 | 602 | then { | |
641 | 603 | let newEpoch = (epoch + 1) | |
642 | 604 | let newEpochLengthOption = getInteger(this, keyEpochLengthNew) | |
643 | 605 | let newEpochLengthActions = match newEpochLengthOption { | |
644 | 606 | case newEpochLength: Int => | |
645 | 607 | [IntegerEntry(keyEpochLength, newEpochLength), DeleteEntry(keyEpochLengthNew)] | |
646 | 608 | case _: Unit => | |
647 | 609 | nil | |
648 | 610 | case _ => | |
649 | 611 | throw("Match error") | |
650 | 612 | } | |
651 | 613 | $Tuple2(([IntegerEntry(keyStartHeightByEpoch(newEpoch), height), IntegerEntry(keyStartHeight, height), IntegerEntry(keyCurrentEpoch, newEpoch), IntegerEntry(keyFinalizationStage, finalizationStageTotal), IntegerEntry(keyEpochLengthByEpoch(epoch), epochLength)] ++ newEpochLengthActions), true) | |
652 | 614 | } | |
653 | 615 | else if (if (force) | |
654 | 616 | then (finalizationStageOrUnit == unit) | |
655 | 617 | else false) | |
656 | 618 | then $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares)], true) | |
657 | 619 | else if ((finalizationStageOrUnit == unit)) | |
658 | 620 | then $Tuple2(nil, false) | |
659 | 621 | else if ((finalizationStageOrUnit == finalizationStageTotal)) | |
660 | 622 | then { | |
661 | 623 | let poolOrUnit = getString(keyNextPool) | |
662 | 624 | let userOrUnit = getString(keyNextUser) | |
663 | 625 | match poolOrUnit { | |
664 | 626 | case _: Unit => | |
665 | 627 | match getString(keyListHead(poolsListName)) { | |
666 | 628 | case _: Unit => | |
667 | 629 | $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares), DeleteEntry(keyNextPool), DeleteEntry(keyNextUser)], true) | |
668 | 630 | case poolsHeadStr: String => | |
669 | 631 | $Tuple2([StringEntry(keyNextPool, poolsHeadStr)], true) | |
670 | 632 | case _ => | |
671 | 633 | throw("Match error") | |
672 | 634 | } | |
673 | 635 | case poolStr: String => | |
674 | 636 | let pool = stringToPool(poolStr) | |
675 | 637 | let nextUserOrUnit = match userOrUnit { | |
676 | 638 | case _: Unit => | |
677 | 639 | getString(keyListHead(getVotesListName(pool))) | |
678 | 640 | case user: String => | |
679 | 641 | let next = getString(keyListNext(getVotesListName(pool), user)) | |
680 | 642 | if ((next == next)) | |
681 | 643 | then { | |
682 | 644 | let processVoteInv = invoke(this, "processVoteINTERNAL", [poolStr, user], nil) | |
683 | 645 | if ((processVoteInv == processVoteInv)) | |
684 | 646 | then next | |
685 | 647 | else throw("Strict value is not equal to itself.") | |
686 | 648 | } | |
687 | 649 | else throw("Strict value is not equal to itself.") | |
688 | 650 | case _ => | |
689 | 651 | throw("Match error") | |
690 | 652 | } | |
691 | 653 | match nextUserOrUnit { | |
692 | 654 | case _: Unit => | |
693 | 655 | let nextPoolOrUnit = getString(keyListNext(poolsListName, poolStr)) | |
694 | 656 | match nextPoolOrUnit { | |
695 | 657 | case _: Unit => | |
696 | 658 | $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares), DeleteEntry(keyNextPool), DeleteEntry(keyNextUser)], true) | |
697 | 659 | case s: String => | |
698 | 660 | $Tuple2([StringEntry(keyNextPool, s), DeleteEntry(keyNextUser)], true) | |
699 | 661 | case _ => | |
700 | 662 | throw("Match error") | |
701 | 663 | } | |
702 | 664 | case nextUser: String => | |
703 | 665 | $Tuple2([StringEntry(keyNextUser, nextUser)], true) | |
704 | 666 | case _ => | |
705 | 667 | throw("Match error") | |
706 | 668 | } | |
707 | 669 | case _ => | |
708 | 670 | throw("Match error") | |
709 | 671 | } | |
710 | 672 | } | |
711 | 673 | else if ((finalizationStageOrUnit == finalizationStageShares)) | |
712 | 674 | then { | |
713 | 675 | let poolOrUnit = getString(keyNextPool) | |
714 | 676 | match poolOrUnit { | |
715 | 677 | case _: Unit => | |
716 | 678 | match getString(keyListHead(poolsListName)) { | |
717 | 679 | case _: Unit => | |
718 | 680 | let actions = if (force) | |
719 | 681 | then [DeleteEntry(keyFinalizationStage), DeleteEntry(keyFinalizationShouldBeForced)] | |
720 | 682 | else [DeleteEntry(keyFinalizationStage), BooleanEntry(keyFinalized(previousEpoch), true), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, startHeight)] | |
721 | 683 | $Tuple2(actions, true) | |
722 | 684 | case nextPoolStr: String => | |
723 | 685 | $Tuple2([StringEntry(keyNextPool, nextPoolStr)], true) | |
724 | 686 | case _ => | |
725 | 687 | throw("Match error") | |
726 | 688 | } | |
727 | 689 | case poolStr: String => | |
728 | 690 | let nextPoolOrUnit = getString(keyListNext(poolsListName, poolStr)) | |
729 | 691 | if ((nextPoolOrUnit == nextPoolOrUnit)) | |
730 | 692 | then { | |
731 | 693 | let r = { | |
732 | 694 | let @ = invoke(this, "processPoolINTERNAL", [poolStr, force], nil) | |
733 | 695 | if ($isInstanceOf(@, "Boolean")) | |
734 | 696 | then @ | |
735 | 697 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
736 | 698 | } | |
737 | 699 | if ((r == r)) | |
738 | 700 | then if (r) | |
739 | 701 | then $Tuple2(nil, true) | |
740 | 702 | else match nextPoolOrUnit { | |
741 | 703 | case _: Unit => | |
742 | 704 | let actions = if (force) | |
743 | 705 | then [DeleteEntry(keyFinalizationStage), DeleteEntry(keyFinalizationShouldBeForced), DeleteEntry(keyNextPool)] | |
744 | 706 | else [DeleteEntry(keyFinalizationStage), BooleanEntry(keyFinalized(previousEpoch), true), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, startHeight), DeleteEntry(keyNextPool)] | |
745 | 707 | $Tuple2(actions, true) | |
746 | 708 | case nextPoolStr: String => | |
747 | 709 | $Tuple2([StringEntry(keyNextPool, nextPoolStr)], true) | |
748 | 710 | case _ => | |
749 | 711 | throw("Match error") | |
750 | 712 | } | |
751 | 713 | else throw("Strict value is not equal to itself.") | |
752 | 714 | } | |
753 | 715 | else throw("Strict value is not equal to itself.") | |
754 | 716 | case _ => | |
755 | 717 | throw("Match error") | |
756 | 718 | } | |
757 | 719 | } | |
758 | 720 | else throwErr("finalization is broken") | |
759 | 721 | } | |
760 | 722 | ||
761 | 723 | ||
762 | 724 | ||
763 | 725 | @Callable(i) | |
764 | 726 | func finalizeWrapper (counter) = { | |
765 | 727 | let result = { | |
766 | 728 | let @ = invoke(this, "finalizeHelper", nil, nil) | |
767 | 729 | if ($isInstanceOf(@, "Boolean")) | |
768 | 730 | then @ | |
769 | 731 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
770 | 732 | } | |
771 | 733 | if ((result == result)) | |
772 | 734 | then if (!(result)) | |
773 | 735 | then if ((counter == 0)) | |
774 | 736 | then throwErr("Current voting is not over yet") | |
775 | 737 | else $Tuple2(nil, unit) | |
776 | 738 | else { | |
777 | 739 | let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault) | |
778 | 740 | if ((maxDepth > counter)) | |
779 | 741 | then { | |
780 | 742 | let inv = invoke(this, "finalizeWrapper", [(counter + 1)], nil) | |
781 | 743 | if ((inv == inv)) | |
782 | 744 | then $Tuple2(nil, unit) | |
783 | 745 | else throw("Strict value is not equal to itself.") | |
784 | 746 | } | |
785 | 747 | else $Tuple2(nil, unit) | |
786 | 748 | } | |
787 | 749 | else throw("Strict value is not equal to itself.") | |
788 | 750 | } | |
789 | 751 | ||
790 | 752 | ||
791 | 753 | ||
792 | 754 | @Callable(i) | |
793 | 755 | func finalize () = { | |
794 | 756 | let inv = invoke(this, "finalizeWrapper", [0], nil) | |
795 | 757 | if ((inv == inv)) | |
796 | 758 | then $Tuple2(nil, unit) | |
797 | 759 | else throw("Strict value is not equal to itself.") | |
798 | 760 | } | |
799 | 761 | ||
800 | 762 | ||
801 | 763 | ||
802 | 764 | @Callable(i) | |
803 | 765 | func containsNodeREADONLY (listName,id) = $Tuple2(nil, containsNode(listName, id)) | |
804 | 766 | ||
805 | 767 | ||
806 | 768 | ||
807 | 769 | @Callable(i) | |
808 | 770 | func insertNode (listName,id) = { | |
809 | 771 | let checkCaller = mustManager(i) | |
810 | 772 | if ((checkCaller == checkCaller)) | |
811 | 773 | then $Tuple2(insertNodeActions(listName, id), unit) | |
812 | 774 | else throw("Strict value is not equal to itself.") | |
813 | 775 | } | |
814 | 776 | ||
815 | 777 | ||
816 | 778 | ||
817 | 779 | @Callable(i) | |
818 | 780 | func deleteNode (listName,id) = { | |
819 | 781 | let checkCaller = mustManager(i) | |
820 | 782 | if ((checkCaller == checkCaller)) | |
821 | 783 | then $Tuple2(deleteNodeActions(listName, id), unit) | |
822 | 784 | else throw("Strict value is not equal to itself.") | |
823 | 785 | } | |
824 | 786 | ||
825 | 787 | ||
826 | 788 | @Verifier(tx) | |
827 | 789 | func verify () = { | |
828 | 790 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
829 | 791 | case pk: ByteVector => | |
830 | 792 | pk | |
831 | 793 | case _: Unit => | |
832 | 794 | tx.senderPublicKey | |
833 | 795 | case _ => | |
834 | 796 | throw("Match error") | |
835 | 797 | } | |
836 | 798 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
837 | 799 | } | |
838 | 800 |
github/deemru/w8io/169f3d6 82.39 ms ◑