tx · BDRX4mrSt3PxsErP5H53fr5RVRuf4BgedeTSKmQWHhA 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos: -0.01400000 Waves 2024.05.28 11:05 [3125567] smart account 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos > SELF 0.00000000 Waves
{ "type": 13, "id": "BDRX4mrSt3PxsErP5H53fr5RVRuf4BgedeTSKmQWHhA", "fee": 1400000, "feeAssetId": null, "timestamp": 1716883557687, "version": 2, "chainId": 84, "sender": "3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos", "senderPublicKey": "F7SLwr7RYVQpyocmVScFC6ooaAwewaGq6wNRDYvyiPj1", "proofs": [ "52Ao5JSBnj7WegPca3ACWhHHHDV7PvfNhQjZX2Hv2KzJnEWANzauFBHYhFsTiBhy3ofccej9ztuoyKYFjBKg9JpC" ], "script": "base64:AAIFAAAAAAAAABIIAhIGCgQIGAgIEgQKAggIEgAAAAALAAAAABRwcmVkaWN0aW9uTWF4Q291bnRlcgAAAAAAAAAAAwAAAAAKbWF4Q291bnRlcgAAAAAAAAAABgAAAAANZGVmYXVsdFJhdGluZwAAAAAAAAAAZAAAAAAOcmF0ZUFkanVzdG1lbnQAAAAAAAAAABQAAAAAB3Rva2VuSWQBAAAAIG33eiemmz/8i1OVqeOeBVscIi9bTehRMFsBoQapAMYYAAAAAAxwYXlvdXRBbW91bnQAAAAAAAX14QAAAAAADHJhdGluZ0N1dG9mZgAAAAAAAAAAMgEAAAARc2VhcmNoRm9yQ291bnRlcnMAAAACAAAABml0ZW1JZAAAAAdjb3VudGVyBAAAABFzZWFyY2hGb3JDb3VudGVycwQAAAAHJG1hdGNoMAkABCIAAAABCQABLAAAAAIJAAEsAAAAAgUAAAAGaXRlbUlkAgAAAAFfCQABpAAAAAEFAAAAB2NvdW50ZXIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwIAAAAHTm8gVXNlcgUA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sAAAAAWkBAAAADHJlZ2lzdGVyVXNlcgAAAAAEAAAADGNsaWVudEFkcmVzcwkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIEAAAADXNlYXJjaEZvclVzZXIEAAAAByRtYXRjaDAJAAQfAAAAAQUAAAAMY2xpZW50QWRyZXNzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMA//////////8DCQEAAAACIT0AAAACBQAAAA1zZWFyY2hGb3JVc2VyAP//////////CQAAAgAAAAECAAAAE1VzZXIgYWxyZWFkeSBleGlzdHMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAADGNsaWVudEFkcmVzcwUAAAANZGVmYXVsdFJhdGluZwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlYUatZ", "height": 3125567, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2w1WzjfYvBQKPaA4aiVcPiXmmzSLJXxVBGJzZ73R7gMX Next: BYDqHfWL2ZtbyAjDWSeji468h9XirGuDAtq2tgmKZBw2 Diff:
Old | New | Differences | |
---|---|---|---|
130 | 130 | case s: Int => | |
131 | 131 | s | |
132 | 132 | case _ => | |
133 | - | | |
133 | + | "User does not exist" | |
134 | 134 | } | |
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") | |
135 | + | if ((searchForUser == "User does not exist")) | |
136 | + | then throw("User does not exist") | |
143 | 137 | else { | |
144 | - | let | |
138 | + | let isFinal = match getBoolean((itemId + "_final")) { | |
145 | 139 | case s: Boolean => | |
146 | 140 | s | |
147 | 141 | case _ => | |
148 | 142 | false | |
149 | 143 | } | |
150 | - | if ( | |
144 | + | if (isFinal) | |
151 | 145 | then throw("Final prediction already made") | |
152 | 146 | else { | |
153 | - | let clientRating = searchForRating(clientAdress) | |
154 | - | if ((ratingCutoff >= clientRating)) | |
155 | - | then throw("You are not allowed to participate anymore") | |
147 | + | let isCanceled = match getBoolean((itemId + "_cancelled")) { | |
148 | + | case s: Boolean => | |
149 | + | s | |
150 | + | case _ => | |
151 | + | false | |
152 | + | } | |
153 | + | if (isCanceled) | |
154 | + | then throw("Final prediction already made") | |
156 | 155 | 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") | |
156 | + | let clientRating = searchForRating(clientAdress) | |
157 | + | if ((ratingCutoff >= clientRating)) | |
158 | + | then throw("You are not allowed to participate anymore") | |
159 | + | else { | |
160 | + | let searchForCounter = match getInteger((itemId + "_counter")) { | |
161 | + | case s: Int => | |
162 | + | s | |
163 | + | case _ => | |
164 | + | -1 | |
165 | + | } | |
166 | + | if ((searchForCounter >= 1)) | |
167 | + | then { | |
168 | + | let adressList = findPredictionAdresses(itemId, searchForCounter) | |
169 | + | if (containsElement(adressList, clientAdress)) | |
170 | + | then throw("This User already gave a Prediction") | |
171 | + | else { | |
172 | + | let predictionCounter = match getInteger((itemId + "_predictionCounter")) { | |
173 | + | case s: Int => | |
174 | + | s | |
175 | + | case _ => | |
176 | + | -1 | |
177 | + | } | |
178 | + | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
179 | + | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
180 | + | case s: String => | |
181 | + | s | |
182 | + | case _ => | |
183 | + | "no Prediction Found" | |
184 | + | } | |
185 | + | let newCounter = (searchForCounter + 1) | |
186 | + | if ((lastPrediction == prediction)) | |
187 | + | then if (((predictionCounter + 1) == predictionMaxCounter)) | |
188 | + | then { | |
189 | + | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
190 | + | if ((invokeAdjustRating != invokeAdjustRating)) | |
191 | + | then throw("Strict value is not equal to itself.") | |
192 | + | 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))] | |
193 | + | } | |
194 | + | 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)] | |
195 | + | else if ((newCounter >= maxCounter)) | |
196 | + | 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)] | |
197 | + | else if (((predictionCounter - 1) == -1)) | |
198 | + | 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))] | |
199 | + | 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))] | |
200 | + | } | |
201 | + | } | |
168 | 202 | else { | |
169 | - | let predictionCounter = match getInteger((itemId + "_predictionCounter")) { | |
170 | - | case s: Int => | |
171 | - | s | |
172 | - | case _ => | |
173 | - | -1 | |
174 | - | } | |
175 | - | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
176 | - | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
203 | + | let searchForNewItem = match getString(("new_" + itemId)) { | |
177 | 204 | case s: String => | |
178 | 205 | s | |
179 | 206 | case _ => | |
180 | - | " | |
207 | + | "Item not Found" | |
181 | 208 | } | |
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))] | |
209 | + | if ((searchForNewItem == "Item not Found")) | |
210 | + | then throw("Item not found") | |
211 | + | 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)] | |
197 | 212 | } | |
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 | 213 | } | |
208 | 214 | } | |
209 | 215 | } |
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 | + | "User does not exist" | |
134 | 134 | } | |
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") | |
135 | + | if ((searchForUser == "User does not exist")) | |
136 | + | then throw("User does not exist") | |
143 | 137 | else { | |
144 | - | let | |
138 | + | let isFinal = match getBoolean((itemId + "_final")) { | |
145 | 139 | case s: Boolean => | |
146 | 140 | s | |
147 | 141 | case _ => | |
148 | 142 | false | |
149 | 143 | } | |
150 | - | if ( | |
144 | + | if (isFinal) | |
151 | 145 | then throw("Final prediction already made") | |
152 | 146 | else { | |
153 | - | let clientRating = searchForRating(clientAdress) | |
154 | - | if ((ratingCutoff >= clientRating)) | |
155 | - | then throw("You are not allowed to participate anymore") | |
147 | + | let isCanceled = match getBoolean((itemId + "_cancelled")) { | |
148 | + | case s: Boolean => | |
149 | + | s | |
150 | + | case _ => | |
151 | + | false | |
152 | + | } | |
153 | + | if (isCanceled) | |
154 | + | then throw("Final prediction already made") | |
156 | 155 | 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") | |
156 | + | let clientRating = searchForRating(clientAdress) | |
157 | + | if ((ratingCutoff >= clientRating)) | |
158 | + | then throw("You are not allowed to participate anymore") | |
159 | + | else { | |
160 | + | let searchForCounter = match getInteger((itemId + "_counter")) { | |
161 | + | case s: Int => | |
162 | + | s | |
163 | + | case _ => | |
164 | + | -1 | |
165 | + | } | |
166 | + | if ((searchForCounter >= 1)) | |
167 | + | then { | |
168 | + | let adressList = findPredictionAdresses(itemId, searchForCounter) | |
169 | + | if (containsElement(adressList, clientAdress)) | |
170 | + | then throw("This User already gave a Prediction") | |
171 | + | else { | |
172 | + | let predictionCounter = match getInteger((itemId + "_predictionCounter")) { | |
173 | + | case s: Int => | |
174 | + | s | |
175 | + | case _ => | |
176 | + | -1 | |
177 | + | } | |
178 | + | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
179 | + | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
180 | + | case s: String => | |
181 | + | s | |
182 | + | case _ => | |
183 | + | "no Prediction Found" | |
184 | + | } | |
185 | + | let newCounter = (searchForCounter + 1) | |
186 | + | if ((lastPrediction == prediction)) | |
187 | + | then if (((predictionCounter + 1) == predictionMaxCounter)) | |
188 | + | then { | |
189 | + | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
190 | + | if ((invokeAdjustRating != invokeAdjustRating)) | |
191 | + | then throw("Strict value is not equal to itself.") | |
192 | + | 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))] | |
193 | + | } | |
194 | + | 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)] | |
195 | + | else if ((newCounter >= maxCounter)) | |
196 | + | 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)] | |
197 | + | else if (((predictionCounter - 1) == -1)) | |
198 | + | 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))] | |
199 | + | 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))] | |
200 | + | } | |
201 | + | } | |
168 | 202 | else { | |
169 | - | let predictionCounter = match getInteger((itemId + "_predictionCounter")) { | |
170 | - | case s: Int => | |
171 | - | s | |
172 | - | case _ => | |
173 | - | -1 | |
174 | - | } | |
175 | - | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
176 | - | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
203 | + | let searchForNewItem = match getString(("new_" + itemId)) { | |
177 | 204 | case s: String => | |
178 | 205 | s | |
179 | 206 | case _ => | |
180 | - | " | |
207 | + | "Item not Found" | |
181 | 208 | } | |
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))] | |
209 | + | if ((searchForNewItem == "Item not Found")) | |
210 | + | then throw("Item not found") | |
211 | + | 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)] | |
197 | 212 | } | |
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 | 213 | } | |
208 | 214 | } | |
209 | 215 | } | |
210 | 216 | } | |
211 | 217 | } | |
212 | 218 | ||
213 | 219 | ||
214 | 220 | ||
215 | 221 | @Callable(i) | |
216 | 222 | func registerUser () = { | |
217 | 223 | let clientAdress = toString(i.caller) | |
218 | 224 | let searchForUser = match getInteger(clientAdress) { | |
219 | 225 | case s: Int => | |
220 | 226 | s | |
221 | 227 | case _ => | |
222 | 228 | -1 | |
223 | 229 | } | |
224 | 230 | if ((searchForUser != -1)) | |
225 | 231 | then throw("User already exists") | |
226 | 232 | else [IntegerEntry(clientAdress, defaultRating)] | |
227 | 233 | } | |
228 | 234 | ||
229 | 235 | ||
230 | 236 | @Verifier(tx) | |
231 | 237 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
232 | 238 |
github/deemru/w8io/026f985 36.55 ms ◑