tx · CQr2MV7ZSMxRbPpSpJQhcjjdUsdmpbaazxs6sKXHchNr 3N9yMmmL5cJ7LJxr8o6GFbKFUbGz4XcAjeg: -0.02000000 Waves 2023.05.10 15:17 [2571780] smart account 3N9yMmmL5cJ7LJxr8o6GFbKFUbGz4XcAjeg > SELF 0.00000000 Waves
{ "type": 13, "id": "CQr2MV7ZSMxRbPpSpJQhcjjdUsdmpbaazxs6sKXHchNr", "fee": 2000000, "feeAssetId": null, "timestamp": 1683721116300, "version": 2, "chainId": 84, "sender": "3N9yMmmL5cJ7LJxr8o6GFbKFUbGz4XcAjeg", "senderPublicKey": "C2aAS9D6FqfbrkCuCQCtPWAiopjyagvitFLjRuLcRPYt", "proofs": [ "5Dmh9w8Xwt7ui5vttkbprhaX2qttfLYQNDt7aPq72mXGp9zC3QLUb13tQ3DnWZi51psZbJhkZ7rrZfiJqwyhrTFE" ], "script": "base64:BgLwFwgCEgwKCggICAEIAQEBAQESBAoCCAgSBAoCCAQSAwoBCBIECgIIARIFCgMICAgSABIDCgEBEgASABIDCgEBEgASAwoBARIDCgEBEgMKAQgiCXNlcGFyYXRvciIPbWF4RGVwdGhEZWZhdWx0IgVhc0ludCIDdmFsIgckbWF0Y2gwIgZ2YWxJbnQiBmFzQm9vbCIHdmFsQm9vbCIMa2V5RmVlQW1vdW50IgxrZXlXeEFzc2V0SWQiEmtleVZvdGluZ1RocmVzaG9sZCIRa2V5Vm90aW5nRHVyYXRpb24iGGtleVZvdGVCZWZvcmVFbGltaW5hdGlvbiIOa2V5U3RhcnRIZWlnaHQiEGtleUN1cnJlbnRQZXJpb2QiE2tleUJvb3N0aW5nQ29udHJhY3QiE2tleUVtaXNzaW9uQ29udHJhY3QiFmtleUFzc2V0c1N0b3JlQ29udHJhY3QiF2tleUxhdGVzdFByb2Nlc3NlZEFzc2V0IhZrZXlMYXRlc3RQcm9jZXNzZWRVc2VyIhxrZXlMYXRlc3RQcm9jZXNzZWRVc2VyUmVtb3ZlIh9rZXlMYXRl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QMJAAACBQJiWgUCYloJAJQKAgkAzAgCCQEMSW50ZWdlckVudHJ5AgUBaQUCY0IFA25pbAUEdW5pdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgJhbQEbZ3d4QXZhaWxhYmxlRm9yVm90ZVJFQURPTkxZAQFaBAJiUwkBAmFMAgUBWgUCYUQJAJQKAgUDbmlsBQJiUwECY0MBAmNEAAQCY0UEAWUJAQJhRwADCQABAgUBZQIKQnl0ZVZlY3RvcgQCYUoFAWUFAmFKAwkAAQIFAWUCBFVuaXQIBQJjQw9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCY0MJYm9keUJ5dGVzCQCRAwIIBQJjQwZwcm9vZnMAAAUCY0XfKAOJ", "height": 2571780, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9LAx7qt9QajDNKTZUMR6GHYk7QCmghdp9kA3YiYfPsUV Next: 3aCwDrjeRL7FnwyPk8uMnssSEYtarfDChD2V9FgBVyQw Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
149 | 149 | func keyUserVoteHistory (type,userAddress,assetId,txId,period) = makeString(["%s%s%s%s%s%d", "history", type, assetId, userAddress, txId, toString(period)], separator) | |
150 | 150 | ||
151 | 151 | ||
152 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
153 | + | ||
154 | + | ||
155 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
156 | + | ||
157 | + | ||
152 | 158 | func thisOnly (i) = if ((i.caller == this)) | |
153 | 159 | then true | |
154 | 160 | else throw("Permission denied") | |
190 | 196 | ||
191 | 197 | let endHeight = (startHeight + votingDuration) | |
192 | 198 | ||
199 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
200 | + | case s: String => | |
201 | + | addressFromStringValue(s) | |
202 | + | case _ => | |
203 | + | this | |
204 | + | } | |
205 | + | ||
206 | + | ||
207 | + | func managerPublicKeyOrUnit () = { | |
208 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
209 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
210 | + | case s: String => | |
211 | + | fromBase58String(s) | |
212 | + | case _: Unit => | |
213 | + | unit | |
214 | + | case _ => | |
215 | + | throw("Match error") | |
216 | + | } | |
217 | + | } | |
218 | + | ||
219 | + | ||
220 | + | func isManager (i) = match managerPublicKeyOrUnit() { | |
221 | + | case pk: ByteVector => | |
222 | + | (i.callerPublicKey == pk) | |
223 | + | case _: Unit => | |
224 | + | (i.caller == this) | |
225 | + | case _ => | |
226 | + | throw("Match error") | |
227 | + | } | |
228 | + | ||
229 | + | ||
230 | + | func mustManager (i) = if (isManager(i)) | |
231 | + | then true | |
232 | + | else throw("permission denied") | |
233 | + | ||
234 | + | ||
193 | 235 | func getUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
194 | 236 | let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil) | |
195 | 237 | asInt(gwxAmount) | |
198 | 240 | ||
199 | 241 | func getVoteResultAction (assetId,total,inFavor,period,verified) = { | |
200 | 242 | let voteResultKey = keyVoteResultByPeriod(assetId, period) | |
201 | - | let $ | |
243 | + | let $t069157218 = match getString(voteResultKey) { | |
202 | 244 | case s: String => | |
203 | 245 | parseVoteResult(s) | |
204 | 246 | case _: Unit => | |
213 | 255 | case _ => | |
214 | 256 | throw("Match error") | |
215 | 257 | } | |
216 | - | let oldTotalYes = $ | |
217 | - | let oldTotalNo = $ | |
218 | - | let oldVerified = $ | |
258 | + | let oldTotalYes = $t069157218._1 | |
259 | + | let oldTotalNo = $t069157218._2 | |
260 | + | let oldVerified = $t069157218._3 | |
219 | 261 | StringEntry(voteResultKey, formatVoteResult((oldTotalYes + (if (inFavor) | |
220 | 262 | then total | |
221 | 263 | else 0)), (oldTotalNo + (if (inFavor) | |
295 | 337 | if ((userPreviousVoteOrUnit == unit)) | |
296 | 338 | then nil | |
297 | 339 | else { | |
298 | - | let $ | |
299 | - | let prevTotal = $ | |
300 | - | let inFavor = $ | |
340 | + | let $t01132911402 = parseUserVote(value(userPreviousVoteOrUnit)) | |
341 | + | let prevTotal = $t01132911402._1 | |
342 | + | let inFavor = $t01132911402._2 | |
301 | 343 | let total = min([prevTotal, userGwxAmountAtEndHeight]) | |
302 | 344 | [StringEntry(userVoteKey, formatUserVote(total, inFavor)), getVoteResultAction(assetId, total, inFavor, currentPeriod, unit)] | |
303 | 345 | } | |
321 | 363 | ||
322 | 364 | @Callable(i) | |
323 | 365 | func constructor (boostingContractPrm,emissionContractPrm,assetsStoreContractPrm,feeAmountPrm,wxAssetIdPrm,votingThresholdPrm,votingDurationPrm,voteBeforeEliminationPrm,startHeightPrm,maxDepthPrm) = { | |
324 | - | let checks = [ | |
366 | + | let checks = [mustManager(i), if (isDefined(addressFromString(boostingContractPrm))) | |
325 | 367 | then true | |
326 | 368 | else throw("Invalid boosting contract address"), if (isDefined(addressFromString(emissionContractPrm))) | |
327 | 369 | then true | |
441 | 483 | let votesListName = getVotesListName(assetId) | |
442 | 484 | let userVoteKey = keyUserVoteByPeriod(userAddress, assetId, currentPeriod) | |
443 | 485 | let userVoteOrUnit = getString(userVoteKey) | |
444 | - | let $ | |
445 | - | let total = $ | |
446 | - | let inFavor = $ | |
486 | + | let $t01672816822 = parseUserVote(valueOrErrorMessage(userVoteOrUnit, "Nothing to cancel")) | |
487 | + | let total = $t01672816822._1 | |
488 | + | let inFavor = $t01672816822._2 | |
447 | 489 | let votesListActions = deleteNode(votesListName, userAddress) | |
448 | 490 | let userVoteActions = [DeleteEntry(userVoteKey), StringEntry(keyUserVoteHistory("cancelVote", userAddress, assetId, toBase58String(i.transactionId), currentPeriod), formatUserVote(0, true)), getVoteResultAction(assetId, -(total), inFavor, currentPeriod, unit)] | |
449 | 491 | $Tuple2((votesListActions ++ userVoteActions), unit) | |
457 | 499 | if ((checkCaller == checkCaller)) | |
458 | 500 | then { | |
459 | 501 | let voteResultKey = keyVoteResultByPeriod(assetId, period) | |
460 | - | let $ | |
502 | + | let $t01745317626 = match getString(voteResultKey) { | |
461 | 503 | case s: String => | |
462 | 504 | let r = parseVoteResult(s) | |
463 | 505 | $Tuple2(r._1, r._2) | |
466 | 508 | case _ => | |
467 | 509 | throw("Match error") | |
468 | 510 | } | |
469 | - | let totalYes = $ | |
470 | - | let totalNo = $ | |
511 | + | let totalYes = $t01745317626._1 | |
512 | + | let totalNo = $t01745317626._2 | |
471 | 513 | let total = (totalYes + totalNo) | |
472 | 514 | let verified = if ((total >= votingThreshold)) | |
473 | 515 | then (totalYes > totalNo) | |
506 | 548 | ||
507 | 549 | @Callable(i) | |
508 | 550 | func deleteUserNodeINTERNAL (assetId,userAddress,latestProcessedUserRemoveKey) = { | |
509 | - | let checkCaller = | |
551 | + | let checkCaller = mustManager(i) | |
510 | 552 | if ((checkCaller == checkCaller)) | |
511 | 553 | then $Tuple2((deleteNode(getVotesListName(assetId), userAddress) :+ DeleteEntry(latestProcessedUserRemoveKey)), unit) | |
512 | 554 | else throw("Strict value is not equal to itself.") | |
706 | 748 | ||
707 | 749 | @Callable(i) | |
708 | 750 | func setVotingThreshold (newThreshold) = { | |
709 | - | let checkCaller = | |
751 | + | let checkCaller = mustManager(i) | |
710 | 752 | if ((checkCaller == checkCaller)) | |
711 | 753 | then $Tuple2([IntegerEntry(keyVotingThreshold, newThreshold)], unit) | |
712 | 754 | else throw("Strict value is not equal to itself.") | |
716 | 758 | ||
717 | 759 | @Callable(i) | |
718 | 760 | func setFee (newFee) = { | |
719 | - | let checkCaller = | |
761 | + | let checkCaller = mustManager(i) | |
720 | 762 | if ((checkCaller == checkCaller)) | |
721 | 763 | then $Tuple2([IntegerEntry(keyFeeAmount, newFee)], unit) | |
722 | 764 | else throw("Strict value is not equal to itself.") | |
731 | 773 | } | |
732 | 774 | ||
733 | 775 | ||
776 | + | @Verifier(tx) | |
777 | + | func verify () = { | |
778 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
779 | + | case pk: ByteVector => | |
780 | + | pk | |
781 | + | case _: Unit => | |
782 | + | tx.senderPublicKey | |
783 | + | case _ => | |
784 | + | throw("Match error") | |
785 | + | } | |
786 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
787 | + | } | |
788 | + |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let maxDepthDefault = 10 | |
7 | 7 | ||
8 | 8 | func asInt (val) = match val { | |
9 | 9 | case valInt: Int => | |
10 | 10 | valInt | |
11 | 11 | case _ => | |
12 | 12 | throw("Failed to cast into Integer") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func asBool (val) = match val { | |
17 | 17 | case valBool: Boolean => | |
18 | 18 | valBool | |
19 | 19 | case _ => | |
20 | 20 | throw("Failed to cast into Boolean") | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | let keyFeeAmount = makeString(["%s", "fee"], separator) | |
25 | 25 | ||
26 | 26 | let keyWxAssetId = makeString(["%s", "wxAssetId"], separator) | |
27 | 27 | ||
28 | 28 | let keyVotingThreshold = makeString(["%s", "votingThreshold"], separator) | |
29 | 29 | ||
30 | 30 | let keyVotingDuration = makeString(["%s", "epochLength"], separator) | |
31 | 31 | ||
32 | 32 | let keyVoteBeforeElimination = makeString(["%s", "voteBeforeElimination"], separator) | |
33 | 33 | ||
34 | 34 | let keyStartHeight = makeString(["%s", "currentVotingHeightStart"], separator) | |
35 | 35 | ||
36 | 36 | let keyCurrentPeriod = makeString(["%s", "currentEpoch"], separator) | |
37 | 37 | ||
38 | 38 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
39 | 39 | ||
40 | 40 | let keyEmissionContract = makeString(["%s", "emissionContract"], separator) | |
41 | 41 | ||
42 | 42 | let keyAssetsStoreContract = makeString(["%s", "assetsStoreContract"], separator) | |
43 | 43 | ||
44 | 44 | let keyLatestProcessedAsset = makeString(["%s", "latestProcessedAsset"], separator) | |
45 | 45 | ||
46 | 46 | let keyLatestProcessedUser = makeString(["%s", "latestProcessedUser"], separator) | |
47 | 47 | ||
48 | 48 | let keyLatestProcessedUserRemove = makeString(["%s", "latestProcessedUserRemove"], separator) | |
49 | 49 | ||
50 | 50 | let keyLatestProcessedAssetTransfer = makeString(["%s", "latestProcessedAssetTransfer"], separator) | |
51 | 51 | ||
52 | 52 | let keyLatestProcessedUserTransfer = makeString(["%s", "latestProcessedUserTransfer"], separator) | |
53 | 53 | ||
54 | 54 | let keyLatestProcessedUserRemoveTransfer = makeString(["%s", "latestProcessedUserRemoveTransfer"], separator) | |
55 | 55 | ||
56 | 56 | let keyMaxDepth = makeString(["%s", "maxDepth"], separator) | |
57 | 57 | ||
58 | 58 | func keyVotesTransferFinishedByPeriod (period) = makeString(["%s", "votesTransferFinished", toString(period)], separator) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | let assetsListName = "__assets" | |
62 | 62 | ||
63 | 63 | func getVotesListName (assetId) = ("%s__votes__" + assetId) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func keyListHead (listName) = makeString([("%s%s" + listName), "head"], separator) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func keyListSize (listName) = makeString([("%s%s" + listName), "size"], separator) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyListPrev (listName,id) = makeString([("%s%s%s" + listName), id, "prev"], separator) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keyListNext (listName,id) = makeString([("%s%s%s" + listName), id, "next"], separator) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyAssetVerifiedByPeriod (assetId,period) = makeString(["%s%d%s", "verifiedAt", toString(period), assetId], separator) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyAssetVerified (assetId) = makeString(["%s%s", "verified", assetId], separator) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyAssetWasEliminated (assetId,period) = makeString(["%s%s%d", "eliminated", assetId, toString(period)], separator) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyVoteResultByPeriod (assetId,period) = makeString(["%s%d%s", "votingResultAtAsset", toString(period), assetId], separator) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func formatVoteResult (totalYes,totalNo,verified) = makeString(["%d%d%s", toString(totalYes), toString(totalNo), toString(verified)], separator) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func parseVoteResult (input) = { | |
94 | 94 | let parts = split(input, separator) | |
95 | 95 | let totalYesIdx = 1 | |
96 | 96 | let totalNoIdx = 2 | |
97 | 97 | let verifiedIdx = 3 | |
98 | 98 | let totalYes = parseIntValue(parts[totalYesIdx]) | |
99 | 99 | let totalNo = parseIntValue(parts[totalNoIdx]) | |
100 | 100 | let verified = if ((size(parts) == 4)) | |
101 | 101 | then (parts[verifiedIdx] == "true") | |
102 | 102 | else false | |
103 | 103 | $Tuple3(totalYes, totalNo, verified) | |
104 | 104 | } | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func keyUserVoteByPeriod (userAddress,assetId,period) = makeString(["%s%d%s%s", "vru", toString(period), assetId, userAddress], separator) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func formatUserVote (total,inFavor) = { | |
111 | 111 | let totalYes = if (inFavor) | |
112 | 112 | then total | |
113 | 113 | else 0 | |
114 | 114 | let totalNo = if (inFavor) | |
115 | 115 | then 0 | |
116 | 116 | else total | |
117 | 117 | makeString(["%d%d", toString(totalYes), toString(totalNo)], separator) | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func parseUserVote (input) = { | |
122 | 122 | let parts = split(input, separator) | |
123 | 123 | let totalYesIdx = 1 | |
124 | 124 | let totalNoIdx = 2 | |
125 | 125 | let totalYes = parseIntValue(parts[totalYesIdx]) | |
126 | 126 | let totalNo = parseIntValue(parts[totalNoIdx]) | |
127 | 127 | let inFavor = if ((totalYes > 0)) | |
128 | 128 | then (totalNo == 0) | |
129 | 129 | else false | |
130 | 130 | let against = if ((totalYes == 0)) | |
131 | 131 | then (totalNo > 0) | |
132 | 132 | else false | |
133 | 133 | let checkTotals = if (if (inFavor) | |
134 | 134 | then true | |
135 | 135 | else against) | |
136 | 136 | then true | |
137 | 137 | else throw("Invalid user vote value") | |
138 | 138 | if ((checkTotals == checkTotals)) | |
139 | 139 | then { | |
140 | 140 | let total = if (inFavor) | |
141 | 141 | then totalYes | |
142 | 142 | else totalNo | |
143 | 143 | $Tuple2(total, inFavor) | |
144 | 144 | } | |
145 | 145 | else throw("Strict value is not equal to itself.") | |
146 | 146 | } | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func keyUserVoteHistory (type,userAddress,assetId,txId,period) = makeString(["%s%s%s%s%s%d", "history", type, assetId, userAddress, txId, toString(period)], separator) | |
150 | 150 | ||
151 | 151 | ||
152 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
153 | + | ||
154 | + | ||
155 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
156 | + | ||
157 | + | ||
152 | 158 | func thisOnly (i) = if ((i.caller == this)) | |
153 | 159 | then true | |
154 | 160 | else throw("Permission denied") | |
155 | 161 | ||
156 | 162 | ||
157 | 163 | func getIntegerOrZero (key) = valueOrElse(getInteger(this, key), 0) | |
158 | 164 | ||
159 | 165 | ||
160 | 166 | func getIntegerOrFail (key) = valueOrErrorMessage(getInteger(this, key), (key + " is not defined")) | |
161 | 167 | ||
162 | 168 | ||
163 | 169 | func getStringOrEmpty (key) = valueOrElse(getString(this, key), "") | |
164 | 170 | ||
165 | 171 | ||
166 | 172 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
167 | 173 | ||
168 | 174 | ||
169 | 175 | let feeAmount = getIntegerOrFail(keyFeeAmount) | |
170 | 176 | ||
171 | 177 | let wxAssetId = fromBase58String(getStringOrFail(keyWxAssetId)) | |
172 | 178 | ||
173 | 179 | let votingThreshold = getIntegerOrFail(keyVotingThreshold) | |
174 | 180 | ||
175 | 181 | let votingDuration = getIntegerOrFail(keyVotingDuration) | |
176 | 182 | ||
177 | 183 | let voteBeforeElimination = getIntegerOrFail(keyVoteBeforeElimination) | |
178 | 184 | ||
179 | 185 | let startHeight = getIntegerOrFail(keyStartHeight) | |
180 | 186 | ||
181 | 187 | let currentPeriod = getIntegerOrFail(keyCurrentPeriod) | |
182 | 188 | ||
183 | 189 | let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract)) | |
184 | 190 | ||
185 | 191 | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract)) | |
186 | 192 | ||
187 | 193 | let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract)) | |
188 | 194 | ||
189 | 195 | let maxDepth = valueOrElse(getInteger(keyMaxDepth), maxDepthDefault) | |
190 | 196 | ||
191 | 197 | let endHeight = (startHeight + votingDuration) | |
192 | 198 | ||
199 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
200 | + | case s: String => | |
201 | + | addressFromStringValue(s) | |
202 | + | case _ => | |
203 | + | this | |
204 | + | } | |
205 | + | ||
206 | + | ||
207 | + | func managerPublicKeyOrUnit () = { | |
208 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
209 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
210 | + | case s: String => | |
211 | + | fromBase58String(s) | |
212 | + | case _: Unit => | |
213 | + | unit | |
214 | + | case _ => | |
215 | + | throw("Match error") | |
216 | + | } | |
217 | + | } | |
218 | + | ||
219 | + | ||
220 | + | func isManager (i) = match managerPublicKeyOrUnit() { | |
221 | + | case pk: ByteVector => | |
222 | + | (i.callerPublicKey == pk) | |
223 | + | case _: Unit => | |
224 | + | (i.caller == this) | |
225 | + | case _ => | |
226 | + | throw("Match error") | |
227 | + | } | |
228 | + | ||
229 | + | ||
230 | + | func mustManager (i) = if (isManager(i)) | |
231 | + | then true | |
232 | + | else throw("permission denied") | |
233 | + | ||
234 | + | ||
193 | 235 | func getUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
194 | 236 | let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil) | |
195 | 237 | asInt(gwxAmount) | |
196 | 238 | } | |
197 | 239 | ||
198 | 240 | ||
199 | 241 | func getVoteResultAction (assetId,total,inFavor,period,verified) = { | |
200 | 242 | let voteResultKey = keyVoteResultByPeriod(assetId, period) | |
201 | - | let $ | |
243 | + | let $t069157218 = match getString(voteResultKey) { | |
202 | 244 | case s: String => | |
203 | 245 | parseVoteResult(s) | |
204 | 246 | case _: Unit => | |
205 | 247 | match getString(keyVoteResultByPeriod(assetId, (period - 1))) { | |
206 | 248 | case s: String => | |
207 | 249 | $Tuple3(0, 0, parseVoteResult(s)._3) | |
208 | 250 | case _: Unit => | |
209 | 251 | $Tuple3(0, 0, false) | |
210 | 252 | case _ => | |
211 | 253 | throw("Match error") | |
212 | 254 | } | |
213 | 255 | case _ => | |
214 | 256 | throw("Match error") | |
215 | 257 | } | |
216 | - | let oldTotalYes = $ | |
217 | - | let oldTotalNo = $ | |
218 | - | let oldVerified = $ | |
258 | + | let oldTotalYes = $t069157218._1 | |
259 | + | let oldTotalNo = $t069157218._2 | |
260 | + | let oldVerified = $t069157218._3 | |
219 | 261 | StringEntry(voteResultKey, formatVoteResult((oldTotalYes + (if (inFavor) | |
220 | 262 | then total | |
221 | 263 | else 0)), (oldTotalNo + (if (inFavor) | |
222 | 264 | then 0 | |
223 | 265 | else total)), if ((verified == unit)) | |
224 | 266 | then oldVerified | |
225 | 267 | else value(verified))) | |
226 | 268 | } | |
227 | 269 | ||
228 | 270 | ||
229 | 271 | func containsNode (listName,id) = { | |
230 | 272 | let head = getString(this, keyListHead(listName)) | |
231 | 273 | let prev = getString(this, keyListPrev(listName, id)) | |
232 | 274 | let next = getString(this, keyListNext(listName, id)) | |
233 | 275 | if (if ((id == head)) | |
234 | 276 | then true | |
235 | 277 | else (prev != unit)) | |
236 | 278 | then true | |
237 | 279 | else (next != unit) | |
238 | 280 | } | |
239 | 281 | ||
240 | 282 | ||
241 | 283 | func insertNode (listName,id) = { | |
242 | 284 | let head = getString(this, keyListHead(listName)) | |
243 | 285 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
244 | 286 | let checkNode = if (!(containsNode(listName, id))) | |
245 | 287 | then true | |
246 | 288 | else throw("Node exists") | |
247 | 289 | if ((checkNode == checkNode)) | |
248 | 290 | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if (isDefined(head)) | |
249 | 291 | then [StringEntry(keyListNext(listName, id), value(head)), StringEntry(keyListPrev(listName, value(head)), id)] | |
250 | 292 | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
251 | 293 | else throw("Strict value is not equal to itself.") | |
252 | 294 | } | |
253 | 295 | ||
254 | 296 | ||
255 | 297 | func deleteNode (listName,id) = { | |
256 | 298 | let head = getString(this, keyListHead(listName)) | |
257 | 299 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
258 | 300 | let prev = getString(this, keyListPrev(listName, id)) | |
259 | 301 | let next = getString(this, keyListNext(listName, id)) | |
260 | 302 | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if (isDefined(prev)) | |
261 | 303 | then isDefined(next) | |
262 | 304 | else false) | |
263 | 305 | then [StringEntry(keyListNext(listName, value(prev)), value(next)), StringEntry(keyListPrev(listName, value(next)), value(prev)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
264 | 306 | else if (isDefined(next)) | |
265 | 307 | then [StringEntry(keyListHead(listName), value(next)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(next)))] | |
266 | 308 | else if (isDefined(prev)) | |
267 | 309 | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prev)))] | |
268 | 310 | else if ((id == head)) | |
269 | 311 | then [DeleteEntry(keyListHead(listName))] | |
270 | 312 | else throw("Invalid node"))) | |
271 | 313 | } | |
272 | 314 | ||
273 | 315 | ||
274 | 316 | func processVote (assetId,userAddressOrUnit,latestProcessedAssetKey,latestProcessedUserKey,latestProcessedUserRemoveKey) = { | |
275 | 317 | let updateLatestProcessedAssetAction = StringEntry(latestProcessedAssetKey, assetId) | |
276 | 318 | let deleteLatestProcessedUserAction = DeleteEntry(latestProcessedUserKey) | |
277 | 319 | if ((userAddressOrUnit == unit)) | |
278 | 320 | then [updateLatestProcessedAssetAction, deleteLatestProcessedUserAction] | |
279 | 321 | else { | |
280 | 322 | let userAddress = value(userAddressOrUnit) | |
281 | 323 | let updateLatestProcessedUserAction = StringEntry(latestProcessedUserKey, userAddress) | |
282 | 324 | let userVoteKey = keyUserVoteByPeriod(userAddress, assetId, currentPeriod) | |
283 | 325 | let userVoteOrUnit = getString(userVoteKey) | |
284 | 326 | let voteActions = if ((userVoteOrUnit == unit)) | |
285 | 327 | then { | |
286 | 328 | let userGwxAmountAtEndHeight = getUserGwxAmountAtHeight(userAddress, endHeight) | |
287 | 329 | if ((userGwxAmountAtEndHeight == 0)) | |
288 | 330 | then [BooleanEntry(latestProcessedUserRemoveKey, true)] | |
289 | 331 | else { | |
290 | 332 | let previousPeriod = (currentPeriod - 1) | |
291 | 333 | let assetWasEliminated = valueOrElse(getBoolean(keyAssetWasEliminated(assetId, previousPeriod)), false) | |
292 | 334 | let userPreviousVoteOrUnit = if (assetWasEliminated) | |
293 | 335 | then unit | |
294 | 336 | else getString(keyUserVoteByPeriod(userAddress, assetId, previousPeriod)) | |
295 | 337 | if ((userPreviousVoteOrUnit == unit)) | |
296 | 338 | then nil | |
297 | 339 | else { | |
298 | - | let $ | |
299 | - | let prevTotal = $ | |
300 | - | let inFavor = $ | |
340 | + | let $t01132911402 = parseUserVote(value(userPreviousVoteOrUnit)) | |
341 | + | let prevTotal = $t01132911402._1 | |
342 | + | let inFavor = $t01132911402._2 | |
301 | 343 | let total = min([prevTotal, userGwxAmountAtEndHeight]) | |
302 | 344 | [StringEntry(userVoteKey, formatUserVote(total, inFavor)), getVoteResultAction(assetId, total, inFavor, currentPeriod, unit)] | |
303 | 345 | } | |
304 | 346 | } | |
305 | 347 | } | |
306 | 348 | else nil | |
307 | 349 | ((voteActions :+ updateLatestProcessedAssetAction) :+ updateLatestProcessedUserAction) | |
308 | 350 | } | |
309 | 351 | } | |
310 | 352 | ||
311 | 353 | ||
312 | 354 | func assetShouldBeEliminated (assetId,period) = !(valueOrElse(getBoolean(keyAssetVerifiedByPeriod(assetId, period)), true)) | |
313 | 355 | ||
314 | 356 | ||
315 | 357 | func eliminationCheck (assetId) = if (if (assetShouldBeEliminated(assetId, (currentPeriod - 1))) | |
316 | 358 | then assetShouldBeEliminated(assetId, (currentPeriod - 2)) | |
317 | 359 | else false) | |
318 | 360 | then assetShouldBeEliminated(assetId, (currentPeriod - 3)) | |
319 | 361 | else false | |
320 | 362 | ||
321 | 363 | ||
322 | 364 | @Callable(i) | |
323 | 365 | func constructor (boostingContractPrm,emissionContractPrm,assetsStoreContractPrm,feeAmountPrm,wxAssetIdPrm,votingThresholdPrm,votingDurationPrm,voteBeforeEliminationPrm,startHeightPrm,maxDepthPrm) = { | |
324 | - | let checks = [ | |
366 | + | let checks = [mustManager(i), if (isDefined(addressFromString(boostingContractPrm))) | |
325 | 367 | then true | |
326 | 368 | else throw("Invalid boosting contract address"), if (isDefined(addressFromString(emissionContractPrm))) | |
327 | 369 | then true | |
328 | 370 | else throw("Invalid emission contract address"), if (isDefined(addressFromString(assetsStoreContractPrm))) | |
329 | 371 | then true | |
330 | 372 | else throw("Invalid asset_store contract address"), if ((feeAmountPrm >= 0)) | |
331 | 373 | then true | |
332 | 374 | else throw("Invalid fee amount"), if (isDefined(assetInfo(fromBase58String(wxAssetIdPrm)))) | |
333 | 375 | then true | |
334 | 376 | else throw("Invalid WX asset ID"), if ((votingThresholdPrm >= 0)) | |
335 | 377 | then true | |
336 | 378 | else throw("Invalid voting threshold"), if ((votingDurationPrm > 0)) | |
337 | 379 | then true | |
338 | 380 | else throw("Invalid voting duration"), if (((startHeightPrm + votingDurationPrm) > height)) | |
339 | 381 | then true | |
340 | 382 | else throw("Invalid start height")] | |
341 | 383 | if ((checks == checks)) | |
342 | 384 | then $Tuple2([StringEntry(keyBoostingContract, boostingContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), StringEntry(keyAssetsStoreContract, assetsStoreContractPrm), IntegerEntry(keyFeeAmount, feeAmountPrm), StringEntry(keyWxAssetId, wxAssetIdPrm), IntegerEntry(keyVotingThreshold, votingThresholdPrm), IntegerEntry(keyVotingDuration, votingDurationPrm), IntegerEntry(keyVoteBeforeElimination, voteBeforeEliminationPrm), IntegerEntry(keyStartHeight, startHeightPrm), IntegerEntry(keyCurrentPeriod, 0), IntegerEntry(keyMaxDepth, maxDepthPrm)], unit) | |
343 | 385 | else throw("Strict value is not equal to itself.") | |
344 | 386 | } | |
345 | 387 | ||
346 | 388 | ||
347 | 389 | ||
348 | 390 | @Callable(i) | |
349 | 391 | func suggest (assetId,assetImage) = { | |
350 | 392 | let info = valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "Invalid asset ID") | |
351 | 393 | if ((info == info)) | |
352 | 394 | then { | |
353 | 395 | let payment = value(i.payments[0]) | |
354 | 396 | let isThis = (i.caller == this) | |
355 | 397 | let checks = [if (if (isThis) | |
356 | 398 | then true | |
357 | 399 | else (value(payment.assetId) == wxAssetId)) | |
358 | 400 | then true | |
359 | 401 | else throw("Invalid fee asset"), if (if (isThis) | |
360 | 402 | then true | |
361 | 403 | else (payment.amount == feeAmount)) | |
362 | 404 | then true | |
363 | 405 | else throw("Invalid fee amount")] | |
364 | 406 | if ((checks == checks)) | |
365 | 407 | then { | |
366 | 408 | let assetsStoreCreateOrUpdateInv = invoke(assetsStoreContract, "createOrUpdate", [assetId, assetImage, false], nil) | |
367 | 409 | if ((assetsStoreCreateOrUpdateInv == assetsStoreCreateOrUpdateInv)) | |
368 | 410 | then { | |
369 | 411 | let burnFeeInv = if (isThis) | |
370 | 412 | then unit | |
371 | 413 | else invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)]) | |
372 | 414 | if ((burnFeeInv == burnFeeInv)) | |
373 | 415 | then { | |
374 | 416 | let addAssetActions = insertNode(assetsListName, assetId) | |
375 | 417 | let nextPeriod = (currentPeriod + 1) | |
376 | 418 | let targetPeriod = if ((endHeight > height)) | |
377 | 419 | then currentPeriod | |
378 | 420 | else nextPeriod | |
379 | 421 | $Tuple2((addAssetActions :+ getVoteResultAction(assetId, 0, true, targetPeriod, false)), unit) | |
380 | 422 | } | |
381 | 423 | else throw("Strict value is not equal to itself.") | |
382 | 424 | } | |
383 | 425 | else throw("Strict value is not equal to itself.") | |
384 | 426 | } | |
385 | 427 | else throw("Strict value is not equal to itself.") | |
386 | 428 | } | |
387 | 429 | else throw("Strict value is not equal to itself.") | |
388 | 430 | } | |
389 | 431 | ||
390 | 432 | ||
391 | 433 | ||
392 | 434 | @Callable(i) | |
393 | 435 | func vote (assetId,inFavor) = { | |
394 | 436 | let checkAsset = if (containsNode(assetsListName, assetId)) | |
395 | 437 | then true | |
396 | 438 | else throw("Invalid asset") | |
397 | 439 | if ((checkAsset == checkAsset)) | |
398 | 440 | then { | |
399 | 441 | let checkHeight = if ((endHeight > height)) | |
400 | 442 | then true | |
401 | 443 | else throw("Current voting is over but results are not finalized") | |
402 | 444 | if ((checkHeight == checkHeight)) | |
403 | 445 | then { | |
404 | 446 | let userAddress = toString(i.caller) | |
405 | 447 | let gwxAmountAtEnd = getUserGwxAmountAtHeight(userAddress, endHeight) | |
406 | 448 | let checkGwxAmountAtEnd = if ((gwxAmountAtEnd > 0)) | |
407 | 449 | then true | |
408 | 450 | else throw("You'll not have gWX at the end of voting") | |
409 | 451 | if ((checkGwxAmountAtEnd == checkGwxAmountAtEnd)) | |
410 | 452 | then { | |
411 | 453 | let votesListName = getVotesListName(assetId) | |
412 | 454 | let userVoteKey = keyUserVoteByPeriod(userAddress, assetId, currentPeriod) | |
413 | 455 | let userVoteOrUnit = getString(userVoteKey) | |
414 | 456 | let cancelVoteInv = if ((userVoteOrUnit == unit)) | |
415 | 457 | then unit | |
416 | 458 | else invoke(this, "cancelVote", [assetId], nil) | |
417 | 459 | if ((cancelVoteInv == cancelVoteInv)) | |
418 | 460 | then { | |
419 | 461 | let userVoteActions = [StringEntry(userVoteKey, formatUserVote(gwxAmountAtEnd, inFavor)), StringEntry(keyUserVoteHistory("vote", userAddress, assetId, toBase58String(i.transactionId), currentPeriod), formatUserVote(gwxAmountAtEnd, inFavor)), getVoteResultAction(assetId, gwxAmountAtEnd, inFavor, currentPeriod, unit)] | |
420 | 462 | let votesListActions = if (containsNode(votesListName, userAddress)) | |
421 | 463 | then nil | |
422 | 464 | else insertNode(votesListName, userAddress) | |
423 | 465 | $Tuple2((votesListActions ++ userVoteActions), unit) | |
424 | 466 | } | |
425 | 467 | else throw("Strict value is not equal to itself.") | |
426 | 468 | } | |
427 | 469 | else throw("Strict value is not equal to itself.") | |
428 | 470 | } | |
429 | 471 | else throw("Strict value is not equal to itself.") | |
430 | 472 | } | |
431 | 473 | else throw("Strict value is not equal to itself.") | |
432 | 474 | } | |
433 | 475 | ||
434 | 476 | ||
435 | 477 | ||
436 | 478 | @Callable(i) | |
437 | 479 | func cancelVote (assetId) = { | |
438 | 480 | let userAddress = if ((i.caller == this)) | |
439 | 481 | then toString(i.originCaller) | |
440 | 482 | else toString(i.caller) | |
441 | 483 | let votesListName = getVotesListName(assetId) | |
442 | 484 | let userVoteKey = keyUserVoteByPeriod(userAddress, assetId, currentPeriod) | |
443 | 485 | let userVoteOrUnit = getString(userVoteKey) | |
444 | - | let $ | |
445 | - | let total = $ | |
446 | - | let inFavor = $ | |
486 | + | let $t01672816822 = parseUserVote(valueOrErrorMessage(userVoteOrUnit, "Nothing to cancel")) | |
487 | + | let total = $t01672816822._1 | |
488 | + | let inFavor = $t01672816822._2 | |
447 | 489 | let votesListActions = deleteNode(votesListName, userAddress) | |
448 | 490 | let userVoteActions = [DeleteEntry(userVoteKey), StringEntry(keyUserVoteHistory("cancelVote", userAddress, assetId, toBase58String(i.transactionId), currentPeriod), formatUserVote(0, true)), getVoteResultAction(assetId, -(total), inFavor, currentPeriod, unit)] | |
449 | 491 | $Tuple2((votesListActions ++ userVoteActions), unit) | |
450 | 492 | } | |
451 | 493 | ||
452 | 494 | ||
453 | 495 | ||
454 | 496 | @Callable(i) | |
455 | 497 | func finalizeAssetINTERNAL (assetId,period) = { | |
456 | 498 | let checkCaller = thisOnly(i) | |
457 | 499 | if ((checkCaller == checkCaller)) | |
458 | 500 | then { | |
459 | 501 | let voteResultKey = keyVoteResultByPeriod(assetId, period) | |
460 | - | let $ | |
502 | + | let $t01745317626 = match getString(voteResultKey) { | |
461 | 503 | case s: String => | |
462 | 504 | let r = parseVoteResult(s) | |
463 | 505 | $Tuple2(r._1, r._2) | |
464 | 506 | case _: Unit => | |
465 | 507 | $Tuple2(0, 0) | |
466 | 508 | case _ => | |
467 | 509 | throw("Match error") | |
468 | 510 | } | |
469 | - | let totalYes = $ | |
470 | - | let totalNo = $ | |
511 | + | let totalYes = $t01745317626._1 | |
512 | + | let totalNo = $t01745317626._2 | |
471 | 513 | let total = (totalYes + totalNo) | |
472 | 514 | let verified = if ((total >= votingThreshold)) | |
473 | 515 | then (totalYes > totalNo) | |
474 | 516 | else false | |
475 | 517 | let assetVerifiedActions = [BooleanEntry(keyAssetVerifiedByPeriod(assetId, period), verified), if (verified) | |
476 | 518 | then BooleanEntry(keyAssetVerified(assetId), true) | |
477 | 519 | else DeleteEntry(keyAssetVerified(assetId))] | |
478 | 520 | let assetsStoreSetVerifiedInv = invoke(assetsStoreContract, "setVerified", [assetId, verified], nil) | |
479 | 521 | if ((assetsStoreSetVerifiedInv == assetsStoreSetVerifiedInv)) | |
480 | 522 | then { | |
481 | 523 | let eliminate = if (verified) | |
482 | 524 | then false | |
483 | 525 | else eliminationCheck(assetId) | |
484 | 526 | let assetWasEliminatedActions = if (eliminate) | |
485 | 527 | then [BooleanEntry(keyAssetWasEliminated(assetId, currentPeriod), true)] | |
486 | 528 | else nil | |
487 | 529 | let voteResultActions = if (eliminate) | |
488 | 530 | then nil | |
489 | 531 | else [getVoteResultAction(assetId, 0, true, (currentPeriod + 1), verified)] | |
490 | 532 | let votesListActions = if (eliminate) | |
491 | 533 | then deleteNode(assetsListName, assetId) | |
492 | 534 | else nil | |
493 | 535 | let onEliminationInv = if (eliminate) | |
494 | 536 | then invoke(assetsStoreContract, "onEliminate", [assetId], nil) | |
495 | 537 | else unit | |
496 | 538 | if ((onEliminationInv == onEliminationInv)) | |
497 | 539 | then $Tuple2(((votesListActions ++ voteResultActions) ++ assetVerifiedActions), unit) | |
498 | 540 | else throw("Strict value is not equal to itself.") | |
499 | 541 | } | |
500 | 542 | else throw("Strict value is not equal to itself.") | |
501 | 543 | } | |
502 | 544 | else throw("Strict value is not equal to itself.") | |
503 | 545 | } | |
504 | 546 | ||
505 | 547 | ||
506 | 548 | ||
507 | 549 | @Callable(i) | |
508 | 550 | func deleteUserNodeINTERNAL (assetId,userAddress,latestProcessedUserRemoveKey) = { | |
509 | - | let checkCaller = | |
551 | + | let checkCaller = mustManager(i) | |
510 | 552 | if ((checkCaller == checkCaller)) | |
511 | 553 | then $Tuple2((deleteNode(getVotesListName(assetId), userAddress) :+ DeleteEntry(latestProcessedUserRemoveKey)), unit) | |
512 | 554 | else throw("Strict value is not equal to itself.") | |
513 | 555 | } | |
514 | 556 | ||
515 | 557 | ||
516 | 558 | ||
517 | 559 | @Callable(i) | |
518 | 560 | func finalizeVotingHelper () = if ((endHeight > height)) | |
519 | 561 | then $Tuple2(nil, false) | |
520 | 562 | else { | |
521 | 563 | let latestProcessedAssetOrUnit = getString(keyLatestProcessedAsset) | |
522 | 564 | let latestProcessedUserOrUnit = getString(keyLatestProcessedUser) | |
523 | 565 | let nextPeriodDelay = 0 | |
524 | 566 | let finish = $Tuple2([IntegerEntry(keyStartHeight, (height + nextPeriodDelay)), IntegerEntry(keyCurrentPeriod, (currentPeriod + 1)), DeleteEntry(keyLatestProcessedAsset), DeleteEntry(keyLatestProcessedUser), DeleteEntry(keyLatestProcessedAssetTransfer), DeleteEntry(keyLatestProcessedUserTransfer)], true) | |
525 | 567 | if ((latestProcessedAssetOrUnit == unit)) | |
526 | 568 | then { | |
527 | 569 | let assetsHeadOrUnit = getString(keyListHead(assetsListName)) | |
528 | 570 | if ((assetsHeadOrUnit == unit)) | |
529 | 571 | then finish | |
530 | 572 | else { | |
531 | 573 | let asset = value(assetsHeadOrUnit) | |
532 | 574 | let userAddressOrUnit = getString(keyListHead(getVotesListName(asset))) | |
533 | 575 | let processVoteActions = processVote(asset, userAddressOrUnit, keyLatestProcessedAsset, keyLatestProcessedUser, keyLatestProcessedUserRemove) | |
534 | 576 | $Tuple2(processVoteActions, true) | |
535 | 577 | } | |
536 | 578 | } | |
537 | 579 | else { | |
538 | 580 | let latestProcessedAsset = value(latestProcessedAssetOrUnit) | |
539 | 581 | if ((latestProcessedUserOrUnit == unit)) | |
540 | 582 | then { | |
541 | 583 | let assetOrUnit = getString(keyListNext(assetsListName, latestProcessedAsset)) | |
542 | 584 | if ((assetOrUnit == assetOrUnit)) | |
543 | 585 | then { | |
544 | 586 | let finalizeAssetInv = invoke(this, "finalizeAssetINTERNAL", [latestProcessedAsset, currentPeriod], nil) | |
545 | 587 | if ((finalizeAssetInv == finalizeAssetInv)) | |
546 | 588 | then if ((assetOrUnit == unit)) | |
547 | 589 | then finish | |
548 | 590 | else { | |
549 | 591 | let asset = value(assetOrUnit) | |
550 | 592 | let userAddressOrUnit = getString(keyListHead(getVotesListName(asset))) | |
551 | 593 | let processVoteActions = processVote(asset, userAddressOrUnit, keyLatestProcessedAsset, keyLatestProcessedUser, keyLatestProcessedUserRemove) | |
552 | 594 | $Tuple2(processVoteActions, true) | |
553 | 595 | } | |
554 | 596 | else throw("Strict value is not equal to itself.") | |
555 | 597 | } | |
556 | 598 | else throw("Strict value is not equal to itself.") | |
557 | 599 | } | |
558 | 600 | else { | |
559 | 601 | let latestProcessedUser = value(latestProcessedUserOrUnit) | |
560 | 602 | let userAddressOrUnit = getString(keyListNext(getVotesListName(latestProcessedAsset), latestProcessedUser)) | |
561 | 603 | if ((userAddressOrUnit == userAddressOrUnit)) | |
562 | 604 | then { | |
563 | 605 | let removeLatestUser = valueOrElse(getBoolean(keyLatestProcessedUserRemove), false) | |
564 | 606 | let deleteUserInv = if (removeLatestUser) | |
565 | 607 | then invoke(this, "deleteUserNodeINTERNAL", [latestProcessedAsset, latestProcessedUser, keyLatestProcessedUserRemove], nil) | |
566 | 608 | else unit | |
567 | 609 | if ((deleteUserInv == deleteUserInv)) | |
568 | 610 | then { | |
569 | 611 | let processVoteActions = processVote(latestProcessedAsset, userAddressOrUnit, keyLatestProcessedAsset, keyLatestProcessedUser, keyLatestProcessedUserRemove) | |
570 | 612 | $Tuple2(processVoteActions, true) | |
571 | 613 | } | |
572 | 614 | else throw("Strict value is not equal to itself.") | |
573 | 615 | } | |
574 | 616 | else throw("Strict value is not equal to itself.") | |
575 | 617 | } | |
576 | 618 | } | |
577 | 619 | } | |
578 | 620 | ||
579 | 621 | ||
580 | 622 | ||
581 | 623 | @Callable(i) | |
582 | 624 | func finalizeVotingWrapper (counter) = { | |
583 | 625 | let result = asBool(invoke(this, "finalizeVotingHelper", nil, nil)) | |
584 | 626 | if ((result == result)) | |
585 | 627 | then if (!(result)) | |
586 | 628 | then if ((counter == 0)) | |
587 | 629 | then throw("Current voting is not over yet") | |
588 | 630 | else $Tuple2(nil, unit) | |
589 | 631 | else if ((maxDepth > counter)) | |
590 | 632 | then { | |
591 | 633 | let inv = invoke(this, "finalizeVotingWrapper", [(counter + 1)], nil) | |
592 | 634 | if ((inv == inv)) | |
593 | 635 | then $Tuple2(nil, unit) | |
594 | 636 | else throw("Strict value is not equal to itself.") | |
595 | 637 | } | |
596 | 638 | else $Tuple2(nil, unit) | |
597 | 639 | else throw("Strict value is not equal to itself.") | |
598 | 640 | } | |
599 | 641 | ||
600 | 642 | ||
601 | 643 | ||
602 | 644 | @Callable(i) | |
603 | 645 | func finalizeVoting () = { | |
604 | 646 | let inv = invoke(this, "finalizeVotingWrapper", [0], nil) | |
605 | 647 | if ((inv == inv)) | |
606 | 648 | then $Tuple2(nil, unit) | |
607 | 649 | else throw("Strict value is not equal to itself.") | |
608 | 650 | } | |
609 | 651 | ||
610 | 652 | ||
611 | 653 | ||
612 | 654 | @Callable(i) | |
613 | 655 | func transferVotesHelper () = { | |
614 | 656 | let votesTransferFinishedKey = keyVotesTransferFinishedByPeriod(currentPeriod) | |
615 | 657 | let votesTransferFinished = valueOrElse(getBoolean(votesTransferFinishedKey), false) | |
616 | 658 | if (if (if ((startHeight > height)) | |
617 | 659 | then true | |
618 | 660 | else (height >= endHeight)) | |
619 | 661 | then true | |
620 | 662 | else votesTransferFinished) | |
621 | 663 | then $Tuple2(nil, false) | |
622 | 664 | else { | |
623 | 665 | let latestProcessedAssetOrUnit = getString(keyLatestProcessedAssetTransfer) | |
624 | 666 | let latestProcessedUserOrUnit = getString(keyLatestProcessedUserTransfer) | |
625 | 667 | let finish = $Tuple2([BooleanEntry(votesTransferFinishedKey, true), DeleteEntry(keyLatestProcessedAssetTransfer), DeleteEntry(keyLatestProcessedUserTransfer)], true) | |
626 | 668 | if ((latestProcessedAssetOrUnit == unit)) | |
627 | 669 | then { | |
628 | 670 | let assetsHeadOrUnit = getString(keyListHead(assetsListName)) | |
629 | 671 | if ((assetsHeadOrUnit == unit)) | |
630 | 672 | then finish | |
631 | 673 | else { | |
632 | 674 | let asset = value(assetsHeadOrUnit) | |
633 | 675 | let userAddressOrUnit = getString(keyListHead(getVotesListName(asset))) | |
634 | 676 | let processVoteActions = processVote(asset, userAddressOrUnit, keyLatestProcessedAssetTransfer, keyLatestProcessedUserTransfer, keyLatestProcessedUserRemoveTransfer) | |
635 | 677 | $Tuple2(processVoteActions, true) | |
636 | 678 | } | |
637 | 679 | } | |
638 | 680 | else { | |
639 | 681 | let latestProcessedAsset = value(latestProcessedAssetOrUnit) | |
640 | 682 | if ((latestProcessedUserOrUnit == unit)) | |
641 | 683 | then { | |
642 | 684 | let assetOrUnit = getString(keyListNext(assetsListName, latestProcessedAsset)) | |
643 | 685 | if ((assetOrUnit == unit)) | |
644 | 686 | then finish | |
645 | 687 | else { | |
646 | 688 | let asset = value(assetOrUnit) | |
647 | 689 | let userAddressOrUnit = getString(keyListHead(getVotesListName(asset))) | |
648 | 690 | let processVoteActions = processVote(asset, userAddressOrUnit, keyLatestProcessedAssetTransfer, keyLatestProcessedUserTransfer, keyLatestProcessedUserRemoveTransfer) | |
649 | 691 | $Tuple2(processVoteActions, true) | |
650 | 692 | } | |
651 | 693 | } | |
652 | 694 | else { | |
653 | 695 | let latestProcessedUser = value(latestProcessedUserOrUnit) | |
654 | 696 | let userAddressOrUnit = getString(keyListNext(getVotesListName(latestProcessedAsset), latestProcessedUser)) | |
655 | 697 | if ((userAddressOrUnit == userAddressOrUnit)) | |
656 | 698 | then { | |
657 | 699 | let removeLatestUser = valueOrElse(getBoolean(keyLatestProcessedUserRemoveTransfer), false) | |
658 | 700 | let deleteUserInv = if (removeLatestUser) | |
659 | 701 | then invoke(this, "deleteUserNodeINTERNAL", [latestProcessedAsset, latestProcessedUser, keyLatestProcessedUserRemoveTransfer], nil) | |
660 | 702 | else unit | |
661 | 703 | if ((deleteUserInv == deleteUserInv)) | |
662 | 704 | then { | |
663 | 705 | let processVoteActions = processVote(latestProcessedAsset, userAddressOrUnit, keyLatestProcessedAssetTransfer, keyLatestProcessedUserTransfer, keyLatestProcessedUserRemoveTransfer) | |
664 | 706 | $Tuple2(processVoteActions, true) | |
665 | 707 | } | |
666 | 708 | else throw("Strict value is not equal to itself.") | |
667 | 709 | } | |
668 | 710 | else throw("Strict value is not equal to itself.") | |
669 | 711 | } | |
670 | 712 | } | |
671 | 713 | } | |
672 | 714 | } | |
673 | 715 | ||
674 | 716 | ||
675 | 717 | ||
676 | 718 | @Callable(i) | |
677 | 719 | func transferVotesWrapper (counter) = { | |
678 | 720 | let result = asBool(invoke(this, "transferVotesHelper", nil, nil)) | |
679 | 721 | if ((result == result)) | |
680 | 722 | then if (!(result)) | |
681 | 723 | then if ((counter == 0)) | |
682 | 724 | then throw("Voting is not started yet") | |
683 | 725 | else $Tuple2(nil, unit) | |
684 | 726 | else if ((maxDepth > counter)) | |
685 | 727 | then { | |
686 | 728 | let inv = invoke(this, "transferVotesWrapper", [(counter + 1)], nil) | |
687 | 729 | if ((inv == inv)) | |
688 | 730 | then $Tuple2(nil, unit) | |
689 | 731 | else throw("Strict value is not equal to itself.") | |
690 | 732 | } | |
691 | 733 | else $Tuple2(nil, unit) | |
692 | 734 | else throw("Strict value is not equal to itself.") | |
693 | 735 | } | |
694 | 736 | ||
695 | 737 | ||
696 | 738 | ||
697 | 739 | @Callable(i) | |
698 | 740 | func transferVotes () = { | |
699 | 741 | let inv = invoke(this, "transferVotesWrapper", [0], nil) | |
700 | 742 | if ((inv == inv)) | |
701 | 743 | then $Tuple2(nil, unit) | |
702 | 744 | else throw("Strict value is not equal to itself.") | |
703 | 745 | } | |
704 | 746 | ||
705 | 747 | ||
706 | 748 | ||
707 | 749 | @Callable(i) | |
708 | 750 | func setVotingThreshold (newThreshold) = { | |
709 | - | let checkCaller = | |
751 | + | let checkCaller = mustManager(i) | |
710 | 752 | if ((checkCaller == checkCaller)) | |
711 | 753 | then $Tuple2([IntegerEntry(keyVotingThreshold, newThreshold)], unit) | |
712 | 754 | else throw("Strict value is not equal to itself.") | |
713 | 755 | } | |
714 | 756 | ||
715 | 757 | ||
716 | 758 | ||
717 | 759 | @Callable(i) | |
718 | 760 | func setFee (newFee) = { | |
719 | - | let checkCaller = | |
761 | + | let checkCaller = mustManager(i) | |
720 | 762 | if ((checkCaller == checkCaller)) | |
721 | 763 | then $Tuple2([IntegerEntry(keyFeeAmount, newFee)], unit) | |
722 | 764 | else throw("Strict value is not equal to itself.") | |
723 | 765 | } | |
724 | 766 | ||
725 | 767 | ||
726 | 768 | ||
727 | 769 | @Callable(i) | |
728 | 770 | func gwxAvailableForVoteREADONLY (userAddress) = { | |
729 | 771 | let gwxAmountAtEnd = getUserGwxAmountAtHeight(userAddress, endHeight) | |
730 | 772 | $Tuple2(nil, gwxAmountAtEnd) | |
731 | 773 | } | |
732 | 774 | ||
733 | 775 | ||
776 | + | @Verifier(tx) | |
777 | + | func verify () = { | |
778 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
779 | + | case pk: ByteVector => | |
780 | + | pk | |
781 | + | case _: Unit => | |
782 | + | tx.senderPublicKey | |
783 | + | case _ => | |
784 | + | throw("Match error") | |
785 | + | } | |
786 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
787 | + | } | |
788 | + |
github/deemru/w8io/026f985 79.57 ms ◑