tx · Ca54uLDM9RY2i7g3QrdYDWAomvZQEQaZjoMJoBvyRCzR 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7: -0.01400000 Waves 2021.08.02 03:50 [1640014] smart account 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7 > SELF 0.00000000 Waves
{ "type": 13, "id": "Ca54uLDM9RY2i7g3QrdYDWAomvZQEQaZjoMJoBvyRCzR", "fee": 1400000, "feeAssetId": null, "timestamp": 1627865437467, "version": 2, "chainId": 84, "sender": "3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7", "senderPublicKey": "3tp5fNYyPi4jMnkf6s1k4kBqvJ7nm57SxzvLyi8RkxT2", "proofs": [ "5RxQnmfXRXP4CXuojwQkjcrLns38zpvXmc2HdwP1CcZnK6SYfAukAxaLFSrmhujr6wY3d8b9Xd3KFkMcsXEARSTh" ], "script": "base64:AAIEAAAAAAAAADoIAhIDCgEIEgYKBAgBCAESBwoFCAgBCAESAwoBCBIDCgEIEgMKAQgSBAoCCAgSBAoCCAgSBQoDCAgIAAAANQAAAAAETk9ORQIAAAAETk9ORQAAAAAGVk9URVJTAAAAAAAAAAADAAAAAAZRVU9SVU0AAAAAAAAAAAIAAAAACEZFQVRVUkVEAgAAAAhmZWF0dXJlZAAAAAAIREVMSVNURUQCAAAACGRlbGlzdGVkAAAAAAZWT1RJTkcCAAAABnZvdGluZwAAAAAGUkVWRUFMAgAAAAZyZXZlYWwAAAAACEFQUFJPVkFMAgAAAAhhcHByb3ZhbAAAAAAIUkVKRUNURUQCAAAACHJlamVjdGVkAAAAAAhBQ0NFUFRFRAIAAAAIYWNjZXB0ZWQBAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUBAAAAD2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AAAACW5ld1N0YXR1cwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAQSXNzdWVUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B3NOhaE=", "height": 1640014, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: KCF2fX7EBAzrGinNGMZuUe5SWH8xZKfZSJVnW3dPzEE Next: 5n9u3MMwMgLhRkpGoPjB2Hh9W8WnqnxTCDiPSPx3STwc Diff:
Old | New | Differences | |
---|---|---|---|
223 | 223 | ||
224 | 224 | ||
225 | 225 | @Callable(i) | |
226 | - | func purchase (item | |
226 | + | func purchase (item) = { | |
227 | 227 | let pmt = i.payments[0] | |
228 | 228 | if (isDefined(pmt.assetId)) | |
229 | 229 | then throw("You can buy tokens only with Waves tokens") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "NONE" | |
5 | 5 | ||
6 | 6 | let VOTERS = 3 | |
7 | 7 | ||
8 | 8 | let QUORUM = 2 | |
9 | 9 | ||
10 | 10 | let FEATURED = "featured" | |
11 | 11 | ||
12 | 12 | let DELISTED = "delisted" | |
13 | 13 | ||
14 | 14 | let VOTING = "voting" | |
15 | 15 | ||
16 | 16 | let REVEAL = "reveal" | |
17 | 17 | ||
18 | 18 | let APPROVAL = "approval" | |
19 | 19 | ||
20 | 20 | let REJECTED = "rejected" | |
21 | 21 | ||
22 | 22 | let ACCEPTED = "accepted" | |
23 | 23 | ||
24 | 24 | func getStringByKey (key) = match getString(this, key) { | |
25 | 25 | case a: String => | |
26 | 26 | a | |
27 | 27 | case _ => | |
28 | 28 | NONE | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func getIntegerByKey (key) = match getInteger(this, key) { | |
33 | 33 | case a: Int => | |
34 | 34 | a | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getKeySupplierAccount (account) = (account + "_account") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func getSupplierAccount (account) = getStringByKey(getKeySupplierAccount(account)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getKeyItem (supplier,title) = { | |
47 | 47 | let supplierTitle = (supplier + title) | |
48 | 48 | ("item_" + toBase58String(sha256(toBytes(supplierTitle)))) | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getKeyItemSupplier (item) = (item + "_owner") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getKeyItemTitle (item) = (item + "_title") | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getKeyItemPrice (item) = (item + "_price") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getKeyItemData (item) = (item + "_data") | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getKeyItemExpireDate (item) = (item + "_expiredate") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getKeyItemSoldCounter (item) = (item + "_sold") | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getKeyCommit (item,user) = (((item + "_") + user) + "_commit") | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getKeyCommitsCount (item) = (item + "_cmtcnt") | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getKeyItemStatus (item) = (item + "_status") | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getKeyVotesCount (item,vote) = ((item + "_res:") + vote) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getKeySupplierBalance (supplier) = (supplier + "_balance") | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getPurchase (supplier,item,user) = ("purchase_" + toBase58String(sha256(toBytes(((((supplier + "_") + item) + "_") + user))))) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func getKeyPurchaseStatus (purchase) = (purchase + "_status") | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func getKeyPurchaseItem (purchase) = (purchase + "_item") | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func getKeyPurchaseSupplier (purchase) = (purchase + "_supplier") | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getKeyPurchaseUser (purchase) = (purchase + "_user") | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func getKeyPurchaseAmount (purchase) = (purchase + "_amount") | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func getKeyPurchaseTimestamp (purchase) = (purchase + "_timestamp") | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func getKeyCoupon (assetId) = ("coupon_" + assetId) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func getKeyCouponItem (coupon) = (coupon + "_item") | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func getValueSupplierBalance (supplier) = getIntegerByKey(getKeySupplierBalance(supplier)) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func getValuePurchaseStatus (purchase) = getStringByKey(getKeyPurchaseStatus(purchase)) | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func getValuePurchaseItem (purchase) = getStringValue(this, getKeyPurchaseItem(purchase)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getValuePurchaseSupplier (purchase) = getStringValue(this, getKeyPurchaseSupplier(purchase)) | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func getValuePurchaseUser (purchase) = getStringValue(this, getKeyPurchaseUser(purchase)) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func getValuePurchaseAmount (purchase) = getIntegerValue(this, getKeyPurchaseAmount(purchase)) | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func getValuePurchaseTimestamp (purchase) = getIntegerByKey(getKeyPurchaseTimestamp(purchase)) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func getValueItemPrice (item) = getIntegerValue(this, getKeyItemPrice(item)) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func getValueItemSupplier (item) = getStringByKey(getKeyItemSupplier(item)) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func getValueItemExpireTime (item) = getIntegerByKey(getKeyItemExpireDate(item)) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func getValueItemTitle (item) = getStringByKey(getKeyItemTitle(item)) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func getValueItemSoldCounter (item) = getIntegerByKey(getKeyItemSoldCounter(item)) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getValueCommit (item,user) = getStringByKey(getKeyCommit(item, user)) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func getValueCommitsCount (item) = getIntegerByKey(getKeyCommitsCount(item)) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func getValueReveal (item,user) = getStringByKey(getKeyReveal(item, user)) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func getValueItemStatus (item) = getStringByKey(getKeyItemStatus(item)) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func getValueVotesCount (item,vote) = getIntegerByKey(getKeyVotesCount(item, vote)) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | @Callable(i) | |
167 | 167 | func registerSupplier (data) = { | |
168 | 168 | let supplier = toBase58String(i.caller.bytes) | |
169 | 169 | let account = getSupplierAccount(supplier) | |
170 | 170 | if ((account != NONE)) | |
171 | 171 | then throw("This address has already registred as supplier") | |
172 | 172 | else [StringEntry(getKeySupplierAccount(supplier), data)] | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | ||
177 | 177 | @Callable(i) | |
178 | 178 | func addItem (title,price,data,expire) = { | |
179 | 179 | let supplier = toBase58String(i.caller.bytes) | |
180 | 180 | let account = getSupplierAccount(supplier) | |
181 | 181 | let item = getKeyItem(supplier, title) | |
182 | 182 | if ((account == NONE)) | |
183 | 183 | then throw("You should register as supplier to add an item") | |
184 | 184 | else if ((0 >= price)) | |
185 | 185 | then throw("Purchase amount cannot be less than item price") | |
186 | 186 | else if ((getValueItemSupplier(item) != NONE)) | |
187 | 187 | then throw("An item already exists") | |
188 | 188 | else [StringEntry(getKeyItemSupplier(item), supplier), StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)] | |
189 | 189 | } | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | ||
193 | 193 | @Callable(i) | |
194 | 194 | func updateItem (item,title,price,data,expire) = { | |
195 | 195 | let supplier = toBase58String(i.caller.bytes) | |
196 | 196 | let account = getSupplierAccount(supplier) | |
197 | 197 | let itemSupplier = getValueItemSupplier(item) | |
198 | 198 | if ((account == NONE)) | |
199 | 199 | then throw("You should register as supplier to remove an item") | |
200 | 200 | else if (if ((item == NONE)) | |
201 | 201 | then true | |
202 | 202 | else (supplier != itemSupplier)) | |
203 | 203 | then throw(("You don't owned item " + item)) | |
204 | 204 | else [StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)] | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | ||
209 | 209 | @Callable(i) | |
210 | 210 | func removeItem (item) = { | |
211 | 211 | let supplier = toBase58String(i.caller.bytes) | |
212 | 212 | let account = getSupplierAccount(supplier) | |
213 | 213 | let itemSupplier = getValueItemSupplier(item) | |
214 | 214 | if ((account == NONE)) | |
215 | 215 | then throw("You should register as supplier to remove an item") | |
216 | 216 | else if (if ((item == NONE)) | |
217 | 217 | then true | |
218 | 218 | else (supplier != itemSupplier)) | |
219 | 219 | then throw(("You don't owned item " + item)) | |
220 | 220 | else [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))] | |
221 | 221 | } | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | ||
225 | 225 | @Callable(i) | |
226 | - | func purchase (item | |
226 | + | func purchase (item) = { | |
227 | 227 | let pmt = i.payments[0] | |
228 | 228 | if (isDefined(pmt.assetId)) | |
229 | 229 | then throw("You can buy tokens only with Waves tokens") | |
230 | 230 | else { | |
231 | 231 | let user = toBase58String(i.caller.bytes) | |
232 | 232 | let price = getValueItemPrice(item) | |
233 | 233 | let supplier = getValueItemSupplier(item) | |
234 | 234 | let expire = getValueItemExpireTime(item) | |
235 | 235 | if (if ((expire > 0)) | |
236 | 236 | then (lastBlock.timestamp >= expire) | |
237 | 237 | else false) | |
238 | 238 | then throw("Coupon expired") | |
239 | 239 | else if ((price > pmt.amount)) | |
240 | 240 | then throw("Purchase amount cannot be less than item price") | |
241 | 241 | else if ((pmt.amount > price)) | |
242 | 242 | then throw("Purchase amount cannot be higher than item price") | |
243 | 243 | else if ((supplier == NONE)) | |
244 | 244 | then throw("Supplier does not exists") | |
245 | 245 | else { | |
246 | 246 | let purchase = getPurchase(supplier, item, user) | |
247 | 247 | let keyPurchaseStatus = getKeyPurchaseStatus(purchase) | |
248 | 248 | let keyPurchaseItem = getKeyPurchaseItem(purchase) | |
249 | 249 | let keyPurchaseSupplier = getKeyPurchaseSupplier(purchase) | |
250 | 250 | let keyPurchaseUser = getKeyPurchaseUser(purchase) | |
251 | 251 | let keyPurchaseAmount = getKeyPurchaseAmount(purchase) | |
252 | 252 | let keyPurchaseTimestamp = getKeyPurchaseTimestamp(purchase) | |
253 | 253 | [StringEntry(keyPurchaseStatus, APPROVAL), StringEntry(keyPurchaseItem, item), StringEntry(keyPurchaseSupplier, supplier), StringEntry(keyPurchaseUser, user), IntegerEntry(keyPurchaseAmount, pmt.amount), IntegerEntry(keyPurchaseTimestamp, lastBlock.timestamp)] | |
254 | 254 | } | |
255 | 255 | } | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | ||
260 | 260 | @Callable(i) | |
261 | 261 | func rejectPurchase (purchase) = { | |
262 | 262 | let caller = toBase58String(i.caller.bytes) | |
263 | 263 | let status = getValuePurchaseStatus(purchase) | |
264 | 264 | let supplier = getValuePurchaseSupplier(purchase) | |
265 | 265 | let item = getValuePurchaseItem(purchase) | |
266 | 266 | if (if ((supplier == NONE)) | |
267 | 267 | then true | |
268 | 268 | else (caller != supplier)) | |
269 | 269 | then throw("Your are not the owner of this item") | |
270 | 270 | else if ((status != APPROVAL)) | |
271 | 271 | then throw("You cannot reject this purchased") | |
272 | 272 | else { | |
273 | 273 | let keyPurchaseStatus = getKeyPurchaseStatus(purchase) | |
274 | 274 | let keyPurchaseAmount = getKeyPurchaseAmount(purchase) | |
275 | 275 | let keySupplierBalance = getKeySupplierBalance(supplier) | |
276 | 276 | let keyItemSoldCounter = getKeyItemSoldCounter(item) | |
277 | 277 | let user = getValuePurchaseUser(purchase) | |
278 | 278 | let amount = getValuePurchaseAmount(purchase) | |
279 | 279 | let supplierBalance = (getValueSupplierBalance(supplier) - amount) | |
280 | 280 | let itemSoldCounter = (getValueItemSoldCounter(item) - 1) | |
281 | 281 | let address = addressFromStringValue(user) | |
282 | 282 | [StringEntry(keyPurchaseStatus, REJECTED), IntegerEntry(keyPurchaseAmount, 0), ScriptTransfer(address, amount, unit)] | |
283 | 283 | } | |
284 | 284 | } | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | ||
288 | 288 | @Callable(i) | |
289 | 289 | func acceptPurchase (purchase,couponAssetId) = { | |
290 | 290 | let caller = toBase58String(i.caller.bytes) | |
291 | 291 | let status = getValuePurchaseStatus(purchase) | |
292 | 292 | let supplier = getValuePurchaseSupplier(purchase) | |
293 | 293 | let item = getValuePurchaseItem(purchase) | |
294 | 294 | let expire = getValueItemExpireTime(item) | |
295 | 295 | if (if ((supplier == NONE)) | |
296 | 296 | then true | |
297 | 297 | else (caller != supplier)) | |
298 | 298 | then throw("Your are not the owner of this item") | |
299 | 299 | else if ((status != APPROVAL)) | |
300 | 300 | then throw("You cannot reject this purchased") | |
301 | 301 | else if (if ((expire > 0)) | |
302 | 302 | then (lastBlock.timestamp >= expire) | |
303 | 303 | else false) | |
304 | 304 | then throw("Coupon expired") | |
305 | 305 | else { | |
306 | 306 | let keyPurchaseStatus = getKeyPurchaseStatus(purchase) | |
307 | 307 | let keySupplierBalance = getKeySupplierBalance(supplier) | |
308 | 308 | let keyItemSoldCounter = getKeyItemSoldCounter(item) | |
309 | 309 | let amount = getValuePurchaseAmount(purchase) | |
310 | 310 | let supplierBalance = (getValueSupplierBalance(supplier) + amount) | |
311 | 311 | let itemSoldCounter = (getValueItemSoldCounter(item) + 1) | |
312 | 312 | let user = getValuePurchaseUser(purchase) | |
313 | 313 | let address = addressFromStringValue(user) | |
314 | 314 | [IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter), ScriptTransfer(address, 1, fromBase58String(couponAssetId))] | |
315 | 315 | } | |
316 | 316 | } | |
317 | 317 | ||
318 | 318 | ||
319 | 319 | ||
320 | 320 | @Callable(i) | |
321 | 321 | func voteCommit (item,hash) = { | |
322 | 322 | let user = toBase58String(i.caller.bytes) | |
323 | 323 | let commitsCount = getValueCommitsCount(item) | |
324 | 324 | let status = getValueItemStatus(item) | |
325 | 325 | if ((commitsCount >= VOTERS)) | |
326 | 326 | then throw("Reached max number of voters") | |
327 | 327 | else if ((getValueCommit(item, user) != NONE)) | |
328 | 328 | then throw("You voted already") | |
329 | 329 | else if ((getKeyItemSupplier(item) == NONE)) | |
330 | 330 | then throw("Item does not exists") | |
331 | 331 | else if (if ((status != NONE)) | |
332 | 332 | then (status != VOTING) | |
333 | 333 | else false) | |
334 | 334 | then throw("Voting is not active for this item now") | |
335 | 335 | else { | |
336 | 336 | let newStatus = if ((commitsCount == VOTERS)) | |
337 | 337 | then REVEAL | |
338 | 338 | else VOTING | |
339 | 339 | [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commitsCount + 1)), StringEntry(getKeyItemStatus(item), newStatus)] | |
340 | 340 | } | |
341 | 341 | } | |
342 | 342 | ||
343 | 343 | ||
344 | 344 | ||
345 | 345 | @Callable(i) | |
346 | 346 | func voteReveal (item,vote,salt) = { | |
347 | 347 | let user = toBase58String(i.caller.bytes) | |
348 | 348 | let status = getValueItemStatus(item) | |
349 | 349 | let newVotesCount = (getValueVotesCount(item, vote) + 1) | |
350 | 350 | let saltedVote = toBase58String(sha256(toBytes(((item + vote) + salt)))) | |
351 | 351 | if ((saltedVote != getValueCommit(item, user))) | |
352 | 352 | then throw("Reveal data is not valid") | |
353 | 353 | else if ((VOTERS > getValueCommitsCount(item))) | |
354 | 354 | then throw("Max number of voters not reached") | |
355 | 355 | else if ((getValueReveal(item, user) != NONE)) | |
356 | 356 | then throw("You voted already") | |
357 | 357 | else if (if ((status != VOTING)) | |
358 | 358 | then (status != REVEAL) | |
359 | 359 | else false) | |
360 | 360 | then throw("Voting is not active for this item now") | |
361 | 361 | else if (if ((vote != FEATURED)) | |
362 | 362 | then (vote != DELISTED) | |
363 | 363 | else false) | |
364 | 364 | then throw("Provided voting option is incorrect") | |
365 | 365 | else { | |
366 | 366 | let newStatus = if ((newVotesCount >= QUORUM)) | |
367 | 367 | then vote | |
368 | 368 | else REVEAL | |
369 | 369 | [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVotesCount(item, user), newVotesCount), StringEntry(getKeyItemStatus(item), newStatus)] | |
370 | 370 | } | |
371 | 371 | } | |
372 | 372 | ||
373 | 373 | ||
374 | 374 | @Verifier(tx) | |
375 | 375 | func verify () = match tx { | |
376 | 376 | case t: SetScriptTransaction => | |
377 | 377 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
378 | 378 | case t: IssueTransaction => | |
379 | 379 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
380 | 380 | case t: TransferTransaction => | |
381 | 381 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
382 | 382 | case _ => | |
383 | 383 | false | |
384 | 384 | } | |
385 | 385 |
github/deemru/w8io/026f985 44.91 ms ◑