tx · 77XM4E5pXgfanzLaPDvsfQwPA1pLgy6L9ZWyyQp1Q1JD 3N9qNNh15o84HrRZa511KX2jQtgLcmqnEgR: -0.01500000 Waves 2024.06.11 15:44 [3146109] smart account 3N9qNNh15o84HrRZa511KX2jQtgLcmqnEgR > SELF 0.00000000 Waves
{ "type": 13, "id": "77XM4E5pXgfanzLaPDvsfQwPA1pLgy6L9ZWyyQp1Q1JD", "fee": 1500000, "feeAssetId": null, "timestamp": 1718109867538, "version": 2, "chainId": 84, "sender": "3N9qNNh15o84HrRZa511KX2jQtgLcmqnEgR", "senderPublicKey": "45oG8LXhBqNC5fxcA6iwy3DhLFnsEUzUBwEm7VrWtFSK", "proofs": [ "g1m5fjNpwWgyMUxuEKKQDrP4wspPqm3JkX5UnqQw21v3AyQgnUVUEoKNUMBeG4L5p33BWVz8qE4fnSih2zGjYpX" ], "script": "base64:CAISCAISBgoECBgICBIECgIICBIAEAAUcHJlZGljdGlvbk1heENvdW50ZXIAAwAKbWF4Q291bnRlcgAGAA1kZWZhdWx0UmF0aW5nAGQADnJhdGVBZGp1c3RtZW50ABQAB3Rva2VuSWQBIG33eiemmz/8i1OVqeOeBVscIi9bTehRMFsBoQapAMYYAAxwYXlvdXRBbW91bnQAgOHrFwAMcmF0aW5nQ3V0b2ZmADIABXJfbWF4APQDAAVzY2FsZQBkARFzZWFyY2hGb3JDb3VudGVycwIGaXRlbUlkB2NvdW50ZXIEEXNlYXJjaEZvckNvdW50ZXJzBAckbWF0Y2gwCQCiCAEJAKwCAgkArAICBQZpdGVtSWQCAV8JAKQDAQUHY291bnRlcgMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAXMFByRtYXRjaDAFAXMCB05vIFVzZXIFEXNlYXJjaEZvckNvdW50ZXJzAQ9zZWFyY2hGb3JSYXRpbmcBB2FkZHJlc3MEBnJhdGluZwQHJG1hdGNoMAkAnwgBCQCsAgIFB2FkZHJlc3MCB19yYXRpbmcDCQABAgUHJG1hdGNoMAIDSW50BAFyB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BQZpdGVtSWQCAV8FDGNsaWVudEFkcmVzcwUKcHJlZGljdGlvbgkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQZpdGVtSWQCCF9jb3VudGVyAAEJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUGaXRlbUlkAhJfcHJlZGljdGlvbkNvdW50ZXIAAQkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgICBG5ld18FBml0ZW1JZAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgICCHVwZGF0ZWRfBQZpdGVtSWQFBml0ZW1JZAUDbmlsAWkBDHJlZ2lzdGVyVXNlcgAEDGNsaWVudEFkcmVzcwkApQgBCAUBaQZjYWxsZXIEDXNlYXJjaEZvclVzZXIEByRtYXRjaDAJAJ8IAQkArAICBQxjbGllbnRBZHJlc3MCB19yYXRpbmcDCQABAgUHJG1hdGNoMAIDSW50BAFzBQckbWF0Y2gwBQFzAP///////////wEDCQECIT0CBQ1zZWFyY2hGb3JVc2VyAP///////////wEJAAIBAhNVc2VyIGFscmVhZHkgZXhpc3RzCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFDGNsaWVudEFkcmVzcwIHX3JhdGluZwUNZGVmYXVsdFJhdGluZwUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleXryG5k=", "height": 3146109, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9SVV4Xx418dED7FCdqDxX1ALQcY76PXdiWoiZYwdXBH8 Next: EkQ3xTy35fxw4sFQQehHByyNBiM3NyUZWMJn8qTMLy7Y Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let predictionMaxCounter = 3 | |
44 | 44 | func searchForAddressPrediction (itemId,adress) = { | |
45 | 45 | let searchForPrediction = match getString(((itemId + "_") + adress)) { | |
46 | 46 | case s: String => | |
47 | + | s | |
48 | + | case _ => | |
49 | + | "Not Found" | |
50 | + | } | |
51 | + | searchForPrediction | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | func searchForPredictionCounter (itemId,prediction) = { | |
56 | + | let searchForPrediction = match getInteger(((itemId + "_prediction_") + prediction)) { | |
57 | + | case s: Int => | |
47 | 58 | s | |
48 | 59 | case _ => | |
49 | 60 | "Not Found" | |
201 | 212 | if (containsElement(adressList, clientAdress)) | |
202 | 213 | then throw("This User already gave a Prediction") | |
203 | 214 | else { | |
204 | - | let predictionCounter = match getInteger((itemId + "_ | |
215 | + | let predictionCounter = match getInteger(((itemId + "_prediction_") + prediction)) { | |
205 | 216 | case s: Int => | |
206 | 217 | s | |
207 | 218 | case _ => | |
208 | - | -1 | |
209 | - | } | |
210 | - | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
211 | - | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
212 | - | case s: String => | |
213 | - | s | |
214 | - | case _ => | |
215 | - | "no Prediction Found" | |
219 | + | 404 | |
216 | 220 | } | |
217 | 221 | let newCounter = (searchForCounter + 1) | |
218 | - | if (( | |
222 | + | if ((predictionCounter != 404)) | |
219 | 223 | then if (((predictionCounter + 1) == predictionMaxCounter)) | |
220 | 224 | then { | |
221 | 225 | let newRating = calculateNewRating(clientRating, r_max, rateAdjustment, 1) | |
223 | 227 | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
224 | 228 | if ((invokeAdjustRating != invokeAdjustRating)) | |
225 | 229 | then throw("Strict value is not equal to itself.") | |
226 | - | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter | |
230 | + | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry(((itemId + "_prediction_") + prediction), (predictionCounter + 1)), IntegerEntry((itemId + "_counter"), newCounter), BooleanEntry((itemId + "_final"), true), BooleanEntry((itemId + "_cancelled"), false), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId), ScriptTransfer(Address(fromBase58String(clientAdress)), calculatedAmount, tokenId), IntegerEntry((clientAdress + "_rating"), newRating), StringEntry((itemId + "_final_prediction"), prediction)] | |
227 | 231 | } | |
228 | - | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), (predictionCounter + 1)), BooleanEntry((itemId + "_final"), false), BooleanEntry((itemId + "_cancelled"), false)] | |
229 | - | else if ((newCounter >= maxCounter)) | |
230 | - | then [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), (predictionCounter - 1)), BooleanEntry((itemId + "_cancelled"), true), BooleanEntry((itemId + "_final"), false), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId)] | |
231 | - | else if (((predictionCounter - 1) == 0)) | |
232 | - | then [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), 1), BooleanEntry((itemId + "_cancelled"), false), BooleanEntry((itemId + "_final"), false)] | |
233 | - | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), (predictionCounter - 1)), BooleanEntry((itemId + "_cancelled"), false), BooleanEntry((itemId + "_final"), false)] | |
232 | + | else if ((newCounter >= maxCounter)) | |
233 | + | then [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), BooleanEntry((itemId + "_cancelled"), true), BooleanEntry((itemId + "_final"), false), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId)] | |
234 | + | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry(((itemId + "_prediction_") + prediction), (predictionCounter + 1)), IntegerEntry((itemId + "_counter"), newCounter), BooleanEntry((itemId + "_final"), false), BooleanEntry((itemId + "_cancelled"), false)] | |
235 | + | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry(((itemId + "_prediction_") + prediction), 1), IntegerEntry((itemId + "_counter"), newCounter), BooleanEntry((itemId + "_cancelled"), false), BooleanEntry((itemId + "_final"), false)] | |
234 | 236 | } | |
235 | 237 | } | |
236 | 238 | else { |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let predictionMaxCounter = 3 | |
5 | 5 | ||
6 | 6 | let maxCounter = 6 | |
7 | 7 | ||
8 | 8 | let defaultRating = 100 | |
9 | 9 | ||
10 | 10 | let rateAdjustment = 20 | |
11 | 11 | ||
12 | 12 | let tokenId = base58'8QGJvsXqJ43q5ksFymoPKF1NWWhwUfr2F7h52oeWgVhH' | |
13 | 13 | ||
14 | 14 | let payoutAmount = 50000000 | |
15 | 15 | ||
16 | 16 | let ratingCutoff = 50 | |
17 | 17 | ||
18 | 18 | let r_max = 500 | |
19 | 19 | ||
20 | 20 | let scale = 100 | |
21 | 21 | ||
22 | 22 | func searchForCounters (itemId,counter) = { | |
23 | 23 | let searchForCounters = match getString(((itemId + "_") + toString(counter))) { | |
24 | 24 | case s: String => | |
25 | 25 | s | |
26 | 26 | case _ => | |
27 | 27 | "No User" | |
28 | 28 | } | |
29 | 29 | searchForCounters | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func searchForRating (address) = { | |
34 | 34 | let rating = match getInteger((address + "_rating")) { | |
35 | 35 | case r: Int => | |
36 | 36 | r | |
37 | 37 | case _ => | |
38 | 38 | defaultRating | |
39 | 39 | } | |
40 | 40 | rating | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func searchForAddressPrediction (itemId,adress) = { | |
45 | 45 | let searchForPrediction = match getString(((itemId + "_") + adress)) { | |
46 | 46 | case s: String => | |
47 | + | s | |
48 | + | case _ => | |
49 | + | "Not Found" | |
50 | + | } | |
51 | + | searchForPrediction | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | func searchForPredictionCounter (itemId,prediction) = { | |
56 | + | let searchForPrediction = match getInteger(((itemId + "_prediction_") + prediction)) { | |
57 | + | case s: Int => | |
47 | 58 | s | |
48 | 59 | case _ => | |
49 | 60 | "Not Found" | |
50 | 61 | } | |
51 | 62 | searchForPrediction | |
52 | 63 | } | |
53 | 64 | ||
54 | 65 | ||
55 | 66 | func findPredictionAdresses (itemId,counter) = { | |
56 | 67 | let adressList = if ((counter >= 5)) | |
57 | 68 | then { | |
58 | 69 | let adress1 = searchForCounters(itemId, 1) | |
59 | 70 | let adress2 = searchForCounters(itemId, 2) | |
60 | 71 | let adress3 = searchForCounters(itemId, 3) | |
61 | 72 | let adress4 = searchForCounters(itemId, 4) | |
62 | 73 | let adress5 = searchForCounters(itemId, 5) | |
63 | 74 | (((((nil :+ adress1) :+ adress2) :+ adress3) :+ adress4) :+ adress5) | |
64 | 75 | } | |
65 | 76 | else if ((counter >= 4)) | |
66 | 77 | then { | |
67 | 78 | let adress1 = searchForCounters(itemId, 1) | |
68 | 79 | let adress2 = searchForCounters(itemId, 2) | |
69 | 80 | let adress3 = searchForCounters(itemId, 3) | |
70 | 81 | let adress4 = searchForCounters(itemId, 4) | |
71 | 82 | ((((nil :+ adress1) :+ adress2) :+ adress3) :+ adress4) | |
72 | 83 | } | |
73 | 84 | else if ((counter >= 3)) | |
74 | 85 | then { | |
75 | 86 | let adress1 = searchForCounters(itemId, 1) | |
76 | 87 | let adress2 = searchForCounters(itemId, 2) | |
77 | 88 | let adress3 = searchForCounters(itemId, 3) | |
78 | 89 | (((nil :+ adress1) :+ adress2) :+ adress3) | |
79 | 90 | } | |
80 | 91 | else if ((counter >= 2)) | |
81 | 92 | then { | |
82 | 93 | let adress1 = searchForCounters(itemId, 1) | |
83 | 94 | let adress2 = searchForCounters(itemId, 2) | |
84 | 95 | ((nil :+ adress1) :+ adress2) | |
85 | 96 | } | |
86 | 97 | else { | |
87 | 98 | let adress1 = searchForCounters(itemId, 1) | |
88 | 99 | (nil :+ adress1) | |
89 | 100 | } | |
90 | 101 | adressList | |
91 | 102 | } | |
92 | 103 | ||
93 | 104 | ||
94 | 105 | func calculatePayout (r_player,r_max) = { | |
95 | 106 | let ratio = ((r_player * 100) / r_max) | |
96 | 107 | let payout = ((payoutAmount * ratio) / 100) | |
97 | 108 | payout | |
98 | 109 | } | |
99 | 110 | ||
100 | 111 | ||
101 | 112 | func calculateNewRating (r_player,r_average,k,actualScore) = { | |
102 | 113 | let ratin_factor = ((r_player * scale) / r_max) | |
103 | 114 | if ((actualScore == 1)) | |
104 | 115 | then { | |
105 | 116 | let adjustment = ((k * (100 - ratin_factor)) / scale) | |
106 | 117 | (r_player + adjustment) | |
107 | 118 | } | |
108 | 119 | else { | |
109 | 120 | let adjustment = ((-(k) * (20 + ratin_factor)) / scale) | |
110 | 121 | (r_player + adjustment) | |
111 | 122 | } | |
112 | 123 | } | |
113 | 124 | ||
114 | 125 | ||
115 | 126 | @Callable(i) | |
116 | 127 | func adjustRatingsAndPayoutParticipants (itemId,addressList,lastCallerAddress,finalPrediction) = { | |
117 | 128 | let caller = toString(i.caller) | |
118 | 129 | if ((caller != toString(this))) | |
119 | 130 | then throw("You are not allowed to call this function") | |
120 | 131 | else { | |
121 | 132 | func updateRatingsFunc (accum,address) = { | |
122 | 133 | let rating = searchForRating(address) | |
123 | 134 | let prediction = searchForAddressPrediction(itemId, address) | |
124 | 135 | let actualScore = if ((prediction == finalPrediction)) | |
125 | 136 | then 1 | |
126 | 137 | else 0 | |
127 | 138 | let newRating = calculateNewRating(rating, r_max, rateAdjustment, actualScore) | |
128 | 139 | let payout = if ((prediction == finalPrediction)) | |
129 | 140 | then true | |
130 | 141 | else false | |
131 | 142 | let updatedEntries = (accum :+ IntegerEntry((address + "_rating"), newRating)) | |
132 | 143 | let calculatedAmount = calculatePayout(newRating, r_max) | |
133 | 144 | if (payout) | |
134 | 145 | then (updatedEntries :+ ScriptTransfer(Address(fromBase58String(address)), calculatedAmount, tokenId)) | |
135 | 146 | else updatedEntries | |
136 | 147 | } | |
137 | 148 | ||
138 | 149 | let updatedRatings = { | |
139 | 150 | let $l = addressList | |
140 | 151 | let $s = size($l) | |
141 | 152 | let $acc0 = nil | |
142 | 153 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
143 | 154 | then $a | |
144 | 155 | else updateRatingsFunc($a, $l[$i]) | |
145 | 156 | ||
146 | 157 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
147 | 158 | then $a | |
148 | 159 | else throw("List size exceeds 5") | |
149 | 160 | ||
150 | 161 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
151 | 162 | } | |
152 | 163 | (updatedRatings :+ BooleanEntry((itemId + "_adjusted"), true)) | |
153 | 164 | } | |
154 | 165 | } | |
155 | 166 | ||
156 | 167 | ||
157 | 168 | ||
158 | 169 | @Callable(i) | |
159 | 170 | func savePrediction (itemId,prediction) = { | |
160 | 171 | let clientAdress = toString(i.caller) | |
161 | 172 | let searchForUser = match getInteger((clientAdress + "_rating")) { | |
162 | 173 | case s: Int => | |
163 | 174 | s | |
164 | 175 | case _ => | |
165 | 176 | "User does not exist" | |
166 | 177 | } | |
167 | 178 | if ((searchForUser == "User does not exist")) | |
168 | 179 | then throw("User does not exist") | |
169 | 180 | else { | |
170 | 181 | let isFinal = match getBoolean((itemId + "_final")) { | |
171 | 182 | case s: Boolean => | |
172 | 183 | s | |
173 | 184 | case _ => | |
174 | 185 | false | |
175 | 186 | } | |
176 | 187 | if (isFinal) | |
177 | 188 | then throw("Final prediction already made") | |
178 | 189 | else { | |
179 | 190 | let isCanceled = match getBoolean((itemId + "_cancelled")) { | |
180 | 191 | case s: Boolean => | |
181 | 192 | s | |
182 | 193 | case _ => | |
183 | 194 | false | |
184 | 195 | } | |
185 | 196 | if (isCanceled) | |
186 | 197 | then throw("Final prediction already made") | |
187 | 198 | else { | |
188 | 199 | let clientRating = searchForRating(clientAdress) | |
189 | 200 | if ((ratingCutoff >= clientRating)) | |
190 | 201 | then throw("You are not allowed to participate anymore") | |
191 | 202 | else { | |
192 | 203 | let searchForCounter = match getInteger((itemId + "_counter")) { | |
193 | 204 | case s: Int => | |
194 | 205 | s | |
195 | 206 | case _ => | |
196 | 207 | -1 | |
197 | 208 | } | |
198 | 209 | if ((searchForCounter >= 1)) | |
199 | 210 | then { | |
200 | 211 | let adressList = findPredictionAdresses(itemId, searchForCounter) | |
201 | 212 | if (containsElement(adressList, clientAdress)) | |
202 | 213 | then throw("This User already gave a Prediction") | |
203 | 214 | else { | |
204 | - | let predictionCounter = match getInteger((itemId + "_ | |
215 | + | let predictionCounter = match getInteger(((itemId + "_prediction_") + prediction)) { | |
205 | 216 | case s: Int => | |
206 | 217 | s | |
207 | 218 | case _ => | |
208 | - | -1 | |
209 | - | } | |
210 | - | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
211 | - | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
212 | - | case s: String => | |
213 | - | s | |
214 | - | case _ => | |
215 | - | "no Prediction Found" | |
219 | + | 404 | |
216 | 220 | } | |
217 | 221 | let newCounter = (searchForCounter + 1) | |
218 | - | if (( | |
222 | + | if ((predictionCounter != 404)) | |
219 | 223 | then if (((predictionCounter + 1) == predictionMaxCounter)) | |
220 | 224 | then { | |
221 | 225 | let newRating = calculateNewRating(clientRating, r_max, rateAdjustment, 1) | |
222 | 226 | let calculatedAmount = calculatePayout(newRating, r_max) | |
223 | 227 | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
224 | 228 | if ((invokeAdjustRating != invokeAdjustRating)) | |
225 | 229 | then throw("Strict value is not equal to itself.") | |
226 | - | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter | |
230 | + | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry(((itemId + "_prediction_") + prediction), (predictionCounter + 1)), IntegerEntry((itemId + "_counter"), newCounter), BooleanEntry((itemId + "_final"), true), BooleanEntry((itemId + "_cancelled"), false), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId), ScriptTransfer(Address(fromBase58String(clientAdress)), calculatedAmount, tokenId), IntegerEntry((clientAdress + "_rating"), newRating), StringEntry((itemId + "_final_prediction"), prediction)] | |
227 | 231 | } | |
228 | - | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), (predictionCounter + 1)), BooleanEntry((itemId + "_final"), false), BooleanEntry((itemId + "_cancelled"), false)] | |
229 | - | else if ((newCounter >= maxCounter)) | |
230 | - | then [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), (predictionCounter - 1)), BooleanEntry((itemId + "_cancelled"), true), BooleanEntry((itemId + "_final"), false), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId)] | |
231 | - | else if (((predictionCounter - 1) == 0)) | |
232 | - | then [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), 1), BooleanEntry((itemId + "_cancelled"), false), BooleanEntry((itemId + "_final"), false)] | |
233 | - | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), (predictionCounter - 1)), BooleanEntry((itemId + "_cancelled"), false), BooleanEntry((itemId + "_final"), false)] | |
232 | + | else if ((newCounter >= maxCounter)) | |
233 | + | then [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), BooleanEntry((itemId + "_cancelled"), true), BooleanEntry((itemId + "_final"), false), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId)] | |
234 | + | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry(((itemId + "_prediction_") + prediction), (predictionCounter + 1)), IntegerEntry((itemId + "_counter"), newCounter), BooleanEntry((itemId + "_final"), false), BooleanEntry((itemId + "_cancelled"), false)] | |
235 | + | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry(((itemId + "_prediction_") + prediction), 1), IntegerEntry((itemId + "_counter"), newCounter), BooleanEntry((itemId + "_cancelled"), false), BooleanEntry((itemId + "_final"), false)] | |
234 | 236 | } | |
235 | 237 | } | |
236 | 238 | else { | |
237 | 239 | let searchForNewItem = match getString(("new_" + itemId)) { | |
238 | 240 | case s: String => | |
239 | 241 | s | |
240 | 242 | case _ => | |
241 | 243 | "Item not Found" | |
242 | 244 | } | |
243 | 245 | if ((searchForNewItem == "Item not Found")) | |
244 | 246 | then throw("Item not found") | |
245 | 247 | else [StringEntry(((itemId + "_") + toString(1)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), 1), IntegerEntry((itemId + "_predictionCounter"), 1), DeleteEntry(("new_" + itemId)), StringEntry(("updated_" + itemId), itemId)] | |
246 | 248 | } | |
247 | 249 | } | |
248 | 250 | } | |
249 | 251 | } | |
250 | 252 | } | |
251 | 253 | } | |
252 | 254 | ||
253 | 255 | ||
254 | 256 | ||
255 | 257 | @Callable(i) | |
256 | 258 | func registerUser () = { | |
257 | 259 | let clientAdress = toString(i.caller) | |
258 | 260 | let searchForUser = match getInteger((clientAdress + "_rating")) { | |
259 | 261 | case s: Int => | |
260 | 262 | s | |
261 | 263 | case _ => | |
262 | 264 | -1 | |
263 | 265 | } | |
264 | 266 | if ((searchForUser != -1)) | |
265 | 267 | then throw("User already exists") | |
266 | 268 | else [IntegerEntry((clientAdress + "_rating"), defaultRating)] | |
267 | 269 | } | |
268 | 270 | ||
269 | 271 | ||
270 | 272 | @Verifier(tx) | |
271 | 273 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
272 | 274 |
github/deemru/w8io/169f3d6 51.84 ms ◑