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