tx · 3qMjexYts2QBnGdDhs9mdLQV28o8Vvfwj3FD45NJEnMd 3N2EM5HFgf6UMBnvcJX3Cegmozwdv1iDeq2: -0.01500000 Waves 2019.09.27 14:43 [694751] smart account 3N2EM5HFgf6UMBnvcJX3Cegmozwdv1iDeq2 > SELF 0.00000000 Waves
{ "type": 13, "id": "3qMjexYts2QBnGdDhs9mdLQV28o8Vvfwj3FD45NJEnMd", "fee": 1500000, "feeAssetId": null, "timestamp": 1569584675050, "version": 1, "sender": "3N2EM5HFgf6UMBnvcJX3Cegmozwdv1iDeq2", "senderPublicKey": "8y2Uc9uYf5gRD6Dzm1aC73zYe3LZvtVDUVAnAhNdN2mg", "proofs": [ "bBCGgQRnZbRdZvgcU31UcUDJHXRp77XLUxAs2CkDzwiCCeUq6XqYk6oHgKUvcxLArcRfHtezQxymJwfDe9xtG8g" ], "script": "base64:AAIDAAAAAAAAAD8IARIDCgEIEgMKAQgSBQoDAQEIEgQKAggBEgQKAggIEgQKAggBEgMKAQgSAwoBCBIECgIICBIDCgEIEgMKAQgAAAAcAAAAAANkYXkAAAAAAAAABaAAAAAABVdBVkVTBQAAAAR1bml0AAAAAAR3QlRDAQAAACBs+mr/xe2qjAt/tSqT0qIML4KC23R6BIxT+/0TH3Og/wAAAAAEd0VVUgEAAAAg7BZhBF97kSFBBjs38+fX1Pjz08YOqoCX85C/0PoVupkAAAAABHdVU0QBAAAAIN0cvQHwz3UFMHgHsqi2OJjRRd1cH7ozWuNAb/pmWXD9AAAAAAlzdGF0ZU9wZW4CAAAABk9wZW5lZAAAAAAOc3RhdGVTdWdnZXN0ZWQCAAAACVN1Z2dlc3RlZAAAAAALc3RhdGVDYW5jZWwCAAAACENhbmNlbGVkAAAAAA9zdGF0ZUluUHJvZ3Jlc3MCAAAACkluUHJvZ3Jlc3MAAAAAEXN0YXRlV2FpdDRDb25maXJtAgAAABNXYWl0Rm9yQ29uZmlybWF0aW9uAAAAAA1zdGF0ZUNvbXBsZXRlAgAAAAlDb21w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AAEGF1Y3Rpb25Bc3NldElkNTgFAAAAA25pbAkAAAIAAAABCQABLAAAAAICAAAAGkluY29ycmVjdCBzdGF0ZS4gTXVzdCBiZTogBQAAABFzdGF0ZVdhaXQ0Q29uZmlybQkAAAIAAAABAgAAACtPbmx5IGF1Y3Rpb24gY3VzdG9tZXIgY2FuIHVzZSB0aGlzIGZ1bmN0aW9uAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5BAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAADdHR4BQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAA3N0eAUAAAAHJG1hdGNoMAYHB5BkpNE=", "chainId": 84, "height": 694751, "spentComplexity": 0 } View: original | compacted Prev: FgtBeHs5LpX3qTrV2Cim5CQ2PryMgAaToPSjLfzxth8x Next: XJKBJEN7mYa7WGJdKWiHEyn5ZLSrspHmaUDL4goW6au Diff:
Old | New | Differences | |
---|---|---|---|
27 | 27 | ||
28 | 28 | let stateDisputeResolved = "DisputeResolved" | |
29 | 29 | ||
30 | - | let | |
30 | + | let client = "CMR" | |
31 | 31 | ||
32 | 32 | let freelancer = "FL" | |
33 | 33 | ||
165 | 165 | then "USD" | |
166 | 166 | else throw("AssetId is incorrect") | |
167 | 167 | let newFreezedBalance = increaseFreezedBalance(pmtAssetName, auctionPrice) | |
168 | - | WriteSet([DataEntry((auctionId + "_State"), stateOpen), DataEntry((auctionId + "_Info"), auctionInfo), DataEntry((auctionId + "_Client"), auctionClient), DataEntry((auctionId + "_AuctionStart"), auctionStart), DataEntry((auctionId + "_AuctionDuration"), auctionDurationBlocks), DataEntry((auctionId + "JobPerformance"), blocksForExecution), DataEntry((auctionId + "_AssetName"), pmtAssetName), DataEntry((auctionId + "_Price"), auctionPrice), DataEntry((pmtAssetName + "_Freezed"), newFreezedBalance)]) | |
168 | + | WriteSet([DataEntry((auctionId + "_State"), stateOpen), DataEntry((auctionId + "_Info"), auctionInfo), DataEntry((auctionId + "_Client"), auctionClient), DataEntry((auctionId + "_AuctionStart"), auctionStart), DataEntry((auctionId + "_AuctionDuration"), auctionDurationBlocks), DataEntry((auctionId + "_JobPerformance"), blocksForExecution), DataEntry((auctionId + "_AssetName"), pmtAssetName), DataEntry((auctionId + "_Price"), auctionPrice), DataEntry((pmtAssetName + "_Freezed"), newFreezedBalance)]) | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 | ||
441 | 441 | @Callable(i) | |
442 | 442 | func increaseExecutionTime (auctionId,executionDays) = { | |
443 | 443 | let caller = extract(i.callerPublicKey) | |
444 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
445 | - | let auctionDataList = getDataList(AuctionIdKey) | |
446 | - | let auctionState = auctionDataList[0] | |
444 | + | let auctionState = { | |
445 | + | let valueState = getString(this, (auctionId + "_State")) | |
446 | + | match valueState { | |
447 | + | case a: String => | |
448 | + | a | |
449 | + | case _ => | |
450 | + | throw("Auction State was not found") | |
451 | + | } | |
452 | + | } | |
447 | 453 | let auctionClient = { | |
448 | 454 | let valueClient = getString(this, (auctionId + "_Client")) | |
449 | 455 | let a = match valueClient { | |
454 | 460 | } | |
455 | 461 | fromBase58String(a) | |
456 | 462 | } | |
457 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
458 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
459 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
460 | - | let auctionAssetName = auctionDataList[6] | |
461 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
463 | + | let auctionExecutionTime = { | |
464 | + | let valueBlocksForExecution = getInteger(this, (auctionId + "JobPerformance")) | |
465 | + | match valueBlocksForExecution { | |
466 | + | case a: Int => | |
467 | + | a | |
468 | + | case _ => | |
469 | + | throw("Auction job performance time was not found") | |
470 | + | } | |
471 | + | } | |
462 | 472 | let newAuctionExecutionTime = { | |
463 | 473 | let newAuctionBlocksForExecution = (executionDays * day) | |
464 | - | if ((newAuctionBlocksForExecution > | |
474 | + | if ((newAuctionBlocksForExecution > auctionExecutionTime)) | |
465 | 475 | then newAuctionBlocksForExecution | |
466 | 476 | else throw("New execution time must more than current execution time") | |
467 | 477 | } | |
468 | 478 | if ((caller == auctionClient)) | |
469 | - | then if ((auctionState == stateOpen)) | |
470 | - | then WriteSet([DataEntry(AuctionIdKey, ((((((((((((auctionState + "_") + toBase58String(auctionClient)) + "_") + toString(auctionStart)) + "_") + toString(auctionDuration)) + "_") + toString(auctionBlocksForExecution)) + "_") + auctionAssetName) + "_") + toString(auctionPrice)))]) | |
471 | - | else if (if ((auctionState == stateSuggested)) | |
472 | - | then true | |
473 | - | else (auctionState == stateInProgress)) | |
474 | - | then { | |
475 | - | let freelancerPub = auctionDataList[7] | |
476 | - | WriteSet([DataEntry(AuctionIdKey, ((((((((((((((auctionState + "_") + toBase58String(auctionClient)) + "_") + toString(auctionStart)) + "_") + toString(auctionDuration)) + "_") + toString(auctionBlocksForExecution)) + "_") + auctionAssetName) + "_") + toString(auctionPrice)) + "_") + freelancerPub))]) | |
477 | - | } | |
478 | - | else throw("Incorrect state") | |
479 | - | else throw("Only customer can increase execution time") | |
479 | + | then if (if (if ((auctionState == stateOpen)) | |
480 | + | then true | |
481 | + | else (auctionState == stateSuggested)) | |
482 | + | then true | |
483 | + | else (auctionState == stateInProgress)) | |
484 | + | then WriteSet([DataEntry((auctionId + "JobPerformance"), newAuctionExecutionTime)]) | |
485 | + | else throw("Incorrect state") | |
486 | + | else throw("Only Client can increase execution time") | |
480 | 487 | } | |
481 | 488 | ||
482 | 489 | ||
483 | 490 | ||
484 | 491 | @Callable(i) | |
485 | 492 | func cancelAuction (auctionId) = { | |
486 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
487 | - | let auctionDataList = getDataList(AuctionIdKey) | |
488 | - | let auctionState = auctionDataList[0] | |
489 | - | let auctionInfo = auctionDataList[1] | |
490 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
491 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
492 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
493 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
494 | - | let auctionAssetName = auctionDataList[6] | |
495 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
496 | - | let auctionIdOwnerCheck = if ((i.callerPublicKey == auctionCustomer)) | |
493 | + | let callerPub = extract(i.callerPublicKey) | |
494 | + | let auctionState = { | |
495 | + | let valueState = getString(this, (auctionId + "_State")) | |
496 | + | match valueState { | |
497 | + | case a: String => | |
498 | + | a | |
499 | + | case _ => | |
500 | + | throw("Auction State was not found") | |
501 | + | } | |
502 | + | } | |
503 | + | let auctionClient = { | |
504 | + | let valueClient = getString(this, (auctionId + "_Client")) | |
505 | + | let a = match valueClient { | |
506 | + | case a: String => | |
507 | + | a | |
508 | + | case _ => | |
509 | + | throw("Auction Client was not found") | |
510 | + | } | |
511 | + | fromBase58String(a) | |
512 | + | } | |
513 | + | let callerIsClient = if ((callerPub == auctionClient)) | |
497 | 514 | then true | |
498 | 515 | else throw("Auction can be canceled only by owner.") | |
499 | - | if ((auctionState == stateOpen)) | |
500 | - | then WriteSet([DataEntry(AuctionIdKey, ((((((((((((((stateCancel + "_") + auctionInfo) + "_") + toBase58String(auctionCustomer)) + "_") + toString(auctionStart)) + "_") + toString(auctionDuration)) + "_") + toString(auctionBlocksForExecution)) + "_") + auctionAssetName) + "_") + toString(auctionPrice)))]) | |
501 | - | else throw("Incorrect auction state.") | |
516 | + | if (callerIsClient) | |
517 | + | then if ((auctionState == stateOpen)) | |
518 | + | then WriteSet([DataEntry((auctionId + "_State"), stateCancel)]) | |
519 | + | else throw("Incorrect auction state.") | |
520 | + | else throw("Only Client can cancel auction") | |
502 | 521 | } | |
503 | 522 | ||
504 | 523 | ||
506 | 525 | @Callable(i) | |
507 | 526 | func openDispute (auctionId) = { | |
508 | 527 | let caller = extract(i.callerPublicKey) | |
509 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
510 | - | let auctionDataList = getDataList(AuctionIdKey) | |
511 | - | let auctionState = auctionDataList[0] | |
512 | - | let auctionInfo = auctionDataList[1] | |
513 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
514 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
515 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
516 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
517 | - | let auctionAssetName = auctionDataList[6] | |
518 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
519 | - | let auctionFreelancer = fromBase58String(auctionDataList[8]) | |
520 | - | if (if ((caller == auctionCustomer)) | |
528 | + | let auctionState = { | |
529 | + | let valueState = getString(this, (auctionId + "_State")) | |
530 | + | match valueState { | |
531 | + | case a: String => | |
532 | + | a | |
533 | + | case _ => | |
534 | + | throw("Auction State was not found") | |
535 | + | } | |
536 | + | } | |
537 | + | let auctionClient = { | |
538 | + | let valueClient = getString(this, (auctionId + "_Client")) | |
539 | + | let a = match valueClient { | |
540 | + | case a: String => | |
541 | + | a | |
542 | + | case _ => | |
543 | + | throw("Auction Client was not found") | |
544 | + | } | |
545 | + | fromBase58String(a) | |
546 | + | } | |
547 | + | let auctionFreelancer = { | |
548 | + | let valueClient = getString(this, (auctionId + "_Freelancer")) | |
549 | + | let a = match valueClient { | |
550 | + | case a: String => | |
551 | + | a | |
552 | + | case _ => | |
553 | + | throw("Auction Client was not found") | |
554 | + | } | |
555 | + | fromBase58String(a) | |
556 | + | } | |
557 | + | if (if ((auctionState == stateOpen)) | |
521 | 558 | then true | |
522 | - | else (caller == auctionFreelancer)) | |
523 | - | then { | |
524 | - | let dataString = "1" | |
525 | - | WriteSet([DataEntry(AuctionIdKey, ((((stateDispute + "_") + auctionInfo) + "_") + dataString)), DataEntry((auctionId + "_Dispute"), "0")]) | |
526 | - | } | |
527 | - | else throw("Only customer and freelancer can open dispute") | |
559 | + | else (auctionState == stateSuggested)) | |
560 | + | then throw("Incorrect auction state for dispute opening") | |
561 | + | else if (if ((caller == auctionClient)) | |
562 | + | then true | |
563 | + | else (caller == auctionFreelancer)) | |
564 | + | then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), 0)]) | |
565 | + | else throw("Only customer and freelancer can open dispute") | |
528 | 566 | } | |
529 | 567 | ||
530 | 568 | ||
531 | 569 | ||
532 | 570 | @Callable(i) | |
533 | 571 | func voteDispute (auctionId,vote) = { | |
534 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
535 | - | let auctionDataList = getDataList(AuctionIdKey) | |
536 | - | let auctionState = auctionDataList[0] | |
537 | - | let auctionInfo = auctionDataList[1] | |
538 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
539 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
540 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
541 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
542 | - | let auctionAssetName = auctionDataList[6] | |
543 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
544 | - | let auctionFreelancer = fromBase58String(auctionDataList[8]) | |
572 | + | let callerPub = extract(i.callerPublicKey) | |
573 | + | let auctionState = { | |
574 | + | let valueState = getString(this, (auctionId + "_State")) | |
575 | + | match valueState { | |
576 | + | case a: String => | |
577 | + | a | |
578 | + | case _ => | |
579 | + | throw("Auction State was not found") | |
580 | + | } | |
581 | + | } | |
582 | + | let auctionClient = { | |
583 | + | let valueClient = getString(this, (auctionId + "_Client")) | |
584 | + | let a = match valueClient { | |
585 | + | case a: String => | |
586 | + | a | |
587 | + | case _ => | |
588 | + | throw("Auction Client was not found") | |
589 | + | } | |
590 | + | fromBase58String(a) | |
591 | + | } | |
592 | + | let auctionAssetName = { | |
593 | + | let valueAssetName = getString(this, (auctionId + "_AssetName")) | |
594 | + | match valueAssetName { | |
595 | + | case a: String => | |
596 | + | a | |
597 | + | case _ => | |
598 | + | throw("Auction asset name was not found") | |
599 | + | } | |
600 | + | } | |
601 | + | let auctionPrice = { | |
602 | + | let valuePrice = getInteger(this, (auctionId + "_Price")) | |
603 | + | match valuePrice { | |
604 | + | case a: Int => | |
605 | + | a | |
606 | + | case _ => | |
607 | + | throw("Auction price was not found") | |
608 | + | } | |
609 | + | } | |
610 | + | let auctionFreelancer = { | |
611 | + | let valueClient = getString(this, (auctionId + "_Freelancer")) | |
612 | + | let a = match valueClient { | |
613 | + | case a: String => | |
614 | + | a | |
615 | + | case _ => | |
616 | + | throw("Auction Client was not found") | |
617 | + | } | |
618 | + | fromBase58String(a) | |
619 | + | } | |
545 | 620 | let comission = ((auctionPrice * 3) / 100) | |
546 | - | let auctionStateCheck = if ((auctionState == stateDispute)) | |
621 | + | let auctionAssetId58 = AssetNameToBase58(auctionAssetName) | |
622 | + | let callerIsAmbassador = if (if (if (if (if ((callerPub == ambassador1)) | |
547 | 623 | then true | |
548 | - | else throw(("Incorrect state. Must be: " + stateDispute)) | |
549 | - | let newVote = if (if ((vote == customer)) | |
624 | + | else (callerPub == ambassador2)) | |
625 | + | then true | |
626 | + | else (callerPub == ambassador3)) | |
627 | + | then true | |
628 | + | else (callerPub == ambassador4)) | |
629 | + | then true | |
630 | + | else (callerPub == ambassador5)) | |
631 | + | then toBase58String(callerPub) | |
632 | + | else throw("Only defined ambassadors can vote in disputes") | |
633 | + | let newVote = if (if ((vote == client)) | |
550 | 634 | then true | |
551 | 635 | else (vote == freelancer)) | |
552 | 636 | then vote | |
553 | - | else throw(((("Vote is incorrect. Must be: " + customer) + " or ") + freelancer)) | |
554 | - | let newVoter = if (if (if (if (if ((i.callerPublicKey == ambassador1)) | |
555 | - | then true | |
556 | - | else (i.callerPublicKey == ambassador2)) | |
557 | - | then true | |
558 | - | else (i.callerPublicKey == ambassador3)) | |
559 | - | then true | |
560 | - | else (i.callerPublicKey == ambassador4)) | |
561 | - | then true | |
562 | - | else (i.callerPublicKey == ambassador5)) | |
563 | - | then toBase58String(i.callerPublicKey) | |
564 | - | else throw("You have no rights for disputes resolving") | |
565 | - | let disputeData = { | |
566 | - | let keyDispute = ((auctionId + "_") + stateDispute) | |
567 | - | let valueDispute = getString(this, keyDispute) | |
568 | - | match valueDispute { | |
637 | + | else throw(((("Vote is incorrect. Must be: " + client) + " or ") + freelancer)) | |
638 | + | let newVoter = { | |
639 | + | let keyVoter = ((auctionId + "_DiputeVote_") + callerIsAmbassador) | |
640 | + | let valueVoter = getString(this, keyVoter) | |
641 | + | match valueVoter { | |
569 | 642 | case a: String => | |
643 | + | throw("User already voted") | |
644 | + | case _ => | |
645 | + | callerIsAmbassador | |
646 | + | } | |
647 | + | } | |
648 | + | let votesNumber = { | |
649 | + | let valueVotesNumber = getInteger(this, (auctionId + "_DisputeVotes")) | |
650 | + | match valueVotesNumber { | |
651 | + | case a: Int => | |
570 | 652 | a | |
571 | 653 | case _ => | |
572 | - | throw(" | |
654 | + | throw("VotesNumber was not found") | |
573 | 655 | } | |
574 | 656 | } | |
575 | - | let disputeDataList = split(disputeData, "/") | |
576 | - | let votesCounter = disputeDataList[0] | |
577 | - | if ((votesCounter == "4")) | |
578 | - | then { | |
579 | - | let votersList = split(disputeDataList[1], "_") | |
580 | - | let votesList = split(disputeDataList[2], "_") | |
581 | - | let alreadyVoted = if ((newVoter == votersList[0])) | |
582 | - | then true | |
583 | - | else (newVoter == votersList[1]) | |
584 | - | if (alreadyVoted) | |
585 | - | then throw("You already voted") | |
586 | - | else { | |
587 | - | let newVotesCounter = "5" | |
588 | - | let newVoters = ((disputeDataList[1] + "_") + newVoter) | |
589 | - | let newVotes = ((disputeDataList[2] + "_") + newVote) | |
590 | - | let newDisputeDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
591 | - | let disputeWinner = { | |
592 | - | let vote1 = if ((votesList[0] == customer)) | |
593 | - | then 1 | |
594 | - | else 0 | |
595 | - | let vote2 = if ((votesList[1] == customer)) | |
596 | - | then 1 | |
597 | - | else 0 | |
598 | - | let vote3 = if ((votesList[2] == customer)) | |
599 | - | then 1 | |
600 | - | else 0 | |
601 | - | let vote4 = if ((votesList[3] == customer)) | |
602 | - | then 1 | |
603 | - | else 0 | |
604 | - | let vote5 = if ((newVote == customer)) | |
605 | - | then 1 | |
606 | - | else 0 | |
607 | - | let customerVotes = ((((vote1 + vote2) + vote3) + vote4) + vote5) | |
608 | - | if ((customerVotes > 2)) | |
609 | - | then customer | |
610 | - | else freelancer | |
611 | - | } | |
612 | - | let newDataString = ((((((((((((((auctionInfo + "_") + toBase58String(auctionCustomer)) + "_") + toString(auctionStart)) + "_") + toString(auctionDuration)) + "_") + toString(auctionBlocksForExecution)) + "_") + auctionAssetName) + "_") + toString(auctionPrice)) + "_") + toBase58String(auctionFreelancer)) | |
613 | - | let disputeWinnerPublic = if ((disputeWinner == customer)) | |
614 | - | then auctionCustomer | |
657 | + | if ((auctionState == stateDispute)) | |
658 | + | then if ((votesNumber == 4)) | |
659 | + | then { | |
660 | + | let disputeWinner = { | |
661 | + | let ambassador1Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador1))) | |
662 | + | let ambassador2Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador2))) | |
663 | + | let ambassador3Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador3))) | |
664 | + | let ambassador4Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador4))) | |
665 | + | let ambassador5Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador5))) | |
666 | + | let v1 = if ((ambassador1Vote == client)) | |
667 | + | then 1 | |
668 | + | else 0 | |
669 | + | let v2 = if ((ambassador2Vote == client)) | |
670 | + | then 1 | |
671 | + | else 0 | |
672 | + | let v3 = if ((ambassador3Vote == client)) | |
673 | + | then 1 | |
674 | + | else 0 | |
675 | + | let v4 = if ((ambassador4Vote == client)) | |
676 | + | then 1 | |
677 | + | else 0 | |
678 | + | let v5 = if ((ambassador5Vote == client)) | |
679 | + | then 1 | |
680 | + | else 0 | |
681 | + | let currentVote = if ((newVote == client)) | |
682 | + | then 1 | |
683 | + | else 0 | |
684 | + | let votesForClient = (((((v1 + v2) + v3) + v4) + v5) + currentVote) | |
685 | + | if ((votesForClient > 2)) | |
686 | + | then auctionClient | |
615 | 687 | else auctionFreelancer | |
616 | - | let amountWithoutComm = if ((disputeWinnerPublic == auctionCustomer)) | |
617 | - | then (auctionPrice - comission) | |
618 | - | else ((auctionPrice - comission) - comission) | |
619 | - | ScriptResult(WriteSet([DataEntry(AuctionIdDataKey(auctionId), ((stateDisputeResolved + "_") + newDataString)), DataEntry(((auctionId + "_") + stateDispute), newDisputeDataString)]), TransferSet([ScriptTransfer(addressFromPublicKey(disputeWinnerPublic), amountWithoutComm, AssetNameToBase58(auctionAssetName))])) | |
620 | 688 | } | |
621 | - | } | |
622 | - | else { | |
623 | - | let newDisputeDataString = if ((votesCounter == "0")) | |
624 | - | then { | |
625 | - | let newVotesCounter = "1" | |
626 | - | let newVoters = newVoter | |
627 | - | let newVotes = newVote | |
628 | - | let newDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
629 | - | newDataString | |
630 | - | } | |
631 | - | else if ((votesCounter == "1")) | |
632 | - | then { | |
633 | - | let voter1 = disputeDataList[1] | |
634 | - | let vote1 = disputeDataList[2] | |
635 | - | let alreadyVoted = (newVoter == voter1) | |
636 | - | if (alreadyVoted) | |
637 | - | then throw("You already voted") | |
638 | - | else { | |
639 | - | let newVotesCounter = "1" | |
640 | - | let newVoters = (voter1 + newVoter) | |
641 | - | let newVotes = (vote1 + newVote) | |
642 | - | let newDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
643 | - | newDataString | |
644 | - | } | |
645 | - | } | |
646 | - | else if ((votesCounter == "2")) | |
647 | - | then { | |
648 | - | let votersList = split(disputeDataList[1], "_") | |
649 | - | let votesList = split(disputeDataList[2], "_") | |
650 | - | let alreadyVoted = if ((newVoter == votersList[0])) | |
651 | - | then true | |
652 | - | else (newVoter == votersList[1]) | |
653 | - | if (alreadyVoted) | |
654 | - | then throw("You already voted") | |
655 | - | else { | |
656 | - | let newVotesCounter = "3" | |
657 | - | let newVoters = ((disputeDataList[1] + "_") + newVoter) | |
658 | - | let newVotes = ((disputeDataList[2] + "_") + newVote) | |
659 | - | let newDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
660 | - | newDataString | |
661 | - | } | |
662 | - | } | |
663 | - | else if ((votesCounter == "3")) | |
664 | - | then { | |
665 | - | let votersList = split(disputeDataList[1], "_") | |
666 | - | let votesList = split(disputeDataList[2], "_") | |
667 | - | let alreadyVoted = if (if ((newVoter == votersList[0])) | |
668 | - | then true | |
669 | - | else (newVoter == votersList[1])) | |
670 | - | then true | |
671 | - | else (newVoter == votersList[2]) | |
672 | - | if (alreadyVoted) | |
673 | - | then throw("You already voted") | |
674 | - | else { | |
675 | - | let newVotesCounter = "4" | |
676 | - | let newVoters = ((disputeDataList[1] + "_") + newVoter) | |
677 | - | let newVotes = ((disputeDataList[2] + "_") + newVote) | |
678 | - | let newDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
679 | - | newDataString | |
680 | - | } | |
681 | - | } | |
682 | - | else throw("Dispute has been already resolved") | |
683 | - | WriteSet([DataEntry(((auctionId + "_") + stateDispute), newDisputeDataString)]) | |
684 | - | } | |
689 | + | let paymentWithoutComm = if ((disputeWinner == auctionClient)) | |
690 | + | then auctionPrice | |
691 | + | else (auctionPrice - comission) | |
692 | + | ScriptResult(WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry((auctionId + "_State"), stateDisputeResolved), DataEntry(((auctionId + "_DiputeVote_") + callerIsAmbassador), newVote)]), TransferSet([ScriptTransfer(addressFromPublicKey(disputeWinner), paymentWithoutComm, auctionAssetId58)])) | |
693 | + | } | |
694 | + | else WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry(((auctionId + "_DiputeVote_") + callerIsAmbassador), newVote)]) | |
695 | + | else throw(("Incorrect state. Must be: " + stateDispute)) | |
685 | 696 | } | |
686 | 697 | ||
687 | 698 | ||
689 | 700 | @Callable(i) | |
690 | 701 | func workHandOver (auctionId) = { | |
691 | 702 | let callerPub = extract(i.callerPublicKey) | |
692 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
693 | - | let auctionDataList = getDataList(AuctionIdKey) | |
694 | - | let auctionState = auctionDataList[0] | |
695 | - | let auctionInfo = auctionDataList[1] | |
696 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
697 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
698 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
699 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
700 | - | let auctionAssetName = auctionDataList[6] | |
701 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
702 | - | let auctionFreelancer = fromBase58String(auctionDataList[8]) | |
703 | + | let auctionState = { | |
704 | + | let valueState = getString(this, (auctionId + "_State")) | |
705 | + | match valueState { | |
706 | + | case a: String => | |
707 | + | a | |
708 | + | case _ => | |
709 | + | throw("Auction State was not found") | |
710 | + | } | |
711 | + | } | |
712 | + | let auctionStart = { | |
713 | + | let valueAuctionStart = getInteger(this, (auctionId + "_AuctionStart")) | |
714 | + | match valueAuctionStart { | |
715 | + | case a: Int => | |
716 | + | a | |
717 | + | case _ => | |
718 | + | throw("Auction Start time was not found") | |
719 | + | } | |
720 | + | } | |
721 | + | let auctionDuration = { | |
722 | + | let valueauctionDuration = getInteger(this, (auctionId + "_AuctionDuration")) | |
723 | + | match valueauctionDuration { | |
724 | + | case a: Int => | |
725 | + | a | |
726 | + | case _ => | |
727 | + | throw("Auction duration time was not found") | |
728 | + | } | |
729 | + | } | |
730 | + | let auctionExecutionTime = { | |
731 | + | let valueBlocksForExecution = getInteger(this, (auctionId + "JobPerformance")) | |
732 | + | match valueBlocksForExecution { | |
733 | + | case a: Int => | |
734 | + | a | |
735 | + | case _ => | |
736 | + | throw("Auction job performance time was not found") | |
737 | + | } | |
738 | + | } | |
739 | + | let auctionFreelancer = { | |
740 | + | let valueClient = getString(this, (auctionId + "_Freelancer")) | |
741 | + | let a = match valueClient { | |
742 | + | case a: String => | |
743 | + | a | |
744 | + | case _ => | |
745 | + | throw("Auction Client was not found") | |
746 | + | } | |
747 | + | fromBase58String(a) | |
748 | + | } | |
703 | 749 | let currentTime = height | |
704 | 750 | let freelancerPubCheck = if ((callerPub == auctionFreelancer)) | |
705 | 751 | then callerPub | |
706 | 752 | else throw("Only a freelancer can indicate that the work is done") | |
707 | - | let timeIsOver = ((currentTime - auctionStart) > | |
753 | + | let timeIsOver = ((currentTime - auctionStart) > auctionExecutionTime) | |
708 | 754 | if ((auctionState == stateInProgress)) | |
709 | 755 | then if (timeIsOver) | |
710 | - | then { | |
711 | - | let newDataString = ((((((((((auctionDataList[1] + "_") + auctionDataList[2]) + "_") + auctionDataList[3]) + "_") + auctionDataList[4]) + "_") + auctionDataList[5]) + "_") + auctionDataList[6]) | |
712 | - | WriteSet([DataEntry(AuctionIdKey, ((((stateDispute + "_") + auctionInfo) + "_") + newDataString))]) | |
713 | - | } | |
714 | - | else { | |
715 | - | let newDataString = ((((((((((auctionDataList[1] + "_") + auctionDataList[2]) + "_") + auctionDataList[3]) + "_") + auctionDataList[4]) + "_") + auctionDataList[5]) + "_") + auctionDataList[6]) | |
716 | - | WriteSet([DataEntry(AuctionIdKey, ((((stateWait4Confirm + "_") + auctionInfo) + "_") + newDataString))]) | |
717 | - | } | |
756 | + | then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), "0")]) | |
757 | + | else WriteSet([DataEntry((auctionId + "_State"), stateWait4Confirm)]) | |
718 | 758 | else throw("Auction state is incorrect") | |
719 | 759 | } | |
720 | 760 | ||
722 | 762 | ||
723 | 763 | @Callable(i) | |
724 | 764 | func acceptWork (auctionId) = { | |
725 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
726 | - | let auctionDataList = getDataList(AuctionIdKey) | |
727 | - | let auctionState = auctionDataList[0] | |
728 | - | let auctionInfo = auctionDataList[1] | |
729 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
730 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
731 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
732 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
733 | - | let auctionAssetName = auctionDataList[6] | |
734 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
735 | - | let auctionFreelancer = auctionDataList[2] | |
736 | - | let caller = extract(i.callerPublicKey) | |
765 | + | let callerPub = extract(i.callerPublicKey) | |
766 | + | let auctionState = { | |
767 | + | let valueState = getString(this, (auctionId + "_State")) | |
768 | + | match valueState { | |
769 | + | case a: String => | |
770 | + | a | |
771 | + | case _ => | |
772 | + | throw("Auction State was not found") | |
773 | + | } | |
774 | + | } | |
775 | + | let auctionClient = { | |
776 | + | let valueClient = getString(this, (auctionId + "_Client")) | |
777 | + | let a = match valueClient { | |
778 | + | case a: String => | |
779 | + | a | |
780 | + | case _ => | |
781 | + | throw("Auction Client was not found") | |
782 | + | } | |
783 | + | fromBase58String(a) | |
784 | + | } | |
785 | + | let auctionStart = { | |
786 | + | let valueAuctionStart = getInteger(this, (auctionId + "_AuctionStart")) | |
787 | + | match valueAuctionStart { | |
788 | + | case a: Int => | |
789 | + | a | |
790 | + | case _ => | |
791 | + | throw("Auction Start time was not found") | |
792 | + | } | |
793 | + | } | |
794 | + | let auctionDuration = { | |
795 | + | let valueauctionDuration = getInteger(this, (auctionId + "_AuctionDuration")) | |
796 | + | match valueauctionDuration { | |
797 | + | case a: Int => | |
798 | + | a | |
799 | + | case _ => | |
800 | + | throw("Auction duration time was not found") | |
801 | + | } | |
802 | + | } | |
803 | + | let auctionExecutionTime = { | |
804 | + | let valueBlocksForExecution = getInteger(this, (auctionId + "JobPerformance")) | |
805 | + | match valueBlocksForExecution { | |
806 | + | case a: Int => | |
807 | + | a | |
808 | + | case _ => | |
809 | + | throw("Auction job performance time was not found") | |
810 | + | } | |
811 | + | } | |
812 | + | let auctionAssetName = { | |
813 | + | let valueAssetName = getString(this, (auctionId + "_AssetName")) | |
814 | + | match valueAssetName { | |
815 | + | case a: String => | |
816 | + | a | |
817 | + | case _ => | |
818 | + | throw("Auction asset name was not found") | |
819 | + | } | |
820 | + | } | |
821 | + | let auctionPrice = { | |
822 | + | let valuePrice = getInteger(this, (auctionId + "_Price")) | |
823 | + | match valuePrice { | |
824 | + | case a: Int => | |
825 | + | a | |
826 | + | case _ => | |
827 | + | throw("Auction price was not found") | |
828 | + | } | |
829 | + | } | |
830 | + | let auctionFreelancer = { | |
831 | + | let valueClient = getString(this, (auctionId + "_Freelancer")) | |
832 | + | let a = match valueClient { | |
833 | + | case a: String => | |
834 | + | a | |
835 | + | case _ => | |
836 | + | throw("Auction Client was not found") | |
837 | + | } | |
838 | + | fromBase58String(a) | |
839 | + | } | |
737 | 840 | let dAppCommission = ((auctionPrice * 3) / 100) | |
738 | 841 | let amountWithoutComm = (auctionPrice - dAppCommission) | |
842 | + | let auctionAssetId58 = AssetNameToBase58(auctionAssetName) | |
739 | 843 | let newRating = { | |
740 | - | let valueRating = getInteger(this, (auctionFreelancer + "_Rating")) | |
844 | + | let valueRating = getInteger(this, (toBase58String(auctionFreelancer) + "_Rating")) | |
741 | 845 | let currentRating = match valueRating { | |
742 | 846 | case a: Int => | |
743 | 847 | a | |
746 | 850 | } | |
747 | 851 | (currentRating + 1) | |
748 | 852 | } | |
749 | - | if (( | |
853 | + | if ((callerPub == auctionClient)) | |
750 | 854 | then if ((auctionState == stateWait4Confirm)) | |
751 | - | then { | |
752 | - | let newDataString = ((((((((((auctionDataList[1] + "_") + auctionDataList[2]) + "_") + auctionDataList[3]) + "_") + auctionDataList[4]) + "_") + auctionDataList[5]) + "_") + auctionDataList[6]) | |
753 | - | ScriptResult(WriteSet([DataEntry(AuctionIdKey, ((((stateComplete + "_") + auctionInfo) + "_") + newDataString)), DataEntry((auctionFreelancer + "_Rating"), newRating)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionFreelancer)), amountWithoutComm, AssetNameToBase58(auctionAssetName))])) | |
754 | - | } | |
855 | + | then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateComplete), DataEntry((toBase58String(auctionFreelancer) + "_Rating"), newRating)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionFreelancer), amountWithoutComm, auctionAssetId58)])) | |
755 | 856 | else throw(("Incorrect state. Must be: " + stateWait4Confirm)) | |
756 | 857 | else throw("Only auction customer can use this function") | |
757 | 858 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let day = 1440 | |
5 | 5 | ||
6 | 6 | let WAVES = unit | |
7 | 7 | ||
8 | 8 | let wBTC = base58'8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS' | |
9 | 9 | ||
10 | 10 | let wEUR = base58'Gtb1WRznfchDnTh37ezoDTJ4wcoKaRsKqKjJjy7nm2zU' | |
11 | 11 | ||
12 | 12 | let wUSD = base58'Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck' | |
13 | 13 | ||
14 | 14 | let stateOpen = "Opened" | |
15 | 15 | ||
16 | 16 | let stateSuggested = "Suggested" | |
17 | 17 | ||
18 | 18 | let stateCancel = "Canceled" | |
19 | 19 | ||
20 | 20 | let stateInProgress = "InProgress" | |
21 | 21 | ||
22 | 22 | let stateWait4Confirm = "WaitForConfirmation" | |
23 | 23 | ||
24 | 24 | let stateComplete = "Completed" | |
25 | 25 | ||
26 | 26 | let stateDispute = "Dispute" | |
27 | 27 | ||
28 | 28 | let stateDisputeResolved = "DisputeResolved" | |
29 | 29 | ||
30 | - | let | |
30 | + | let client = "CMR" | |
31 | 31 | ||
32 | 32 | let freelancer = "FL" | |
33 | 33 | ||
34 | 34 | let ambassador1 = base58'1' | |
35 | 35 | ||
36 | 36 | let ambassador2 = base58'1' | |
37 | 37 | ||
38 | 38 | let ambassador3 = base58'1' | |
39 | 39 | ||
40 | 40 | let ambassador4 = base58'1' | |
41 | 41 | ||
42 | 42 | let ambassador5 = base58'1' | |
43 | 43 | ||
44 | 44 | func AuctionIdDataKey (auctionId) = (auctionId + "_AuctionData") | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func getDataList (auctionId) = { | |
48 | 48 | let getDataString = getString(this, auctionId) | |
49 | 49 | let a = match getDataString { | |
50 | 50 | case a: String => | |
51 | 51 | a | |
52 | 52 | case _ => | |
53 | 53 | throw("AuctionId was not found") | |
54 | 54 | } | |
55 | 55 | split(a, "_") | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getDisputeDataList (auctionId) = { | |
60 | 60 | let keyDisputeData = ((auctionId + "_") + stateDispute) | |
61 | 61 | let getDisputeDataString = getString(this, keyDisputeData) | |
62 | 62 | let a = match getDisputeDataString { | |
63 | 63 | case a: String => | |
64 | 64 | a | |
65 | 65 | case _ => | |
66 | 66 | throw("Dispute data was not found") | |
67 | 67 | } | |
68 | 68 | split(a, "/") | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func AssetNameToBase58 (auctionAssetName) = if ((auctionAssetName == "WAVES")) | |
73 | 73 | then WAVES | |
74 | 74 | else if ((auctionAssetName == "BTC")) | |
75 | 75 | then wBTC | |
76 | 76 | else if ((auctionAssetName == "EUR")) | |
77 | 77 | then wEUR | |
78 | 78 | else if ((auctionAssetName == "USD")) | |
79 | 79 | then wUSD | |
80 | 80 | else throw("Incorrect Asset Id") | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func timeCheck (currentTime,startTime,expirationTime) = ((currentTime - startTime) > expirationTime) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func increaseFreezedBalance (pmtAssetName,auctionPrice) = { | |
87 | 87 | let keyFreezedFunds = getInteger(this, (pmtAssetName + "_Freezed")) | |
88 | 88 | let currentFreezedBalance = match keyFreezedFunds { | |
89 | 89 | case a: Int => | |
90 | 90 | a | |
91 | 91 | case _ => | |
92 | 92 | 0 | |
93 | 93 | } | |
94 | 94 | (currentFreezedBalance + auctionPrice) | |
95 | 95 | } | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func decreaseFreezedBalance (pmtAssetName,auctionPrice) = { | |
99 | 99 | let keyFreezedFunds = getInteger(this, (pmtAssetName + "_Freezed")) | |
100 | 100 | let currentFreezedBalance = match keyFreezedFunds { | |
101 | 101 | case a: Int => | |
102 | 102 | a | |
103 | 103 | case _ => | |
104 | 104 | 0 | |
105 | 105 | } | |
106 | 106 | let a = (currentFreezedBalance - auctionPrice) | |
107 | 107 | if ((a > 0)) | |
108 | 108 | then a | |
109 | 109 | else throw("Freezed amount couldn't be less than 0") | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func freelancerIsRegistered (callerPub) = { | |
114 | 114 | let freelancerIsRegistered = getString(this, (callerPub + "_Freelancer")) | |
115 | 115 | match freelancerIsRegistered { | |
116 | 116 | case a: String => | |
117 | 117 | callerPub | |
118 | 118 | case _ => | |
119 | 119 | throw("Only registered users can make bets") | |
120 | 120 | } | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | @Callable(i) | |
125 | 125 | func freelancerSignUp (info) = { | |
126 | 126 | let userPublicKey = toBase58String(i.callerPublicKey) | |
127 | 127 | let alreadyRegistered = getString(this, (userPublicKey + "_Freelancer")) | |
128 | 128 | if (isDefined(alreadyRegistered)) | |
129 | 129 | then throw("User already registered") | |
130 | 130 | else WriteSet([DataEntry((userPublicKey + "_Freelancer"), info)]) | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | ||
135 | 135 | @Callable(i) | |
136 | 136 | func clientSignUp (info) = { | |
137 | 137 | let userPublicKey = toBase58String(i.callerPublicKey) | |
138 | 138 | let alreadyRegistered = getString(this, (userPublicKey + "_Client")) | |
139 | 139 | if (isDefined(alreadyRegistered)) | |
140 | 140 | then throw("User already registered") | |
141 | 141 | else WriteSet([DataEntry((userPublicKey + "_Client"), info)]) | |
142 | 142 | } | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | ||
146 | 146 | @Callable(i) | |
147 | 147 | func createAuction (jobExecutionDays,auctionDurationDays,auctionInfo) = { | |
148 | 148 | let auctionId = toBase58String(i.transactionId) | |
149 | 149 | let auctionClient = toBase58String(i.callerPublicKey) | |
150 | 150 | let pmt = extract(i.payment) | |
151 | 151 | let pmtAmount = pmt.amount | |
152 | 152 | let auctionPrice = if ((pmtAmount > 0)) | |
153 | 153 | then pmtAmount | |
154 | 154 | else throw("Amount must be higher then 0") | |
155 | 155 | let auctionStart = height | |
156 | 156 | let auctionDurationBlocks = (auctionDurationDays * day) | |
157 | 157 | let blocksForExecution = (jobExecutionDays * day) | |
158 | 158 | let pmtAssetName = if (!(isDefined(pmt.assetId))) | |
159 | 159 | then "WAVES" | |
160 | 160 | else if ((pmt.assetId == wBTC)) | |
161 | 161 | then "BTC" | |
162 | 162 | else if ((pmt.assetId == wEUR)) | |
163 | 163 | then "EUR" | |
164 | 164 | else if ((pmt.assetId == wUSD)) | |
165 | 165 | then "USD" | |
166 | 166 | else throw("AssetId is incorrect") | |
167 | 167 | let newFreezedBalance = increaseFreezedBalance(pmtAssetName, auctionPrice) | |
168 | - | WriteSet([DataEntry((auctionId + "_State"), stateOpen), DataEntry((auctionId + "_Info"), auctionInfo), DataEntry((auctionId + "_Client"), auctionClient), DataEntry((auctionId + "_AuctionStart"), auctionStart), DataEntry((auctionId + "_AuctionDuration"), auctionDurationBlocks), DataEntry((auctionId + "JobPerformance"), blocksForExecution), DataEntry((auctionId + "_AssetName"), pmtAssetName), DataEntry((auctionId + "_Price"), auctionPrice), DataEntry((pmtAssetName + "_Freezed"), newFreezedBalance)]) | |
168 | + | WriteSet([DataEntry((auctionId + "_State"), stateOpen), DataEntry((auctionId + "_Info"), auctionInfo), DataEntry((auctionId + "_Client"), auctionClient), DataEntry((auctionId + "_AuctionStart"), auctionStart), DataEntry((auctionId + "_AuctionDuration"), auctionDurationBlocks), DataEntry((auctionId + "_JobPerformance"), blocksForExecution), DataEntry((auctionId + "_AssetName"), pmtAssetName), DataEntry((auctionId + "_Price"), auctionPrice), DataEntry((pmtAssetName + "_Freezed"), newFreezedBalance)]) | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | ||
173 | 173 | @Callable(i) | |
174 | 174 | func makeBid (auctionId,betPrice) = { | |
175 | 175 | let callerPub = toBase58String(i.callerPublicKey) | |
176 | 176 | let betTime = height | |
177 | 177 | let auctionState = { | |
178 | 178 | let valueState = getString(this, (auctionId + "_State")) | |
179 | 179 | match valueState { | |
180 | 180 | case a: String => | |
181 | 181 | a | |
182 | 182 | case _ => | |
183 | 183 | throw("Auction State was not found") | |
184 | 184 | } | |
185 | 185 | } | |
186 | 186 | let auctionInfo = { | |
187 | 187 | let valueAuctionInfo = getString(this, (auctionId + "_Info")) | |
188 | 188 | match valueAuctionInfo { | |
189 | 189 | case a: String => | |
190 | 190 | a | |
191 | 191 | case _ => | |
192 | 192 | throw("Auction info was not found") | |
193 | 193 | } | |
194 | 194 | } | |
195 | 195 | let auctionClient = { | |
196 | 196 | let valueClient = getString(this, (auctionId + "_Client")) | |
197 | 197 | let a = match valueClient { | |
198 | 198 | case a: String => | |
199 | 199 | a | |
200 | 200 | case _ => | |
201 | 201 | throw("Auction Client was not found") | |
202 | 202 | } | |
203 | 203 | fromBase58String(a) | |
204 | 204 | } | |
205 | 205 | let auctionStart = { | |
206 | 206 | let valueAuctionStart = getInteger(this, (auctionId + "_AuctionStart")) | |
207 | 207 | match valueAuctionStart { | |
208 | 208 | case a: Int => | |
209 | 209 | a | |
210 | 210 | case _ => | |
211 | 211 | throw("Auction Start time was not found") | |
212 | 212 | } | |
213 | 213 | } | |
214 | 214 | let auctionDuration = { | |
215 | 215 | let valueauctionDuration = getInteger(this, (auctionId + "_AuctionDuration")) | |
216 | 216 | match valueauctionDuration { | |
217 | 217 | case a: Int => | |
218 | 218 | a | |
219 | 219 | case _ => | |
220 | 220 | throw("Auction duration time was not found") | |
221 | 221 | } | |
222 | 222 | } | |
223 | 223 | let auctionBlocksForExecution = { | |
224 | 224 | let valueBlocksForExecution = getInteger(this, (auctionId + "JobPerformance")) | |
225 | 225 | match valueBlocksForExecution { | |
226 | 226 | case a: Int => | |
227 | 227 | a | |
228 | 228 | case _ => | |
229 | 229 | throw("Auction job performance time was not found") | |
230 | 230 | } | |
231 | 231 | } | |
232 | 232 | let auctionAssetName = { | |
233 | 233 | let valueAssetName = getString(this, (auctionId + "_AssetName")) | |
234 | 234 | match valueAssetName { | |
235 | 235 | case a: String => | |
236 | 236 | a | |
237 | 237 | case _ => | |
238 | 238 | throw("Auction asset name was not found") | |
239 | 239 | } | |
240 | 240 | } | |
241 | 241 | let auctionPrice = { | |
242 | 242 | let valuePrice = getInteger(this, (auctionId + "_Price")) | |
243 | 243 | match valuePrice { | |
244 | 244 | case a: Int => | |
245 | 245 | a | |
246 | 246 | case _ => | |
247 | 247 | throw("Auction price was not found") | |
248 | 248 | } | |
249 | 249 | } | |
250 | 250 | let auctionAssetId58 = AssetNameToBase58(auctionAssetName) | |
251 | 251 | let newFreelancer = freelancerIsRegistered(callerPub) | |
252 | 252 | let dAppCommission = ((auctionPrice * 3) / 100) | |
253 | 253 | let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice) | |
254 | 254 | let auctionTimeisOver = timeCheck(betTime, auctionStart, auctionDuration) | |
255 | 255 | if (auctionTimeisOver) | |
256 | 256 | then if ((auctionState == stateOpen)) | |
257 | 257 | then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), (auctionPrice - dAppCommission), auctionAssetId58)])) | |
258 | 258 | else if ((auctionState == stateSuggested)) | |
259 | 259 | then { | |
260 | 260 | let auctionLowestBidder = { | |
261 | 261 | let valueLowestBidder = getString(this, (auctionId + "_LowestBidderPub")) | |
262 | 262 | match valueLowestBidder { | |
263 | 263 | case a: String => | |
264 | 264 | a | |
265 | 265 | case _ => | |
266 | 266 | throw("Auction lowest bidder was not found") | |
267 | 267 | } | |
268 | 268 | } | |
269 | 269 | let newAuctionPrice = { | |
270 | 270 | let valueNewAuctionPrice = getInteger(this, ((auctionId + "_Bid_") + auctionLowestBidder)) | |
271 | 271 | match valueNewAuctionPrice { | |
272 | 272 | case a: Int => | |
273 | 273 | a | |
274 | 274 | case _ => | |
275 | 275 | throw("Auction lowest bid was not found") | |
276 | 276 | } | |
277 | 277 | } | |
278 | 278 | let amountDifference = ((auctionPrice - newAuctionPrice) - dAppCommission) | |
279 | 279 | ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_Freelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), newAuctionPrice)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), amountDifference, auctionAssetId58)])) | |
280 | 280 | } | |
281 | 281 | else throw("Incorrect auction state") | |
282 | 282 | else if ((auctionState == stateOpen)) | |
283 | 283 | then WriteSet([DataEntry(((auctionId + "_Bid_") + newFreelancer), betPrice), DataEntry((auctionId + "_State"), stateSuggested), DataEntry((auctionId + "_LowestBidderPub"), callerPub), DataEntry((auctionId + callerPub), betPrice)]) | |
284 | 284 | else if ((auctionState == stateSuggested)) | |
285 | 285 | then { | |
286 | 286 | let currentLowestBidderPub = { | |
287 | 287 | let lowestBidder = getString(this, (auctionId + "_LowestBidderPub")) | |
288 | 288 | match lowestBidder { | |
289 | 289 | case a: String => | |
290 | 290 | a | |
291 | 291 | case _ => | |
292 | 292 | throw("Auction lowest bidder was not found") | |
293 | 293 | } | |
294 | 294 | } | |
295 | 295 | let newLowestBidderPub = { | |
296 | 296 | let valueCurrentLowestBid = getInteger(this, ((auctionId + "_Bid_") + currentLowestBidderPub)) | |
297 | 297 | let currentLowestBid = match valueCurrentLowestBid { | |
298 | 298 | case a: Int => | |
299 | 299 | a | |
300 | 300 | case _ => | |
301 | 301 | throw("Auction lowest bid was not found") | |
302 | 302 | } | |
303 | 303 | if ((currentLowestBid > betPrice)) | |
304 | 304 | then newFreelancer | |
305 | 305 | else currentLowestBidderPub | |
306 | 306 | } | |
307 | 307 | WriteSet([DataEntry((auctionId + "_LowestBidderPub"), newLowestBidderPub), DataEntry(((auctionId + "_Bid_") + newFreelancer), betPrice)]) | |
308 | 308 | } | |
309 | 309 | else throw(((((("Incorrect jobId state. Now: " + auctionState) + ", must be: ") + stateOpen) + " or ") + stateSuggested)) | |
310 | 310 | } | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | ||
314 | 314 | @Callable(i) | |
315 | 315 | func chooseFreelancer (auctionId,freelancerPub) = { | |
316 | 316 | let callerPub = extract(i.callerPublicKey) | |
317 | 317 | let betTime = height | |
318 | 318 | let auctionState = { | |
319 | 319 | let valueState = getString(this, (auctionId + "_State")) | |
320 | 320 | match valueState { | |
321 | 321 | case a: String => | |
322 | 322 | a | |
323 | 323 | case _ => | |
324 | 324 | throw("Auction State was not found") | |
325 | 325 | } | |
326 | 326 | } | |
327 | 327 | let auctionClient = { | |
328 | 328 | let valueClient = getString(this, (auctionId + "_Client")) | |
329 | 329 | let a = match valueClient { | |
330 | 330 | case a: String => | |
331 | 331 | a | |
332 | 332 | case _ => | |
333 | 333 | throw("Auction Client was not found") | |
334 | 334 | } | |
335 | 335 | fromBase58String(a) | |
336 | 336 | } | |
337 | 337 | let auctionStart = { | |
338 | 338 | let valueAuctionStart = getInteger(this, (auctionId + "_AuctionStart")) | |
339 | 339 | match valueAuctionStart { | |
340 | 340 | case a: Int => | |
341 | 341 | a | |
342 | 342 | case _ => | |
343 | 343 | throw("Auction Start time was not found") | |
344 | 344 | } | |
345 | 345 | } | |
346 | 346 | let auctionDuration = { | |
347 | 347 | let valueauctionDuration = getInteger(this, (auctionId + "_AuctionDuration")) | |
348 | 348 | match valueauctionDuration { | |
349 | 349 | case a: Int => | |
350 | 350 | a | |
351 | 351 | case _ => | |
352 | 352 | throw("Auction duration time was not found") | |
353 | 353 | } | |
354 | 354 | } | |
355 | 355 | let auctionAssetName = { | |
356 | 356 | let valueAssetName = getString(this, (auctionId + "_AssetName")) | |
357 | 357 | match valueAssetName { | |
358 | 358 | case a: String => | |
359 | 359 | a | |
360 | 360 | case _ => | |
361 | 361 | throw("Auction asset name was not found") | |
362 | 362 | } | |
363 | 363 | } | |
364 | 364 | let auctionPrice = { | |
365 | 365 | let valuePrice = getInteger(this, (auctionId + "_Price")) | |
366 | 366 | match valuePrice { | |
367 | 367 | case a: Int => | |
368 | 368 | a | |
369 | 369 | case _ => | |
370 | 370 | throw("Auction price was not found") | |
371 | 371 | } | |
372 | 372 | } | |
373 | 373 | let auctionAssetId58 = AssetNameToBase58(auctionAssetName) | |
374 | 374 | let freelancerBidAmount = { | |
375 | 375 | let keyFreelancerBid = ((auctionId + "_") + freelancerPub) | |
376 | 376 | let valueFreelacerBid = getInteger(this, keyFreelancerBid) | |
377 | 377 | match valueFreelacerBid { | |
378 | 378 | case a: Int => | |
379 | 379 | a | |
380 | 380 | case _ => | |
381 | 381 | throw("Freelancer's bet was not found") | |
382 | 382 | } | |
383 | 383 | } | |
384 | 384 | let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice) | |
385 | 385 | let dAppCommission = ((auctionPrice * 3) / 100) | |
386 | 386 | let amountDifference = ((auctionPrice - freelancerBidAmount) - dAppCommission) | |
387 | 387 | let auctionTimeisOver = timeCheck(betTime, auctionStart, auctionDuration) | |
388 | 388 | if ((callerPub == auctionClient)) | |
389 | 389 | then if (auctionTimeisOver) | |
390 | 390 | then if ((auctionState == stateOpen)) | |
391 | 391 | then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), (auctionPrice - dAppCommission), auctionAssetId58)])) | |
392 | 392 | else if ((auctionState == stateSuggested)) | |
393 | 393 | then { | |
394 | 394 | let auctionLowestBidder = { | |
395 | 395 | let valueLowestBidder = getString(this, (auctionId + "_LowestBidderPub")) | |
396 | 396 | match valueLowestBidder { | |
397 | 397 | case a: String => | |
398 | 398 | a | |
399 | 399 | case _ => | |
400 | 400 | throw("Auction lowest bidder was not found") | |
401 | 401 | } | |
402 | 402 | } | |
403 | 403 | let newAuctionPrice = { | |
404 | 404 | let valueNewAuctionPrice = getInteger(this, ((auctionId + "_Bid_") + auctionLowestBidder)) | |
405 | 405 | match valueNewAuctionPrice { | |
406 | 406 | case a: Int => | |
407 | 407 | a | |
408 | 408 | case _ => | |
409 | 409 | throw("Auction lowest bid was not found") | |
410 | 410 | } | |
411 | 411 | } | |
412 | 412 | WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_Freelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), newAuctionPrice)]) | |
413 | 413 | } | |
414 | 414 | else throw("Incorrect auction state") | |
415 | 415 | else { | |
416 | 416 | let setNewFreelancer = { | |
417 | 417 | let newFreelancer = getInteger(this, ((auctionId + "_Bid_") + freelancerPub)) | |
418 | 418 | match newFreelancer { | |
419 | 419 | case a: Int => | |
420 | 420 | freelancerPub | |
421 | 421 | case _ => | |
422 | 422 | throw("Error: Incorrect freelancerPub") | |
423 | 423 | } | |
424 | 424 | } | |
425 | 425 | let setNewPrice = { | |
426 | 426 | let lowestBidder = getInteger(this, ((auctionId + "_Bid_") + freelancerPub)) | |
427 | 427 | match lowestBidder { | |
428 | 428 | case a: Int => | |
429 | 429 | a | |
430 | 430 | case _ => | |
431 | 431 | throw("Auction lowest bidder was not found") | |
432 | 432 | } | |
433 | 433 | } | |
434 | 434 | ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_Freelancer"), setNewFreelancer), DataEntry((auctionId + "_Price"), setNewPrice)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), amountDifference, auctionAssetId58)])) | |
435 | 435 | } | |
436 | 436 | else throw("Only auction customer can choose a freelancer") | |
437 | 437 | } | |
438 | 438 | ||
439 | 439 | ||
440 | 440 | ||
441 | 441 | @Callable(i) | |
442 | 442 | func increaseExecutionTime (auctionId,executionDays) = { | |
443 | 443 | let caller = extract(i.callerPublicKey) | |
444 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
445 | - | let auctionDataList = getDataList(AuctionIdKey) | |
446 | - | let auctionState = auctionDataList[0] | |
444 | + | let auctionState = { | |
445 | + | let valueState = getString(this, (auctionId + "_State")) | |
446 | + | match valueState { | |
447 | + | case a: String => | |
448 | + | a | |
449 | + | case _ => | |
450 | + | throw("Auction State was not found") | |
451 | + | } | |
452 | + | } | |
447 | 453 | let auctionClient = { | |
448 | 454 | let valueClient = getString(this, (auctionId + "_Client")) | |
449 | 455 | let a = match valueClient { | |
450 | 456 | case a: String => | |
451 | 457 | a | |
452 | 458 | case _ => | |
453 | 459 | throw("Auction Client was not found") | |
454 | 460 | } | |
455 | 461 | fromBase58String(a) | |
456 | 462 | } | |
457 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
458 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
459 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
460 | - | let auctionAssetName = auctionDataList[6] | |
461 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
463 | + | let auctionExecutionTime = { | |
464 | + | let valueBlocksForExecution = getInteger(this, (auctionId + "JobPerformance")) | |
465 | + | match valueBlocksForExecution { | |
466 | + | case a: Int => | |
467 | + | a | |
468 | + | case _ => | |
469 | + | throw("Auction job performance time was not found") | |
470 | + | } | |
471 | + | } | |
462 | 472 | let newAuctionExecutionTime = { | |
463 | 473 | let newAuctionBlocksForExecution = (executionDays * day) | |
464 | - | if ((newAuctionBlocksForExecution > | |
474 | + | if ((newAuctionBlocksForExecution > auctionExecutionTime)) | |
465 | 475 | then newAuctionBlocksForExecution | |
466 | 476 | else throw("New execution time must more than current execution time") | |
467 | 477 | } | |
468 | 478 | if ((caller == auctionClient)) | |
469 | - | then if ((auctionState == stateOpen)) | |
470 | - | then WriteSet([DataEntry(AuctionIdKey, ((((((((((((auctionState + "_") + toBase58String(auctionClient)) + "_") + toString(auctionStart)) + "_") + toString(auctionDuration)) + "_") + toString(auctionBlocksForExecution)) + "_") + auctionAssetName) + "_") + toString(auctionPrice)))]) | |
471 | - | else if (if ((auctionState == stateSuggested)) | |
472 | - | then true | |
473 | - | else (auctionState == stateInProgress)) | |
474 | - | then { | |
475 | - | let freelancerPub = auctionDataList[7] | |
476 | - | WriteSet([DataEntry(AuctionIdKey, ((((((((((((((auctionState + "_") + toBase58String(auctionClient)) + "_") + toString(auctionStart)) + "_") + toString(auctionDuration)) + "_") + toString(auctionBlocksForExecution)) + "_") + auctionAssetName) + "_") + toString(auctionPrice)) + "_") + freelancerPub))]) | |
477 | - | } | |
478 | - | else throw("Incorrect state") | |
479 | - | else throw("Only customer can increase execution time") | |
479 | + | then if (if (if ((auctionState == stateOpen)) | |
480 | + | then true | |
481 | + | else (auctionState == stateSuggested)) | |
482 | + | then true | |
483 | + | else (auctionState == stateInProgress)) | |
484 | + | then WriteSet([DataEntry((auctionId + "JobPerformance"), newAuctionExecutionTime)]) | |
485 | + | else throw("Incorrect state") | |
486 | + | else throw("Only Client can increase execution time") | |
480 | 487 | } | |
481 | 488 | ||
482 | 489 | ||
483 | 490 | ||
484 | 491 | @Callable(i) | |
485 | 492 | func cancelAuction (auctionId) = { | |
486 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
487 | - | let auctionDataList = getDataList(AuctionIdKey) | |
488 | - | let auctionState = auctionDataList[0] | |
489 | - | let auctionInfo = auctionDataList[1] | |
490 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
491 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
492 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
493 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
494 | - | let auctionAssetName = auctionDataList[6] | |
495 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
496 | - | let auctionIdOwnerCheck = if ((i.callerPublicKey == auctionCustomer)) | |
493 | + | let callerPub = extract(i.callerPublicKey) | |
494 | + | let auctionState = { | |
495 | + | let valueState = getString(this, (auctionId + "_State")) | |
496 | + | match valueState { | |
497 | + | case a: String => | |
498 | + | a | |
499 | + | case _ => | |
500 | + | throw("Auction State was not found") | |
501 | + | } | |
502 | + | } | |
503 | + | let auctionClient = { | |
504 | + | let valueClient = getString(this, (auctionId + "_Client")) | |
505 | + | let a = match valueClient { | |
506 | + | case a: String => | |
507 | + | a | |
508 | + | case _ => | |
509 | + | throw("Auction Client was not found") | |
510 | + | } | |
511 | + | fromBase58String(a) | |
512 | + | } | |
513 | + | let callerIsClient = if ((callerPub == auctionClient)) | |
497 | 514 | then true | |
498 | 515 | else throw("Auction can be canceled only by owner.") | |
499 | - | if ((auctionState == stateOpen)) | |
500 | - | then WriteSet([DataEntry(AuctionIdKey, ((((((((((((((stateCancel + "_") + auctionInfo) + "_") + toBase58String(auctionCustomer)) + "_") + toString(auctionStart)) + "_") + toString(auctionDuration)) + "_") + toString(auctionBlocksForExecution)) + "_") + auctionAssetName) + "_") + toString(auctionPrice)))]) | |
501 | - | else throw("Incorrect auction state.") | |
516 | + | if (callerIsClient) | |
517 | + | then if ((auctionState == stateOpen)) | |
518 | + | then WriteSet([DataEntry((auctionId + "_State"), stateCancel)]) | |
519 | + | else throw("Incorrect auction state.") | |
520 | + | else throw("Only Client can cancel auction") | |
502 | 521 | } | |
503 | 522 | ||
504 | 523 | ||
505 | 524 | ||
506 | 525 | @Callable(i) | |
507 | 526 | func openDispute (auctionId) = { | |
508 | 527 | let caller = extract(i.callerPublicKey) | |
509 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
510 | - | let auctionDataList = getDataList(AuctionIdKey) | |
511 | - | let auctionState = auctionDataList[0] | |
512 | - | let auctionInfo = auctionDataList[1] | |
513 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
514 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
515 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
516 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
517 | - | let auctionAssetName = auctionDataList[6] | |
518 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
519 | - | let auctionFreelancer = fromBase58String(auctionDataList[8]) | |
520 | - | if (if ((caller == auctionCustomer)) | |
528 | + | let auctionState = { | |
529 | + | let valueState = getString(this, (auctionId + "_State")) | |
530 | + | match valueState { | |
531 | + | case a: String => | |
532 | + | a | |
533 | + | case _ => | |
534 | + | throw("Auction State was not found") | |
535 | + | } | |
536 | + | } | |
537 | + | let auctionClient = { | |
538 | + | let valueClient = getString(this, (auctionId + "_Client")) | |
539 | + | let a = match valueClient { | |
540 | + | case a: String => | |
541 | + | a | |
542 | + | case _ => | |
543 | + | throw("Auction Client was not found") | |
544 | + | } | |
545 | + | fromBase58String(a) | |
546 | + | } | |
547 | + | let auctionFreelancer = { | |
548 | + | let valueClient = getString(this, (auctionId + "_Freelancer")) | |
549 | + | let a = match valueClient { | |
550 | + | case a: String => | |
551 | + | a | |
552 | + | case _ => | |
553 | + | throw("Auction Client was not found") | |
554 | + | } | |
555 | + | fromBase58String(a) | |
556 | + | } | |
557 | + | if (if ((auctionState == stateOpen)) | |
521 | 558 | then true | |
522 | - | else (caller == auctionFreelancer)) | |
523 | - | then { | |
524 | - | let dataString = "1" | |
525 | - | WriteSet([DataEntry(AuctionIdKey, ((((stateDispute + "_") + auctionInfo) + "_") + dataString)), DataEntry((auctionId + "_Dispute"), "0")]) | |
526 | - | } | |
527 | - | else throw("Only customer and freelancer can open dispute") | |
559 | + | else (auctionState == stateSuggested)) | |
560 | + | then throw("Incorrect auction state for dispute opening") | |
561 | + | else if (if ((caller == auctionClient)) | |
562 | + | then true | |
563 | + | else (caller == auctionFreelancer)) | |
564 | + | then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), 0)]) | |
565 | + | else throw("Only customer and freelancer can open dispute") | |
528 | 566 | } | |
529 | 567 | ||
530 | 568 | ||
531 | 569 | ||
532 | 570 | @Callable(i) | |
533 | 571 | func voteDispute (auctionId,vote) = { | |
534 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
535 | - | let auctionDataList = getDataList(AuctionIdKey) | |
536 | - | let auctionState = auctionDataList[0] | |
537 | - | let auctionInfo = auctionDataList[1] | |
538 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
539 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
540 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
541 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
542 | - | let auctionAssetName = auctionDataList[6] | |
543 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
544 | - | let auctionFreelancer = fromBase58String(auctionDataList[8]) | |
572 | + | let callerPub = extract(i.callerPublicKey) | |
573 | + | let auctionState = { | |
574 | + | let valueState = getString(this, (auctionId + "_State")) | |
575 | + | match valueState { | |
576 | + | case a: String => | |
577 | + | a | |
578 | + | case _ => | |
579 | + | throw("Auction State was not found") | |
580 | + | } | |
581 | + | } | |
582 | + | let auctionClient = { | |
583 | + | let valueClient = getString(this, (auctionId + "_Client")) | |
584 | + | let a = match valueClient { | |
585 | + | case a: String => | |
586 | + | a | |
587 | + | case _ => | |
588 | + | throw("Auction Client was not found") | |
589 | + | } | |
590 | + | fromBase58String(a) | |
591 | + | } | |
592 | + | let auctionAssetName = { | |
593 | + | let valueAssetName = getString(this, (auctionId + "_AssetName")) | |
594 | + | match valueAssetName { | |
595 | + | case a: String => | |
596 | + | a | |
597 | + | case _ => | |
598 | + | throw("Auction asset name was not found") | |
599 | + | } | |
600 | + | } | |
601 | + | let auctionPrice = { | |
602 | + | let valuePrice = getInteger(this, (auctionId + "_Price")) | |
603 | + | match valuePrice { | |
604 | + | case a: Int => | |
605 | + | a | |
606 | + | case _ => | |
607 | + | throw("Auction price was not found") | |
608 | + | } | |
609 | + | } | |
610 | + | let auctionFreelancer = { | |
611 | + | let valueClient = getString(this, (auctionId + "_Freelancer")) | |
612 | + | let a = match valueClient { | |
613 | + | case a: String => | |
614 | + | a | |
615 | + | case _ => | |
616 | + | throw("Auction Client was not found") | |
617 | + | } | |
618 | + | fromBase58String(a) | |
619 | + | } | |
545 | 620 | let comission = ((auctionPrice * 3) / 100) | |
546 | - | let auctionStateCheck = if ((auctionState == stateDispute)) | |
621 | + | let auctionAssetId58 = AssetNameToBase58(auctionAssetName) | |
622 | + | let callerIsAmbassador = if (if (if (if (if ((callerPub == ambassador1)) | |
547 | 623 | then true | |
548 | - | else throw(("Incorrect state. Must be: " + stateDispute)) | |
549 | - | let newVote = if (if ((vote == customer)) | |
624 | + | else (callerPub == ambassador2)) | |
625 | + | then true | |
626 | + | else (callerPub == ambassador3)) | |
627 | + | then true | |
628 | + | else (callerPub == ambassador4)) | |
629 | + | then true | |
630 | + | else (callerPub == ambassador5)) | |
631 | + | then toBase58String(callerPub) | |
632 | + | else throw("Only defined ambassadors can vote in disputes") | |
633 | + | let newVote = if (if ((vote == client)) | |
550 | 634 | then true | |
551 | 635 | else (vote == freelancer)) | |
552 | 636 | then vote | |
553 | - | else throw(((("Vote is incorrect. Must be: " + customer) + " or ") + freelancer)) | |
554 | - | let newVoter = if (if (if (if (if ((i.callerPublicKey == ambassador1)) | |
555 | - | then true | |
556 | - | else (i.callerPublicKey == ambassador2)) | |
557 | - | then true | |
558 | - | else (i.callerPublicKey == ambassador3)) | |
559 | - | then true | |
560 | - | else (i.callerPublicKey == ambassador4)) | |
561 | - | then true | |
562 | - | else (i.callerPublicKey == ambassador5)) | |
563 | - | then toBase58String(i.callerPublicKey) | |
564 | - | else throw("You have no rights for disputes resolving") | |
565 | - | let disputeData = { | |
566 | - | let keyDispute = ((auctionId + "_") + stateDispute) | |
567 | - | let valueDispute = getString(this, keyDispute) | |
568 | - | match valueDispute { | |
637 | + | else throw(((("Vote is incorrect. Must be: " + client) + " or ") + freelancer)) | |
638 | + | let newVoter = { | |
639 | + | let keyVoter = ((auctionId + "_DiputeVote_") + callerIsAmbassador) | |
640 | + | let valueVoter = getString(this, keyVoter) | |
641 | + | match valueVoter { | |
569 | 642 | case a: String => | |
643 | + | throw("User already voted") | |
644 | + | case _ => | |
645 | + | callerIsAmbassador | |
646 | + | } | |
647 | + | } | |
648 | + | let votesNumber = { | |
649 | + | let valueVotesNumber = getInteger(this, (auctionId + "_DisputeVotes")) | |
650 | + | match valueVotesNumber { | |
651 | + | case a: Int => | |
570 | 652 | a | |
571 | 653 | case _ => | |
572 | - | throw(" | |
654 | + | throw("VotesNumber was not found") | |
573 | 655 | } | |
574 | 656 | } | |
575 | - | let disputeDataList = split(disputeData, "/") | |
576 | - | let votesCounter = disputeDataList[0] | |
577 | - | if ((votesCounter == "4")) | |
578 | - | then { | |
579 | - | let votersList = split(disputeDataList[1], "_") | |
580 | - | let votesList = split(disputeDataList[2], "_") | |
581 | - | let alreadyVoted = if ((newVoter == votersList[0])) | |
582 | - | then true | |
583 | - | else (newVoter == votersList[1]) | |
584 | - | if (alreadyVoted) | |
585 | - | then throw("You already voted") | |
586 | - | else { | |
587 | - | let newVotesCounter = "5" | |
588 | - | let newVoters = ((disputeDataList[1] + "_") + newVoter) | |
589 | - | let newVotes = ((disputeDataList[2] + "_") + newVote) | |
590 | - | let newDisputeDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
591 | - | let disputeWinner = { | |
592 | - | let vote1 = if ((votesList[0] == customer)) | |
593 | - | then 1 | |
594 | - | else 0 | |
595 | - | let vote2 = if ((votesList[1] == customer)) | |
596 | - | then 1 | |
597 | - | else 0 | |
598 | - | let vote3 = if ((votesList[2] == customer)) | |
599 | - | then 1 | |
600 | - | else 0 | |
601 | - | let vote4 = if ((votesList[3] == customer)) | |
602 | - | then 1 | |
603 | - | else 0 | |
604 | - | let vote5 = if ((newVote == customer)) | |
605 | - | then 1 | |
606 | - | else 0 | |
607 | - | let customerVotes = ((((vote1 + vote2) + vote3) + vote4) + vote5) | |
608 | - | if ((customerVotes > 2)) | |
609 | - | then customer | |
610 | - | else freelancer | |
611 | - | } | |
612 | - | let newDataString = ((((((((((((((auctionInfo + "_") + toBase58String(auctionCustomer)) + "_") + toString(auctionStart)) + "_") + toString(auctionDuration)) + "_") + toString(auctionBlocksForExecution)) + "_") + auctionAssetName) + "_") + toString(auctionPrice)) + "_") + toBase58String(auctionFreelancer)) | |
613 | - | let disputeWinnerPublic = if ((disputeWinner == customer)) | |
614 | - | then auctionCustomer | |
657 | + | if ((auctionState == stateDispute)) | |
658 | + | then if ((votesNumber == 4)) | |
659 | + | then { | |
660 | + | let disputeWinner = { | |
661 | + | let ambassador1Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador1))) | |
662 | + | let ambassador2Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador2))) | |
663 | + | let ambassador3Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador3))) | |
664 | + | let ambassador4Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador4))) | |
665 | + | let ambassador5Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador5))) | |
666 | + | let v1 = if ((ambassador1Vote == client)) | |
667 | + | then 1 | |
668 | + | else 0 | |
669 | + | let v2 = if ((ambassador2Vote == client)) | |
670 | + | then 1 | |
671 | + | else 0 | |
672 | + | let v3 = if ((ambassador3Vote == client)) | |
673 | + | then 1 | |
674 | + | else 0 | |
675 | + | let v4 = if ((ambassador4Vote == client)) | |
676 | + | then 1 | |
677 | + | else 0 | |
678 | + | let v5 = if ((ambassador5Vote == client)) | |
679 | + | then 1 | |
680 | + | else 0 | |
681 | + | let currentVote = if ((newVote == client)) | |
682 | + | then 1 | |
683 | + | else 0 | |
684 | + | let votesForClient = (((((v1 + v2) + v3) + v4) + v5) + currentVote) | |
685 | + | if ((votesForClient > 2)) | |
686 | + | then auctionClient | |
615 | 687 | else auctionFreelancer | |
616 | - | let amountWithoutComm = if ((disputeWinnerPublic == auctionCustomer)) | |
617 | - | then (auctionPrice - comission) | |
618 | - | else ((auctionPrice - comission) - comission) | |
619 | - | ScriptResult(WriteSet([DataEntry(AuctionIdDataKey(auctionId), ((stateDisputeResolved + "_") + newDataString)), DataEntry(((auctionId + "_") + stateDispute), newDisputeDataString)]), TransferSet([ScriptTransfer(addressFromPublicKey(disputeWinnerPublic), amountWithoutComm, AssetNameToBase58(auctionAssetName))])) | |
620 | 688 | } | |
621 | - | } | |
622 | - | else { | |
623 | - | let newDisputeDataString = if ((votesCounter == "0")) | |
624 | - | then { | |
625 | - | let newVotesCounter = "1" | |
626 | - | let newVoters = newVoter | |
627 | - | let newVotes = newVote | |
628 | - | let newDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
629 | - | newDataString | |
630 | - | } | |
631 | - | else if ((votesCounter == "1")) | |
632 | - | then { | |
633 | - | let voter1 = disputeDataList[1] | |
634 | - | let vote1 = disputeDataList[2] | |
635 | - | let alreadyVoted = (newVoter == voter1) | |
636 | - | if (alreadyVoted) | |
637 | - | then throw("You already voted") | |
638 | - | else { | |
639 | - | let newVotesCounter = "1" | |
640 | - | let newVoters = (voter1 + newVoter) | |
641 | - | let newVotes = (vote1 + newVote) | |
642 | - | let newDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
643 | - | newDataString | |
644 | - | } | |
645 | - | } | |
646 | - | else if ((votesCounter == "2")) | |
647 | - | then { | |
648 | - | let votersList = split(disputeDataList[1], "_") | |
649 | - | let votesList = split(disputeDataList[2], "_") | |
650 | - | let alreadyVoted = if ((newVoter == votersList[0])) | |
651 | - | then true | |
652 | - | else (newVoter == votersList[1]) | |
653 | - | if (alreadyVoted) | |
654 | - | then throw("You already voted") | |
655 | - | else { | |
656 | - | let newVotesCounter = "3" | |
657 | - | let newVoters = ((disputeDataList[1] + "_") + newVoter) | |
658 | - | let newVotes = ((disputeDataList[2] + "_") + newVote) | |
659 | - | let newDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
660 | - | newDataString | |
661 | - | } | |
662 | - | } | |
663 | - | else if ((votesCounter == "3")) | |
664 | - | then { | |
665 | - | let votersList = split(disputeDataList[1], "_") | |
666 | - | let votesList = split(disputeDataList[2], "_") | |
667 | - | let alreadyVoted = if (if ((newVoter == votersList[0])) | |
668 | - | then true | |
669 | - | else (newVoter == votersList[1])) | |
670 | - | then true | |
671 | - | else (newVoter == votersList[2]) | |
672 | - | if (alreadyVoted) | |
673 | - | then throw("You already voted") | |
674 | - | else { | |
675 | - | let newVotesCounter = "4" | |
676 | - | let newVoters = ((disputeDataList[1] + "_") + newVoter) | |
677 | - | let newVotes = ((disputeDataList[2] + "_") + newVote) | |
678 | - | let newDataString = ((((newVotesCounter + "/") + newVoters) + "/") + newVotes) | |
679 | - | newDataString | |
680 | - | } | |
681 | - | } | |
682 | - | else throw("Dispute has been already resolved") | |
683 | - | WriteSet([DataEntry(((auctionId + "_") + stateDispute), newDisputeDataString)]) | |
684 | - | } | |
689 | + | let paymentWithoutComm = if ((disputeWinner == auctionClient)) | |
690 | + | then auctionPrice | |
691 | + | else (auctionPrice - comission) | |
692 | + | ScriptResult(WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry((auctionId + "_State"), stateDisputeResolved), DataEntry(((auctionId + "_DiputeVote_") + callerIsAmbassador), newVote)]), TransferSet([ScriptTransfer(addressFromPublicKey(disputeWinner), paymentWithoutComm, auctionAssetId58)])) | |
693 | + | } | |
694 | + | else WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry(((auctionId + "_DiputeVote_") + callerIsAmbassador), newVote)]) | |
695 | + | else throw(("Incorrect state. Must be: " + stateDispute)) | |
685 | 696 | } | |
686 | 697 | ||
687 | 698 | ||
688 | 699 | ||
689 | 700 | @Callable(i) | |
690 | 701 | func workHandOver (auctionId) = { | |
691 | 702 | let callerPub = extract(i.callerPublicKey) | |
692 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
693 | - | let auctionDataList = getDataList(AuctionIdKey) | |
694 | - | let auctionState = auctionDataList[0] | |
695 | - | let auctionInfo = auctionDataList[1] | |
696 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
697 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
698 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
699 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
700 | - | let auctionAssetName = auctionDataList[6] | |
701 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
702 | - | let auctionFreelancer = fromBase58String(auctionDataList[8]) | |
703 | + | let auctionState = { | |
704 | + | let valueState = getString(this, (auctionId + "_State")) | |
705 | + | match valueState { | |
706 | + | case a: String => | |
707 | + | a | |
708 | + | case _ => | |
709 | + | throw("Auction State was not found") | |
710 | + | } | |
711 | + | } | |
712 | + | let auctionStart = { | |
713 | + | let valueAuctionStart = getInteger(this, (auctionId + "_AuctionStart")) | |
714 | + | match valueAuctionStart { | |
715 | + | case a: Int => | |
716 | + | a | |
717 | + | case _ => | |
718 | + | throw("Auction Start time was not found") | |
719 | + | } | |
720 | + | } | |
721 | + | let auctionDuration = { | |
722 | + | let valueauctionDuration = getInteger(this, (auctionId + "_AuctionDuration")) | |
723 | + | match valueauctionDuration { | |
724 | + | case a: Int => | |
725 | + | a | |
726 | + | case _ => | |
727 | + | throw("Auction duration time was not found") | |
728 | + | } | |
729 | + | } | |
730 | + | let auctionExecutionTime = { | |
731 | + | let valueBlocksForExecution = getInteger(this, (auctionId + "JobPerformance")) | |
732 | + | match valueBlocksForExecution { | |
733 | + | case a: Int => | |
734 | + | a | |
735 | + | case _ => | |
736 | + | throw("Auction job performance time was not found") | |
737 | + | } | |
738 | + | } | |
739 | + | let auctionFreelancer = { | |
740 | + | let valueClient = getString(this, (auctionId + "_Freelancer")) | |
741 | + | let a = match valueClient { | |
742 | + | case a: String => | |
743 | + | a | |
744 | + | case _ => | |
745 | + | throw("Auction Client was not found") | |
746 | + | } | |
747 | + | fromBase58String(a) | |
748 | + | } | |
703 | 749 | let currentTime = height | |
704 | 750 | let freelancerPubCheck = if ((callerPub == auctionFreelancer)) | |
705 | 751 | then callerPub | |
706 | 752 | else throw("Only a freelancer can indicate that the work is done") | |
707 | - | let timeIsOver = ((currentTime - auctionStart) > | |
753 | + | let timeIsOver = ((currentTime - auctionStart) > auctionExecutionTime) | |
708 | 754 | if ((auctionState == stateInProgress)) | |
709 | 755 | then if (timeIsOver) | |
710 | - | then { | |
711 | - | let newDataString = ((((((((((auctionDataList[1] + "_") + auctionDataList[2]) + "_") + auctionDataList[3]) + "_") + auctionDataList[4]) + "_") + auctionDataList[5]) + "_") + auctionDataList[6]) | |
712 | - | WriteSet([DataEntry(AuctionIdKey, ((((stateDispute + "_") + auctionInfo) + "_") + newDataString))]) | |
713 | - | } | |
714 | - | else { | |
715 | - | let newDataString = ((((((((((auctionDataList[1] + "_") + auctionDataList[2]) + "_") + auctionDataList[3]) + "_") + auctionDataList[4]) + "_") + auctionDataList[5]) + "_") + auctionDataList[6]) | |
716 | - | WriteSet([DataEntry(AuctionIdKey, ((((stateWait4Confirm + "_") + auctionInfo) + "_") + newDataString))]) | |
717 | - | } | |
756 | + | then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), "0")]) | |
757 | + | else WriteSet([DataEntry((auctionId + "_State"), stateWait4Confirm)]) | |
718 | 758 | else throw("Auction state is incorrect") | |
719 | 759 | } | |
720 | 760 | ||
721 | 761 | ||
722 | 762 | ||
723 | 763 | @Callable(i) | |
724 | 764 | func acceptWork (auctionId) = { | |
725 | - | let AuctionIdKey = AuctionIdDataKey(auctionId) | |
726 | - | let auctionDataList = getDataList(AuctionIdKey) | |
727 | - | let auctionState = auctionDataList[0] | |
728 | - | let auctionInfo = auctionDataList[1] | |
729 | - | let auctionCustomer = fromBase58String(auctionDataList[2]) | |
730 | - | let auctionStart = parseIntValue(auctionDataList[3]) | |
731 | - | let auctionDuration = parseIntValue(auctionDataList[4]) | |
732 | - | let auctionBlocksForExecution = parseIntValue(auctionDataList[5]) | |
733 | - | let auctionAssetName = auctionDataList[6] | |
734 | - | let auctionPrice = parseIntValue(auctionDataList[7]) | |
735 | - | let auctionFreelancer = auctionDataList[2] | |
736 | - | let caller = extract(i.callerPublicKey) | |
765 | + | let callerPub = extract(i.callerPublicKey) | |
766 | + | let auctionState = { | |
767 | + | let valueState = getString(this, (auctionId + "_State")) | |
768 | + | match valueState { | |
769 | + | case a: String => | |
770 | + | a | |
771 | + | case _ => | |
772 | + | throw("Auction State was not found") | |
773 | + | } | |
774 | + | } | |
775 | + | let auctionClient = { | |
776 | + | let valueClient = getString(this, (auctionId + "_Client")) | |
777 | + | let a = match valueClient { | |
778 | + | case a: String => | |
779 | + | a | |
780 | + | case _ => | |
781 | + | throw("Auction Client was not found") | |
782 | + | } | |
783 | + | fromBase58String(a) | |
784 | + | } | |
785 | + | let auctionStart = { | |
786 | + | let valueAuctionStart = getInteger(this, (auctionId + "_AuctionStart")) | |
787 | + | match valueAuctionStart { | |
788 | + | case a: Int => | |
789 | + | a | |
790 | + | case _ => | |
791 | + | throw("Auction Start time was not found") | |
792 | + | } | |
793 | + | } | |
794 | + | let auctionDuration = { | |
795 | + | let valueauctionDuration = getInteger(this, (auctionId + "_AuctionDuration")) | |
796 | + | match valueauctionDuration { | |
797 | + | case a: Int => | |
798 | + | a | |
799 | + | case _ => | |
800 | + | throw("Auction duration time was not found") | |
801 | + | } | |
802 | + | } | |
803 | + | let auctionExecutionTime = { | |
804 | + | let valueBlocksForExecution = getInteger(this, (auctionId + "JobPerformance")) | |
805 | + | match valueBlocksForExecution { | |
806 | + | case a: Int => | |
807 | + | a | |
808 | + | case _ => | |
809 | + | throw("Auction job performance time was not found") | |
810 | + | } | |
811 | + | } | |
812 | + | let auctionAssetName = { | |
813 | + | let valueAssetName = getString(this, (auctionId + "_AssetName")) | |
814 | + | match valueAssetName { | |
815 | + | case a: String => | |
816 | + | a | |
817 | + | case _ => | |
818 | + | throw("Auction asset name was not found") | |
819 | + | } | |
820 | + | } | |
821 | + | let auctionPrice = { | |
822 | + | let valuePrice = getInteger(this, (auctionId + "_Price")) | |
823 | + | match valuePrice { | |
824 | + | case a: Int => | |
825 | + | a | |
826 | + | case _ => | |
827 | + | throw("Auction price was not found") | |
828 | + | } | |
829 | + | } | |
830 | + | let auctionFreelancer = { | |
831 | + | let valueClient = getString(this, (auctionId + "_Freelancer")) | |
832 | + | let a = match valueClient { | |
833 | + | case a: String => | |
834 | + | a | |
835 | + | case _ => | |
836 | + | throw("Auction Client was not found") | |
837 | + | } | |
838 | + | fromBase58String(a) | |
839 | + | } | |
737 | 840 | let dAppCommission = ((auctionPrice * 3) / 100) | |
738 | 841 | let amountWithoutComm = (auctionPrice - dAppCommission) | |
842 | + | let auctionAssetId58 = AssetNameToBase58(auctionAssetName) | |
739 | 843 | let newRating = { | |
740 | - | let valueRating = getInteger(this, (auctionFreelancer + "_Rating")) | |
844 | + | let valueRating = getInteger(this, (toBase58String(auctionFreelancer) + "_Rating")) | |
741 | 845 | let currentRating = match valueRating { | |
742 | 846 | case a: Int => | |
743 | 847 | a | |
744 | 848 | case _ => | |
745 | 849 | 0 | |
746 | 850 | } | |
747 | 851 | (currentRating + 1) | |
748 | 852 | } | |
749 | - | if (( | |
853 | + | if ((callerPub == auctionClient)) | |
750 | 854 | then if ((auctionState == stateWait4Confirm)) | |
751 | - | then { | |
752 | - | let newDataString = ((((((((((auctionDataList[1] + "_") + auctionDataList[2]) + "_") + auctionDataList[3]) + "_") + auctionDataList[4]) + "_") + auctionDataList[5]) + "_") + auctionDataList[6]) | |
753 | - | ScriptResult(WriteSet([DataEntry(AuctionIdKey, ((((stateComplete + "_") + auctionInfo) + "_") + newDataString)), DataEntry((auctionFreelancer + "_Rating"), newRating)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionFreelancer)), amountWithoutComm, AssetNameToBase58(auctionAssetName))])) | |
754 | - | } | |
855 | + | then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateComplete), DataEntry((toBase58String(auctionFreelancer) + "_Rating"), newRating)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionFreelancer), amountWithoutComm, auctionAssetId58)])) | |
755 | 856 | else throw(("Incorrect state. Must be: " + stateWait4Confirm)) | |
756 | 857 | else throw("Only auction customer can use this function") | |
757 | 858 | } | |
758 | 859 | ||
759 | 860 | ||
760 | 861 | @Verifier(tx) | |
761 | 862 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
762 | 863 | then match tx { | |
763 | 864 | case ttx: TransferTransaction => | |
764 | 865 | true | |
765 | 866 | case stx: SetScriptTransaction => | |
766 | 867 | true | |
767 | 868 | case _ => | |
768 | 869 | false | |
769 | 870 | } | |
770 | 871 | else false | |
771 | 872 |
github/deemru/w8io/169f3d6 91.74 ms ◑