tx · 5tdrBtY5Y9NTfeYbV2XqAyWWKcqSx9tJyshjbFeqd54p 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos: -0.01500000 Waves 2024.06.10 10:39 [3144361] smart account 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos > SELF 0.00000000 Waves
{ "type": 13, "id": "5tdrBtY5Y9NTfeYbV2XqAyWWKcqSx9tJyshjbFeqd54p", "fee": 1500000, "feeAssetId": null, "timestamp": 1718005157307, "version": 2, "chainId": 84, "sender": "3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos", "senderPublicKey": "F7SLwr7RYVQpyocmVScFC6ooaAwewaGq6wNRDYvyiPj1", "proofs": [ "ie2bFqfKX8PsCvWBQwSSjhzoNRzdhPZANVccUxRFoHMjiy9ushVCoX72nccPT4yctRHg5PtAewUMqnw1aJ3Myj2" ], "script": "base64:AAIFAAAAAAAAABIIAhIGCgQIGAgIEgQKAggIEgAAAAAPAAAAABRwcmVkaWN0aW9uTWF4Q291bnRlcgAAAAAAAAAAAwAAAAAKbWF4Q291bnRlcgAAAAAAAAAABgAAAAANZGVmYXVsdFJhdGluZwAAAAAAAAAAZAAAAAAOcmF0ZUFkanVzdG1lbnQAAAAAAAAAABQAAAAAB3Rva2VuSWQBAAAAIG33eiemmz/8i1OVqeOeBVscIi9bTehRMFsBoQapAMYYAAAAAAxwYXlvdXRBbW91bnQAAAAAAAL68IAAAAAADHJhdGluZ0N1dG9mZgAAAAAAAAAAMgAAAAAFcl9tYXgAAAAAAAAAAfQAAAAABXNjYWxlAAAAAAAAAABkAQAAABFzZWFyY2hGb3JDb3VudGVycwAAAAIAAAAGaXRlbUlkAAAAB2NvdW50ZXIEAAAAEXNlYXJjaEZvckNvdW50ZXJzBAAAAAckbWF0Y2gwCQAEIgAAAAEJAAEsAAAAAgkAASwAAAACBQAAAAZpdGVtSWQCAAAAAV8JAAGkAAAAAQUAAAAHY291bnRlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAI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NOA==", "height": 3144361, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4mmixvcrru92yoyqKzaGjnqKhsUjush4SaRmr66PunQY Next: 2GDEKDCLzU434mnfv8GYFHPF8n4xiDAHyYfs2xVwrbXE Diff:
Old | New | Differences | |
---|---|---|---|
223 | 223 | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
224 | 224 | if ((invokeAdjustRating != invokeAdjustRating)) | |
225 | 225 | then throw("Strict value is not equal to itself.") | |
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)] | |
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), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId), ScriptTransfer(Address(fromBase58String(clientAdress)), calculatedAmount, tokenId), IntegerEntry((clientAdress + "_rating"), newRating)] | |
227 | 227 | } | |
228 | 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)] | |
229 | 229 | else if ((newCounter >= maxCounter)) | |
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)] | |
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), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId)] | |
231 | 231 | else if (((predictionCounter - 1) == 0)) | |
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) | |
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) | |
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)] | |
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)] | |
234 | 234 | } | |
235 | 235 | } | |
236 | 236 | else { |
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 = 50000000 | |
15 | 15 | ||
16 | 16 | let ratingCutoff = 50 | |
17 | 17 | ||
18 | 18 | let r_max = 500 | |
19 | 19 | ||
20 | 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 | 94 | func calculatePayout (r_player,r_max) = { | |
95 | 95 | let ratio = ((r_player * 100) / r_max) | |
96 | 96 | let payout = ((payoutAmount * ratio) / 100) | |
97 | 97 | payout | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func calculateNewRating (r_player,r_average,k,actualScore) = { | |
102 | 102 | let ratin_factor = ((r_player * scale) / r_max) | |
103 | 103 | if ((actualScore == 1)) | |
104 | 104 | then { | |
105 | 105 | let adjustment = ((k * (100 - ratin_factor)) / scale) | |
106 | 106 | (r_player + adjustment) | |
107 | 107 | } | |
108 | 108 | else { | |
109 | 109 | let adjustment = ((-(k) * (20 + ratin_factor)) / scale) | |
110 | 110 | (r_player + adjustment) | |
111 | 111 | } | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | @Callable(i) | |
116 | 116 | func adjustRatingsAndPayoutParticipants (itemId,addressList,lastCallerAddress,finalPrediction) = { | |
117 | 117 | let caller = toString(i.caller) | |
118 | 118 | if ((caller != toString(this))) | |
119 | 119 | then throw("You are not allowed to call this function") | |
120 | 120 | else { | |
121 | 121 | func updateRatingsFunc (accum,address) = { | |
122 | 122 | let rating = searchForRating(address) | |
123 | 123 | let prediction = searchForAddressPrediction(itemId, address) | |
124 | 124 | let actualScore = if ((prediction == finalPrediction)) | |
125 | 125 | then 1 | |
126 | 126 | else 0 | |
127 | 127 | let newRating = calculateNewRating(rating, r_max, rateAdjustment, actualScore) | |
128 | 128 | let payout = if ((prediction == finalPrediction)) | |
129 | 129 | then true | |
130 | 130 | else false | |
131 | 131 | let updatedEntries = (accum :+ IntegerEntry((address + "_rating"), newRating)) | |
132 | 132 | let calculatedAmount = calculatePayout(newRating, r_max) | |
133 | 133 | if (payout) | |
134 | 134 | then (updatedEntries :+ ScriptTransfer(Address(fromBase58String(address)), calculatedAmount, tokenId)) | |
135 | 135 | else updatedEntries | |
136 | 136 | } | |
137 | 137 | ||
138 | 138 | let updatedRatings = { | |
139 | 139 | let $l = addressList | |
140 | 140 | let $s = size($l) | |
141 | 141 | let $acc0 = nil | |
142 | 142 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
143 | 143 | then $a | |
144 | 144 | else updateRatingsFunc($a, $l[$i]) | |
145 | 145 | ||
146 | 146 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
147 | 147 | then $a | |
148 | 148 | else throw("List size exceeds 5") | |
149 | 149 | ||
150 | 150 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
151 | 151 | } | |
152 | 152 | (updatedRatings :+ BooleanEntry((itemId + "_adjusted"), true)) | |
153 | 153 | } | |
154 | 154 | } | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | ||
158 | 158 | @Callable(i) | |
159 | 159 | func savePrediction (itemId,prediction) = { | |
160 | 160 | let clientAdress = toString(i.caller) | |
161 | 161 | let searchForUser = match getInteger((clientAdress + "_rating")) { | |
162 | 162 | case s: Int => | |
163 | 163 | s | |
164 | 164 | case _ => | |
165 | 165 | "User does not exist" | |
166 | 166 | } | |
167 | 167 | if ((searchForUser == "User does not exist")) | |
168 | 168 | then throw("User does not exist") | |
169 | 169 | else { | |
170 | 170 | let isFinal = match getBoolean((itemId + "_final")) { | |
171 | 171 | case s: Boolean => | |
172 | 172 | s | |
173 | 173 | case _ => | |
174 | 174 | false | |
175 | 175 | } | |
176 | 176 | if (isFinal) | |
177 | 177 | then throw("Final prediction already made") | |
178 | 178 | else { | |
179 | 179 | let isCanceled = match getBoolean((itemId + "_cancelled")) { | |
180 | 180 | case s: Boolean => | |
181 | 181 | s | |
182 | 182 | case _ => | |
183 | 183 | false | |
184 | 184 | } | |
185 | 185 | if (isCanceled) | |
186 | 186 | then throw("Final prediction already made") | |
187 | 187 | else { | |
188 | 188 | let clientRating = searchForRating(clientAdress) | |
189 | 189 | if ((ratingCutoff >= clientRating)) | |
190 | 190 | then throw("You are not allowed to participate anymore") | |
191 | 191 | else { | |
192 | 192 | let searchForCounter = match getInteger((itemId + "_counter")) { | |
193 | 193 | case s: Int => | |
194 | 194 | s | |
195 | 195 | case _ => | |
196 | 196 | -1 | |
197 | 197 | } | |
198 | 198 | if ((searchForCounter >= 1)) | |
199 | 199 | then { | |
200 | 200 | let adressList = findPredictionAdresses(itemId, searchForCounter) | |
201 | 201 | if (containsElement(adressList, clientAdress)) | |
202 | 202 | then throw("This User already gave a Prediction") | |
203 | 203 | else { | |
204 | 204 | let predictionCounter = match getInteger((itemId + "_predictionCounter")) { | |
205 | 205 | case s: Int => | |
206 | 206 | s | |
207 | 207 | case _ => | |
208 | 208 | -1 | |
209 | 209 | } | |
210 | 210 | let lastPredictionAdress = adressList[(size(adressList) - 1)] | |
211 | 211 | let lastPrediction = match getString(((itemId + "_") + lastPredictionAdress)) { | |
212 | 212 | case s: String => | |
213 | 213 | s | |
214 | 214 | case _ => | |
215 | 215 | "no Prediction Found" | |
216 | 216 | } | |
217 | 217 | let newCounter = (searchForCounter + 1) | |
218 | 218 | if ((lastPrediction == prediction)) | |
219 | 219 | then if (((predictionCounter + 1) == predictionMaxCounter)) | |
220 | 220 | then { | |
221 | 221 | let newRating = calculateNewRating(clientRating, r_max, rateAdjustment, 1) | |
222 | 222 | let calculatedAmount = calculatePayout(newRating, r_max) | |
223 | 223 | let invokeAdjustRating = invoke(this, "adjustRatingsAndPayoutParticipants", [itemId, adressList, clientAdress, prediction], nil) | |
224 | 224 | if ((invokeAdjustRating != invokeAdjustRating)) | |
225 | 225 | then throw("Strict value is not equal to itself.") | |
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)] | |
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), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId), ScriptTransfer(Address(fromBase58String(clientAdress)), calculatedAmount, tokenId), IntegerEntry((clientAdress + "_rating"), newRating)] | |
227 | 227 | } | |
228 | 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)] | |
229 | 229 | else if ((newCounter >= maxCounter)) | |
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)] | |
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), DeleteEntry(("updated_" + itemId)), StringEntry(("final_" + itemId), itemId)] | |
231 | 231 | else if (((predictionCounter - 1) == 0)) | |
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) | |
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) | |
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)] | |
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)] | |
234 | 234 | } | |
235 | 235 | } | |
236 | 236 | else { | |
237 | 237 | let searchForNewItem = match getString(("new_" + itemId)) { | |
238 | 238 | case s: String => | |
239 | 239 | s | |
240 | 240 | case _ => | |
241 | 241 | "Item not Found" | |
242 | 242 | } | |
243 | 243 | if ((searchForNewItem == "Item not Found")) | |
244 | 244 | then throw("Item not found") | |
245 | 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)] | |
246 | 246 | } | |
247 | 247 | } | |
248 | 248 | } | |
249 | 249 | } | |
250 | 250 | } | |
251 | 251 | } | |
252 | 252 | ||
253 | 253 | ||
254 | 254 | ||
255 | 255 | @Callable(i) | |
256 | 256 | func registerUser () = { | |
257 | 257 | let clientAdress = toString(i.caller) | |
258 | 258 | let searchForUser = match getInteger((clientAdress + "_rating")) { | |
259 | 259 | case s: Int => | |
260 | 260 | s | |
261 | 261 | case _ => | |
262 | 262 | -1 | |
263 | 263 | } | |
264 | 264 | if ((searchForUser != -1)) | |
265 | 265 | then throw("User already exists") | |
266 | 266 | else [IntegerEntry((clientAdress + "_rating"), defaultRating)] | |
267 | 267 | } | |
268 | 268 | ||
269 | 269 | ||
270 | 270 | @Verifier(tx) | |
271 | 271 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
272 | 272 |
github/deemru/w8io/026f985 82.88 ms ◑