tx · 7BaXTizJ1e2xLrPvfqbEuPsXwpibrbQZycte7U3Aobik 3MwB4DruW4zASGmUcka1mXAYyaw7fjmQpoo: -0.01000000 Waves 2021.07.23 12:35 [1626115] smart account 3MwB4DruW4zASGmUcka1mXAYyaw7fjmQpoo > SELF 0.00000000 Waves
{ "type": 13, "id": "7BaXTizJ1e2xLrPvfqbEuPsXwpibrbQZycte7U3Aobik", "fee": 1000000, "feeAssetId": null, "timestamp": 1627032988649, "version": 2, "chainId": 84, "sender": "3MwB4DruW4zASGmUcka1mXAYyaw7fjmQpoo", "senderPublicKey": "mEckVFEgtDdVAbdGoJipwq49i1iWigTh7kx1ZvsC17U", "proofs": [ "A9b7P2de3gVxH9cNjH7JUiP5PSj2bFb1hEQ7QqXxGzrHvSRgCoRVn4xhCFt9oZ7GNeKQDuE8Ktz5FhsUQm8Y7Aa" ], "script": "base64:AAIFAAAAAAAAAKQIAhIFCgMIAQgSAwoBCBIAEgQKAggIEgUKAwgICBIFCgMIAQgSAwoBCBIAEgQKAggIEgUKAwgICBIFCgMIAQgSAwoBCBIAEgQKAggIEgUKAwgICBIFCgMIAQgSAwoBCBIAEgQKAggIEgUKAwgICBIFCgMIAQgSAwoBCBIAEgQKAggIEgUKAwgICBIFCgMIAQgSAwoBCBIAEgQKAggIEgUKAwgICAAAACEAAAAABE5PTkUCAAAABG5vbmUBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAA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kAAAIAAAABAgAAAAp3cm9uZyB2b3RlAwMJAAAAAAAAAgUAAAAGc3RhdHVzBQAAAAhGRUFUVVJFRAYJAAAAAAAAAgUAAAAGc3RhdHVzBQAAAAhERUxJU1RFRAkAAAIAAAABAgAAABF2b3RlIGhhcyBmaW5pc2hlZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAAMZ2V0S2V5UmV2ZWFsAAAAAgUAAAAEaXRlbQUAAAAEdXNlcgUAAAAEdm90ZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAAD2dldEtleVZvdGVDb3VudAAAAAIFAAAABGl0ZW0FAAAABHZvdGUFAAAADG5ld1ZvdGVDb3VudAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAAQZ2V0S2V5SXRlbVN0YXR1cwAAAAEFAAAABGl0ZW0DCQAAZwAAAAIFAAAADG5ld1ZvdGVDb3VudAUAAAAGUVVPUlVNBQAAAAR2b3RlBQAAAAZSRVZFQUwFAAAAA25pbAAAAAB6vWmg", "height": 1626115, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 93wfZT3chPFgqEWsRDhatojaVEHpRCvcg2f1uA3sh1j Next: none Diff:
Old | New | Differences | |
---|---|---|---|
213 | 213 | } | |
214 | 214 | ||
215 | 215 | ||
216 | + | ||
217 | + | @Callable(i) | |
218 | + | func addItem2 (title,price,data) = { | |
219 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
220 | + | let item = getKeyItem(supplierAddress, title) | |
221 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
222 | + | if ((0 >= price)) | |
223 | + | then throw("Purchase amount cannot be less than item price") | |
224 | + | else if ((getValueItemSupplier(item) != NONE)) | |
225 | + | then throw("an item already exists") | |
226 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
227 | + | then throw("supplier's account has been blacklisted") | |
228 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
229 | + | } | |
230 | + | ||
231 | + | ||
232 | + | ||
233 | + | @Callable(i) | |
234 | + | func purchase2 (item) = { | |
235 | + | let pmt = i.payments[0] | |
236 | + | if (isDefined(pmt.assetId)) | |
237 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
238 | + | else { | |
239 | + | let userAddress = toBase58String(i.caller.bytes) | |
240 | + | let price = getValueItemPrice(item) | |
241 | + | let supplierAddress = getValueItemSupplier(item) | |
242 | + | if ((price > pmt.amount)) | |
243 | + | then throw("Purchase amount cannot be less than item price") | |
244 | + | else if ((supplierAddress == NONE)) | |
245 | + | then throw("Supplier does not exist") | |
246 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
247 | + | } | |
248 | + | } | |
249 | + | ||
250 | + | ||
251 | + | ||
252 | + | @Callable(i) | |
253 | + | func withdraw2 () = { | |
254 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
255 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
256 | + | if ((0 >= balance)) | |
257 | + | then throw("insuficient balance") | |
258 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
259 | + | } | |
260 | + | ||
261 | + | ||
262 | + | ||
263 | + | @Callable(i) | |
264 | + | func voteCommit2 (item,hash) = { | |
265 | + | let user = toBase58String(i.caller.bytes) | |
266 | + | let commits = getValueCommitsCount(item) | |
267 | + | let status = getValueItemStatus(item) | |
268 | + | if ((commits >= VOTERS)) | |
269 | + | then throw("Reached max num of voters") | |
270 | + | else if ((getValueCommit(item, user) != NONE)) | |
271 | + | then throw("b1") | |
272 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
273 | + | then throw("b2") | |
274 | + | else if (if ((status != NONE)) | |
275 | + | then (status != VOTING) | |
276 | + | else false) | |
277 | + | then throw("b3") | |
278 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
279 | + | then REVEAL | |
280 | + | else VOTING)] | |
281 | + | } | |
282 | + | ||
283 | + | ||
284 | + | ||
285 | + | @Callable(i) | |
286 | + | func voteReveal2 (item,vote,salt) = { | |
287 | + | let user = toBase58String(i.caller.bytes) | |
288 | + | let status = getValueItemStatus(item) | |
289 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
290 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
291 | + | then throw("Reveal data is not valid") | |
292 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
293 | + | then throw("max num of voters hasnt reached yet") | |
294 | + | else if ((getValueReveal(item, user) != NONE)) | |
295 | + | then throw("user has already participated") | |
296 | + | else if (if ((status != VOTING)) | |
297 | + | then (status != REVEAL) | |
298 | + | else false) | |
299 | + | then throw("wrong status") | |
300 | + | else if (if ((vote != FEATURED)) | |
301 | + | then (vote != DELISTED) | |
302 | + | else false) | |
303 | + | then throw("wrong vote") | |
304 | + | else if (if ((status == FEATURED)) | |
305 | + | then true | |
306 | + | else (status == DELISTED)) | |
307 | + | then throw("vote has finished") | |
308 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
309 | + | then vote | |
310 | + | else REVEAL)] | |
311 | + | } | |
312 | + | ||
313 | + | ||
314 | + | ||
315 | + | @Callable(i) | |
316 | + | func addItem3 (title,price,data) = { | |
317 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
318 | + | let item = getKeyItem(supplierAddress, title) | |
319 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
320 | + | if ((0 >= price)) | |
321 | + | then throw("Purchase amount cannot be less than item price") | |
322 | + | else if ((getValueItemSupplier(item) != NONE)) | |
323 | + | then throw("an item already exists") | |
324 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
325 | + | then throw("supplier's account has been blacklisted") | |
326 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
327 | + | } | |
328 | + | ||
329 | + | ||
330 | + | ||
331 | + | @Callable(i) | |
332 | + | func purchase3 (item) = { | |
333 | + | let pmt = i.payments[0] | |
334 | + | if (isDefined(pmt.assetId)) | |
335 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
336 | + | else { | |
337 | + | let userAddress = toBase58String(i.caller.bytes) | |
338 | + | let price = getValueItemPrice(item) | |
339 | + | let supplierAddress = getValueItemSupplier(item) | |
340 | + | if ((price > pmt.amount)) | |
341 | + | then throw("Purchase amount cannot be less than item price") | |
342 | + | else if ((supplierAddress == NONE)) | |
343 | + | then throw("Supplier does not exist") | |
344 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
345 | + | } | |
346 | + | } | |
347 | + | ||
348 | + | ||
349 | + | ||
350 | + | @Callable(i) | |
351 | + | func withdraw3 () = { | |
352 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
353 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
354 | + | if ((0 >= balance)) | |
355 | + | then throw("insuficient balance") | |
356 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
357 | + | } | |
358 | + | ||
359 | + | ||
360 | + | ||
361 | + | @Callable(i) | |
362 | + | func voteCommit3 (item,hash) = { | |
363 | + | let user = toBase58String(i.caller.bytes) | |
364 | + | let commits = getValueCommitsCount(item) | |
365 | + | let status = getValueItemStatus(item) | |
366 | + | if ((commits >= VOTERS)) | |
367 | + | then throw("Reached max num of voters") | |
368 | + | else if ((getValueCommit(item, user) != NONE)) | |
369 | + | then throw("b1") | |
370 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
371 | + | then throw("b2") | |
372 | + | else if (if ((status != NONE)) | |
373 | + | then (status != VOTING) | |
374 | + | else false) | |
375 | + | then throw("b3") | |
376 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
377 | + | then REVEAL | |
378 | + | else VOTING)] | |
379 | + | } | |
380 | + | ||
381 | + | ||
382 | + | ||
383 | + | @Callable(i) | |
384 | + | func voteReveal3 (item,vote,salt) = { | |
385 | + | let user = toBase58String(i.caller.bytes) | |
386 | + | let status = getValueItemStatus(item) | |
387 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
388 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
389 | + | then throw("Reveal data is not valid") | |
390 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
391 | + | then throw("max num of voters hasnt reached yet") | |
392 | + | else if ((getValueReveal(item, user) != NONE)) | |
393 | + | then throw("user has already participated") | |
394 | + | else if (if ((status != VOTING)) | |
395 | + | then (status != REVEAL) | |
396 | + | else false) | |
397 | + | then throw("wrong status") | |
398 | + | else if (if ((vote != FEATURED)) | |
399 | + | then (vote != DELISTED) | |
400 | + | else false) | |
401 | + | then throw("wrong vote") | |
402 | + | else if (if ((status == FEATURED)) | |
403 | + | then true | |
404 | + | else (status == DELISTED)) | |
405 | + | then throw("vote has finished") | |
406 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
407 | + | then vote | |
408 | + | else REVEAL)] | |
409 | + | } | |
410 | + | ||
411 | + | ||
412 | + | ||
413 | + | @Callable(i) | |
414 | + | func addItem4 (title,price,data) = { | |
415 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
416 | + | let item = getKeyItem(supplierAddress, title) | |
417 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
418 | + | if ((0 >= price)) | |
419 | + | then throw("Purchase amount cannot be less than item price") | |
420 | + | else if ((getValueItemSupplier(item) != NONE)) | |
421 | + | then throw("an item already exists") | |
422 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
423 | + | then throw("supplier's account has been blacklisted") | |
424 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
425 | + | } | |
426 | + | ||
427 | + | ||
428 | + | ||
429 | + | @Callable(i) | |
430 | + | func purchase4 (item) = { | |
431 | + | let pmt = i.payments[0] | |
432 | + | if (isDefined(pmt.assetId)) | |
433 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
434 | + | else { | |
435 | + | let userAddress = toBase58String(i.caller.bytes) | |
436 | + | let price = getValueItemPrice(item) | |
437 | + | let supplierAddress = getValueItemSupplier(item) | |
438 | + | if ((price > pmt.amount)) | |
439 | + | then throw("Purchase amount cannot be less than item price") | |
440 | + | else if ((supplierAddress == NONE)) | |
441 | + | then throw("Supplier does not exist") | |
442 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
443 | + | } | |
444 | + | } | |
445 | + | ||
446 | + | ||
447 | + | ||
448 | + | @Callable(i) | |
449 | + | func withdraw4 () = { | |
450 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
451 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
452 | + | if ((0 >= balance)) | |
453 | + | then throw("insuficient balance") | |
454 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
455 | + | } | |
456 | + | ||
457 | + | ||
458 | + | ||
459 | + | @Callable(i) | |
460 | + | func voteCommit4 (item,hash) = { | |
461 | + | let user = toBase58String(i.caller.bytes) | |
462 | + | let commits = getValueCommitsCount(item) | |
463 | + | let status = getValueItemStatus(item) | |
464 | + | if ((commits >= VOTERS)) | |
465 | + | then throw("Reached max num of voters") | |
466 | + | else if ((getValueCommit(item, user) != NONE)) | |
467 | + | then throw("b1") | |
468 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
469 | + | then throw("b2") | |
470 | + | else if (if ((status != NONE)) | |
471 | + | then (status != VOTING) | |
472 | + | else false) | |
473 | + | then throw("b3") | |
474 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
475 | + | then REVEAL | |
476 | + | else VOTING)] | |
477 | + | } | |
478 | + | ||
479 | + | ||
480 | + | ||
481 | + | @Callable(i) | |
482 | + | func voteReveal4 (item,vote,salt) = { | |
483 | + | let user = toBase58String(i.caller.bytes) | |
484 | + | let status = getValueItemStatus(item) | |
485 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
486 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
487 | + | then throw("Reveal data is not valid") | |
488 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
489 | + | then throw("max num of voters hasnt reached yet") | |
490 | + | else if ((getValueReveal(item, user) != NONE)) | |
491 | + | then throw("user has already participated") | |
492 | + | else if (if ((status != VOTING)) | |
493 | + | then (status != REVEAL) | |
494 | + | else false) | |
495 | + | then throw("wrong status") | |
496 | + | else if (if ((vote != FEATURED)) | |
497 | + | then (vote != DELISTED) | |
498 | + | else false) | |
499 | + | then throw("wrong vote") | |
500 | + | else if (if ((status == FEATURED)) | |
501 | + | then true | |
502 | + | else (status == DELISTED)) | |
503 | + | then throw("vote has finished") | |
504 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
505 | + | then vote | |
506 | + | else REVEAL)] | |
507 | + | } | |
508 | + | ||
509 | + | ||
510 | + | ||
511 | + | @Callable(i) | |
512 | + | func addItem5 (title,price,data) = { | |
513 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
514 | + | let item = getKeyItem(supplierAddress, title) | |
515 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
516 | + | if ((0 >= price)) | |
517 | + | then throw("Purchase amount cannot be less than item price") | |
518 | + | else if ((getValueItemSupplier(item) != NONE)) | |
519 | + | then throw("an item already exists") | |
520 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
521 | + | then throw("supplier's account has been blacklisted") | |
522 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
523 | + | } | |
524 | + | ||
525 | + | ||
526 | + | ||
527 | + | @Callable(i) | |
528 | + | func purchase5 (item) = { | |
529 | + | let pmt = i.payments[0] | |
530 | + | if (isDefined(pmt.assetId)) | |
531 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
532 | + | else { | |
533 | + | let userAddress = toBase58String(i.caller.bytes) | |
534 | + | let price = getValueItemPrice(item) | |
535 | + | let supplierAddress = getValueItemSupplier(item) | |
536 | + | if ((price > pmt.amount)) | |
537 | + | then throw("Purchase amount cannot be less than item price") | |
538 | + | else if ((supplierAddress == NONE)) | |
539 | + | then throw("Supplier does not exist") | |
540 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
541 | + | } | |
542 | + | } | |
543 | + | ||
544 | + | ||
545 | + | ||
546 | + | @Callable(i) | |
547 | + | func withdraw5 () = { | |
548 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
549 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
550 | + | if ((0 >= balance)) | |
551 | + | then throw("insuficient balance") | |
552 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
553 | + | } | |
554 | + | ||
555 | + | ||
556 | + | ||
557 | + | @Callable(i) | |
558 | + | func voteCommit5 (item,hash) = { | |
559 | + | let user = toBase58String(i.caller.bytes) | |
560 | + | let commits = getValueCommitsCount(item) | |
561 | + | let status = getValueItemStatus(item) | |
562 | + | if ((commits >= VOTERS)) | |
563 | + | then throw("Reached max num of voters") | |
564 | + | else if ((getValueCommit(item, user) != NONE)) | |
565 | + | then throw("b1") | |
566 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
567 | + | then throw("b2") | |
568 | + | else if (if ((status != NONE)) | |
569 | + | then (status != VOTING) | |
570 | + | else false) | |
571 | + | then throw("b3") | |
572 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
573 | + | then REVEAL | |
574 | + | else VOTING)] | |
575 | + | } | |
576 | + | ||
577 | + | ||
578 | + | ||
579 | + | @Callable(i) | |
580 | + | func voteReveal5 (item,vote,salt) = { | |
581 | + | let user = toBase58String(i.caller.bytes) | |
582 | + | let status = getValueItemStatus(item) | |
583 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
584 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
585 | + | then throw("Reveal data is not valid") | |
586 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
587 | + | then throw("max num of voters hasnt reached yet") | |
588 | + | else if ((getValueReveal(item, user) != NONE)) | |
589 | + | then throw("user has already participated") | |
590 | + | else if (if ((status != VOTING)) | |
591 | + | then (status != REVEAL) | |
592 | + | else false) | |
593 | + | then throw("wrong status") | |
594 | + | else if (if ((vote != FEATURED)) | |
595 | + | then (vote != DELISTED) | |
596 | + | else false) | |
597 | + | then throw("wrong vote") | |
598 | + | else if (if ((status == FEATURED)) | |
599 | + | then true | |
600 | + | else (status == DELISTED)) | |
601 | + | then throw("vote has finished") | |
602 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
603 | + | then vote | |
604 | + | else REVEAL)] | |
605 | + | } | |
606 | + | ||
607 | + | ||
608 | + | ||
609 | + | @Callable(i) | |
610 | + | func addItem6 (title,price,data) = { | |
611 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
612 | + | let item = getKeyItem(supplierAddress, title) | |
613 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
614 | + | if ((0 >= price)) | |
615 | + | then throw("Purchase amount cannot be less than item price") | |
616 | + | else if ((getValueItemSupplier(item) != NONE)) | |
617 | + | then throw("an item already exists") | |
618 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
619 | + | then throw("supplier's account has been blacklisted") | |
620 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
621 | + | } | |
622 | + | ||
623 | + | ||
624 | + | ||
625 | + | @Callable(i) | |
626 | + | func purchase6 (item) = { | |
627 | + | let pmt = i.payments[0] | |
628 | + | if (isDefined(pmt.assetId)) | |
629 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
630 | + | else { | |
631 | + | let userAddress = toBase58String(i.caller.bytes) | |
632 | + | let price = getValueItemPrice(item) | |
633 | + | let supplierAddress = getValueItemSupplier(item) | |
634 | + | if ((price > pmt.amount)) | |
635 | + | then throw("Purchase amount cannot be less than item price") | |
636 | + | else if ((supplierAddress == NONE)) | |
637 | + | then throw("Supplier does not exist") | |
638 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
639 | + | } | |
640 | + | } | |
641 | + | ||
642 | + | ||
643 | + | ||
644 | + | @Callable(i) | |
645 | + | func withdraw6 () = { | |
646 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
647 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
648 | + | if ((0 >= balance)) | |
649 | + | then throw("insuficient balance") | |
650 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
651 | + | } | |
652 | + | ||
653 | + | ||
654 | + | ||
655 | + | @Callable(i) | |
656 | + | func voteCommit6 (item,hash) = { | |
657 | + | let user = toBase58String(i.caller.bytes) | |
658 | + | let commits = getValueCommitsCount(item) | |
659 | + | let status = getValueItemStatus(item) | |
660 | + | if ((commits >= VOTERS)) | |
661 | + | then throw("Reached max num of voters") | |
662 | + | else if ((getValueCommit(item, user) != NONE)) | |
663 | + | then throw("b1") | |
664 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
665 | + | then throw("b2") | |
666 | + | else if (if ((status != NONE)) | |
667 | + | then (status != VOTING) | |
668 | + | else false) | |
669 | + | then throw("b3") | |
670 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
671 | + | then REVEAL | |
672 | + | else VOTING)] | |
673 | + | } | |
674 | + | ||
675 | + | ||
676 | + | ||
677 | + | @Callable(i) | |
678 | + | func voteReveal6 (item,vote,salt) = { | |
679 | + | let user = toBase58String(i.caller.bytes) | |
680 | + | let status = getValueItemStatus(item) | |
681 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
682 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
683 | + | then throw("Reveal data is not valid") | |
684 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
685 | + | then throw("max num of voters hasnt reached yet") | |
686 | + | else if ((getValueReveal(item, user) != NONE)) | |
687 | + | then throw("user has already participated") | |
688 | + | else if (if ((status != VOTING)) | |
689 | + | then (status != REVEAL) | |
690 | + | else false) | |
691 | + | then throw("wrong status") | |
692 | + | else if (if ((vote != FEATURED)) | |
693 | + | then (vote != DELISTED) | |
694 | + | else false) | |
695 | + | then throw("wrong vote") | |
696 | + | else if (if ((status == FEATURED)) | |
697 | + | then true | |
698 | + | else (status == DELISTED)) | |
699 | + | then throw("vote has finished") | |
700 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
701 | + | then vote | |
702 | + | else REVEAL)] | |
703 | + | } | |
704 | + | ||
705 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "none" | |
5 | 5 | ||
6 | 6 | func getNumberByKey (key) = { | |
7 | 7 | let num = match getInteger(this, key) { | |
8 | 8 | case a: Int => | |
9 | 9 | a | |
10 | 10 | case _ => | |
11 | 11 | 0 | |
12 | 12 | } | |
13 | 13 | num | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func getStrByKey (key) = { | |
18 | 18 | let str = match getString(this, key) { | |
19 | 19 | case a: String => | |
20 | 20 | a | |
21 | 21 | case _ => | |
22 | 22 | NONE | |
23 | 23 | } | |
24 | 24 | str | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getKeyItemPrice (item) = (item + "_price") | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func getValueItemPrice (item) = getNumberByKey(getKeyItemPrice(item)) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title))))) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func getKeyItemData (item) = (item + "_data") | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getKeyItemSupplier (item) = (item + "_owner") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item)) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getKeyBalanceSupplier (account) = (account + "_balance") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getValueBalanceSupplier (account) = getNumberByKey(getKeyBalanceSupplier(account)) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | let VOTERS = 3 | |
59 | 59 | ||
60 | 60 | let QUORUM = 2 | |
61 | 61 | ||
62 | 62 | let VOTING = "voting" | |
63 | 63 | ||
64 | 64 | let REVEAL = "reveal" | |
65 | 65 | ||
66 | 66 | let FEATURED = "featured" | |
67 | 67 | ||
68 | 68 | let DELISTED = "delisted" | |
69 | 69 | ||
70 | 70 | func getKeyCommit (item,user) = (((item + "_") + user) + "_commit") | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getValueCommit (item,user) = getStrByKey(getKeyCommit(item, user)) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getKeyCommitsCount (item) = (item + "_comcnt") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getValueCommitsCount (item) = getNumberByKey(getKeyCommitsCount(item)) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getValueReveal (item,user) = getStrByKey(getKeyReveal(item, user)) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getKeyItemStatus (item) = (item + "_status") | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func getValueItemStatus (item) = getStrByKey(getKeyItemStatus(item)) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func getKeyVoteCount (item,vote) = ((item + "_res:") + vote) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func getValueVoteCount (item,vote) = getNumberByKey(getKeyVoteCount(item, vote)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getExtAddressOracle () = value(addressFromString("3MsbiyFyy8B3aN3kF8ntda474SPn4YMVkiq")) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | let BLACKLISTED = "blacklist" | |
104 | 104 | ||
105 | 105 | func getExtKeyItemWhiteListStatus (account) = (account + "_verifier_status") | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func getExtValueItemWhiteListStatus (oracle,account) = { | |
109 | 109 | let str = match getString(oracle, getExtKeyItemWhiteListStatus(account)) { | |
110 | 110 | case a: String => | |
111 | 111 | a | |
112 | 112 | case _ => | |
113 | 113 | NONE | |
114 | 114 | } | |
115 | 115 | str | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | @Callable(i) | |
120 | 120 | func addItem (title,price,data) = { | |
121 | 121 | let supplierAddress = toBase58String(i.caller.bytes) | |
122 | 122 | let item = getKeyItem(supplierAddress, title) | |
123 | 123 | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
124 | 124 | if ((0 >= price)) | |
125 | 125 | then throw("Purchase amount cannot be less than item price") | |
126 | 126 | else if ((getValueItemSupplier(item) != NONE)) | |
127 | 127 | then throw("an item already exists") | |
128 | 128 | else if ((supplierWhiteList == BLACKLISTED)) | |
129 | 129 | then throw("supplier's account has been blacklisted") | |
130 | 130 | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | ||
135 | 135 | @Callable(i) | |
136 | 136 | func purchase (item) = { | |
137 | 137 | let pmt = i.payments[0] | |
138 | 138 | if (isDefined(pmt.assetId)) | |
139 | 139 | then throw("WAVES ONLY HHEUAWHEUAS") | |
140 | 140 | else { | |
141 | 141 | let userAddress = toBase58String(i.caller.bytes) | |
142 | 142 | let price = getValueItemPrice(item) | |
143 | 143 | let supplierAddress = getValueItemSupplier(item) | |
144 | 144 | if ((price > pmt.amount)) | |
145 | 145 | then throw("Purchase amount cannot be less than item price") | |
146 | 146 | else if ((supplierAddress == NONE)) | |
147 | 147 | then throw("Supplier does not exist") | |
148 | 148 | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
149 | 149 | } | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | ||
154 | 154 | @Callable(i) | |
155 | 155 | func withdraw () = { | |
156 | 156 | let supplierAddress = toBase58String(i.caller.bytes) | |
157 | 157 | let balance = getValueBalanceSupplier(supplierAddress) | |
158 | 158 | if ((0 >= balance)) | |
159 | 159 | then throw("insuficient balance") | |
160 | 160 | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
161 | 161 | } | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | ||
165 | 165 | @Callable(i) | |
166 | 166 | func voteCommit (item,hash) = { | |
167 | 167 | let user = toBase58String(i.caller.bytes) | |
168 | 168 | let commits = getValueCommitsCount(item) | |
169 | 169 | let status = getValueItemStatus(item) | |
170 | 170 | if ((commits >= VOTERS)) | |
171 | 171 | then throw("Reached max num of voters") | |
172 | 172 | else if ((getValueCommit(item, user) != NONE)) | |
173 | 173 | then throw("b1") | |
174 | 174 | else if ((getKeyItemSupplier(item) == NONE)) | |
175 | 175 | then throw("b2") | |
176 | 176 | else if (if ((status != NONE)) | |
177 | 177 | then (status != VOTING) | |
178 | 178 | else false) | |
179 | 179 | then throw("b3") | |
180 | 180 | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
181 | 181 | then REVEAL | |
182 | 182 | else VOTING)] | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | ||
187 | 187 | @Callable(i) | |
188 | 188 | func voteReveal (item,vote,salt) = { | |
189 | 189 | let user = toBase58String(i.caller.bytes) | |
190 | 190 | let status = getValueItemStatus(item) | |
191 | 191 | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
192 | 192 | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
193 | 193 | then throw("Reveal data is not valid") | |
194 | 194 | else if ((VOTERS > getValueCommitsCount(item))) | |
195 | 195 | then throw("max num of voters hasnt reached yet") | |
196 | 196 | else if ((getValueReveal(item, user) != NONE)) | |
197 | 197 | then throw("user has already participated") | |
198 | 198 | else if (if ((status != VOTING)) | |
199 | 199 | then (status != REVEAL) | |
200 | 200 | else false) | |
201 | 201 | then throw("wrong status") | |
202 | 202 | else if (if ((vote != FEATURED)) | |
203 | 203 | then (vote != DELISTED) | |
204 | 204 | else false) | |
205 | 205 | then throw("wrong vote") | |
206 | 206 | else if (if ((status == FEATURED)) | |
207 | 207 | then true | |
208 | 208 | else (status == DELISTED)) | |
209 | 209 | then throw("vote has finished") | |
210 | 210 | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
211 | 211 | then vote | |
212 | 212 | else REVEAL)] | |
213 | 213 | } | |
214 | 214 | ||
215 | 215 | ||
216 | + | ||
217 | + | @Callable(i) | |
218 | + | func addItem2 (title,price,data) = { | |
219 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
220 | + | let item = getKeyItem(supplierAddress, title) | |
221 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
222 | + | if ((0 >= price)) | |
223 | + | then throw("Purchase amount cannot be less than item price") | |
224 | + | else if ((getValueItemSupplier(item) != NONE)) | |
225 | + | then throw("an item already exists") | |
226 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
227 | + | then throw("supplier's account has been blacklisted") | |
228 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
229 | + | } | |
230 | + | ||
231 | + | ||
232 | + | ||
233 | + | @Callable(i) | |
234 | + | func purchase2 (item) = { | |
235 | + | let pmt = i.payments[0] | |
236 | + | if (isDefined(pmt.assetId)) | |
237 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
238 | + | else { | |
239 | + | let userAddress = toBase58String(i.caller.bytes) | |
240 | + | let price = getValueItemPrice(item) | |
241 | + | let supplierAddress = getValueItemSupplier(item) | |
242 | + | if ((price > pmt.amount)) | |
243 | + | then throw("Purchase amount cannot be less than item price") | |
244 | + | else if ((supplierAddress == NONE)) | |
245 | + | then throw("Supplier does not exist") | |
246 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
247 | + | } | |
248 | + | } | |
249 | + | ||
250 | + | ||
251 | + | ||
252 | + | @Callable(i) | |
253 | + | func withdraw2 () = { | |
254 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
255 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
256 | + | if ((0 >= balance)) | |
257 | + | then throw("insuficient balance") | |
258 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
259 | + | } | |
260 | + | ||
261 | + | ||
262 | + | ||
263 | + | @Callable(i) | |
264 | + | func voteCommit2 (item,hash) = { | |
265 | + | let user = toBase58String(i.caller.bytes) | |
266 | + | let commits = getValueCommitsCount(item) | |
267 | + | let status = getValueItemStatus(item) | |
268 | + | if ((commits >= VOTERS)) | |
269 | + | then throw("Reached max num of voters") | |
270 | + | else if ((getValueCommit(item, user) != NONE)) | |
271 | + | then throw("b1") | |
272 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
273 | + | then throw("b2") | |
274 | + | else if (if ((status != NONE)) | |
275 | + | then (status != VOTING) | |
276 | + | else false) | |
277 | + | then throw("b3") | |
278 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
279 | + | then REVEAL | |
280 | + | else VOTING)] | |
281 | + | } | |
282 | + | ||
283 | + | ||
284 | + | ||
285 | + | @Callable(i) | |
286 | + | func voteReveal2 (item,vote,salt) = { | |
287 | + | let user = toBase58String(i.caller.bytes) | |
288 | + | let status = getValueItemStatus(item) | |
289 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
290 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
291 | + | then throw("Reveal data is not valid") | |
292 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
293 | + | then throw("max num of voters hasnt reached yet") | |
294 | + | else if ((getValueReveal(item, user) != NONE)) | |
295 | + | then throw("user has already participated") | |
296 | + | else if (if ((status != VOTING)) | |
297 | + | then (status != REVEAL) | |
298 | + | else false) | |
299 | + | then throw("wrong status") | |
300 | + | else if (if ((vote != FEATURED)) | |
301 | + | then (vote != DELISTED) | |
302 | + | else false) | |
303 | + | then throw("wrong vote") | |
304 | + | else if (if ((status == FEATURED)) | |
305 | + | then true | |
306 | + | else (status == DELISTED)) | |
307 | + | then throw("vote has finished") | |
308 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
309 | + | then vote | |
310 | + | else REVEAL)] | |
311 | + | } | |
312 | + | ||
313 | + | ||
314 | + | ||
315 | + | @Callable(i) | |
316 | + | func addItem3 (title,price,data) = { | |
317 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
318 | + | let item = getKeyItem(supplierAddress, title) | |
319 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
320 | + | if ((0 >= price)) | |
321 | + | then throw("Purchase amount cannot be less than item price") | |
322 | + | else if ((getValueItemSupplier(item) != NONE)) | |
323 | + | then throw("an item already exists") | |
324 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
325 | + | then throw("supplier's account has been blacklisted") | |
326 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
327 | + | } | |
328 | + | ||
329 | + | ||
330 | + | ||
331 | + | @Callable(i) | |
332 | + | func purchase3 (item) = { | |
333 | + | let pmt = i.payments[0] | |
334 | + | if (isDefined(pmt.assetId)) | |
335 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
336 | + | else { | |
337 | + | let userAddress = toBase58String(i.caller.bytes) | |
338 | + | let price = getValueItemPrice(item) | |
339 | + | let supplierAddress = getValueItemSupplier(item) | |
340 | + | if ((price > pmt.amount)) | |
341 | + | then throw("Purchase amount cannot be less than item price") | |
342 | + | else if ((supplierAddress == NONE)) | |
343 | + | then throw("Supplier does not exist") | |
344 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
345 | + | } | |
346 | + | } | |
347 | + | ||
348 | + | ||
349 | + | ||
350 | + | @Callable(i) | |
351 | + | func withdraw3 () = { | |
352 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
353 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
354 | + | if ((0 >= balance)) | |
355 | + | then throw("insuficient balance") | |
356 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
357 | + | } | |
358 | + | ||
359 | + | ||
360 | + | ||
361 | + | @Callable(i) | |
362 | + | func voteCommit3 (item,hash) = { | |
363 | + | let user = toBase58String(i.caller.bytes) | |
364 | + | let commits = getValueCommitsCount(item) | |
365 | + | let status = getValueItemStatus(item) | |
366 | + | if ((commits >= VOTERS)) | |
367 | + | then throw("Reached max num of voters") | |
368 | + | else if ((getValueCommit(item, user) != NONE)) | |
369 | + | then throw("b1") | |
370 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
371 | + | then throw("b2") | |
372 | + | else if (if ((status != NONE)) | |
373 | + | then (status != VOTING) | |
374 | + | else false) | |
375 | + | then throw("b3") | |
376 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
377 | + | then REVEAL | |
378 | + | else VOTING)] | |
379 | + | } | |
380 | + | ||
381 | + | ||
382 | + | ||
383 | + | @Callable(i) | |
384 | + | func voteReveal3 (item,vote,salt) = { | |
385 | + | let user = toBase58String(i.caller.bytes) | |
386 | + | let status = getValueItemStatus(item) | |
387 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
388 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
389 | + | then throw("Reveal data is not valid") | |
390 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
391 | + | then throw("max num of voters hasnt reached yet") | |
392 | + | else if ((getValueReveal(item, user) != NONE)) | |
393 | + | then throw("user has already participated") | |
394 | + | else if (if ((status != VOTING)) | |
395 | + | then (status != REVEAL) | |
396 | + | else false) | |
397 | + | then throw("wrong status") | |
398 | + | else if (if ((vote != FEATURED)) | |
399 | + | then (vote != DELISTED) | |
400 | + | else false) | |
401 | + | then throw("wrong vote") | |
402 | + | else if (if ((status == FEATURED)) | |
403 | + | then true | |
404 | + | else (status == DELISTED)) | |
405 | + | then throw("vote has finished") | |
406 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
407 | + | then vote | |
408 | + | else REVEAL)] | |
409 | + | } | |
410 | + | ||
411 | + | ||
412 | + | ||
413 | + | @Callable(i) | |
414 | + | func addItem4 (title,price,data) = { | |
415 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
416 | + | let item = getKeyItem(supplierAddress, title) | |
417 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
418 | + | if ((0 >= price)) | |
419 | + | then throw("Purchase amount cannot be less than item price") | |
420 | + | else if ((getValueItemSupplier(item) != NONE)) | |
421 | + | then throw("an item already exists") | |
422 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
423 | + | then throw("supplier's account has been blacklisted") | |
424 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
425 | + | } | |
426 | + | ||
427 | + | ||
428 | + | ||
429 | + | @Callable(i) | |
430 | + | func purchase4 (item) = { | |
431 | + | let pmt = i.payments[0] | |
432 | + | if (isDefined(pmt.assetId)) | |
433 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
434 | + | else { | |
435 | + | let userAddress = toBase58String(i.caller.bytes) | |
436 | + | let price = getValueItemPrice(item) | |
437 | + | let supplierAddress = getValueItemSupplier(item) | |
438 | + | if ((price > pmt.amount)) | |
439 | + | then throw("Purchase amount cannot be less than item price") | |
440 | + | else if ((supplierAddress == NONE)) | |
441 | + | then throw("Supplier does not exist") | |
442 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
443 | + | } | |
444 | + | } | |
445 | + | ||
446 | + | ||
447 | + | ||
448 | + | @Callable(i) | |
449 | + | func withdraw4 () = { | |
450 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
451 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
452 | + | if ((0 >= balance)) | |
453 | + | then throw("insuficient balance") | |
454 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
455 | + | } | |
456 | + | ||
457 | + | ||
458 | + | ||
459 | + | @Callable(i) | |
460 | + | func voteCommit4 (item,hash) = { | |
461 | + | let user = toBase58String(i.caller.bytes) | |
462 | + | let commits = getValueCommitsCount(item) | |
463 | + | let status = getValueItemStatus(item) | |
464 | + | if ((commits >= VOTERS)) | |
465 | + | then throw("Reached max num of voters") | |
466 | + | else if ((getValueCommit(item, user) != NONE)) | |
467 | + | then throw("b1") | |
468 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
469 | + | then throw("b2") | |
470 | + | else if (if ((status != NONE)) | |
471 | + | then (status != VOTING) | |
472 | + | else false) | |
473 | + | then throw("b3") | |
474 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
475 | + | then REVEAL | |
476 | + | else VOTING)] | |
477 | + | } | |
478 | + | ||
479 | + | ||
480 | + | ||
481 | + | @Callable(i) | |
482 | + | func voteReveal4 (item,vote,salt) = { | |
483 | + | let user = toBase58String(i.caller.bytes) | |
484 | + | let status = getValueItemStatus(item) | |
485 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
486 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
487 | + | then throw("Reveal data is not valid") | |
488 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
489 | + | then throw("max num of voters hasnt reached yet") | |
490 | + | else if ((getValueReveal(item, user) != NONE)) | |
491 | + | then throw("user has already participated") | |
492 | + | else if (if ((status != VOTING)) | |
493 | + | then (status != REVEAL) | |
494 | + | else false) | |
495 | + | then throw("wrong status") | |
496 | + | else if (if ((vote != FEATURED)) | |
497 | + | then (vote != DELISTED) | |
498 | + | else false) | |
499 | + | then throw("wrong vote") | |
500 | + | else if (if ((status == FEATURED)) | |
501 | + | then true | |
502 | + | else (status == DELISTED)) | |
503 | + | then throw("vote has finished") | |
504 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
505 | + | then vote | |
506 | + | else REVEAL)] | |
507 | + | } | |
508 | + | ||
509 | + | ||
510 | + | ||
511 | + | @Callable(i) | |
512 | + | func addItem5 (title,price,data) = { | |
513 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
514 | + | let item = getKeyItem(supplierAddress, title) | |
515 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
516 | + | if ((0 >= price)) | |
517 | + | then throw("Purchase amount cannot be less than item price") | |
518 | + | else if ((getValueItemSupplier(item) != NONE)) | |
519 | + | then throw("an item already exists") | |
520 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
521 | + | then throw("supplier's account has been blacklisted") | |
522 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
523 | + | } | |
524 | + | ||
525 | + | ||
526 | + | ||
527 | + | @Callable(i) | |
528 | + | func purchase5 (item) = { | |
529 | + | let pmt = i.payments[0] | |
530 | + | if (isDefined(pmt.assetId)) | |
531 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
532 | + | else { | |
533 | + | let userAddress = toBase58String(i.caller.bytes) | |
534 | + | let price = getValueItemPrice(item) | |
535 | + | let supplierAddress = getValueItemSupplier(item) | |
536 | + | if ((price > pmt.amount)) | |
537 | + | then throw("Purchase amount cannot be less than item price") | |
538 | + | else if ((supplierAddress == NONE)) | |
539 | + | then throw("Supplier does not exist") | |
540 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
541 | + | } | |
542 | + | } | |
543 | + | ||
544 | + | ||
545 | + | ||
546 | + | @Callable(i) | |
547 | + | func withdraw5 () = { | |
548 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
549 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
550 | + | if ((0 >= balance)) | |
551 | + | then throw("insuficient balance") | |
552 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
553 | + | } | |
554 | + | ||
555 | + | ||
556 | + | ||
557 | + | @Callable(i) | |
558 | + | func voteCommit5 (item,hash) = { | |
559 | + | let user = toBase58String(i.caller.bytes) | |
560 | + | let commits = getValueCommitsCount(item) | |
561 | + | let status = getValueItemStatus(item) | |
562 | + | if ((commits >= VOTERS)) | |
563 | + | then throw("Reached max num of voters") | |
564 | + | else if ((getValueCommit(item, user) != NONE)) | |
565 | + | then throw("b1") | |
566 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
567 | + | then throw("b2") | |
568 | + | else if (if ((status != NONE)) | |
569 | + | then (status != VOTING) | |
570 | + | else false) | |
571 | + | then throw("b3") | |
572 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
573 | + | then REVEAL | |
574 | + | else VOTING)] | |
575 | + | } | |
576 | + | ||
577 | + | ||
578 | + | ||
579 | + | @Callable(i) | |
580 | + | func voteReveal5 (item,vote,salt) = { | |
581 | + | let user = toBase58String(i.caller.bytes) | |
582 | + | let status = getValueItemStatus(item) | |
583 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
584 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
585 | + | then throw("Reveal data is not valid") | |
586 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
587 | + | then throw("max num of voters hasnt reached yet") | |
588 | + | else if ((getValueReveal(item, user) != NONE)) | |
589 | + | then throw("user has already participated") | |
590 | + | else if (if ((status != VOTING)) | |
591 | + | then (status != REVEAL) | |
592 | + | else false) | |
593 | + | then throw("wrong status") | |
594 | + | else if (if ((vote != FEATURED)) | |
595 | + | then (vote != DELISTED) | |
596 | + | else false) | |
597 | + | then throw("wrong vote") | |
598 | + | else if (if ((status == FEATURED)) | |
599 | + | then true | |
600 | + | else (status == DELISTED)) | |
601 | + | then throw("vote has finished") | |
602 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
603 | + | then vote | |
604 | + | else REVEAL)] | |
605 | + | } | |
606 | + | ||
607 | + | ||
608 | + | ||
609 | + | @Callable(i) | |
610 | + | func addItem6 (title,price,data) = { | |
611 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
612 | + | let item = getKeyItem(supplierAddress, title) | |
613 | + | let supplierWhiteList = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress) | |
614 | + | if ((0 >= price)) | |
615 | + | then throw("Purchase amount cannot be less than item price") | |
616 | + | else if ((getValueItemSupplier(item) != NONE)) | |
617 | + | then throw("an item already exists") | |
618 | + | else if ((supplierWhiteList == BLACKLISTED)) | |
619 | + | then throw("supplier's account has been blacklisted") | |
620 | + | else [StringEntry(getKeyItemSupplier(item), supplierAddress), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), StringEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierWhiteList)] | |
621 | + | } | |
622 | + | ||
623 | + | ||
624 | + | ||
625 | + | @Callable(i) | |
626 | + | func purchase6 (item) = { | |
627 | + | let pmt = i.payments[0] | |
628 | + | if (isDefined(pmt.assetId)) | |
629 | + | then throw("WAVES ONLY HHEUAWHEUAS") | |
630 | + | else { | |
631 | + | let userAddress = toBase58String(i.caller.bytes) | |
632 | + | let price = getValueItemPrice(item) | |
633 | + | let supplierAddress = getValueItemSupplier(item) | |
634 | + | if ((price > pmt.amount)) | |
635 | + | then throw("Purchase amount cannot be less than item price") | |
636 | + | else if ((supplierAddress == NONE)) | |
637 | + | then throw("Supplier does not exist") | |
638 | + | else [IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), IntegerEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))] | |
639 | + | } | |
640 | + | } | |
641 | + | ||
642 | + | ||
643 | + | ||
644 | + | @Callable(i) | |
645 | + | func withdraw6 () = { | |
646 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
647 | + | let balance = getValueBalanceSupplier(supplierAddress) | |
648 | + | if ((0 >= balance)) | |
649 | + | then throw("insuficient balance") | |
650 | + | else [IntegerEntry(getKeyBalanceSupplier(supplierAddress), 0), ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)] | |
651 | + | } | |
652 | + | ||
653 | + | ||
654 | + | ||
655 | + | @Callable(i) | |
656 | + | func voteCommit6 (item,hash) = { | |
657 | + | let user = toBase58String(i.caller.bytes) | |
658 | + | let commits = getValueCommitsCount(item) | |
659 | + | let status = getValueItemStatus(item) | |
660 | + | if ((commits >= VOTERS)) | |
661 | + | then throw("Reached max num of voters") | |
662 | + | else if ((getValueCommit(item, user) != NONE)) | |
663 | + | then throw("b1") | |
664 | + | else if ((getKeyItemSupplier(item) == NONE)) | |
665 | + | then throw("b2") | |
666 | + | else if (if ((status != NONE)) | |
667 | + | then (status != VOTING) | |
668 | + | else false) | |
669 | + | then throw("b3") | |
670 | + | else [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commits + 1)), StringEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
671 | + | then REVEAL | |
672 | + | else VOTING)] | |
673 | + | } | |
674 | + | ||
675 | + | ||
676 | + | ||
677 | + | @Callable(i) | |
678 | + | func voteReveal6 (item,vote,salt) = { | |
679 | + | let user = toBase58String(i.caller.bytes) | |
680 | + | let status = getValueItemStatus(item) | |
681 | + | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
682 | + | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
683 | + | then throw("Reveal data is not valid") | |
684 | + | else if ((VOTERS > getValueCommitsCount(item))) | |
685 | + | then throw("max num of voters hasnt reached yet") | |
686 | + | else if ((getValueReveal(item, user) != NONE)) | |
687 | + | then throw("user has already participated") | |
688 | + | else if (if ((status != VOTING)) | |
689 | + | then (status != REVEAL) | |
690 | + | else false) | |
691 | + | then throw("wrong status") | |
692 | + | else if (if ((vote != FEATURED)) | |
693 | + | then (vote != DELISTED) | |
694 | + | else false) | |
695 | + | then throw("wrong vote") | |
696 | + | else if (if ((status == FEATURED)) | |
697 | + | then true | |
698 | + | else (status == DELISTED)) | |
699 | + | then throw("vote has finished") | |
700 | + | else [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVoteCount(item, vote), newVoteCount), StringEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
701 | + | then vote | |
702 | + | else REVEAL)] | |
703 | + | } | |
704 | + | ||
705 | + |
github/deemru/w8io/169f3d6 62.82 ms ◑