tx · HxNKxsgNGbQux9D7QJfjmTtfZ45fuVu8Qk4Hecd1aMBE 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos: -0.01400000 Waves 2024.05.21 16:22 [3115816] smart account 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos > SELF 0.00000000 Waves
{ "type": 13, "id": "HxNKxsgNGbQux9D7QJfjmTtfZ45fuVu8Qk4Hecd1aMBE", "fee": 1400000, "feeAssetId": null, "timestamp": 1716297736827, "version": 2, "chainId": 84, "sender": "3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos", "senderPublicKey": "F7SLwr7RYVQpyocmVScFC6ooaAwewaGq6wNRDYvyiPj1", "proofs": [ "dWCqPDdb7TN78uxV9CY3RLsuLS5vxKiTCboeX3jGcDS3pFtkbLncxMcPbGwLKbAyT5NCqXErpCfQREqaXnTvXQD" ], "script": "base64:AAIFAAAAAAAAABIIAhIGCgQIGAgIEgQKAggIEgAAAAAGAAAAABRwcmVkaWN0aW9uTWF4Q291bnRlcgAAAAAAAAAAAwAAAAAKbWF4Q291bnRlcgAAAAAAAAAABgAAAAANZGVmYXVsdFJhdGluZwAAAAAAAAAAZAEAAAARc2VhcmNoRm9yQ291bnRlcnMAAAACAAAABml0ZW1JZAAAAAdjb3VudGVyBAAAABFzZWFyY2hGb3JDb3VudGVycwQAAAAHJG1hdGNoMAkABCIAAAABCQABLAAAAAIJAAEsAAAAAgUAAAAGaXRlbUlkAgAAAAFfCQABpAAAAAEFAAAAB2NvdW50ZXIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwIAAAAHTm8gVXNlcgUAAAARc2VhcmNoRm9yQ291bnRlcnMBAAAAGXNlYXJjaEZvckFkcmVzc1ByZWRpY3Rpb24AAAACAAAABml0ZW1JZAAAAAZhZHJlc3MEAAAAE3NlYXJjaEZvclByZWRpY3Rpb24EAAAAByRtYXRjaDAJAAQiAAAAAQkAASwA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AAAACCQABLAAAAAIFAAAABml0ZW1JZAIAAAABXwUAAAAMY2xpZW50QWRyZXNzBQAAAApwcmVkaWN0aW9uCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAABml0ZW1JZAIAAAAIX2NvdW50ZXIAAAAAAAAAAAEJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgUAAAAGaXRlbUlkAgAAABJfcHJlZGljdGlvbkNvdW50ZXIAAAAAAAAAAAEJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACAgAAAARuZXdfBQAAAAZpdGVtSWQFAAAAA25pbAAAAAFpAQAAAAxyZWdpc3RlclVzZXIAAAAABAAAAAxjbGllbnRBZHJlc3MJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBAAAAA1zZWFyY2hGb3JVc2VyBAAAAAckbWF0Y2gwCQAEHwAAAAEFAAAADGNsaWVudEFkcmVzcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAgAAAA1ObyB1c2VyIGZvdW5kAwkAAAAAAAACBQAAAA1zZWFyY2hGb3JVc2VyAgAAAA1ObyB1c2VyIEZvdW5kCQAAAgAAAAECAAAAE1VzZXIgYWxyZWFkeSBleGlzdHMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAADGNsaWVudEFkcmVzcwUAAAANZGVmYXVsdFJhdGluZwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmapnfJ", "height": 3115816, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DiALfCc5dpcEZ9R5BeV8H2yK3w1n4NT6hyjMVwu3MxWK Next: 76x32X84mpxogaYxhwNrQ3EAowTjWANnnJWRbnez6MsE Full:
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 | func searchForCounters (itemId,counter) = { | |
11 | 11 | let searchForCounters = match getString(((itemId + "_") + toString(counter))) { | |
12 | 12 | case s: String => | |
13 | 13 | s | |
14 | 14 | case _ => | |
15 | 15 | "No User" | |
16 | 16 | } | |
17 | 17 | searchForCounters | |
18 | 18 | } | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func searchForAdressPrediction (itemId,adress) = { | |
22 | 22 | let searchForPrediction = match getString(((itemId + "_") + adress)) { | |
23 | 23 | case s: String => | |
24 | 24 | s | |
25 | 25 | case _ => | |
26 | 26 | "Not Found" | |
27 | 27 | } | |
28 | 28 | searchForPrediction | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func findPredictionAdresses (itemId,counter) = { | |
33 | 33 | let adressList = nil | |
34 | 34 | if ((counter >= 1)) | |
35 | 35 | then { | |
36 | 36 | let adress1 = searchForCounters(itemId, 1) | |
37 | 37 | (adressList :+ adress1) | |
38 | 38 | } | |
39 | 39 | else if ((counter >= 2)) | |
40 | 40 | then { | |
41 | 41 | let adress1 = searchForCounters(itemId, 1) | |
42 | 42 | let adress2 = searchForCounters(itemId, 2) | |
43 | 43 | ((adressList :+ adress1) :+ adress2) | |
44 | 44 | } | |
45 | 45 | else if ((counter >= 3)) | |
46 | 46 | then { | |
47 | 47 | let adress1 = searchForCounters(itemId, 1) | |
48 | 48 | let adress2 = searchForCounters(itemId, 2) | |
49 | 49 | let adress3 = searchForCounters(itemId, 3) | |
50 | 50 | (((adressList :+ adress1) :+ adress2) :+ adress3) | |
51 | 51 | } | |
52 | 52 | else if ((counter >= 4)) | |
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 | ((((adressList :+ adress1) :+ adress2) :+ adress3) :+ adress4) | |
59 | 59 | } | |
60 | 60 | else { | |
61 | 61 | let adress1 = searchForCounters(itemId, 1) | |
62 | 62 | let adress2 = searchForCounters(itemId, 2) | |
63 | 63 | let adress3 = searchForCounters(itemId, 3) | |
64 | 64 | let adress4 = searchForCounters(itemId, 4) | |
65 | 65 | let adress5 = searchForCounters(itemId, 5) | |
66 | 66 | (((((adressList :+ adress1) :+ adress2) :+ adress3) :+ adress4) :+ adress5) | |
67 | 67 | } | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | @Callable(i) | |
72 | 72 | func adjustRatingsAndPayoutParticipants (itemId,adressList,lastCallerAdress,finalPrediction) = nil | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 | @Callable(i) | |
77 | 77 | func savePrediction (itemId,prediction) = { | |
78 | 78 | let clientAdress = toString(i.caller) | |
79 | 79 | let searchForUser = match getInteger(clientAdress) { | |
80 | 80 | case s: Int => | |
81 | 81 | s | |
82 | 82 | case _ => | |
83 | 83 | "no User exists" | |
84 | 84 | } | |
85 | 85 | if ((searchForUser == "no User exists")) | |
86 | 86 | then throw("User does not exist") | |
87 | 87 | else { | |
88 | 88 | let searchForCounter = match getInteger((itemId + "_counter")) { | |
89 | 89 | case s: Int => | |
90 | 90 | s | |
91 | 91 | case _ => | |
92 | 92 | -1 | |
93 | 93 | } | |
94 | 94 | if ((searchForCounter >= 1)) | |
95 | 95 | then { | |
96 | 96 | let adressList = findPredictionAdresses(itemId, searchForCounter) | |
97 | 97 | if (containsElement(adressList, clientAdress)) | |
98 | 98 | then throw("This User already gave a Prediction") | |
99 | 99 | else { | |
100 | 100 | let predictionCounter = match getInteger((itemId + "_predictionCounter")) { | |
101 | 101 | case s: Int => | |
102 | 102 | s | |
103 | 103 | case _ => | |
104 | 104 | -1 | |
105 | 105 | } | |
106 | 106 | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
107 | 107 | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
108 | 108 | case s: String => | |
109 | 109 | s | |
110 | 110 | case _ => | |
111 | 111 | "no Prediction Found" | |
112 | 112 | } | |
113 | 113 | let newCounter = (searchForCounter + 1) | |
114 | 114 | if ((lastPrediction == prediction)) | |
115 | 115 | then if (((predictionCounter + 1) == predictionMaxCounter)) | |
116 | 116 | then { | |
117 | 117 | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
118 | 118 | if ((invokeAdjustRating != invokeAdjustRating)) | |
119 | 119 | then throw("Strict value is not equal to itself.") | |
120 | 120 | 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)] | |
121 | 121 | } | |
122 | 122 | 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)] | |
123 | 123 | else if ((newCounter >= maxCounter)) | |
124 | 124 | 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)] | |
125 | 125 | 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)] | |
126 | 126 | } | |
127 | 127 | } | |
128 | 128 | else { | |
129 | 129 | let searchForNewItem = match getString(("new_" + itemId)) { | |
130 | 130 | case s: String => | |
131 | 131 | s | |
132 | 132 | case _ => | |
133 | 133 | "not Found" | |
134 | 134 | } | |
135 | 135 | if ((searchForNewItem != itemId)) | |
136 | 136 | then throw("Item not Found") | |
137 | 137 | else [StringEntry(((itemId + "_") + toString(1)), clientAdress), StringEntry(((itemId + "_") + clientAdress), prediction), IntegerEntry((itemId + "_counter"), 1), IntegerEntry((itemId + "_predictionCounter"), 1), DeleteEntry(("new_" + itemId))] | |
138 | 138 | } | |
139 | 139 | } | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | ||
144 | 144 | @Callable(i) | |
145 | 145 | func registerUser () = { | |
146 | 146 | let clientAdress = toString(i.caller) | |
147 | 147 | let searchForUser = match getInteger(clientAdress) { | |
148 | 148 | case s: Int => | |
149 | 149 | s | |
150 | 150 | case _ => | |
151 | 151 | "No user found" | |
152 | 152 | } | |
153 | 153 | if ((searchForUser == "No user Found")) | |
154 | 154 | then throw("User already exists") | |
155 | 155 | else [IntegerEntry(clientAdress, defaultRating)] | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | @Verifier(tx) | |
160 | 160 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
161 | 161 |
github/deemru/w8io/026f985 26.63 ms ◑