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