tx · 59JRXajgPL2a7ZCqxiKBRmfTaAfXNV539Acg4N1qWgGH

3N2EM5HFgf6UMBnvcJX3Cegmozwdv1iDeq2:  -0.01500000 Waves

2019.10.14 13:48 [719504] smart account 3N2EM5HFgf6UMBnvcJX3Cegmozwdv1iDeq2 > SELF 0.00000000 Waves

{ "type": 13, "id": "59JRXajgPL2a7ZCqxiKBRmfTaAfXNV539Acg4N1qWgGH", "fee": 1500000, "feeAssetId": null, "timestamp": 1571050088414, "version": 1, "sender": "3N2EM5HFgf6UMBnvcJX3Cegmozwdv1iDeq2", "senderPublicKey": "8y2Uc9uYf5gRD6Dzm1aC73zYe3LZvtVDUVAnAhNdN2mg", "proofs": [ "bA4wdF2TFZhNG7Ux1mFSMHYCajm9ai6aMLkP7riJXhbgf3T75336NsxGdHGqEbt1onqkDNrME44Eemf6BbKyrGX" ], "script": "base64:AAIDAAAAAAAAAD8IARIDCgEIEgMKAQgSBQoDAQEIEgQKAggBEgQKAggIEgQKAggBEgMKAQgSAwoBCBIECgIICBIDCgEIEgMKAQgAAAAxAAAAAANkYXkAAAAAAAAABaAAAAAABVdBVkVTBQAAAAR1bml0AAAAAAR3QlRDAQAAACBs+mr/xe2qjAt/tSqT0qIML4KC23R6BIxT+/0TH3Og/wAAAAAEd0VVUgEAAAAg7BZhBF97kSFBBjs38+fX1Pjz08YOqoCX85C/0PoVupkAAAAABHdVU0QBAAAAIN0cvQHwz3UFMHgHsqi2OJjRRd1cH7ozWuNAb/pmWXD9AAAAAAlhdWN0VG9rZW4BAAAAAQAAAAAACXN0YXRlT3BlbgIAAAAGT3BlbmVkAAAAAA5zdGF0ZVN1Z2dlc3RlZAIAAAAJU3VnZ2VzdGVkAAAAAAtzdGF0ZUNhbmNlbAIAAAAIQ2FuY2VsZWQAAAAAD3N0YXRlSW5Qcm9ncmVzcwIAAAAKSW5Qcm9ncmVzcwAAAAARc3RhdGVXYWl0NENvbmZpcm0CAAAAE1dhaXRGb3JDb25maXJtYXRpb24AAAAADX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AJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAN0dHgFAAAAByRtYXRjaDAEAAAACWFzc2V0TmFtZQkBAAAAEkFzc2V0SWRUb0Fzc2V0TmFtZQAAAAEIBQAAAAN0dHgAAAAHYXNzZXRJZAQAAAAUdmFsdWVSZXNlcnZlZEJhbGFuY2UJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAlhc3NldE5hbWUCAAAACV9SZXNlcnZlZAQAAAAPcmVzZXJ2ZWRCYWxhbmNlBAAAAAckbWF0Y2gxBQAAABR2YWx1ZVJlc2VydmVkQmFsYW5jZQMJAAABAAAAAgUAAAAHJG1hdGNoMQIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gxBQAAAAFhAAAAAAAAAAAABAAAABBhdmFpbGFibGVCYWxhbmNlCQAAZQAAAAIJAAPrAAAAAgUAAAAEdGhpcwgFAAAAA3R0eAAAAAdhc3NldElkBQAAAA9yZXNlcnZlZEJhbGFuY2UJAABnAAAAAgUAAAAQYXZhaWxhYmxlQmFsYW5jZQgFAAAAA3R0eAAAAAZhbW91bnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAANzdHgFAAAAByRtYXRjaDAGBwcT2gjf", "chainId": 84, "height": 719504, "spentComplexity": 0 } View: original | compacted Prev: SA49YpFDw2LFfJT6bTi5BiQQwgdbFtsNBJzDxsCnSXb Next: 5BUM7Kj8n12HoTQxRt7bxEBBxXHJWEVR3FGk1wuxsu5r Diff:
OldNewDifferences
1010 let wEUR = base58'Gtb1WRznfchDnTh37ezoDTJ4wcoKaRsKqKjJjy7nm2zU'
1111
1212 let wUSD = base58'Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck'
13+
14+let auctToken = base58'1'
1315
1416 let stateOpen = "Opened"
1517
3133
3234 let freelancer = "FL"
3335
34-let ambassador1 = base58'FneCJqM5BP2eAuyteMiuEEHYALrE4axhEfcpHVGbdr5s'
36+let ambassador1 = "FneCJqM5BP2eAuyteMiuEEHYALrE4axhEfcpHVGbdr5s"
3537
36-let ambassador2 = base58'6QAMdssb1GJjpQVQQcnx8fKU8WhtcF9ZsQhifdThAEK8'
38+let ambassador2 = "6QAMdssb1GJjpQVQQcnx8fKU8WhtcF9ZsQhifdThAEK8"
3739
38-let ambassador3 = base58'2ituwW7DSRsLP3Vcbnpr98QUQMGFRWKmyYPFqsUKRDoP'
40+let ambassador3 = "2ituwW7DSRsLP3Vcbnpr98QUQMGFRWKmyYPFqsUKRDoP"
3941
40-let ambassador4 = base58'ANsPQocEESyLb3yQqk2pwCdoK7PJQxLoZVpYvsm3SxUG'
42+let ambassador4 = "ANsPQocEESyLb3yQqk2pwCdoK7PJQxLoZVpYvsm3SxUG"
4143
42-let ambassador5 = base58'13VixwQin1MzZCyY69NSWMSBNEV27Rzc159o7uZXR9VS'
43-
44-func AuctionIdDataKey (auctionId) = (auctionId + "_AuctionData")
45-
44+let ambassador5 = "13VixwQin1MzZCyY69NSWMSBNEV27Rzc159o7uZXR9VS"
4645
4746 func getInt (key) = {
4847 let valueJobsOnGoing = getInteger(this, key)
5554 }
5655
5756
58-func AssetNameToBase58 (auctionAssetName) = if ((auctionAssetName == "WAVES"))
57+func AssetIdToAssetName (pmtAssetId) = if (!(isDefined(pmtAssetId)))
58+ then "WAVES"
59+ else if ((pmtAssetId == wBTC))
60+ then "BTC"
61+ else if ((pmtAssetId == wEUR))
62+ then "EUR"
63+ else if ((pmtAssetId == wUSD))
64+ then "USD"
65+ else if ((pmtAssetId == auctToken))
66+ then "AUCT"
67+ else throw("AssetId is incorrect")
68+
69+
70+func AssetNameToAssetId (auctionAssetName) = if ((auctionAssetName == "WAVES"))
5971 then WAVES
6072 else if ((auctionAssetName == "BTC"))
6173 then wBTC
6375 then wEUR
6476 else if ((auctionAssetName == "USD"))
6577 then wUSD
66- else throw("Incorrect Asset Id")
78+ else if ((auctionAssetName == "AUCT"))
79+ then auctToken
80+ else throw("Incorrect Asset Id")
6781
6882
6983 func timeCheck (currentTime,startTime,expirationTime) = ((currentTime - startTime) > expirationTime)
101115 }
102116
103117
104-func freelancerIsRegistered (callerPub) = {
118+func clientRegistered (callerPub) = {
119+ let freelancerIsRegistered = getString(this, (callerPub + "_Freelancer"))
120+ match freelancerIsRegistered {
121+ case a: String =>
122+ callerPub
123+ case _ =>
124+ throw("Only registered users can make bets")
125+ }
126+ }
127+
128+
129+func freelancerRegistered (callerPub) = {
105130 let freelancerIsRegistered = getString(this, (callerPub + "_Freelancer"))
106131 match freelancerIsRegistered {
107132 case a: String =>
129154
130155
131156 func getAuctionClientPub (auctionId) = {
132- let valueClient = getString(this, (auctionId + "_AuctionClient"))
133- let clientPub = match valueClient {
157+ let valueClientPub = getString(this, (auctionId + "_AuctionClient"))
158+ match valueClientPub {
134159 case a: String =>
135160 a
136161 case _ =>
137162 throw("Auction Client was not found")
138163 }
139- fromBase58String(clientPub)
140164 }
141165
142166
197221
198222 func getAuctionFreelancerPub (auctionId) = {
199223 let valueClient = getString(this, (auctionId + "_HiredFreelancer"))
200- let a = match valueClient {
224+ match valueClient {
201225 case a: String =>
202226 a
203227 case _ =>
204228 throw("Auction Client was not found")
205229 }
206- fromBase58String(a)
230+ }
231+
232+
233+func getAuctionLowestBidder (auctionId) = {
234+ let valueLowestBidder = getString(this, (auctionId + "_LowestBidderPub"))
235+ match valueLowestBidder {
236+ case a: String =>
237+ a
238+ case _ =>
239+ throw("Auction lowest bidder was not found")
240+ }
241+ }
242+
243+
244+func getBid (auctionId,auctionLowestBidder) = {
245+ let valueNewAuctionPrice = getInteger(this, ((auctionId + "_Bid_") + auctionLowestBidder))
246+ match valueNewAuctionPrice {
247+ case a: Int =>
248+ a
249+ case _ =>
250+ throw("Auction lowest bid was not found")
251+ }
252+ }
253+
254+
255+func defineNewLowestBidder (auctionId,currentLowestBidderPub,bidAmount,newFreelancer) = {
256+ let valueCurrentLowestBid = getInteger(this, ((auctionId + "_Bid_") + currentLowestBidderPub))
257+ let currentLowestBid = match valueCurrentLowestBid {
258+ case a: Int =>
259+ a
260+ case _ =>
261+ throw("Auction lowest bid was not found")
262+ }
263+ if ((currentLowestBid > bidAmount))
264+ then newFreelancer
265+ else currentLowestBidderPub
266+ }
267+
268+
269+func choosedFreelancerCheck (auctionId,freelancerPub) = {
270+ let newFreelancer = getInteger(this, ((auctionId + "_Bid_") + freelancerPub))
271+ match newFreelancer {
272+ case a: Int =>
273+ freelancerPub
274+ case _ =>
275+ throw("Error: Incorrect freelancerPub")
276+ }
277+ }
278+
279+
280+func newExecutionTimeCheck (executionDays,auctionBlocksForExecution) = {
281+ let newAuctionBlocksForExecution = (executionDays * day)
282+ if ((newAuctionBlocksForExecution > auctionBlocksForExecution))
283+ then newAuctionBlocksForExecution
284+ else throw("New execution time must more than current execution time")
285+ }
286+
287+
288+func getRating (auctionFreelancer) = {
289+ let valueRating = getInteger(this, (auctionFreelancer + "_Rating"))
290+ match valueRating {
291+ case a: Int =>
292+ a
293+ case _ =>
294+ 0
295+ }
296+ }
297+
298+
299+func callerIsAmbassador (callerPub) = if (if (if (if (if ((callerPub == ambassador1))
300+ then true
301+ else (callerPub == ambassador2))
302+ then true
303+ else (callerPub == ambassador3))
304+ then true
305+ else (callerPub == ambassador4))
306+ then true
307+ else (callerPub == ambassador5))
308+ then callerPub
309+ else throw("Only defined ambassadors can vote in disputes")
310+
311+
312+func ambassadorVoteCheck (auctionId,ambassadorPub,vote) = {
313+ let keyVoter = ((auctionId + "_DiputeVote_") + ambassadorPub)
314+ let valueVoter = getString(this, keyVoter)
315+ let ambassadorVoted = match valueVoter {
316+ case a: String =>
317+ true
318+ case _ =>
319+ false
320+ }
321+ if (ambassadorVoted)
322+ then throw("Ambassador voted already ")
323+ else if (if ((vote == client))
324+ then true
325+ else (vote == freelancer))
326+ then vote
327+ else throw(((("Vote is incorrect. Must be: " + client) + " or ") + freelancer))
328+ }
329+
330+
331+func getVotesNumber (auctionId) = {
332+ let valueVotesNumber = getInteger(this, (auctionId + "_DisputeVotes"))
333+ match valueVotesNumber {
334+ case a: Int =>
335+ a
336+ case _ =>
337+ throw("VotesNumber was not found")
338+ }
339+ }
340+
341+
342+func defineDisputeWinner (auctionId,newVote,auctionClient,auctionFreelancer) = {
343+ let ambassador1Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador1))
344+ let ambassador2Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador2))
345+ let ambassador3Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador3))
346+ let ambassador4Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador4))
347+ let ambassador5Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador5))
348+ let v1 = if ((ambassador1Vote == client))
349+ then 1
350+ else 0
351+ let v2 = if ((ambassador2Vote == client))
352+ then 1
353+ else 0
354+ let v3 = if ((ambassador3Vote == client))
355+ then 1
356+ else 0
357+ let v4 = if ((ambassador4Vote == client))
358+ then 1
359+ else 0
360+ let v5 = if ((ambassador5Vote == client))
361+ then 1
362+ else 0
363+ let currentVote = if ((newVote == client))
364+ then 1
365+ else 0
366+ let votesForClient = (((((v1 + v2) + v3) + v4) + v5) + currentVote)
367+ if ((votesForClient > 2))
368+ then auctionClient
369+ else auctionFreelancer
207370 }
208371
209372
231394
232395 @Callable(i)
233396 func createAuction (jobExecutionDays,auctionDurationDays,auctionInfo) = {
397+ let callerPub = toBase58String(i.callerPublicKey)
234398 let auctionId = toBase58String(i.transactionId)
235- let auctionClient = toBase58String(i.callerPublicKey)
399+ let auctionClient = clientRegistered(callerPub)
236400 let pmt = extract(i.payment)
237401 let pmtAmount = pmt.amount
238402 let auctionPrice = createAuctionPriceCheck(pmtAmount)
239403 let auctionStart = height
240404 let auctionDurationBlocks = (auctionDurationDays * day)
241405 let blocksForExecution = (jobExecutionDays * day)
242- let pmtAssetName = if (!(isDefined(pmt.assetId)))
243- then "WAVES"
244- else if ((pmt.assetId == wBTC))
245- then "BTC"
246- else if ((pmt.assetId == wEUR))
247- then "EUR"
248- else if ((pmt.assetId == wUSD))
249- then "USD"
250- else throw("AssetId is incorrect")
406+ let pmtAssetName = AssetIdToAssetName(pmt.assetId)
251407 let jobsCreated = getInt((auctionClient + "_JobsCreated"))
252408 let newFreezedBalance = increaseFreezedBalance(pmtAssetName, auctionPrice)
253409 WriteSet([DataEntry((auctionId + "_State"), stateOpen), DataEntry((auctionId + "_Info"), auctionInfo), DataEntry((auctionId + "_AuctionClient"), 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), DataEntry((auctionClient + "_JobsCreated"), (jobsCreated + 1))])
258414 @Callable(i)
259415 func makeBid (auctionId,amount) = {
260416 let callerPub = toBase58String(i.callerPublicKey)
261- let betTime = height
262417 let auctionState = getAuctionState(auctionId)
263418 let auctionClient = getAuctionClientPub(auctionId)
264419 let auctionStart = getAuctionStartTime(auctionId)
266421 let auctionBlocksForExecution = getAuctionJobPerformanceTime(auctionId)
267422 let auctionAssetName = getAuctionAssetName(auctionId)
268423 let auctionPrice = getAuctionPrice(auctionId)
269- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
270- let newFreelancer = freelancerIsRegistered(callerPub)
424+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
425+ let newFreelancer = freelancerRegistered(callerPub)
271426 let dAppCommission = ((auctionPrice * 3) / 100)
272427 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
273428 let bidAmount = bidAmountCheck(amount, auctionPrice)
274- let auctionTimeisOver = timeCheck(betTime, auctionStart, auctionDuration)
429+ let auctionTimeisOver = timeCheck(height, auctionStart, auctionDuration)
275430 if (auctionTimeisOver)
276431 then if ((auctionState == stateOpen))
277- then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), (auctionPrice - dAppCommission), auctionAssetId58)]))
432+ then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), (auctionPrice - dAppCommission), auctionAssetId58)]))
278433 else if ((auctionState == stateSuggested))
279434 then {
280- let auctionLowestBidder = {
281- let valueLowestBidder = getString(this, (auctionId + "_LowestBidderPub"))
282- match valueLowestBidder {
283- case a: String =>
284- a
285- case _ =>
286- throw("Auction lowest bidder was not found")
287- }
288- }
289- let newAuctionPrice = {
290- let valueNewAuctionPrice = getInteger(this, ((auctionId + "_Bid_") + auctionLowestBidder))
291- match valueNewAuctionPrice {
292- case a: Int =>
293- a
294- case _ =>
295- throw("Auction lowest bid was not found")
296- }
297- }
298- let amountDifference = ((auctionPrice - newAuctionPrice) - dAppCommission)
299- ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), newAuctionPrice)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), amountDifference, auctionAssetId58)]))
435+ let auctionLowestBidder = getAuctionLowestBidder(auctionId)
436+ let auctionLowestBid = getBid(auctionId, auctionLowestBidder)
437+ let amountDifference = ((auctionPrice - auctionLowestBid) - dAppCommission)
438+ ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), auctionLowestBid)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), amountDifference, auctionAssetId58)]))
300439 }
301440 else throw("Incorrect auction state")
302441 else if ((auctionState == stateOpen))
303442 then WriteSet([DataEntry(((auctionId + "_Bid_") + newFreelancer), bidAmount), DataEntry((auctionId + "_State"), stateSuggested), DataEntry((auctionId + "_LowestBidderPub"), callerPub)])
304443 else if ((auctionState == stateSuggested))
305444 then {
306- let currentLowestBidderPub = {
307- let lowestBidder = getString(this, (auctionId + "_LowestBidderPub"))
308- match lowestBidder {
309- case a: String =>
310- a
311- case _ =>
312- throw("Auction lowest bidder was not found")
313- }
314- }
315- let newLowestBidderPub = {
316- let valueCurrentLowestBid = getInteger(this, ((auctionId + "_Bid_") + currentLowestBidderPub))
317- let currentLowestBid = match valueCurrentLowestBid {
318- case a: Int =>
319- a
320- case _ =>
321- throw("Auction lowest bid was not found")
322- }
323- if ((currentLowestBid > bidAmount))
324- then newFreelancer
325- else currentLowestBidderPub
326- }
445+ let currentLowestBidderPub = getAuctionLowestBidder(auctionId)
446+ let newLowestBidderPub = defineNewLowestBidder(auctionId, currentLowestBidderPub, bidAmount, newFreelancer)
327447 WriteSet([DataEntry((auctionId + "_LowestBidderPub"), newLowestBidderPub), DataEntry(((auctionId + "_Bid_") + newFreelancer), bidAmount)])
328448 }
329449 else throw(((((("Incorrect jobId state. Now: " + auctionState) + ", must be: ") + stateOpen) + " or ") + stateSuggested))
333453
334454 @Callable(i)
335455 func chooseFreelancer (auctionId,freelancerPub) = {
336- let callerPub = extract(i.callerPublicKey)
337- let betTime = height
456+ let callerPub = toBase58String(i.callerPublicKey)
338457 let auctionState = getAuctionState(auctionId)
339458 let auctionClient = getAuctionClientPub(auctionId)
340459 let auctionStart = getAuctionStartTime(auctionId)
341460 let auctionDuration = getAuctionDurationTime(auctionId)
342461 let auctionAssetName = getAuctionAssetName(auctionId)
343462 let auctionPrice = getAuctionPrice(auctionId)
344- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
345- let jobsOnGoing = getInt((toBase58String(auctionClient) + "_JobsOnGoing"))
463+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
464+ let newFreelancer = choosedFreelancerCheck(auctionId, freelancerPub)
465+ let freelancerBidAmount = getBid(auctionId, newFreelancer)
466+ let auctionTimeisOver = timeCheck(height, auctionStart, auctionDuration)
467+ let jobsOnGoing = getInt((auctionClient + "_JobsOnGoing"))
346468 let freelancerPendingEarnings = getInt((freelancerPub + "_PendingEarnings"))
347469 let freelancerTotalEarnings = getInt((freelancerPub + "_TotalEarnings"))
348- let freelancerBidAmount = {
349- let keyFreelancerBid = ((auctionId + "_Bid_") + freelancerPub)
350- let valueFreelacerBid = getInteger(this, keyFreelancerBid)
351- match valueFreelacerBid {
352- case a: Int =>
353- a
354- case _ =>
355- throw("Freelancer's bet was not found")
356- }
357- }
358- let auctionTimeisOver = timeCheck(betTime, auctionStart, auctionDuration)
359470 if ((callerPub == auctionClient))
360471 then if (auctionTimeisOver)
361472 then if ((auctionState == stateOpen))
362473 then {
363474 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
364475 let dAppCommission = ((auctionPrice * 3) / 100)
365- ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), (auctionPrice - dAppCommission), auctionAssetId58)]))
476+ ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), (auctionPrice - dAppCommission), auctionAssetId58)]))
366477 }
367478 else if ((auctionState == stateSuggested))
368479 then {
369- let auctionLowestBidder = {
370- let valueLowestBidder = getString(this, (auctionId + "_LowestBidderPub"))
371- match valueLowestBidder {
372- case a: String =>
373- a
374- case _ =>
375- throw("Auction lowest bidder was not found")
376- }
377- }
378- let newAuctionPrice = {
379- let valueNewAuctionPrice = getInteger(this, ((auctionId + "_Bid_") + auctionLowestBidder))
380- match valueNewAuctionPrice {
381- case a: Int =>
382- a
383- case _ =>
384- throw("Auction lowest bid was not found")
385- }
386- }
387- let amountDifference = (auctionPrice - newAuctionPrice)
480+ let auctionLowestBidder = getAuctionLowestBidder(auctionId)
481+ let auctionLowestBid = getBid(auctionId, auctionLowestBidder)
482+ let amountDifference = (auctionPrice - auctionLowestBid)
388483 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, amountDifference)
389- ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), newAuctionPrice), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((toBase58String(auctionClient) + "_JobsOnGoing"), (jobsOnGoing + 1)), DataEntry((freelancerPub + "_PendingEarnings"), (freelancerPendingEarnings + newAuctionPrice)), DataEntry((freelancerPub + "_TotalEarnings"), (freelancerTotalEarnings + newAuctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), amountDifference, auctionAssetId58)]))
484+ ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), auctionLowestBid), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsOnGoing"), (jobsOnGoing + 1)), DataEntry((freelancerPub + "_PendingEarnings"), (freelancerPendingEarnings + auctionLowestBid)), DataEntry((freelancerPub + "_TotalEarnings"), (freelancerTotalEarnings + auctionLowestBid))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), amountDifference, auctionAssetId58)]))
390485 }
391486 else throw("Incorrect auction state")
392487 else if (if ((auctionState == stateOpen))
393488 then true
394489 else (auctionState == stateSuggested))
395490 then {
396- let setNewFreelancer = {
397- let newFreelancer = getInteger(this, ((auctionId + "_Bid_") + freelancerPub))
398- match newFreelancer {
399- case a: Int =>
400- freelancerPub
401- case _ =>
402- throw("Error: Incorrect freelancerPub")
403- }
404- }
405- let newAuctionPrice = {
406- let freelancerBid = getInteger(this, ((auctionId + "_Bid_") + freelancerPub))
407- match freelancerBid {
408- case a: Int =>
409- a
410- case _ =>
411- throw("Auction lowest bidder was not found")
412- }
413- }
414491 let amountDifference = (auctionPrice - freelancerBidAmount)
415492 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, amountDifference)
416- ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), setNewFreelancer), DataEntry((auctionId + "_Price"), newAuctionPrice), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((toBase58String(auctionClient) + "_JobsOnGoing"), (jobsOnGoing + 1)), DataEntry((freelancerPub + "_PendingEarnings"), (freelancerPendingEarnings + newAuctionPrice)), DataEntry((freelancerPub + "_TotalEarnings"), (freelancerTotalEarnings + newAuctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), (amountDifference + 1), auctionAssetId58)]))
493+ ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), newFreelancer), DataEntry((auctionId + "_Price"), freelancerBidAmount), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsOnGoing"), (jobsOnGoing + 1)), DataEntry((freelancerPub + "_PendingEarnings"), (freelancerPendingEarnings + freelancerBidAmount)), DataEntry((freelancerPub + "_TotalEarnings"), (freelancerTotalEarnings + freelancerBidAmount))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), (amountDifference + 1), auctionAssetId58)]))
417494 }
418495 else throw("Incorrect auction state")
419496 else throw("Only auction customer can choose a freelancer")
423500
424501 @Callable(i)
425502 func increaseExecutionTime (auctionId,executionDays) = {
426- let caller = extract(i.callerPublicKey)
503+ let caller = toBase58String(i.callerPublicKey)
427504 let auctionState = getAuctionState(auctionId)
428505 let auctionClient = getAuctionClientPub(auctionId)
429506 let auctionBlocksForExecution = getAuctionJobPerformanceTime(auctionId)
430- let newAuctionExecutionTime = {
431- let newAuctionBlocksForExecution = (executionDays * day)
432- if ((newAuctionBlocksForExecution > auctionBlocksForExecution))
433- then newAuctionBlocksForExecution
434- else throw("New execution time must more than current execution time")
435- }
507+ let newAuctionExecutionTime = newExecutionTimeCheck(executionDays, auctionBlocksForExecution)
436508 if ((caller == auctionClient))
437509 then if (if (if ((auctionState == stateOpen))
438510 then true
448520
449521 @Callable(i)
450522 func cancelAuction (auctionId) = {
451- let callerPub = extract(i.callerPublicKey)
523+ let callerPub = toBase58String(i.callerPublicKey)
452524 let auctionState = getAuctionState(auctionId)
453525 let auctionClient = getAuctionClientPub(auctionId)
454526 let auctionAssetName = getAuctionAssetName(auctionId)
455527 let auctionPrice = getAuctionPrice(auctionId)
456- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
528+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
457529 let dAppCommission = ((auctionPrice * 3) / 100)
458530 let amountWithoutComm = (auctionPrice - dAppCommission)
459531 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
460532 if ((callerPub == auctionClient))
461533 then if ((auctionState == stateOpen))
462- then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), amountWithoutComm, auctionAssetId58)]))
534+ then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), amountWithoutComm, auctionAssetId58)]))
463535 else throw("Auction can be canceled only by auction owner.")
464536 else throw("Only Client can cancel auction")
465537 }
468540
469541 @Callable(i)
470542 func openDispute (auctionId) = {
471- let caller = extract(i.callerPublicKey)
543+ let caller = toBase58String(i.callerPublicKey)
472544 let auctionState = getAuctionState(auctionId)
473545 let auctionClient = getAuctionClientPub(auctionId)
474546 let auctionFreelancer = getAuctionFreelancerPub(auctionId)
475- let clientJobsInDispute = getInt((toBase58String(auctionClient) + "_JobsInDispute"))
547+ let clientJobsInDispute = getInt((auctionClient + "_JobsInDispute"))
476548 if (if ((auctionState == stateInProgress))
477549 then true
478550 else (auctionState == stateWait4Confirm))
479551 then if (if ((caller == auctionClient))
480552 then true
481553 else (caller == auctionFreelancer))
482- then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), 0), DataEntry((toBase58String(auctionClient) + "_JobsInDispute"), (clientJobsInDispute + 1))])
554+ then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), 0), DataEntry((auctionClient + "_JobsInDispute"), (clientJobsInDispute + 1))])
483555 else throw("Only Client and Freelancer can open dispute")
484556 else throw("Incorrect auction state for dispute opening")
485557 }
488560
489561 @Callable(i)
490562 func voteDispute (auctionId,vote) = {
491- let callerPub = extract(i.callerPublicKey)
563+ let callerPub = toBase58String(i.callerPublicKey)
492564 let auctionState = getAuctionState(auctionId)
493565 let auctionClient = getAuctionClientPub(auctionId)
494566 let auctionAssetName = getAuctionAssetName(auctionId)
495567 let auctionPrice = getAuctionPrice(auctionId)
496568 let auctionFreelancer = getAuctionFreelancerPub(auctionId)
497569 let commission = ((auctionPrice * 3) / 100)
498- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
499- let clientJobsInDispute = getInt((toBase58String(auctionClient) + "_JobsInDispute"))
500- let freelancerPendingEarnings = getInt((toBase58String(auctionFreelancer) + "_PendingEarnings"))
501- let callerIsAmbassador = if (if (if (if (if ((callerPub == ambassador1))
502- then true
503- else (callerPub == ambassador2))
504- then true
505- else (callerPub == ambassador3))
506- then true
507- else (callerPub == ambassador4))
508- then true
509- else (callerPub == ambassador5))
510- then toBase58String(callerPub)
511- else throw("Only defined ambassadors can vote in disputes")
512- let newVote = if (if ((vote == client))
513- then true
514- else (vote == freelancer))
515- then vote
516- else throw(((("Vote is incorrect. Must be: " + client) + " or ") + freelancer))
517- let newVoter = {
518- let keyVoter = ((auctionId + "_DiputeVote_") + callerIsAmbassador)
519- let valueVoter = getString(this, keyVoter)
520- match valueVoter {
521- case a: String =>
522- throw("User already voted")
523- case _ =>
524- callerIsAmbassador
525- }
526- }
527- let votesNumber = {
528- let valueVotesNumber = getInteger(this, (auctionId + "_DisputeVotes"))
529- match valueVotesNumber {
530- case a: Int =>
531- a
532- case _ =>
533- throw("VotesNumber was not found")
534- }
535- }
570+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
571+ let ambassadorPub = callerIsAmbassador(callerPub)
572+ let ambassadorVote = ambassadorVoteCheck(auctionId, ambassadorPub, vote)
573+ let votesNumber = getVotesNumber(auctionId)
574+ let clientJobsInDispute = getInt((auctionClient + "_JobsInDispute"))
575+ let freelancerPendingEarnings = getInt((auctionFreelancer + "_PendingEarnings"))
576+ let freelancerTotalEarnings = getInt((auctionFreelancer + "_TotalEarnings"))
536577 if ((auctionState == stateDispute))
537578 then if ((votesNumber == 4))
538579 then {
539- let disputeWinner = {
540- let ambassador1Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador1)))
541- let ambassador2Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador2)))
542- let ambassador3Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador3)))
543- let ambassador4Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador4)))
544- let ambassador5Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador5)))
545- let v1 = if ((ambassador1Vote == client))
546- then 1
547- else 0
548- let v2 = if ((ambassador2Vote == client))
549- then 1
550- else 0
551- let v3 = if ((ambassador3Vote == client))
552- then 1
553- else 0
554- let v4 = if ((ambassador4Vote == client))
555- then 1
556- else 0
557- let v5 = if ((ambassador5Vote == client))
558- then 1
559- else 0
560- let currentVote = if ((newVote == client))
561- then 1
562- else 0
563- let votesForClient = (((((v1 + v2) + v3) + v4) + v5) + currentVote)
564- if ((votesForClient > 2))
565- then auctionClient
566- else auctionFreelancer
567- }
568- let paymentWithoutComm = if ((disputeWinner == auctionClient))
569- then (auctionPrice - commission)
570- else (auctionPrice - (commission * 2))
580+ let disputeWinnerPub = defineDisputeWinner(auctionId, ambassadorVote, auctionClient, auctionFreelancer)
571581 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
572- ScriptResult(WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry((auctionId + "_State"), stateDisputeResolved), DataEntry(((auctionId + "_DiputeVote_") + newVoter), newVote), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((toBase58String(auctionClient) + "_JobsInDispute"), (clientJobsInDispute - 1)), DataEntry((toBase58String(auctionFreelancer) + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(disputeWinner), paymentWithoutComm, auctionAssetId58)]))
582+ if ((disputeWinnerPub == auctionClient))
583+ then {
584+ let paymentWithoutComm = (auctionPrice - commission)
585+ ScriptResult(WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry((auctionId + "_State"), stateDisputeResolved), DataEntry(((auctionId + "_DiputeVote_") + ambassadorPub), ambassadorVote), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsInDispute"), (clientJobsInDispute - 1)), DataEntry((auctionFreelancer + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice)), DataEntry((auctionFreelancer + "_TotalEarnings"), (freelancerTotalEarnings - auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(disputeWinnerPub)), paymentWithoutComm, auctionAssetId58)]))
586+ }
587+ else {
588+ let paymentWithoutComm = (auctionPrice - (commission * 2))
589+ ScriptResult(WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry((auctionId + "_State"), stateDisputeResolved), DataEntry(((auctionId + "_DiputeVote_") + ambassadorPub), ambassadorVote), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsInDispute"), (clientJobsInDispute - 1)), DataEntry((auctionFreelancer + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(disputeWinnerPub)), paymentWithoutComm, auctionAssetId58)]))
590+ }
573591 }
574- else WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry(((auctionId + "_DiputeVote_") + newVoter), newVote)])
592+ else WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry(((auctionId + "_DiputeVote_") + ambassadorPub), ambassadorVote)])
575593 else throw(("Incorrect state. Must be: " + stateDispute))
576594 }
577595
579597
580598 @Callable(i)
581599 func workHandOver (auctionId) = {
582- let callerPub = extract(i.callerPublicKey)
600+ let callerPub = toBase58String(i.callerPublicKey)
583601 let auctionState = getAuctionState(auctionId)
584602 let auctionClient = getAuctionClientPub(auctionId)
585603 let auctionStart = getAuctionStartTime(auctionId)
586604 let auctionDuration = getAuctionDurationTime(auctionId)
587605 let auctionBlocksForExecution = getAuctionJobPerformanceTime(auctionId)
588606 let auctionFreelancer = getAuctionFreelancerPub(auctionId)
589- let clientJobsInDispute = getInt((toBase58String(auctionClient) + "_JobsInDispute"))
590- let currentTime = height
591- let freelancerPubCheck = if ((callerPub == auctionFreelancer))
592- then callerPub
607+ let timeIsOver = ((height - auctionStart) > auctionBlocksForExecution)
608+ let clientJobsInDispute = getInt((auctionClient + "_JobsInDispute"))
609+ if ((callerPub == auctionFreelancer))
610+ then if ((auctionState == stateInProgress))
611+ then if (timeIsOver)
612+ then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), "0"), DataEntry((auctionClient + "_JobInDispute"), (clientJobsInDispute + 1))])
613+ else WriteSet([DataEntry((auctionId + "_State"), stateWait4Confirm)])
614+ else throw("Auction state is incorrect")
593615 else throw("Only a freelancer can indicate that the work is done")
594- let timeIsOver = ((currentTime - auctionStart) > auctionBlocksForExecution)
595- if ((auctionState == stateInProgress))
596- then if (timeIsOver)
597- then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), "0"), DataEntry((toBase58String(auctionClient) + "_JobInDispute"), (clientJobsInDispute + 1))])
598- else WriteSet([DataEntry((auctionId + "_State"), stateWait4Confirm)])
599- else throw("Auction state is incorrect")
600616 }
601617
602618
603619
604620 @Callable(i)
605621 func acceptWork (auctionId) = {
606- let callerPub = extract(i.callerPublicKey)
622+ let callerPub = toBase58String(i.callerPublicKey)
607623 let auctionState = getAuctionState(auctionId)
608624 let auctionClient = getAuctionClientPub(auctionId)
609625 let auctionStart = getAuctionStartTime(auctionId)
611627 let auctionAssetName = getAuctionAssetName(auctionId)
612628 let auctionPrice = getAuctionPrice(auctionId)
613629 let auctionFreelancer = getAuctionFreelancerPub(auctionId)
614- let jobsOnGoing = getInt((toBase58String(auctionClient) + "_JobsOnGoing"))
615- let freelancerPendingEarnings = getInt((toBase58String(auctionFreelancer) + "_PendingEarnings"))
616- let freelancerPaidEarnings = getInt((toBase58String(auctionFreelancer) + "_PaidEarnings"))
630+ let jobsOnGoing = getInt((auctionClient + "_JobsOnGoing"))
631+ let freelancerPendingEarnings = getInt((auctionFreelancer + "_PendingEarnings"))
632+ let freelancerPaidEarnings = getInt((auctionFreelancer + "_PaidEarnings"))
617633 let dAppCommission = ((auctionPrice * 3) / 100)
618- let amountWithoutComm = (auctionPrice - dAppCommission)
619- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
634+ let amountWithoutComm = (auctionPrice - (dAppCommission * 2))
635+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
620636 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
621- let newRating = {
622- let valueRating = getInteger(this, (toBase58String(auctionFreelancer) + "_Rating"))
623- let currentRating = match valueRating {
624- case a: Int =>
625- a
626- case _ =>
627- 0
628- }
629- (currentRating + 1)
630- }
637+ let freelancerRating = getRating(auctionFreelancer)
631638 if ((callerPub == auctionClient))
632639 then if ((auctionState == stateWait4Confirm))
633- then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateComplete), DataEntry((toBase58String(auctionFreelancer) + "_Rating"), newRating), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((toBase58String(auctionClient) + "_JobsOnGoing"), (jobsOnGoing - 1)), DataEntry((toBase58String(auctionFreelancer) + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice)), DataEntry((toBase58String(auctionFreelancer) + "_PaidEarnings"), (freelancerPaidEarnings + auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionFreelancer), amountWithoutComm, auctionAssetId58)]))
640+ then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateComplete), DataEntry((auctionFreelancer + "_Rating"), (freelancerRating + 1)), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsOnGoing"), (jobsOnGoing - 1)), DataEntry((auctionFreelancer + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice)), DataEntry((auctionFreelancer + "_PaidEarnings"), (freelancerPaidEarnings + auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionFreelancer)), amountWithoutComm, auctionAssetId58)]))
634641 else throw(("Incorrect state. Must be: " + stateWait4Confirm))
635642 else throw("Only auction customer can use this function")
636643 }
640647 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
641648 then match tx {
642649 case ttx: TransferTransaction =>
643- true
650+ let assetName = AssetIdToAssetName(ttx.assetId)
651+ let valueReservedBalance = getInteger(this, (assetName + "_Reserved"))
652+ let reservedBalance = match valueReservedBalance {
653+ case a: Int =>
654+ a
655+ case _ =>
656+ 0
657+ }
658+ let availableBalance = (assetBalance(this, ttx.assetId) - reservedBalance)
659+ (availableBalance >= ttx.amount)
644660 case stx: SetScriptTransaction =>
645661 true
646662 case _ =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let day = 1440
55
66 let WAVES = unit
77
88 let wBTC = base58'8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS'
99
1010 let wEUR = base58'Gtb1WRznfchDnTh37ezoDTJ4wcoKaRsKqKjJjy7nm2zU'
1111
1212 let wUSD = base58'Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck'
13+
14+let auctToken = base58'1'
1315
1416 let stateOpen = "Opened"
1517
1618 let stateSuggested = "Suggested"
1719
1820 let stateCancel = "Canceled"
1921
2022 let stateInProgress = "InProgress"
2123
2224 let stateWait4Confirm = "WaitForConfirmation"
2325
2426 let stateComplete = "Completed"
2527
2628 let stateDispute = "Dispute"
2729
2830 let stateDisputeResolved = "DisputeResolved"
2931
3032 let client = "CL"
3133
3234 let freelancer = "FL"
3335
34-let ambassador1 = base58'FneCJqM5BP2eAuyteMiuEEHYALrE4axhEfcpHVGbdr5s'
36+let ambassador1 = "FneCJqM5BP2eAuyteMiuEEHYALrE4axhEfcpHVGbdr5s"
3537
36-let ambassador2 = base58'6QAMdssb1GJjpQVQQcnx8fKU8WhtcF9ZsQhifdThAEK8'
38+let ambassador2 = "6QAMdssb1GJjpQVQQcnx8fKU8WhtcF9ZsQhifdThAEK8"
3739
38-let ambassador3 = base58'2ituwW7DSRsLP3Vcbnpr98QUQMGFRWKmyYPFqsUKRDoP'
40+let ambassador3 = "2ituwW7DSRsLP3Vcbnpr98QUQMGFRWKmyYPFqsUKRDoP"
3941
40-let ambassador4 = base58'ANsPQocEESyLb3yQqk2pwCdoK7PJQxLoZVpYvsm3SxUG'
42+let ambassador4 = "ANsPQocEESyLb3yQqk2pwCdoK7PJQxLoZVpYvsm3SxUG"
4143
42-let ambassador5 = base58'13VixwQin1MzZCyY69NSWMSBNEV27Rzc159o7uZXR9VS'
43-
44-func AuctionIdDataKey (auctionId) = (auctionId + "_AuctionData")
45-
44+let ambassador5 = "13VixwQin1MzZCyY69NSWMSBNEV27Rzc159o7uZXR9VS"
4645
4746 func getInt (key) = {
4847 let valueJobsOnGoing = getInteger(this, key)
4948 match valueJobsOnGoing {
5049 case a: Int =>
5150 a
5251 case _ =>
5352 0
5453 }
5554 }
5655
5756
58-func AssetNameToBase58 (auctionAssetName) = if ((auctionAssetName == "WAVES"))
57+func AssetIdToAssetName (pmtAssetId) = if (!(isDefined(pmtAssetId)))
58+ then "WAVES"
59+ else if ((pmtAssetId == wBTC))
60+ then "BTC"
61+ else if ((pmtAssetId == wEUR))
62+ then "EUR"
63+ else if ((pmtAssetId == wUSD))
64+ then "USD"
65+ else if ((pmtAssetId == auctToken))
66+ then "AUCT"
67+ else throw("AssetId is incorrect")
68+
69+
70+func AssetNameToAssetId (auctionAssetName) = if ((auctionAssetName == "WAVES"))
5971 then WAVES
6072 else if ((auctionAssetName == "BTC"))
6173 then wBTC
6274 else if ((auctionAssetName == "EUR"))
6375 then wEUR
6476 else if ((auctionAssetName == "USD"))
6577 then wUSD
66- else throw("Incorrect Asset Id")
78+ else if ((auctionAssetName == "AUCT"))
79+ then auctToken
80+ else throw("Incorrect Asset Id")
6781
6882
6983 func timeCheck (currentTime,startTime,expirationTime) = ((currentTime - startTime) > expirationTime)
7084
7185
7286 func bidAmountCheck (amount,auctionPrice) = if ((amount > auctionPrice))
7387 then throw("Bid amount must be lower or equal than auctionPrice")
7488 else amount
7589
7690
7791 func increaseFreezedBalance (pmtAssetName,auctionPrice) = {
7892 let keyFreezedFunds = getInteger(this, (pmtAssetName + "_Freezed"))
7993 let currentFreezedBalance = match keyFreezedFunds {
8094 case a: Int =>
8195 a
8296 case _ =>
8397 0
8498 }
8599 (currentFreezedBalance + auctionPrice)
86100 }
87101
88102
89103 func decreaseFreezedBalance (pmtAssetName,auctionPrice) = {
90104 let keyFreezedFunds = getInteger(this, (pmtAssetName + "_Freezed"))
91105 let currentFreezedBalance = match keyFreezedFunds {
92106 case a: Int =>
93107 a
94108 case _ =>
95109 0
96110 }
97111 let a = (currentFreezedBalance - auctionPrice)
98112 if ((a >= 0))
99113 then a
100114 else throw("Freezed amount couldn't be less than 0")
101115 }
102116
103117
104-func freelancerIsRegistered (callerPub) = {
118+func clientRegistered (callerPub) = {
119+ let freelancerIsRegistered = getString(this, (callerPub + "_Freelancer"))
120+ match freelancerIsRegistered {
121+ case a: String =>
122+ callerPub
123+ case _ =>
124+ throw("Only registered users can make bets")
125+ }
126+ }
127+
128+
129+func freelancerRegistered (callerPub) = {
105130 let freelancerIsRegistered = getString(this, (callerPub + "_Freelancer"))
106131 match freelancerIsRegistered {
107132 case a: String =>
108133 callerPub
109134 case _ =>
110135 throw("Only registered users can make bets")
111136 }
112137 }
113138
114139
115140 func createAuctionPriceCheck (pmtAmount) = if ((pmtAmount > 0))
116141 then pmtAmount
117142 else throw("Amount must be higher then 0")
118143
119144
120145 func getAuctionState (auctionId) = {
121146 let valueState = getString(this, (auctionId + "_State"))
122147 match valueState {
123148 case a: String =>
124149 a
125150 case _ =>
126151 throw("Auction State was not found")
127152 }
128153 }
129154
130155
131156 func getAuctionClientPub (auctionId) = {
132- let valueClient = getString(this, (auctionId + "_AuctionClient"))
133- let clientPub = match valueClient {
157+ let valueClientPub = getString(this, (auctionId + "_AuctionClient"))
158+ match valueClientPub {
134159 case a: String =>
135160 a
136161 case _ =>
137162 throw("Auction Client was not found")
138163 }
139- fromBase58String(clientPub)
140164 }
141165
142166
143167 func getAuctionStartTime (auctionId) = {
144168 let valueAuctionStart = getInteger(this, (auctionId + "_AuctionStart"))
145169 match valueAuctionStart {
146170 case a: Int =>
147171 a
148172 case _ =>
149173 throw("Auction Start time was not found")
150174 }
151175 }
152176
153177
154178 func getAuctionDurationTime (auctionId) = {
155179 let valueauctionDuration = getInteger(this, (auctionId + "_AuctionDuration"))
156180 match valueauctionDuration {
157181 case a: Int =>
158182 a
159183 case _ =>
160184 throw("Auction duration time was not found")
161185 }
162186 }
163187
164188
165189 func getAuctionJobPerformanceTime (auctionId) = {
166190 let valueBlocksForExecution = getInteger(this, (auctionId + "_JobPerformance"))
167191 match valueBlocksForExecution {
168192 case a: Int =>
169193 a
170194 case _ =>
171195 throw("Auction job performance time was not found")
172196 }
173197 }
174198
175199
176200 func getAuctionAssetName (auctionId) = {
177201 let valueAssetName = getString(this, (auctionId + "_AssetName"))
178202 match valueAssetName {
179203 case a: String =>
180204 a
181205 case _ =>
182206 throw("Auction asset name was not found")
183207 }
184208 }
185209
186210
187211 func getAuctionPrice (auctionId) = {
188212 let valuePrice = getInteger(this, (auctionId + "_Price"))
189213 match valuePrice {
190214 case a: Int =>
191215 a
192216 case _ =>
193217 throw("Auction price was not found")
194218 }
195219 }
196220
197221
198222 func getAuctionFreelancerPub (auctionId) = {
199223 let valueClient = getString(this, (auctionId + "_HiredFreelancer"))
200- let a = match valueClient {
224+ match valueClient {
201225 case a: String =>
202226 a
203227 case _ =>
204228 throw("Auction Client was not found")
205229 }
206- fromBase58String(a)
230+ }
231+
232+
233+func getAuctionLowestBidder (auctionId) = {
234+ let valueLowestBidder = getString(this, (auctionId + "_LowestBidderPub"))
235+ match valueLowestBidder {
236+ case a: String =>
237+ a
238+ case _ =>
239+ throw("Auction lowest bidder was not found")
240+ }
241+ }
242+
243+
244+func getBid (auctionId,auctionLowestBidder) = {
245+ let valueNewAuctionPrice = getInteger(this, ((auctionId + "_Bid_") + auctionLowestBidder))
246+ match valueNewAuctionPrice {
247+ case a: Int =>
248+ a
249+ case _ =>
250+ throw("Auction lowest bid was not found")
251+ }
252+ }
253+
254+
255+func defineNewLowestBidder (auctionId,currentLowestBidderPub,bidAmount,newFreelancer) = {
256+ let valueCurrentLowestBid = getInteger(this, ((auctionId + "_Bid_") + currentLowestBidderPub))
257+ let currentLowestBid = match valueCurrentLowestBid {
258+ case a: Int =>
259+ a
260+ case _ =>
261+ throw("Auction lowest bid was not found")
262+ }
263+ if ((currentLowestBid > bidAmount))
264+ then newFreelancer
265+ else currentLowestBidderPub
266+ }
267+
268+
269+func choosedFreelancerCheck (auctionId,freelancerPub) = {
270+ let newFreelancer = getInteger(this, ((auctionId + "_Bid_") + freelancerPub))
271+ match newFreelancer {
272+ case a: Int =>
273+ freelancerPub
274+ case _ =>
275+ throw("Error: Incorrect freelancerPub")
276+ }
277+ }
278+
279+
280+func newExecutionTimeCheck (executionDays,auctionBlocksForExecution) = {
281+ let newAuctionBlocksForExecution = (executionDays * day)
282+ if ((newAuctionBlocksForExecution > auctionBlocksForExecution))
283+ then newAuctionBlocksForExecution
284+ else throw("New execution time must more than current execution time")
285+ }
286+
287+
288+func getRating (auctionFreelancer) = {
289+ let valueRating = getInteger(this, (auctionFreelancer + "_Rating"))
290+ match valueRating {
291+ case a: Int =>
292+ a
293+ case _ =>
294+ 0
295+ }
296+ }
297+
298+
299+func callerIsAmbassador (callerPub) = if (if (if (if (if ((callerPub == ambassador1))
300+ then true
301+ else (callerPub == ambassador2))
302+ then true
303+ else (callerPub == ambassador3))
304+ then true
305+ else (callerPub == ambassador4))
306+ then true
307+ else (callerPub == ambassador5))
308+ then callerPub
309+ else throw("Only defined ambassadors can vote in disputes")
310+
311+
312+func ambassadorVoteCheck (auctionId,ambassadorPub,vote) = {
313+ let keyVoter = ((auctionId + "_DiputeVote_") + ambassadorPub)
314+ let valueVoter = getString(this, keyVoter)
315+ let ambassadorVoted = match valueVoter {
316+ case a: String =>
317+ true
318+ case _ =>
319+ false
320+ }
321+ if (ambassadorVoted)
322+ then throw("Ambassador voted already ")
323+ else if (if ((vote == client))
324+ then true
325+ else (vote == freelancer))
326+ then vote
327+ else throw(((("Vote is incorrect. Must be: " + client) + " or ") + freelancer))
328+ }
329+
330+
331+func getVotesNumber (auctionId) = {
332+ let valueVotesNumber = getInteger(this, (auctionId + "_DisputeVotes"))
333+ match valueVotesNumber {
334+ case a: Int =>
335+ a
336+ case _ =>
337+ throw("VotesNumber was not found")
338+ }
339+ }
340+
341+
342+func defineDisputeWinner (auctionId,newVote,auctionClient,auctionFreelancer) = {
343+ let ambassador1Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador1))
344+ let ambassador2Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador2))
345+ let ambassador3Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador3))
346+ let ambassador4Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador4))
347+ let ambassador5Vote = getString(this, ((auctionId + "_DiputeVote_") + ambassador5))
348+ let v1 = if ((ambassador1Vote == client))
349+ then 1
350+ else 0
351+ let v2 = if ((ambassador2Vote == client))
352+ then 1
353+ else 0
354+ let v3 = if ((ambassador3Vote == client))
355+ then 1
356+ else 0
357+ let v4 = if ((ambassador4Vote == client))
358+ then 1
359+ else 0
360+ let v5 = if ((ambassador5Vote == client))
361+ then 1
362+ else 0
363+ let currentVote = if ((newVote == client))
364+ then 1
365+ else 0
366+ let votesForClient = (((((v1 + v2) + v3) + v4) + v5) + currentVote)
367+ if ((votesForClient > 2))
368+ then auctionClient
369+ else auctionFreelancer
207370 }
208371
209372
210373 @Callable(i)
211374 func freelancerSignUp (info) = {
212375 let userPublicKey = toBase58String(i.callerPublicKey)
213376 let alreadyRegistered = getString(this, (userPublicKey + "_Freelancer"))
214377 if (isDefined(alreadyRegistered))
215378 then throw("User already registered")
216379 else WriteSet([DataEntry((userPublicKey + "_Freelancer"), info), DataEntry((userPublicKey + "_PendingEarnings"), 0), DataEntry((userPublicKey + "_PaidEarnings"), 0), DataEntry((userPublicKey + "_TotalEarnings"), 0), DataEntry((userPublicKey + "_JobsPending"), 0), DataEntry((userPublicKey + "_JobsCompleted"), 0), DataEntry((userPublicKey + "_JobsTotal"), 0)])
217380 }
218381
219382
220383
221384 @Callable(i)
222385 func clientSignUp (info) = {
223386 let userPublicKey = toBase58String(i.callerPublicKey)
224387 let alreadyRegistered = getString(this, (userPublicKey + "_Client"))
225388 if (isDefined(alreadyRegistered))
226389 then throw("User already registered")
227390 else WriteSet([DataEntry((userPublicKey + "_Client"), info), DataEntry((userPublicKey + "_JobsCreated"), 0), DataEntry((userPublicKey + "_JobsOnGoing"), 0), DataEntry((userPublicKey + "_JobInDispute"), 0)])
228391 }
229392
230393
231394
232395 @Callable(i)
233396 func createAuction (jobExecutionDays,auctionDurationDays,auctionInfo) = {
397+ let callerPub = toBase58String(i.callerPublicKey)
234398 let auctionId = toBase58String(i.transactionId)
235- let auctionClient = toBase58String(i.callerPublicKey)
399+ let auctionClient = clientRegistered(callerPub)
236400 let pmt = extract(i.payment)
237401 let pmtAmount = pmt.amount
238402 let auctionPrice = createAuctionPriceCheck(pmtAmount)
239403 let auctionStart = height
240404 let auctionDurationBlocks = (auctionDurationDays * day)
241405 let blocksForExecution = (jobExecutionDays * day)
242- let pmtAssetName = if (!(isDefined(pmt.assetId)))
243- then "WAVES"
244- else if ((pmt.assetId == wBTC))
245- then "BTC"
246- else if ((pmt.assetId == wEUR))
247- then "EUR"
248- else if ((pmt.assetId == wUSD))
249- then "USD"
250- else throw("AssetId is incorrect")
406+ let pmtAssetName = AssetIdToAssetName(pmt.assetId)
251407 let jobsCreated = getInt((auctionClient + "_JobsCreated"))
252408 let newFreezedBalance = increaseFreezedBalance(pmtAssetName, auctionPrice)
253409 WriteSet([DataEntry((auctionId + "_State"), stateOpen), DataEntry((auctionId + "_Info"), auctionInfo), DataEntry((auctionId + "_AuctionClient"), 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), DataEntry((auctionClient + "_JobsCreated"), (jobsCreated + 1))])
254410 }
255411
256412
257413
258414 @Callable(i)
259415 func makeBid (auctionId,amount) = {
260416 let callerPub = toBase58String(i.callerPublicKey)
261- let betTime = height
262417 let auctionState = getAuctionState(auctionId)
263418 let auctionClient = getAuctionClientPub(auctionId)
264419 let auctionStart = getAuctionStartTime(auctionId)
265420 let auctionDuration = getAuctionDurationTime(auctionId)
266421 let auctionBlocksForExecution = getAuctionJobPerformanceTime(auctionId)
267422 let auctionAssetName = getAuctionAssetName(auctionId)
268423 let auctionPrice = getAuctionPrice(auctionId)
269- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
270- let newFreelancer = freelancerIsRegistered(callerPub)
424+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
425+ let newFreelancer = freelancerRegistered(callerPub)
271426 let dAppCommission = ((auctionPrice * 3) / 100)
272427 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
273428 let bidAmount = bidAmountCheck(amount, auctionPrice)
274- let auctionTimeisOver = timeCheck(betTime, auctionStart, auctionDuration)
429+ let auctionTimeisOver = timeCheck(height, auctionStart, auctionDuration)
275430 if (auctionTimeisOver)
276431 then if ((auctionState == stateOpen))
277- then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), (auctionPrice - dAppCommission), auctionAssetId58)]))
432+ then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), (auctionPrice - dAppCommission), auctionAssetId58)]))
278433 else if ((auctionState == stateSuggested))
279434 then {
280- let auctionLowestBidder = {
281- let valueLowestBidder = getString(this, (auctionId + "_LowestBidderPub"))
282- match valueLowestBidder {
283- case a: String =>
284- a
285- case _ =>
286- throw("Auction lowest bidder was not found")
287- }
288- }
289- let newAuctionPrice = {
290- let valueNewAuctionPrice = getInteger(this, ((auctionId + "_Bid_") + auctionLowestBidder))
291- match valueNewAuctionPrice {
292- case a: Int =>
293- a
294- case _ =>
295- throw("Auction lowest bid was not found")
296- }
297- }
298- let amountDifference = ((auctionPrice - newAuctionPrice) - dAppCommission)
299- ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), newAuctionPrice)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), amountDifference, auctionAssetId58)]))
435+ let auctionLowestBidder = getAuctionLowestBidder(auctionId)
436+ let auctionLowestBid = getBid(auctionId, auctionLowestBidder)
437+ let amountDifference = ((auctionPrice - auctionLowestBid) - dAppCommission)
438+ ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), auctionLowestBid)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), amountDifference, auctionAssetId58)]))
300439 }
301440 else throw("Incorrect auction state")
302441 else if ((auctionState == stateOpen))
303442 then WriteSet([DataEntry(((auctionId + "_Bid_") + newFreelancer), bidAmount), DataEntry((auctionId + "_State"), stateSuggested), DataEntry((auctionId + "_LowestBidderPub"), callerPub)])
304443 else if ((auctionState == stateSuggested))
305444 then {
306- let currentLowestBidderPub = {
307- let lowestBidder = getString(this, (auctionId + "_LowestBidderPub"))
308- match lowestBidder {
309- case a: String =>
310- a
311- case _ =>
312- throw("Auction lowest bidder was not found")
313- }
314- }
315- let newLowestBidderPub = {
316- let valueCurrentLowestBid = getInteger(this, ((auctionId + "_Bid_") + currentLowestBidderPub))
317- let currentLowestBid = match valueCurrentLowestBid {
318- case a: Int =>
319- a
320- case _ =>
321- throw("Auction lowest bid was not found")
322- }
323- if ((currentLowestBid > bidAmount))
324- then newFreelancer
325- else currentLowestBidderPub
326- }
445+ let currentLowestBidderPub = getAuctionLowestBidder(auctionId)
446+ let newLowestBidderPub = defineNewLowestBidder(auctionId, currentLowestBidderPub, bidAmount, newFreelancer)
327447 WriteSet([DataEntry((auctionId + "_LowestBidderPub"), newLowestBidderPub), DataEntry(((auctionId + "_Bid_") + newFreelancer), bidAmount)])
328448 }
329449 else throw(((((("Incorrect jobId state. Now: " + auctionState) + ", must be: ") + stateOpen) + " or ") + stateSuggested))
330450 }
331451
332452
333453
334454 @Callable(i)
335455 func chooseFreelancer (auctionId,freelancerPub) = {
336- let callerPub = extract(i.callerPublicKey)
337- let betTime = height
456+ let callerPub = toBase58String(i.callerPublicKey)
338457 let auctionState = getAuctionState(auctionId)
339458 let auctionClient = getAuctionClientPub(auctionId)
340459 let auctionStart = getAuctionStartTime(auctionId)
341460 let auctionDuration = getAuctionDurationTime(auctionId)
342461 let auctionAssetName = getAuctionAssetName(auctionId)
343462 let auctionPrice = getAuctionPrice(auctionId)
344- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
345- let jobsOnGoing = getInt((toBase58String(auctionClient) + "_JobsOnGoing"))
463+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
464+ let newFreelancer = choosedFreelancerCheck(auctionId, freelancerPub)
465+ let freelancerBidAmount = getBid(auctionId, newFreelancer)
466+ let auctionTimeisOver = timeCheck(height, auctionStart, auctionDuration)
467+ let jobsOnGoing = getInt((auctionClient + "_JobsOnGoing"))
346468 let freelancerPendingEarnings = getInt((freelancerPub + "_PendingEarnings"))
347469 let freelancerTotalEarnings = getInt((freelancerPub + "_TotalEarnings"))
348- let freelancerBidAmount = {
349- let keyFreelancerBid = ((auctionId + "_Bid_") + freelancerPub)
350- let valueFreelacerBid = getInteger(this, keyFreelancerBid)
351- match valueFreelacerBid {
352- case a: Int =>
353- a
354- case _ =>
355- throw("Freelancer's bet was not found")
356- }
357- }
358- let auctionTimeisOver = timeCheck(betTime, auctionStart, auctionDuration)
359470 if ((callerPub == auctionClient))
360471 then if (auctionTimeisOver)
361472 then if ((auctionState == stateOpen))
362473 then {
363474 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
364475 let dAppCommission = ((auctionPrice * 3) / 100)
365- ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), (auctionPrice - dAppCommission), auctionAssetId58)]))
476+ ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), (auctionPrice - dAppCommission), auctionAssetId58)]))
366477 }
367478 else if ((auctionState == stateSuggested))
368479 then {
369- let auctionLowestBidder = {
370- let valueLowestBidder = getString(this, (auctionId + "_LowestBidderPub"))
371- match valueLowestBidder {
372- case a: String =>
373- a
374- case _ =>
375- throw("Auction lowest bidder was not found")
376- }
377- }
378- let newAuctionPrice = {
379- let valueNewAuctionPrice = getInteger(this, ((auctionId + "_Bid_") + auctionLowestBidder))
380- match valueNewAuctionPrice {
381- case a: Int =>
382- a
383- case _ =>
384- throw("Auction lowest bid was not found")
385- }
386- }
387- let amountDifference = (auctionPrice - newAuctionPrice)
480+ let auctionLowestBidder = getAuctionLowestBidder(auctionId)
481+ let auctionLowestBid = getBid(auctionId, auctionLowestBidder)
482+ let amountDifference = (auctionPrice - auctionLowestBid)
388483 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, amountDifference)
389- ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), newAuctionPrice), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((toBase58String(auctionClient) + "_JobsOnGoing"), (jobsOnGoing + 1)), DataEntry((freelancerPub + "_PendingEarnings"), (freelancerPendingEarnings + newAuctionPrice)), DataEntry((freelancerPub + "_TotalEarnings"), (freelancerTotalEarnings + newAuctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), amountDifference, auctionAssetId58)]))
484+ ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), auctionLowestBidder), DataEntry((auctionId + "_Price"), auctionLowestBid), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsOnGoing"), (jobsOnGoing + 1)), DataEntry((freelancerPub + "_PendingEarnings"), (freelancerPendingEarnings + auctionLowestBid)), DataEntry((freelancerPub + "_TotalEarnings"), (freelancerTotalEarnings + auctionLowestBid))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), amountDifference, auctionAssetId58)]))
390485 }
391486 else throw("Incorrect auction state")
392487 else if (if ((auctionState == stateOpen))
393488 then true
394489 else (auctionState == stateSuggested))
395490 then {
396- let setNewFreelancer = {
397- let newFreelancer = getInteger(this, ((auctionId + "_Bid_") + freelancerPub))
398- match newFreelancer {
399- case a: Int =>
400- freelancerPub
401- case _ =>
402- throw("Error: Incorrect freelancerPub")
403- }
404- }
405- let newAuctionPrice = {
406- let freelancerBid = getInteger(this, ((auctionId + "_Bid_") + freelancerPub))
407- match freelancerBid {
408- case a: Int =>
409- a
410- case _ =>
411- throw("Auction lowest bidder was not found")
412- }
413- }
414491 let amountDifference = (auctionPrice - freelancerBidAmount)
415492 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, amountDifference)
416- ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), setNewFreelancer), DataEntry((auctionId + "_Price"), newAuctionPrice), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((toBase58String(auctionClient) + "_JobsOnGoing"), (jobsOnGoing + 1)), DataEntry((freelancerPub + "_PendingEarnings"), (freelancerPendingEarnings + newAuctionPrice)), DataEntry((freelancerPub + "_TotalEarnings"), (freelancerTotalEarnings + newAuctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), (amountDifference + 1), auctionAssetId58)]))
493+ ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateInProgress), DataEntry((auctionId + "_HiredFreelancer"), newFreelancer), DataEntry((auctionId + "_Price"), freelancerBidAmount), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsOnGoing"), (jobsOnGoing + 1)), DataEntry((freelancerPub + "_PendingEarnings"), (freelancerPendingEarnings + freelancerBidAmount)), DataEntry((freelancerPub + "_TotalEarnings"), (freelancerTotalEarnings + freelancerBidAmount))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), (amountDifference + 1), auctionAssetId58)]))
417494 }
418495 else throw("Incorrect auction state")
419496 else throw("Only auction customer can choose a freelancer")
420497 }
421498
422499
423500
424501 @Callable(i)
425502 func increaseExecutionTime (auctionId,executionDays) = {
426- let caller = extract(i.callerPublicKey)
503+ let caller = toBase58String(i.callerPublicKey)
427504 let auctionState = getAuctionState(auctionId)
428505 let auctionClient = getAuctionClientPub(auctionId)
429506 let auctionBlocksForExecution = getAuctionJobPerformanceTime(auctionId)
430- let newAuctionExecutionTime = {
431- let newAuctionBlocksForExecution = (executionDays * day)
432- if ((newAuctionBlocksForExecution > auctionBlocksForExecution))
433- then newAuctionBlocksForExecution
434- else throw("New execution time must more than current execution time")
435- }
507+ let newAuctionExecutionTime = newExecutionTimeCheck(executionDays, auctionBlocksForExecution)
436508 if ((caller == auctionClient))
437509 then if (if (if ((auctionState == stateOpen))
438510 then true
439511 else (auctionState == stateSuggested))
440512 then true
441513 else (auctionState == stateInProgress))
442514 then WriteSet([DataEntry((auctionId + "_JobPerformance"), newAuctionExecutionTime)])
443515 else throw("Incorrect state")
444516 else throw("Only Client can increase execution time")
445517 }
446518
447519
448520
449521 @Callable(i)
450522 func cancelAuction (auctionId) = {
451- let callerPub = extract(i.callerPublicKey)
523+ let callerPub = toBase58String(i.callerPublicKey)
452524 let auctionState = getAuctionState(auctionId)
453525 let auctionClient = getAuctionClientPub(auctionId)
454526 let auctionAssetName = getAuctionAssetName(auctionId)
455527 let auctionPrice = getAuctionPrice(auctionId)
456- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
528+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
457529 let dAppCommission = ((auctionPrice * 3) / 100)
458530 let amountWithoutComm = (auctionPrice - dAppCommission)
459531 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
460532 if ((callerPub == auctionClient))
461533 then if ((auctionState == stateOpen))
462- then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionClient), amountWithoutComm, auctionAssetId58)]))
534+ then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateCancel), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionClient)), amountWithoutComm, auctionAssetId58)]))
463535 else throw("Auction can be canceled only by auction owner.")
464536 else throw("Only Client can cancel auction")
465537 }
466538
467539
468540
469541 @Callable(i)
470542 func openDispute (auctionId) = {
471- let caller = extract(i.callerPublicKey)
543+ let caller = toBase58String(i.callerPublicKey)
472544 let auctionState = getAuctionState(auctionId)
473545 let auctionClient = getAuctionClientPub(auctionId)
474546 let auctionFreelancer = getAuctionFreelancerPub(auctionId)
475- let clientJobsInDispute = getInt((toBase58String(auctionClient) + "_JobsInDispute"))
547+ let clientJobsInDispute = getInt((auctionClient + "_JobsInDispute"))
476548 if (if ((auctionState == stateInProgress))
477549 then true
478550 else (auctionState == stateWait4Confirm))
479551 then if (if ((caller == auctionClient))
480552 then true
481553 else (caller == auctionFreelancer))
482- then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), 0), DataEntry((toBase58String(auctionClient) + "_JobsInDispute"), (clientJobsInDispute + 1))])
554+ then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), 0), DataEntry((auctionClient + "_JobsInDispute"), (clientJobsInDispute + 1))])
483555 else throw("Only Client and Freelancer can open dispute")
484556 else throw("Incorrect auction state for dispute opening")
485557 }
486558
487559
488560
489561 @Callable(i)
490562 func voteDispute (auctionId,vote) = {
491- let callerPub = extract(i.callerPublicKey)
563+ let callerPub = toBase58String(i.callerPublicKey)
492564 let auctionState = getAuctionState(auctionId)
493565 let auctionClient = getAuctionClientPub(auctionId)
494566 let auctionAssetName = getAuctionAssetName(auctionId)
495567 let auctionPrice = getAuctionPrice(auctionId)
496568 let auctionFreelancer = getAuctionFreelancerPub(auctionId)
497569 let commission = ((auctionPrice * 3) / 100)
498- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
499- let clientJobsInDispute = getInt((toBase58String(auctionClient) + "_JobsInDispute"))
500- let freelancerPendingEarnings = getInt((toBase58String(auctionFreelancer) + "_PendingEarnings"))
501- let callerIsAmbassador = if (if (if (if (if ((callerPub == ambassador1))
502- then true
503- else (callerPub == ambassador2))
504- then true
505- else (callerPub == ambassador3))
506- then true
507- else (callerPub == ambassador4))
508- then true
509- else (callerPub == ambassador5))
510- then toBase58String(callerPub)
511- else throw("Only defined ambassadors can vote in disputes")
512- let newVote = if (if ((vote == client))
513- then true
514- else (vote == freelancer))
515- then vote
516- else throw(((("Vote is incorrect. Must be: " + client) + " or ") + freelancer))
517- let newVoter = {
518- let keyVoter = ((auctionId + "_DiputeVote_") + callerIsAmbassador)
519- let valueVoter = getString(this, keyVoter)
520- match valueVoter {
521- case a: String =>
522- throw("User already voted")
523- case _ =>
524- callerIsAmbassador
525- }
526- }
527- let votesNumber = {
528- let valueVotesNumber = getInteger(this, (auctionId + "_DisputeVotes"))
529- match valueVotesNumber {
530- case a: Int =>
531- a
532- case _ =>
533- throw("VotesNumber was not found")
534- }
535- }
570+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
571+ let ambassadorPub = callerIsAmbassador(callerPub)
572+ let ambassadorVote = ambassadorVoteCheck(auctionId, ambassadorPub, vote)
573+ let votesNumber = getVotesNumber(auctionId)
574+ let clientJobsInDispute = getInt((auctionClient + "_JobsInDispute"))
575+ let freelancerPendingEarnings = getInt((auctionFreelancer + "_PendingEarnings"))
576+ let freelancerTotalEarnings = getInt((auctionFreelancer + "_TotalEarnings"))
536577 if ((auctionState == stateDispute))
537578 then if ((votesNumber == 4))
538579 then {
539- let disputeWinner = {
540- let ambassador1Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador1)))
541- let ambassador2Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador2)))
542- let ambassador3Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador3)))
543- let ambassador4Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador4)))
544- let ambassador5Vote = getString(this, ((auctionId + "_DiputeVote_") + toBase58String(ambassador5)))
545- let v1 = if ((ambassador1Vote == client))
546- then 1
547- else 0
548- let v2 = if ((ambassador2Vote == client))
549- then 1
550- else 0
551- let v3 = if ((ambassador3Vote == client))
552- then 1
553- else 0
554- let v4 = if ((ambassador4Vote == client))
555- then 1
556- else 0
557- let v5 = if ((ambassador5Vote == client))
558- then 1
559- else 0
560- let currentVote = if ((newVote == client))
561- then 1
562- else 0
563- let votesForClient = (((((v1 + v2) + v3) + v4) + v5) + currentVote)
564- if ((votesForClient > 2))
565- then auctionClient
566- else auctionFreelancer
567- }
568- let paymentWithoutComm = if ((disputeWinner == auctionClient))
569- then (auctionPrice - commission)
570- else (auctionPrice - (commission * 2))
580+ let disputeWinnerPub = defineDisputeWinner(auctionId, ambassadorVote, auctionClient, auctionFreelancer)
571581 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
572- ScriptResult(WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry((auctionId + "_State"), stateDisputeResolved), DataEntry(((auctionId + "_DiputeVote_") + newVoter), newVote), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((toBase58String(auctionClient) + "_JobsInDispute"), (clientJobsInDispute - 1)), DataEntry((toBase58String(auctionFreelancer) + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(disputeWinner), paymentWithoutComm, auctionAssetId58)]))
582+ if ((disputeWinnerPub == auctionClient))
583+ then {
584+ let paymentWithoutComm = (auctionPrice - commission)
585+ ScriptResult(WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry((auctionId + "_State"), stateDisputeResolved), DataEntry(((auctionId + "_DiputeVote_") + ambassadorPub), ambassadorVote), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsInDispute"), (clientJobsInDispute - 1)), DataEntry((auctionFreelancer + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice)), DataEntry((auctionFreelancer + "_TotalEarnings"), (freelancerTotalEarnings - auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(disputeWinnerPub)), paymentWithoutComm, auctionAssetId58)]))
586+ }
587+ else {
588+ let paymentWithoutComm = (auctionPrice - (commission * 2))
589+ ScriptResult(WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry((auctionId + "_State"), stateDisputeResolved), DataEntry(((auctionId + "_DiputeVote_") + ambassadorPub), ambassadorVote), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsInDispute"), (clientJobsInDispute - 1)), DataEntry((auctionFreelancer + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(disputeWinnerPub)), paymentWithoutComm, auctionAssetId58)]))
590+ }
573591 }
574- else WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry(((auctionId + "_DiputeVote_") + newVoter), newVote)])
592+ else WriteSet([DataEntry((auctionId + "_DisputeVotes"), (votesNumber + 1)), DataEntry(((auctionId + "_DiputeVote_") + ambassadorPub), ambassadorVote)])
575593 else throw(("Incorrect state. Must be: " + stateDispute))
576594 }
577595
578596
579597
580598 @Callable(i)
581599 func workHandOver (auctionId) = {
582- let callerPub = extract(i.callerPublicKey)
600+ let callerPub = toBase58String(i.callerPublicKey)
583601 let auctionState = getAuctionState(auctionId)
584602 let auctionClient = getAuctionClientPub(auctionId)
585603 let auctionStart = getAuctionStartTime(auctionId)
586604 let auctionDuration = getAuctionDurationTime(auctionId)
587605 let auctionBlocksForExecution = getAuctionJobPerformanceTime(auctionId)
588606 let auctionFreelancer = getAuctionFreelancerPub(auctionId)
589- let clientJobsInDispute = getInt((toBase58String(auctionClient) + "_JobsInDispute"))
590- let currentTime = height
591- let freelancerPubCheck = if ((callerPub == auctionFreelancer))
592- then callerPub
607+ let timeIsOver = ((height - auctionStart) > auctionBlocksForExecution)
608+ let clientJobsInDispute = getInt((auctionClient + "_JobsInDispute"))
609+ if ((callerPub == auctionFreelancer))
610+ then if ((auctionState == stateInProgress))
611+ then if (timeIsOver)
612+ then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), "0"), DataEntry((auctionClient + "_JobInDispute"), (clientJobsInDispute + 1))])
613+ else WriteSet([DataEntry((auctionId + "_State"), stateWait4Confirm)])
614+ else throw("Auction state is incorrect")
593615 else throw("Only a freelancer can indicate that the work is done")
594- let timeIsOver = ((currentTime - auctionStart) > auctionBlocksForExecution)
595- if ((auctionState == stateInProgress))
596- then if (timeIsOver)
597- then WriteSet([DataEntry((auctionId + "_State"), stateDispute), DataEntry((auctionId + "_DisputeVotes"), "0"), DataEntry((toBase58String(auctionClient) + "_JobInDispute"), (clientJobsInDispute + 1))])
598- else WriteSet([DataEntry((auctionId + "_State"), stateWait4Confirm)])
599- else throw("Auction state is incorrect")
600616 }
601617
602618
603619
604620 @Callable(i)
605621 func acceptWork (auctionId) = {
606- let callerPub = extract(i.callerPublicKey)
622+ let callerPub = toBase58String(i.callerPublicKey)
607623 let auctionState = getAuctionState(auctionId)
608624 let auctionClient = getAuctionClientPub(auctionId)
609625 let auctionStart = getAuctionStartTime(auctionId)
610626 let auctionDuration = getAuctionDurationTime(auctionId)
611627 let auctionAssetName = getAuctionAssetName(auctionId)
612628 let auctionPrice = getAuctionPrice(auctionId)
613629 let auctionFreelancer = getAuctionFreelancerPub(auctionId)
614- let jobsOnGoing = getInt((toBase58String(auctionClient) + "_JobsOnGoing"))
615- let freelancerPendingEarnings = getInt((toBase58String(auctionFreelancer) + "_PendingEarnings"))
616- let freelancerPaidEarnings = getInt((toBase58String(auctionFreelancer) + "_PaidEarnings"))
630+ let jobsOnGoing = getInt((auctionClient + "_JobsOnGoing"))
631+ let freelancerPendingEarnings = getInt((auctionFreelancer + "_PendingEarnings"))
632+ let freelancerPaidEarnings = getInt((auctionFreelancer + "_PaidEarnings"))
617633 let dAppCommission = ((auctionPrice * 3) / 100)
618- let amountWithoutComm = (auctionPrice - dAppCommission)
619- let auctionAssetId58 = AssetNameToBase58(auctionAssetName)
634+ let amountWithoutComm = (auctionPrice - (dAppCommission * 2))
635+ let auctionAssetId58 = AssetNameToAssetId(auctionAssetName)
620636 let newFreezedBalance = decreaseFreezedBalance(auctionAssetName, auctionPrice)
621- let newRating = {
622- let valueRating = getInteger(this, (toBase58String(auctionFreelancer) + "_Rating"))
623- let currentRating = match valueRating {
624- case a: Int =>
625- a
626- case _ =>
627- 0
628- }
629- (currentRating + 1)
630- }
637+ let freelancerRating = getRating(auctionFreelancer)
631638 if ((callerPub == auctionClient))
632639 then if ((auctionState == stateWait4Confirm))
633- then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateComplete), DataEntry((toBase58String(auctionFreelancer) + "_Rating"), newRating), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((toBase58String(auctionClient) + "_JobsOnGoing"), (jobsOnGoing - 1)), DataEntry((toBase58String(auctionFreelancer) + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice)), DataEntry((toBase58String(auctionFreelancer) + "_PaidEarnings"), (freelancerPaidEarnings + auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(auctionFreelancer), amountWithoutComm, auctionAssetId58)]))
640+ then ScriptResult(WriteSet([DataEntry((auctionId + "_State"), stateComplete), DataEntry((auctionFreelancer + "_Rating"), (freelancerRating + 1)), DataEntry((auctionAssetName + "_Freezed"), newFreezedBalance), DataEntry((auctionClient + "_JobsOnGoing"), (jobsOnGoing - 1)), DataEntry((auctionFreelancer + "_PendingEarnings"), (freelancerPendingEarnings - auctionPrice)), DataEntry((auctionFreelancer + "_PaidEarnings"), (freelancerPaidEarnings + auctionPrice))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(auctionFreelancer)), amountWithoutComm, auctionAssetId58)]))
634641 else throw(("Incorrect state. Must be: " + stateWait4Confirm))
635642 else throw("Only auction customer can use this function")
636643 }
637644
638645
639646 @Verifier(tx)
640647 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
641648 then match tx {
642649 case ttx: TransferTransaction =>
643- true
650+ let assetName = AssetIdToAssetName(ttx.assetId)
651+ let valueReservedBalance = getInteger(this, (assetName + "_Reserved"))
652+ let reservedBalance = match valueReservedBalance {
653+ case a: Int =>
654+ a
655+ case _ =>
656+ 0
657+ }
658+ let availableBalance = (assetBalance(this, ttx.assetId) - reservedBalance)
659+ (availableBalance >= ttx.amount)
644660 case stx: SetScriptTransaction =>
645661 true
646662 case _ =>
647663 false
648664 }
649665 else false
650666

github/deemru/w8io/169f3d6 
104.78 ms