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