tx · 8GKfovNdPx94daFZHUpSV8YKdY2AmNHq2XXKvpzkh1eo 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos: -0.01400000 Waves 2024.05.28 11:21 [3125582] smart account 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos > SELF 0.00000000 Waves
{ "type": 13, "id": "8GKfovNdPx94daFZHUpSV8YKdY2AmNHq2XXKvpzkh1eo", "fee": 1400000, "feeAssetId": null, "timestamp": 1716884580640, "version": 2, "chainId": 84, "sender": "3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos", "senderPublicKey": "F7SLwr7RYVQpyocmVScFC6ooaAwewaGq6wNRDYvyiPj1", "proofs": [ "5Kkj5FCKm7Ng5cDgQ9JuXQUSCdwTDnKASLnxyTDzp4e9mdCma1FPzEKJaLyHcLUZjXCfmCVe3bzVEQEgmFQJYk8X" ], "script": "base64:AAIFAAAAAAAAABIIAhIGCgQIGAgIEgQKAggIEgAAAAALAAAAABRwcmVkaWN0aW9uTWF4Q291bnRlcgAAAAAAAAAAAwAAAAAKbWF4Q291bnRlcgAAAAAAAAAABgAAAAANZGVmYXVsdFJhdGluZwAAAAAAAAAAZAAAAAAOcmF0ZUFkanVzdG1lbnQAAAAAAAAAABQAAAAAB3Rva2VuSWQBAAAAIG33eiemmz/8i1OVqeOeBVscIi9bTehRMFsBoQapAMYYAAAAAAxwYXlvdXRBbW91bnQAAAAAAAX14QAAAAAADHJhdGluZ0N1dG9mZgAAAAAAAAAAMgEAAAARc2VhcmNoRm9yQ291bnRlcnMAAAACAAAABml0ZW1JZAAAAAdjb3VudGVyBAAAABFzZWFyY2hGb3JDb3VudGVycwQAAAAHJG1hdGNoMAkABCIAAAABCQABLAAAAAIJAAEsAAAAAgUAAAAGaXRlbUlkAgAAAAFfCQABpAAAAAEFAAAAB2NvdW50ZXIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwIAAAAHTm8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ACCQABLAAAAAIFAAAABml0ZW1JZAIAAAASX3ByZWRpY3Rpb25Db3VudGVyAAAAAAAAAAABCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgIAAAAEbmV3XwUAAAAGaXRlbUlkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAIdXBkYXRlZF8FAAAABml0ZW1JZAUAAAAGaXRlbUlkBQAAAANuaWwAAAABaQEAAAAMcmVnaXN0ZXJVc2VyAAAAAAQAAAAMY2xpZW50QWRyZXNzCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgQAAAANc2VhcmNoRm9yVXNlcgQAAAAHJG1hdGNoMAkABB8AAAABBQAAAAxjbGllbnRBZHJlc3MDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwD//////////wMJAQAAAAIhPQAAAAIFAAAADXNlYXJjaEZvclVzZXIA//////////8JAAACAAAAAQIAAAATVXNlciBhbHJlYWR5IGV4aXN0cwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAMY2xpZW50QWRyZXNzBQAAAA1kZWZhdWx0UmF0aW5nBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleWTmS4I=", "height": 3125582, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DnyYzkkRAsvcMKwEZy6nZVgz3Xn53iy4wgbnr6HdpaXz Next: CG4LMwoRBTcQHvB95Nkr8qdzqZvHtDhShHnwfg2HLLwK Diff:
Old | New | Differences | |
---|---|---|---|
90 | 90 | @Callable(i) | |
91 | 91 | func adjustRatingsAndPayoutParticipants (itemId,addressList,lastCallerAddress,finalPrediction) = { | |
92 | 92 | let caller = toString(i.caller) | |
93 | - | func updateRatingsFunc (accum,address) = { | |
94 | - | let rating = searchForRating(address) | |
95 | - | let prediction = searchForAddressPrediction(itemId, address) | |
96 | - | let updatedRating = if ((prediction == finalPrediction)) | |
97 | - | then (rating + rateAdjustment) | |
98 | - | else (rating - rateAdjustment) | |
99 | - | let payout = if ((prediction == finalPrediction)) | |
100 | - | then payoutAmount | |
101 | - | else 0 | |
102 | - | let updatedEntries = (accum :+ IntegerEntry(address, updatedRating)) | |
103 | - | if ((payout > 0)) | |
104 | - | then (updatedEntries :+ ScriptTransfer(Address(fromBase58String(address)), payout, tokenId)) | |
105 | - | else updatedEntries | |
106 | - | } | |
93 | + | if ((caller != toString(this))) | |
94 | + | then throw("You are not allowed to call this function") | |
95 | + | else { | |
96 | + | func updateRatingsFunc (accum,address) = { | |
97 | + | let rating = searchForRating(address) | |
98 | + | let prediction = searchForAddressPrediction(itemId, address) | |
99 | + | let updatedRating = if ((prediction == finalPrediction)) | |
100 | + | then (rating + rateAdjustment) | |
101 | + | else (rating - rateAdjustment) | |
102 | + | let payout = if ((prediction == finalPrediction)) | |
103 | + | then payoutAmount | |
104 | + | else 0 | |
105 | + | let updatedEntries = (accum :+ IntegerEntry(address, updatedRating)) | |
106 | + | if ((payout > 0)) | |
107 | + | then (updatedEntries :+ ScriptTransfer(Address(fromBase58String(address)), payout, tokenId)) | |
108 | + | else updatedEntries | |
109 | + | } | |
107 | 110 | ||
108 | - | let updatedRatings = { | |
109 | - | let $l = addressList | |
110 | - | let $s = size($l) | |
111 | - | let $acc0 = nil | |
112 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
113 | - | then $a | |
114 | - | else updateRatingsFunc($a, $l[$i]) | |
111 | + | let updatedRatings = { | |
112 | + | let $l = addressList | |
113 | + | let $s = size($l) | |
114 | + | let $acc0 = nil | |
115 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
116 | + | then $a | |
117 | + | else updateRatingsFunc($a, $l[$i]) | |
115 | 118 | ||
116 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
117 | - | then $a | |
118 | - | else throw("List size exceeds 5") | |
119 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
120 | + | then $a | |
121 | + | else throw("List size exceeds 5") | |
119 | 122 | ||
120 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
121 | - | } | |
122 | - | ((updatedRatings :+ BooleanEntry((itemId + "_adjusted"), true)) :+ StringEntry("Test1", caller)) | |
123 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
124 | + | } | |
125 | + | (updatedRatings :+ BooleanEntry((itemId + "_adjusted"), true)) | |
126 | + | } | |
123 | 127 | } | |
124 | 128 | ||
125 | 129 |
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 | let caller = toString(i.caller) | |
93 | - | func updateRatingsFunc (accum,address) = { | |
94 | - | let rating = searchForRating(address) | |
95 | - | let prediction = searchForAddressPrediction(itemId, address) | |
96 | - | let updatedRating = if ((prediction == finalPrediction)) | |
97 | - | then (rating + rateAdjustment) | |
98 | - | else (rating - rateAdjustment) | |
99 | - | let payout = if ((prediction == finalPrediction)) | |
100 | - | then payoutAmount | |
101 | - | else 0 | |
102 | - | let updatedEntries = (accum :+ IntegerEntry(address, updatedRating)) | |
103 | - | if ((payout > 0)) | |
104 | - | then (updatedEntries :+ ScriptTransfer(Address(fromBase58String(address)), payout, tokenId)) | |
105 | - | else updatedEntries | |
106 | - | } | |
93 | + | if ((caller != toString(this))) | |
94 | + | then throw("You are not allowed to call this function") | |
95 | + | else { | |
96 | + | func updateRatingsFunc (accum,address) = { | |
97 | + | let rating = searchForRating(address) | |
98 | + | let prediction = searchForAddressPrediction(itemId, address) | |
99 | + | let updatedRating = if ((prediction == finalPrediction)) | |
100 | + | then (rating + rateAdjustment) | |
101 | + | else (rating - rateAdjustment) | |
102 | + | let payout = if ((prediction == finalPrediction)) | |
103 | + | then payoutAmount | |
104 | + | else 0 | |
105 | + | let updatedEntries = (accum :+ IntegerEntry(address, updatedRating)) | |
106 | + | if ((payout > 0)) | |
107 | + | then (updatedEntries :+ ScriptTransfer(Address(fromBase58String(address)), payout, tokenId)) | |
108 | + | else updatedEntries | |
109 | + | } | |
107 | 110 | ||
108 | - | let updatedRatings = { | |
109 | - | let $l = addressList | |
110 | - | let $s = size($l) | |
111 | - | let $acc0 = nil | |
112 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
113 | - | then $a | |
114 | - | else updateRatingsFunc($a, $l[$i]) | |
111 | + | let updatedRatings = { | |
112 | + | let $l = addressList | |
113 | + | let $s = size($l) | |
114 | + | let $acc0 = nil | |
115 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
116 | + | then $a | |
117 | + | else updateRatingsFunc($a, $l[$i]) | |
115 | 118 | ||
116 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
117 | - | then $a | |
118 | - | else throw("List size exceeds 5") | |
119 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
120 | + | then $a | |
121 | + | else throw("List size exceeds 5") | |
119 | 122 | ||
120 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
121 | - | } | |
122 | - | ((updatedRatings :+ BooleanEntry((itemId + "_adjusted"), true)) :+ StringEntry("Test1", caller)) | |
123 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
124 | + | } | |
125 | + | (updatedRatings :+ BooleanEntry((itemId + "_adjusted"), true)) | |
126 | + | } | |
123 | 127 | } | |
124 | 128 | ||
125 | 129 | ||
126 | 130 | ||
127 | 131 | @Callable(i) | |
128 | 132 | func savePrediction (itemId,prediction) = { | |
129 | 133 | let clientAdress = toString(i.caller) | |
130 | 134 | let searchForUser = match getInteger(clientAdress) { | |
131 | 135 | case s: Int => | |
132 | 136 | s | |
133 | 137 | case _ => | |
134 | 138 | "User does not exist" | |
135 | 139 | } | |
136 | 140 | if ((searchForUser == "User does not exist")) | |
137 | 141 | then throw("User does not exist") | |
138 | 142 | else { | |
139 | 143 | let isFinal = match getBoolean((itemId + "_final")) { | |
140 | 144 | case s: Boolean => | |
141 | 145 | s | |
142 | 146 | case _ => | |
143 | 147 | false | |
144 | 148 | } | |
145 | 149 | if (isFinal) | |
146 | 150 | then throw("Final prediction already made") | |
147 | 151 | else { | |
148 | 152 | let isCanceled = match getBoolean((itemId + "_cancelled")) { | |
149 | 153 | case s: Boolean => | |
150 | 154 | s | |
151 | 155 | case _ => | |
152 | 156 | false | |
153 | 157 | } | |
154 | 158 | if (isCanceled) | |
155 | 159 | then throw("Final prediction already made") | |
156 | 160 | else { | |
157 | 161 | let clientRating = searchForRating(clientAdress) | |
158 | 162 | if ((ratingCutoff >= clientRating)) | |
159 | 163 | then throw("You are not allowed to participate anymore") | |
160 | 164 | else { | |
161 | 165 | let searchForCounter = match getInteger((itemId + "_counter")) { | |
162 | 166 | case s: Int => | |
163 | 167 | s | |
164 | 168 | case _ => | |
165 | 169 | -1 | |
166 | 170 | } | |
167 | 171 | if ((searchForCounter >= 1)) | |
168 | 172 | then { | |
169 | 173 | let adressList = findPredictionAdresses(itemId, searchForCounter) | |
170 | 174 | if (containsElement(adressList, clientAdress)) | |
171 | 175 | then throw("This User already gave a Prediction") | |
172 | 176 | else { | |
173 | 177 | let predictionCounter = match getInteger((itemId + "_predictionCounter")) { | |
174 | 178 | case s: Int => | |
175 | 179 | s | |
176 | 180 | case _ => | |
177 | 181 | -1 | |
178 | 182 | } | |
179 | 183 | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
180 | 184 | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
181 | 185 | case s: String => | |
182 | 186 | s | |
183 | 187 | case _ => | |
184 | 188 | "no Prediction Found" | |
185 | 189 | } | |
186 | 190 | let newCounter = (searchForCounter + 1) | |
187 | 191 | if ((lastPrediction == prediction)) | |
188 | 192 | then if (((predictionCounter + 1) == predictionMaxCounter)) | |
189 | 193 | then { | |
190 | 194 | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
191 | 195 | if ((invokeAdjustRating != invokeAdjustRating)) | |
192 | 196 | then throw("Strict value is not equal to itself.") | |
193 | 197 | 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))] | |
194 | 198 | } | |
195 | 199 | 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)] | |
196 | 200 | else if ((newCounter >= maxCounter)) | |
197 | 201 | 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)] | |
198 | 202 | else if (((predictionCounter - 1) == 0)) | |
199 | 203 | 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))] | |
200 | 204 | 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))] | |
201 | 205 | } | |
202 | 206 | } | |
203 | 207 | else { | |
204 | 208 | let searchForNewItem = match getString(("new_" + itemId)) { | |
205 | 209 | case s: String => | |
206 | 210 | s | |
207 | 211 | case _ => | |
208 | 212 | "Item not Found" | |
209 | 213 | } | |
210 | 214 | if ((searchForNewItem == "Item not Found")) | |
211 | 215 | then throw("Item not found") | |
212 | 216 | 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)] | |
213 | 217 | } | |
214 | 218 | } | |
215 | 219 | } | |
216 | 220 | } | |
217 | 221 | } | |
218 | 222 | } | |
219 | 223 | ||
220 | 224 | ||
221 | 225 | ||
222 | 226 | @Callable(i) | |
223 | 227 | func registerUser () = { | |
224 | 228 | let clientAdress = toString(i.caller) | |
225 | 229 | let searchForUser = match getInteger(clientAdress) { | |
226 | 230 | case s: Int => | |
227 | 231 | s | |
228 | 232 | case _ => | |
229 | 233 | -1 | |
230 | 234 | } | |
231 | 235 | if ((searchForUser != -1)) | |
232 | 236 | then throw("User already exists") | |
233 | 237 | else [IntegerEntry(clientAdress, defaultRating)] | |
234 | 238 | } | |
235 | 239 | ||
236 | 240 | ||
237 | 241 | @Verifier(tx) | |
238 | 242 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
239 | 243 |
github/deemru/w8io/026f985 35.41 ms ◑