tx · 2w1WzjfYvBQKPaA4aiVcPiXmmzSLJXxVBGJzZ73R7gMX 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos: -0.01400000 Waves 2024.05.28 10:58 [3125562] smart account 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos > SELF 0.00000000 Waves
{ "type": 13, "id": "2w1WzjfYvBQKPaA4aiVcPiXmmzSLJXxVBGJzZ73R7gMX", "fee": 1400000, "feeAssetId": null, "timestamp": 1716883149515, "version": 2, "chainId": 84, "sender": "3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos", "senderPublicKey": "F7SLwr7RYVQpyocmVScFC6ooaAwewaGq6wNRDYvyiPj1", "proofs": [ "fGqorMbY6Pt4WyHui2hNWp6h22huMF93tkL7AmY4WhYyaQydep1GGw99THv4UHZBMWXnY998y4xVUpwZvT6JL2b" ], "script": "base64:AAIFAAAAAAAAABIIAhIGCgQIGAgIEgQKAggIEgAAAAALAAAAABRwcmVkaWN0aW9uTWF4Q291bnRlcgAAAAAAAAAAAwAAAAAKbWF4Q291bnRlcgAAAAAAAAAABgAAAAANZGVmYXVsdFJhdGluZwAAAAAAAAAAZAAAAAAOcmF0ZUFkanVzdG1lbnQAAAAAAAAAABQAAAAAB3Rva2VuSWQBAAAAIG33eiemmz/8i1OVqeOeBVscIi9bTehRMFsBoQapAMYYAAAAAAxwYXlvdXRBbW91bnQAAAAAAAX14QAAAAAADHJhdGluZ0N1dG9mZgAAAAAAAAAAMgEAAAARc2VhcmNoRm9yQ291bnRlcnMAAAACAAAABml0ZW1JZAAAAAdjb3VudGVyBAAAABFzZWFyY2hGb3JDb3VudGVycwQAAAAHJG1hdGNoMAkABCIAAAABCQABLAAAAAIJAAEsAAAAAgUAAAAGaXRlbUlkAgAAAAFfCQABpAAAAAEFAAAAB2NvdW50ZXIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwIAAAAHTm8gVXNlc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AAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAP//////////AwkBAAAAAiE9AAAAAgUAAAANc2VhcmNoRm9yVXNlcgD//////////wkAAAIAAAABAgAAABNVc2VyIGFscmVhZHkgZXhpc3RzCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAxjbGllbnRBZHJlc3MFAAAADWRlZmF1bHRSYXRpbmcFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5aMLLeQ==", "height": 3125562, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AuWQBNTbpHNsfeXZ7JdsNzTq2TmW9ZgJqbocuevNvLpc Next: BDRX4mrSt3PxsErP5H53fr5RVRuf4BgedeTSKmQWHhA Diff:
Old | New | Differences | |
---|---|---|---|
130 | 130 | case s: Int => | |
131 | 131 | s | |
132 | 132 | case _ => | |
133 | - | " | |
133 | + | throw("User does not exist") | |
134 | 134 | } | |
135 | - | let | |
136 | - | | |
137 | - | | |
138 | - | | |
139 | - | | |
140 | - | | |
141 | - | | |
142 | - | | |
143 | - | | |
144 | - | ||
145 | - | | |
146 | - | | |
147 | - | | |
148 | - | | |
149 | - | | |
150 | - | ||
151 | - | ||
152 | - | ||
153 | - | ||
154 | - | | |
155 | - | | |
156 | - | | |
157 | - | ||
158 | - | | |
159 | - | | |
160 | - | | |
161 | - | | |
162 | - | | |
163 | - | | |
164 | - | | |
165 | - | | |
166 | - | | |
167 | - | | |
168 | - | | |
169 | - | | |
170 | - | | |
171 | - | | |
172 | - | | |
173 | - | | |
135 | + | let isFinal = match getBoolean((itemId + "_final")) { | |
136 | + | case s: Boolean => | |
137 | + | s | |
138 | + | case _ => | |
139 | + | false | |
140 | + | } | |
141 | + | if (isFinal) | |
142 | + | then throw("Final prediction already made") | |
143 | + | else { | |
144 | + | let isCanceled = match getBoolean((itemId + "_cancelled")) { | |
145 | + | case s: Boolean => | |
146 | + | s | |
147 | + | case _ => | |
148 | + | false | |
149 | + | } | |
150 | + | if (isCanceled) | |
151 | + | then throw("Final prediction already made") | |
152 | + | else { | |
153 | + | let clientRating = searchForRating(clientAdress) | |
154 | + | if ((ratingCutoff >= clientRating)) | |
155 | + | then throw("You are not allowed to participate anymore") | |
156 | + | else { | |
157 | + | let searchForCounter = match getInteger((itemId + "_counter")) { | |
158 | + | case s: Int => | |
159 | + | s | |
160 | + | case _ => | |
161 | + | -1 | |
162 | + | } | |
163 | + | if ((searchForCounter >= 1)) | |
164 | + | then { | |
165 | + | let adressList = findPredictionAdresses(itemId, searchForCounter) | |
166 | + | if (containsElement(adressList, clientAdress)) | |
167 | + | then throw("This User already gave a Prediction") | |
168 | + | else { | |
169 | + | let predictionCounter = match getInteger((itemId + "_predictionCounter")) { | |
170 | + | case s: Int => | |
171 | + | s | |
172 | + | case _ => | |
173 | + | -1 | |
174 | 174 | } | |
175 | - | 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)] | |
176 | - | else if ((newCounter >= maxCounter)) | |
177 | - | 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)] | |
178 | - | else if (((predictionCounter - 1) == -1)) | |
179 | - | 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), StringEntry("test", lastPrediction), IntegerEntry("test2", size(adressList))] | |
180 | - | 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), StringEntry("test", lastPrediction), IntegerEntry("test2", size(adressList))] | |
181 | - | } | |
182 | - | } | |
183 | - | else { | |
184 | - | let searchForNewItem = match getString(("new_" + itemId)) { | |
185 | - | case s: String => | |
186 | - | s | |
187 | - | case _ => | |
188 | - | "not Found" | |
189 | - | } | |
190 | - | if ((searchForNewItem != itemId)) | |
191 | - | then throw("Item not Found") | |
192 | - | 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)] | |
193 | - | } | |
194 | - | } | |
175 | + | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
176 | + | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
177 | + | case s: String => | |
178 | + | s | |
179 | + | case _ => | |
180 | + | "no Prediction Found" | |
181 | + | } | |
182 | + | let newCounter = (searchForCounter + 1) | |
183 | + | if ((lastPrediction == prediction)) | |
184 | + | then if (((predictionCounter + 1) == predictionMaxCounter)) | |
185 | + | then { | |
186 | + | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
187 | + | if ((invokeAdjustRating != invokeAdjustRating)) | |
188 | + | then throw("Strict value is not equal to itself.") | |
189 | + | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), (predictionCounter + 1)), BooleanEntry((itemId + "_final"), true), BooleanEntry((itemId + "_cancelled"), false), ScriptTransfer(Address(fromBase58String(clientAdress)), payoutAmount, tokenId), IntegerEntry(clientAdress, (clientRating + 20))] | |
190 | + | } | |
191 | + | 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)] | |
192 | + | else if ((newCounter >= maxCounter)) | |
193 | + | 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)] | |
194 | + | else if (((predictionCounter - 1) == -1)) | |
195 | + | 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), StringEntry("test", lastPrediction), IntegerEntry("test2", size(adressList))] | |
196 | + | 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), StringEntry("test", lastPrediction), IntegerEntry("test2", size(adressList))] | |
197 | + | } | |
198 | + | } | |
199 | + | else { | |
200 | + | let searchForNewItem = match getString(("new_" + itemId)) { | |
201 | + | case s: String => | |
202 | + | s | |
203 | + | case _ => | |
204 | + | throw("Item not Found") | |
205 | + | } | |
206 | + | [StringEntry(((itemId + "_") + toString(1)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), 1), IntegerEntry((itemId + "_predictionCounter"), 1), DeleteEntry(("new_" + itemId)), StringEntry(("updated_" + itemId), itemId)] | |
207 | + | } | |
208 | + | } | |
209 | + | } | |
210 | + | } | |
195 | 211 | } | |
196 | 212 | ||
197 | 213 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
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 = 100000000 | |
15 | 15 | ||
16 | 16 | let ratingCutoff = 50 | |
17 | 17 | ||
18 | 18 | func searchForCounters (itemId,counter) = { | |
19 | 19 | let searchForCounters = match getString(((itemId + "_") + toString(counter))) { | |
20 | 20 | case s: String => | |
21 | 21 | s | |
22 | 22 | case _ => | |
23 | 23 | "No User" | |
24 | 24 | } | |
25 | 25 | searchForCounters | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func searchForRating (address) = { | |
30 | 30 | let rating = match getInteger(address) { | |
31 | 31 | case r: Int => | |
32 | 32 | r | |
33 | 33 | case _ => | |
34 | 34 | defaultRating | |
35 | 35 | } | |
36 | 36 | rating | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func searchForAddressPrediction (itemId,adress) = { | |
41 | 41 | let searchForPrediction = match getString(((itemId + "_") + adress)) { | |
42 | 42 | case s: String => | |
43 | 43 | s | |
44 | 44 | case _ => | |
45 | 45 | "Not Found" | |
46 | 46 | } | |
47 | 47 | searchForPrediction | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func findPredictionAdresses (itemId,counter) = { | |
52 | 52 | let adressList = if ((counter >= 5)) | |
53 | 53 | then { | |
54 | 54 | let adress1 = searchForCounters(itemId, 1) | |
55 | 55 | let adress2 = searchForCounters(itemId, 2) | |
56 | 56 | let adress3 = searchForCounters(itemId, 3) | |
57 | 57 | let adress4 = searchForCounters(itemId, 4) | |
58 | 58 | let adress5 = searchForCounters(itemId, 5) | |
59 | 59 | (((((nil :+ adress1) :+ adress2) :+ adress3) :+ adress4) :+ adress5) | |
60 | 60 | } | |
61 | 61 | else if ((counter >= 4)) | |
62 | 62 | then { | |
63 | 63 | let adress1 = searchForCounters(itemId, 1) | |
64 | 64 | let adress2 = searchForCounters(itemId, 2) | |
65 | 65 | let adress3 = searchForCounters(itemId, 3) | |
66 | 66 | let adress4 = searchForCounters(itemId, 4) | |
67 | 67 | ((((nil :+ adress1) :+ adress2) :+ adress3) :+ adress4) | |
68 | 68 | } | |
69 | 69 | else if ((counter >= 3)) | |
70 | 70 | then { | |
71 | 71 | let adress1 = searchForCounters(itemId, 1) | |
72 | 72 | let adress2 = searchForCounters(itemId, 2) | |
73 | 73 | let adress3 = searchForCounters(itemId, 3) | |
74 | 74 | (((nil :+ adress1) :+ adress2) :+ adress3) | |
75 | 75 | } | |
76 | 76 | else if ((counter >= 2)) | |
77 | 77 | then { | |
78 | 78 | let adress1 = searchForCounters(itemId, 1) | |
79 | 79 | let adress2 = searchForCounters(itemId, 2) | |
80 | 80 | ((nil :+ adress1) :+ adress2) | |
81 | 81 | } | |
82 | 82 | else { | |
83 | 83 | let adress1 = searchForCounters(itemId, 1) | |
84 | 84 | (nil :+ adress1) | |
85 | 85 | } | |
86 | 86 | adressList | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(i) | |
91 | 91 | func adjustRatingsAndPayoutParticipants (itemId,addressList,lastCallerAddress,finalPrediction) = { | |
92 | 92 | func updateRatingsFunc (accum,address) = { | |
93 | 93 | let rating = searchForRating(address) | |
94 | 94 | let prediction = searchForAddressPrediction(itemId, address) | |
95 | 95 | let updatedRating = if ((prediction == finalPrediction)) | |
96 | 96 | then (rating + rateAdjustment) | |
97 | 97 | else (rating - rateAdjustment) | |
98 | 98 | let payout = if ((prediction == finalPrediction)) | |
99 | 99 | then payoutAmount | |
100 | 100 | else 0 | |
101 | 101 | let updatedEntries = (accum :+ IntegerEntry(address, updatedRating)) | |
102 | 102 | if ((payout > 0)) | |
103 | 103 | then (updatedEntries :+ ScriptTransfer(Address(fromBase58String(address)), payout, tokenId)) | |
104 | 104 | else updatedEntries | |
105 | 105 | } | |
106 | 106 | ||
107 | 107 | let updatedRatings = { | |
108 | 108 | let $l = addressList | |
109 | 109 | let $s = size($l) | |
110 | 110 | let $acc0 = nil | |
111 | 111 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
112 | 112 | then $a | |
113 | 113 | else updateRatingsFunc($a, $l[$i]) | |
114 | 114 | ||
115 | 115 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
116 | 116 | then $a | |
117 | 117 | else throw("List size exceeds 5") | |
118 | 118 | ||
119 | 119 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
120 | 120 | } | |
121 | 121 | (updatedRatings :+ BooleanEntry((itemId + "_adjusted"), true)) | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | ||
126 | 126 | @Callable(i) | |
127 | 127 | func savePrediction (itemId,prediction) = { | |
128 | 128 | let clientAdress = toString(i.caller) | |
129 | 129 | let searchForUser = match getInteger(clientAdress) { | |
130 | 130 | case s: Int => | |
131 | 131 | s | |
132 | 132 | case _ => | |
133 | - | " | |
133 | + | throw("User does not exist") | |
134 | 134 | } | |
135 | - | let | |
136 | - | | |
137 | - | | |
138 | - | | |
139 | - | | |
140 | - | | |
141 | - | | |
142 | - | | |
143 | - | | |
144 | - | ||
145 | - | | |
146 | - | | |
147 | - | | |
148 | - | | |
149 | - | | |
150 | - | ||
151 | - | ||
152 | - | ||
153 | - | ||
154 | - | | |
155 | - | | |
156 | - | | |
157 | - | ||
158 | - | | |
159 | - | | |
160 | - | | |
161 | - | | |
162 | - | | |
163 | - | | |
164 | - | | |
165 | - | | |
166 | - | | |
167 | - | | |
168 | - | | |
169 | - | | |
170 | - | | |
171 | - | | |
172 | - | | |
173 | - | | |
135 | + | let isFinal = match getBoolean((itemId + "_final")) { | |
136 | + | case s: Boolean => | |
137 | + | s | |
138 | + | case _ => | |
139 | + | false | |
140 | + | } | |
141 | + | if (isFinal) | |
142 | + | then throw("Final prediction already made") | |
143 | + | else { | |
144 | + | let isCanceled = match getBoolean((itemId + "_cancelled")) { | |
145 | + | case s: Boolean => | |
146 | + | s | |
147 | + | case _ => | |
148 | + | false | |
149 | + | } | |
150 | + | if (isCanceled) | |
151 | + | then throw("Final prediction already made") | |
152 | + | else { | |
153 | + | let clientRating = searchForRating(clientAdress) | |
154 | + | if ((ratingCutoff >= clientRating)) | |
155 | + | then throw("You are not allowed to participate anymore") | |
156 | + | else { | |
157 | + | let searchForCounter = match getInteger((itemId + "_counter")) { | |
158 | + | case s: Int => | |
159 | + | s | |
160 | + | case _ => | |
161 | + | -1 | |
162 | + | } | |
163 | + | if ((searchForCounter >= 1)) | |
164 | + | then { | |
165 | + | let adressList = findPredictionAdresses(itemId, searchForCounter) | |
166 | + | if (containsElement(adressList, clientAdress)) | |
167 | + | then throw("This User already gave a Prediction") | |
168 | + | else { | |
169 | + | let predictionCounter = match getInteger((itemId + "_predictionCounter")) { | |
170 | + | case s: Int => | |
171 | + | s | |
172 | + | case _ => | |
173 | + | -1 | |
174 | 174 | } | |
175 | - | 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)] | |
176 | - | else if ((newCounter >= maxCounter)) | |
177 | - | 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)] | |
178 | - | else if (((predictionCounter - 1) == -1)) | |
179 | - | 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), StringEntry("test", lastPrediction), IntegerEntry("test2", size(adressList))] | |
180 | - | 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), StringEntry("test", lastPrediction), IntegerEntry("test2", size(adressList))] | |
181 | - | } | |
182 | - | } | |
183 | - | else { | |
184 | - | let searchForNewItem = match getString(("new_" + itemId)) { | |
185 | - | case s: String => | |
186 | - | s | |
187 | - | case _ => | |
188 | - | "not Found" | |
189 | - | } | |
190 | - | if ((searchForNewItem != itemId)) | |
191 | - | then throw("Item not Found") | |
192 | - | 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)] | |
193 | - | } | |
194 | - | } | |
175 | + | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
176 | + | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
177 | + | case s: String => | |
178 | + | s | |
179 | + | case _ => | |
180 | + | "no Prediction Found" | |
181 | + | } | |
182 | + | let newCounter = (searchForCounter + 1) | |
183 | + | if ((lastPrediction == prediction)) | |
184 | + | then if (((predictionCounter + 1) == predictionMaxCounter)) | |
185 | + | then { | |
186 | + | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
187 | + | if ((invokeAdjustRating != invokeAdjustRating)) | |
188 | + | then throw("Strict value is not equal to itself.") | |
189 | + | else [StringEntry(((itemId + "_") + toString(newCounter)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), newCounter), IntegerEntry((itemId + "_predictionCounter"), (predictionCounter + 1)), BooleanEntry((itemId + "_final"), true), BooleanEntry((itemId + "_cancelled"), false), ScriptTransfer(Address(fromBase58String(clientAdress)), payoutAmount, tokenId), IntegerEntry(clientAdress, (clientRating + 20))] | |
190 | + | } | |
191 | + | 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)] | |
192 | + | else if ((newCounter >= maxCounter)) | |
193 | + | 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)] | |
194 | + | else if (((predictionCounter - 1) == -1)) | |
195 | + | 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), StringEntry("test", lastPrediction), IntegerEntry("test2", size(adressList))] | |
196 | + | 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), StringEntry("test", lastPrediction), IntegerEntry("test2", size(adressList))] | |
197 | + | } | |
198 | + | } | |
199 | + | else { | |
200 | + | let searchForNewItem = match getString(("new_" + itemId)) { | |
201 | + | case s: String => | |
202 | + | s | |
203 | + | case _ => | |
204 | + | throw("Item not Found") | |
205 | + | } | |
206 | + | [StringEntry(((itemId + "_") + toString(1)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), 1), IntegerEntry((itemId + "_predictionCounter"), 1), DeleteEntry(("new_" + itemId)), StringEntry(("updated_" + itemId), itemId)] | |
207 | + | } | |
208 | + | } | |
209 | + | } | |
210 | + | } | |
195 | 211 | } | |
196 | 212 | ||
197 | 213 | ||
198 | 214 | ||
199 | 215 | @Callable(i) | |
200 | 216 | func registerUser () = { | |
201 | 217 | let clientAdress = toString(i.caller) | |
202 | 218 | let searchForUser = match getInteger(clientAdress) { | |
203 | 219 | case s: Int => | |
204 | 220 | s | |
205 | 221 | case _ => | |
206 | 222 | -1 | |
207 | 223 | } | |
208 | 224 | if ((searchForUser != -1)) | |
209 | 225 | then throw("User already exists") | |
210 | 226 | else [IntegerEntry(clientAdress, defaultRating)] | |
211 | 227 | } | |
212 | 228 | ||
213 | 229 | ||
214 | 230 | @Verifier(tx) | |
215 | 231 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
216 | 232 |
github/deemru/w8io/026f985 74.83 ms ◑