tx · 4d5f7c2sSBSbq9LAwRoqoZzYHQCZBBFcLADPcMwQs813 3MyRsssByY6ZDZxzXEFK7sgFYbtXAxajmJp: -0.01000000 Waves 2021.10.06 12:18 [1734174] smart account 3MyRsssByY6ZDZxzXEFK7sgFYbtXAxajmJp > SELF 0.00000000 Waves
{ "type": 13, "id": "4d5f7c2sSBSbq9LAwRoqoZzYHQCZBBFcLADPcMwQs813", "fee": 1000000, "feeAssetId": null, "timestamp": 1633511931585, "version": 2, "chainId": 84, "sender": "3MyRsssByY6ZDZxzXEFK7sgFYbtXAxajmJp", "senderPublicKey": "7mNS5bKoVK7u5db7PvrcUj25wxK6NvkMjqkMHjBKcpVb", "proofs": [ "4FfJ3stvXYqsbYZZYEdyenY4n6k2noVbfjjUr8Tyu9wM6Ur9dzuwDF8TrejdFLdKs9qf2FRUbX9aVt9LdRaoAA2a" ], "script": "base64:AAIFAAAAAAAAAD8IAhIFCgMBCAgSCQoHCAgICAgICBIJCgcIAQEICAEBEgQKAggIEgMKAQgSBAoCCAgSBgoECAgICBIFCgMICAgAAABQAAAAAAh1bml0VGVzdAcAAAAACW9yYWNsZUZlZQkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTXBaUWp6R29nbWlmY0VLZThtRGQ2cmliTDdueFQ5QUN5ZQAAAAALZmVlUmVjZWl2ZXICAAAAIzNONjV4THE4SmNDZWFFaVIxVEpRN2RCcVhCdkV5NkU0OFd6AAAAAAhjZXJ0RGFwcAIAAAAjM014Y1hyTmJNWktZYVNyaGNmZU1tMmhabkJlQ3UzeVJXc3cAAAAACHVzZXJEYXBwCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNOOWNRZ1pGUEhIVnU4d3FzbjJEa1FGZWhnM2g4Q05pb29BAAAAAA13aGl0ZWxpc3REYXBwCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNOOXhaWUdwek1GRFh2WHVjdG1VNnpWOHFTem0yWmZGMzFmAAAAAAtVU0ROQXN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A5rZXlBdWN0aW9uVHlwZQAAAAIFAAAABmlzc3VlcgUAAAAFYXJ0SWQDCQAAAAAAAAIFAAAAC2F1Y3Rpb25UeXBlBQAAAAxhdWN0aW9uVHlwZTEJAQAAAA1jYW5jZWxCaWRJbXBsAAAABAUAAAABaQUAAAAFYXJ0SWQFAAAABmlzc3VlcgUAAAAFYmlkSWQJAQAAABhjYW5jZWxCaWRJbXBsVHJhZGl0aW9uYWwAAAAEBQAAAAFpBQAAAAVhcnRJZAUAAAAGaXNzdWVyBQAAAAViaWRJZAAAAAAPVw8g", "height": 1734174, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BTWWj5ACCiSgaVYEYa2NnMrWD4jxqBHnKo9SeHinVfeL Next: 2mFEyMVbvC1WJvi4f5V7USxJcULDZZAK6DjDFFtacPUY Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | let feeReceiver = "3N65xLq8JcCeaEiR1TJQ7dBqXBvEy6E48Wz" | |
9 | 9 | ||
10 | + | let certDapp = "3MxcXrNbMZKYaSrhcfeMm2hZnBeCu3yRWsw" | |
11 | + | ||
10 | 12 | let userDapp = value(addressFromString("3N9cQgZFPHHVu8wqsn2DkQFehg3h8CNiooA")) | |
11 | 13 | ||
12 | 14 | let whitelistDapp = value(addressFromString("3N9xZYGpzMFDXvXuctmU6zV8qSzm2ZfF31f")) | |
13 | 15 | ||
14 | - | let | |
16 | + | let USDNAssetId = base58'132maRL3uF35tc2bpRih9D6MYq5DR6H28zkop786dKyu' | |
15 | 17 | ||
16 | - | let | |
18 | + | let owners = [getString(oracleFee, "owner1"), getString(oracleFee, "owner2")] | |
17 | 19 | ||
18 | - | let sconexFirstSellCut = 150 | |
20 | + | let USDNFirstSellCut = 150 | |
21 | + | ||
22 | + | let USDNSecondSellCut = 30 | |
23 | + | ||
24 | + | let originalCreatorCut = 70 | |
19 | 25 | ||
20 | 26 | let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true) | |
21 | 27 | ||
33 | 39 | ||
34 | 40 | let auctionType2 = "TRADITIONAL" | |
35 | 41 | ||
42 | + | func getStringByKeyFromUsers (key) = valueOrElse(getString(userDapp, key), "") | |
43 | + | ||
44 | + | ||
36 | 45 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
46 | + | ||
47 | + | ||
48 | + | func getStringByKeyOrError (key,error) = valueOrErrorMessage(getString(this, key), error) | |
37 | 49 | ||
38 | 50 | ||
39 | 51 | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
46 | 58 | ||
47 | 59 | ||
48 | 60 | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
61 | + | ||
62 | + | ||
63 | + | func validateHash (hash) = (size(hash) == 64) | |
49 | 64 | ||
50 | 65 | ||
51 | 66 | func keyUserStatus (caller) = ("user_status_" + caller) | |
117 | 132 | func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller))))) | |
118 | 133 | ||
119 | 134 | ||
120 | - | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String( | |
135 | + | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(USDNAssetId))) | |
121 | 136 | ||
122 | 137 | func getAmountByBidId (bidId) = valueOrElse(getIntegerByKey(keyBidId(bidId)), 0) | |
123 | 138 | ||
124 | 139 | ||
125 | 140 | func getAmountHighestBidByArtId (artId) = { | |
126 | - | let bidId = | |
141 | + | let bidId = getStringByKey(keyHighestBidBidId(artId)) | |
127 | 142 | if ((bidId == "")) | |
128 | 143 | then 0 | |
129 | 144 | else getAmountByBidId(bidId) | |
157 | 172 | then throw(checkUser) | |
158 | 173 | else if ((size(cidDisplay) == 0)) | |
159 | 174 | then throw("Display CID cannot be empty") | |
160 | - | else if (!(validateString(name, 100))) | |
161 | - | then throw("100 Char. max name") | |
162 | - | else if (!(validateString(description, 1000))) | |
163 | - | then throw("1000 Char. max description") | |
164 | - | else if ((size(split(tags, ",")) > 5)) | |
165 | - | then throw("5 tags max.") | |
166 | - | else "" | |
175 | + | else if ((size(cidDisplay) != 46)) | |
176 | + | then throw("This doesn't seem a valid CID!") | |
177 | + | else if (!(validateString(name, 100))) | |
178 | + | then throw("100 Char. max name") | |
179 | + | else if (!(validateString(description, 1000))) | |
180 | + | then throw("1000 Char. max description") | |
181 | + | else if ((size(split(tags, ",")) > 5)) | |
182 | + | then throw("5 tags max.") | |
183 | + | else "" | |
167 | 184 | } | |
168 | 185 | ||
169 | 186 | ||
181 | 198 | let payment = t089829018._1 | |
182 | 199 | let amount = t089829018._2 | |
183 | 200 | let assetId = if (if (isDefined(payment.assetId)) | |
184 | - | then (payment.assetId == | |
201 | + | then (payment.assetId == USDNAssetId) | |
185 | 202 | else false) | |
186 | 203 | then payment.assetId | |
187 | - | else throw("Only | |
204 | + | else throw("Only USDN token accepted as transaction fee") | |
188 | 205 | if ((amount != currentCertificationPrice)) | |
189 | - | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
206 | + | then throw(((("Payment amount should be " + toString(currentCertificationPrice)) + " but is: ") + toString(amount))) | |
190 | 207 | else $Tuple2(amount, assetId) | |
191 | 208 | } | |
209 | + | ||
210 | + | ||
211 | + | func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) { | |
212 | + | case b: Int => | |
213 | + | if ((b != 0)) | |
214 | + | then true | |
215 | + | else false | |
216 | + | case _ => | |
217 | + | false | |
218 | + | } | |
192 | 219 | ||
193 | 220 | ||
194 | 221 | func validatePriceAssetId (i,priceAssetId,artworkPrice) = { | |
212 | 239 | } | |
213 | 240 | ||
214 | 241 | ||
215 | - | func acceptedAssetIds (assetId) = if ((assetId != toBase58String( | |
216 | - | then throw("Only | |
242 | + | func acceptedAssetIds (assetId) = if ((assetId != toBase58String(USDNAssetId))) | |
243 | + | then throw("Only USDN accepted") | |
217 | 244 | else true | |
218 | 245 | ||
219 | 246 | ||
221 | 248 | let minSellSconex = if (unitTest) | |
222 | 249 | then 1 | |
223 | 250 | else (currentCertificationPrice * 2) | |
224 | - | if (if (if ((assetId == toBase58String( | |
251 | + | if (if (if ((assetId == toBase58String(USDNAssetId))) | |
225 | 252 | then (minSellSconex > price) | |
226 | 253 | else false) | |
227 | 254 | then (price != 0) | |
232 | 259 | ||
233 | 260 | ||
234 | 261 | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
235 | - | then throw("Only | |
262 | + | then throw("Only USDN is accepted!") | |
236 | 263 | else fromBase58String(assetId) | |
237 | 264 | ||
238 | 265 | ||
256 | 283 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
257 | 284 | ||
258 | 285 | ||
286 | + | func isBidCheck (i,issuer,bidOwner,bidId) = if (if (if ((toBase58String(i.caller.bytes) == issuer)) | |
287 | + | then (bidOwner != "") | |
288 | + | else false) | |
289 | + | then (bidId != "") | |
290 | + | else false) | |
291 | + | then true | |
292 | + | else false | |
293 | + | ||
294 | + | ||
259 | 295 | func getArtData (i,issuer,artId,isBid) = { | |
260 | 296 | let callerIsIssuer = (toBase58String(i.caller.bytes) == issuer) | |
261 | 297 | let totalNFT = getIntegerByKey("total_nft_issued") | |
267 | 303 | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
268 | 304 | let artworkPrice = valueOrElse(getIntegerByKey(keyPrice(issuer, artId)), (currentCertificationPrice * 2)) | |
269 | 305 | let priceAssetId = if (callerIsIssuer) | |
270 | - | then toBase58String( | |
306 | + | then toBase58String(USDNAssetId) | |
271 | 307 | else getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
272 | 308 | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
273 | 309 | if (if (if (!(isBid)) | |
313 | 349 | let isWhitelisted = checkWhitelist(issuer) | |
314 | 350 | let cut = if ((isWhitelisted > height)) | |
315 | 351 | then 0 | |
316 | - | else if ((assetId == | |
317 | - | then | |
318 | - | else throw("Only | |
352 | + | else if ((assetId == USDNAssetId)) | |
353 | + | then USDNFirstSellCut | |
354 | + | else throw("Only USDN is accepted!") | |
319 | 355 | let amountForSconex = fraction(amount, cut, 1000) | |
320 | 356 | let amountForCreator = (amount - amountForSconex) | |
321 | 357 | if ((amountSold == maxCanSell)) | |
329 | 365 | ||
330 | 366 | func getIssueData (issuer,artId,artworkName,newAmountSold,maxCanSell,totalNFT,caller,bidOwner,bidId,i,isOnSale) = { | |
331 | 367 | let issueMeta = ((((((((("Creator: " + issuer) + ",ArtID: ") + artId) + ",Artwork name: ") + artworkName) + ",Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
332 | - | let issueNFT = Issue(("SCONEX_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
333 | - | let idNFT = calculateAssetId(issueNFT) | |
334 | 368 | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
335 | 369 | then true | |
336 | 370 | else !(isOnSale)) | |
339 | 373 | let receiveNFT = if ((bidOwner != "")) | |
340 | 374 | then addressFromStringValue(bidOwner) | |
341 | 375 | else i.caller | |
342 | - | $ | |
376 | + | $Tuple3(sellStatus, receiveNFT, issueMeta) | |
343 | 377 | } | |
378 | + | ||
379 | + | ||
380 | + | func calculateRarity (mintIndex) = if ((4 > mintIndex)) | |
381 | + | then "SSR" | |
382 | + | else if ((11 > mintIndex)) | |
383 | + | then "SR" | |
384 | + | else if ((101 > mintIndex)) | |
385 | + | then "R" | |
386 | + | else "N" | |
344 | 387 | ||
345 | 388 | ||
346 | 389 | func getBidKeyVal (assetId,bidDataKey,date) = { | |
347 | 390 | let assetIdBid = if (!(isDefined(assetId))) | |
348 | - | then throw("Only | |
391 | + | then throw("Only USDN is accepted") | |
349 | 392 | else toBase58String(value(assetId)) | |
350 | 393 | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
351 | 394 | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
376 | 419 | let amountForCreator = commisionData._2 | |
377 | 420 | let newAmountSold = commisionData._3 | |
378 | 421 | let issuerData = getIssueData(issuer, artId, artworkName, newAmountSold, maxCanSell, totalNFT, caller, bidOwner, bidId, i, isOnSale) | |
379 | - | let issueNFT = issuerData._1 | |
380 | - | let idNFT = issuerData._2 | |
381 | - | let sellStatus = issuerData._3 | |
382 | - | let receiveNFT = issuerData._4 | |
383 | - | let bidKeyValue = getBidKeyVal(assetId, bidDataKey, date) | |
384 | - | let assetIdBid = bidKeyValue._1 | |
385 | - | let bidDelOld = bidKeyValue._2 | |
386 | - | let bidUpdate = bidKeyValue._3 | |
387 | - | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
388 | - | let soldValue = if (!(isBid)) | |
389 | - | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
390 | - | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
391 | - | let soldData = StringEntry(soldKey, soldValue) | |
392 | - | let buyRes = [IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSconex, assetId), ScriptTransfer(receiveNFT, 1, idNFT), StringEntry(KeyNftIssuer(toBase58String(idNFT)), issuer)] | |
393 | - | if (isBid) | |
394 | - | then (((buyRes :+ soldData) :+ bidUpdate) :+ bidDelOld) | |
395 | - | else soldData :: buyRes | |
422 | + | let sellStatus = issuerData._1 | |
423 | + | let receiveNFT = issuerData._2 | |
424 | + | let issueMeta = issuerData._3 | |
425 | + | let idNFTInvoke = invoke(this, "mintNft", [totalNFT, issueMeta, toString(receiveNFT)], nil) | |
426 | + | if ((idNFTInvoke == idNFTInvoke)) | |
427 | + | then { | |
428 | + | let idNFT = match idNFTInvoke { | |
429 | + | case r: String => | |
430 | + | r | |
431 | + | case _ => | |
432 | + | throw("Incorrect invoke result") | |
433 | + | } | |
434 | + | let bidKeyValue = getBidKeyVal(assetId, bidDataKey, date) | |
435 | + | let assetIdBid = bidKeyValue._1 | |
436 | + | let bidDelOld = bidKeyValue._2 | |
437 | + | let bidUpdate = bidKeyValue._3 | |
438 | + | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
439 | + | let rarity = calculateRarity(newAmountSold) | |
440 | + | let soldValue = if (!(isBid)) | |
441 | + | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + idNFT) | |
442 | + | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + idNFT) | |
443 | + | let soldData = StringEntry(soldKey, soldValue) | |
444 | + | let buyRes = [IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + idNFT), soldKey), StringEntry(("nft_rarity_" + idNFT), rarity), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyOnSale(issuer, artId), sellStatus), ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSconex, assetId), StringEntry(KeyNftIssuer(idNFT), issuer)] | |
445 | + | let res = invoke(addressFromStringValue(certDapp), "createCert", [toString(receiveNFT), idNFT, issuer], nil) | |
446 | + | if ((res == res)) | |
447 | + | then if (isBid) | |
448 | + | then (((buyRes :+ soldData) :+ bidUpdate) :+ bidDelOld) | |
449 | + | else soldData :: buyRes | |
450 | + | else throw("Strict value is not equal to itself.") | |
451 | + | } | |
452 | + | else throw("Strict value is not equal to itself.") | |
396 | 453 | } | |
397 | 454 | ||
398 | 455 | ||
405 | 462 | let payment = t02775227788._1 | |
406 | 463 | let amount = t02775227788._2 | |
407 | 464 | let assetId = if (!(isDefined(payment.assetId))) | |
408 | - | then throw("Only | |
465 | + | then throw("Only USDN is accepted!") | |
409 | 466 | else toBase58String(value(payment.assetId)) | |
410 | 467 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
411 | 468 | if (!(acceptedAssetIds(assetId))) | |
438 | 495 | let payment = isPaymentVar._1 | |
439 | 496 | let amount = isPaymentVar._2 | |
440 | 497 | if ((highestBid >= amount)) | |
441 | - | then throw(("Please place a bid higher | |
498 | + | then throw(("Please place a bid higher than: " + toString(highestBid))) | |
442 | 499 | else { | |
443 | 500 | let assetId = if (!(isDefined(payment.assetId))) | |
444 | - | then throw("Only | |
501 | + | then throw("Only USDN is accepted!") | |
445 | 502 | else toBase58String(value(payment.assetId)) | |
446 | 503 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
447 | 504 | if (!(acceptedAssetIds(assetId))) | |
506 | 563 | let date = t02894229094._3 | |
507 | 564 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
508 | 565 | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + bidId) | |
509 | - | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
510 | - | if ((bidData == "")) | |
511 | - | then throw("Bid not found") | |
512 | - | else { | |
513 | - | let bidDataArr = split(bidData, "_") | |
514 | - | let assetId = getBidAssetId(bidDataArr[0]) | |
515 | - | let bidStatus = "CANCELED" | |
566 | + | let bidData = getStringByKeyOrError((bidDataKey + "_OPEN"), "Bid not found") | |
567 | + | let bidDataArr = split(bidData, "_") | |
568 | + | let assetId = getBidAssetId(bidDataArr[0]) | |
569 | + | let bidStatus = "CANCELED" | |
516 | 570 | [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
517 | - | } | |
518 | 571 | } | |
519 | 572 | ||
520 | 573 | ||
525 | 578 | let date = t02894229094._3 | |
526 | 579 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
527 | 580 | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + bidId) | |
528 | - | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
529 | - | if ((bidData == "")) | |
530 | - | then throw("Bid not found") | |
531 | - | else { | |
532 | - | let bidDataArr = split(bidData, "_") | |
533 | - | let assetId = getBidAssetId(bidDataArr[0]) | |
534 | - | let bidStatus = "CANCELED" | |
535 | - | let bidAmount = parseIntValue(bidDataArr[1]) | |
536 | - | let highestBidId = getStringByKey(keyHighestBidBidId(artId)) | |
537 | - | if ((bidId == highestBidId)) | |
538 | - | then throw("You can't cancel the highest bid!") | |
539 | - | else [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(caller)), bidAmount, assetId)] | |
540 | - | } | |
581 | + | let bidData = getStringByKeyOrError((bidDataKey + "_OPEN"), "Bid not found") | |
582 | + | let bidDataArr = split(bidData, "_") | |
583 | + | let assetId = getBidAssetId(bidDataArr[0]) | |
584 | + | let bidStatus = "CANCELED" | |
585 | + | let bidAmount = parseIntValue(bidDataArr[1]) | |
586 | + | let highestBidId = getStringByKey(keyHighestBidBidId(artId)) | |
587 | + | if ((bidId == highestBidId)) | |
588 | + | then throw("You can't cancel the highest bid!") | |
589 | + | else [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(caller)), bidAmount, assetId)] | |
541 | 590 | } | |
591 | + | ||
592 | + | ||
593 | + | @Callable(i) | |
594 | + | func mintNft (totalNFT,issueMeta,receiveNFT) = if ((i.caller == this)) | |
595 | + | then { | |
596 | + | let receiveNFTAddy = Address(fromBase58String(receiveNFT)) | |
597 | + | let issueNFT = Issue(("SCONEX_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
598 | + | let idNFT = calculateAssetId(issueNFT) | |
599 | + | $Tuple2([issueNFT, ScriptTransfer(receiveNFTAddy, 1, idNFT)], toBase58String(idNFT)) | |
600 | + | } | |
601 | + | else throw("Only the dApp can mint NFT's") | |
602 | + | ||
542 | 603 | ||
543 | 604 | ||
544 | 605 | @Callable(i) | |
563 | 624 | else { | |
564 | 625 | let hashExist = getStringByKey(keyOwnerByHash(sha256Hash)) | |
565 | 626 | if ((hashExist != "")) | |
566 | - | then throw(" | |
627 | + | then throw("This hash is already registered") | |
567 | 628 | else [StringEntry(keyOwnerByHash(sha256Hash), caller), StringEntry(keyTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyDate(caller, artId), date), StringEntry(keyName(caller, artId), name), StringEntry(keyDesc(caller, artId), description), StringEntry(keyDisplayCid(caller, artId), cidDisplay), StringEntry(keyType(caller, artId), type), StringEntry(keyTags(caller, artId), tags), IntegerEntry(keyMaxMint(caller, artId), 0), IntegerEntry(keyIssued(caller, artId), 0), BooleanEntry(keyOnSale(caller, artId), false), StringEntry(keyHashByTxidAddr(caller, artId), sha256Hash), StringEntry(keyEntitlement(caller, artId), entitlement), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
568 | 629 | } | |
569 | 630 | } | |
579 | 640 | let caller = t02571425747._2 | |
580 | 641 | let artworkName = getStringByKey(keyName(caller, artId)) | |
581 | 642 | if (!(containsElement([auctionType1, auctionType2], auctionType))) | |
582 | - | then throw("We | |
643 | + | then throw("We don't know this auction type") | |
583 | 644 | else if ((artworkName == "")) | |
584 | 645 | then throw("This art doesn't match your account") | |
585 | 646 | else { | |
595 | 656 | else { | |
596 | 657 | let amountSold = getIntegerByKey(keyIssued(caller, artId)) | |
597 | 658 | let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId)) | |
598 | - | if ((maxMint > | |
599 | - | then throw(" | |
659 | + | if ((maxMint > 101)) | |
660 | + | then throw("101 editions max per artwork") | |
600 | 661 | else if (if ((amountSold != 0)) | |
601 | 662 | then (amountSold == maxCanSell) | |
602 | 663 | else false) | |
633 | 694 | @Callable(i) | |
634 | 695 | func deleteEntry (entry) = { | |
635 | 696 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
636 | - | if ((caller | |
697 | + | if (containsElement(owners, caller)) | |
637 | 698 | then [DeleteEntry(entry)] | |
638 | 699 | else throw("no") | |
639 | 700 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let unitTest = false | |
5 | 5 | ||
6 | 6 | let oracleFee = value(addressFromString("3MpZQjzGogmifcEKe8mDd6ribL7nxT9ACye")) | |
7 | 7 | ||
8 | 8 | let feeReceiver = "3N65xLq8JcCeaEiR1TJQ7dBqXBvEy6E48Wz" | |
9 | 9 | ||
10 | + | let certDapp = "3MxcXrNbMZKYaSrhcfeMm2hZnBeCu3yRWsw" | |
11 | + | ||
10 | 12 | let userDapp = value(addressFromString("3N9cQgZFPHHVu8wqsn2DkQFehg3h8CNiooA")) | |
11 | 13 | ||
12 | 14 | let whitelistDapp = value(addressFromString("3N9xZYGpzMFDXvXuctmU6zV8qSzm2ZfF31f")) | |
13 | 15 | ||
14 | - | let | |
16 | + | let USDNAssetId = base58'132maRL3uF35tc2bpRih9D6MYq5DR6H28zkop786dKyu' | |
15 | 17 | ||
16 | - | let | |
18 | + | let owners = [getString(oracleFee, "owner1"), getString(oracleFee, "owner2")] | |
17 | 19 | ||
18 | - | let sconexFirstSellCut = 150 | |
20 | + | let USDNFirstSellCut = 150 | |
21 | + | ||
22 | + | let USDNSecondSellCut = 30 | |
23 | + | ||
24 | + | let originalCreatorCut = 70 | |
19 | 25 | ||
20 | 26 | let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true) | |
21 | 27 | ||
22 | 28 | let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "") | |
23 | 29 | ||
24 | 30 | let userSuspended = "SUSPENDED" | |
25 | 31 | ||
26 | 32 | let userRemoved = "REMOVED" | |
27 | 33 | ||
28 | 34 | let userUnregistered = "UNREGISTERED" | |
29 | 35 | ||
30 | 36 | let userAllowed = "ALLOWED" | |
31 | 37 | ||
32 | 38 | let auctionType1 = "BIDTYPE" | |
33 | 39 | ||
34 | 40 | let auctionType2 = "TRADITIONAL" | |
35 | 41 | ||
42 | + | func getStringByKeyFromUsers (key) = valueOrElse(getString(userDapp, key), "") | |
43 | + | ||
44 | + | ||
36 | 45 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
46 | + | ||
47 | + | ||
48 | + | func getStringByKeyOrError (key,error) = valueOrErrorMessage(getString(this, key), error) | |
37 | 49 | ||
38 | 50 | ||
39 | 51 | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
40 | 52 | ||
41 | 53 | ||
42 | 54 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
43 | 55 | ||
44 | 56 | ||
45 | 57 | func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0) | |
46 | 58 | ||
47 | 59 | ||
48 | 60 | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
61 | + | ||
62 | + | ||
63 | + | func validateHash (hash) = (size(hash) == 64) | |
49 | 64 | ||
50 | 65 | ||
51 | 66 | func keyUserStatus (caller) = ("user_status_" + caller) | |
52 | 67 | ||
53 | 68 | ||
54 | 69 | func keyDate (caller,artId) = ((("art_date_" + artId) + "_") + caller) | |
55 | 70 | ||
56 | 71 | ||
57 | 72 | func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller) | |
58 | 73 | ||
59 | 74 | ||
60 | 75 | func keyDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller) | |
61 | 76 | ||
62 | 77 | ||
63 | 78 | func keyDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller) | |
64 | 79 | ||
65 | 80 | ||
66 | 81 | func keyMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller) | |
67 | 82 | ||
68 | 83 | ||
69 | 84 | func keyMinPrice (caller,artId) = ((("art_minprice_" + artId) + "_") + caller) | |
70 | 85 | ||
71 | 86 | ||
72 | 87 | func keyHighestBidBidId (artId) = ("art_highestBidBidId_" + artId) | |
73 | 88 | ||
74 | 89 | ||
75 | 90 | func keyBidId (bidId) = ("bid_" + bidId) | |
76 | 91 | ||
77 | 92 | ||
78 | 93 | func keyDuration (caller,artId) = ((("art_duration_" + artId) + "_") + caller) | |
79 | 94 | ||
80 | 95 | ||
81 | 96 | func keyEndHeight (caller,artId) = ((("art_endheight_" + artId) + "_") + caller) | |
82 | 97 | ||
83 | 98 | ||
84 | 99 | func keyAuctionType (caller,artId) = ((("art_auctiontype_" + artId) + "_") + caller) | |
85 | 100 | ||
86 | 101 | ||
87 | 102 | func keyIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller) | |
88 | 103 | ||
89 | 104 | ||
90 | 105 | func KeyNftIssuer (nftId) = ("nft_issued_" + nftId) | |
91 | 106 | ||
92 | 107 | ||
93 | 108 | func keyOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller) | |
94 | 109 | ||
95 | 110 | ||
96 | 111 | func keyEntitlement (caller,artId) = ((("art_entitlement_" + artId) + "_") + caller) | |
97 | 112 | ||
98 | 113 | ||
99 | 114 | func keyTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller) | |
100 | 115 | ||
101 | 116 | ||
102 | 117 | func keyType (caller,artId) = ((("art_type_" + artId) + "_") + caller) | |
103 | 118 | ||
104 | 119 | ||
105 | 120 | func keyPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller) | |
106 | 121 | ||
107 | 122 | ||
108 | 123 | func keyAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller) | |
109 | 124 | ||
110 | 125 | ||
111 | 126 | func keyHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller) | |
112 | 127 | ||
113 | 128 | ||
114 | 129 | func keyOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash) | |
115 | 130 | ||
116 | 131 | ||
117 | 132 | func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller))))) | |
118 | 133 | ||
119 | 134 | ||
120 | - | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String( | |
135 | + | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(USDNAssetId))) | |
121 | 136 | ||
122 | 137 | func getAmountByBidId (bidId) = valueOrElse(getIntegerByKey(keyBidId(bidId)), 0) | |
123 | 138 | ||
124 | 139 | ||
125 | 140 | func getAmountHighestBidByArtId (artId) = { | |
126 | - | let bidId = | |
141 | + | let bidId = getStringByKey(keyHighestBidBidId(artId)) | |
127 | 142 | if ((bidId == "")) | |
128 | 143 | then 0 | |
129 | 144 | else getAmountByBidId(bidId) | |
130 | 145 | } | |
131 | 146 | ||
132 | 147 | ||
133 | 148 | func validateString (str,max) = if ((size(str) == 0)) | |
134 | 149 | then throw("Field cannot be is empty") | |
135 | 150 | else if ((size(str) > max)) | |
136 | 151 | then throw((str + " is too long")) | |
137 | 152 | else true | |
138 | 153 | ||
139 | 154 | ||
140 | 155 | func validateUser (caller) = { | |
141 | 156 | let userStatus = valueOrElse(getString(userDapp, keyUserStatus(caller)), userUnregistered) | |
142 | 157 | if (if ((userStatus == userUnregistered)) | |
143 | 158 | then true | |
144 | 159 | else (userStatus == userAllowed)) | |
145 | 160 | then "Register this account first with 'Account' tab" | |
146 | 161 | else if ((userStatus == userSuspended)) | |
147 | 162 | then "Account suspended" | |
148 | 163 | else if ((userStatus == userRemoved)) | |
149 | 164 | then "Account removed" | |
150 | 165 | else "" | |
151 | 166 | } | |
152 | 167 | ||
153 | 168 | ||
154 | 169 | func validateArtworkData (caller,cidDisplay,name,description,tags) = { | |
155 | 170 | let checkUser = validateUser(caller) | |
156 | 171 | if ((checkUser != "")) | |
157 | 172 | then throw(checkUser) | |
158 | 173 | else if ((size(cidDisplay) == 0)) | |
159 | 174 | then throw("Display CID cannot be empty") | |
160 | - | else if (!(validateString(name, 100))) | |
161 | - | then throw("100 Char. max name") | |
162 | - | else if (!(validateString(description, 1000))) | |
163 | - | then throw("1000 Char. max description") | |
164 | - | else if ((size(split(tags, ",")) > 5)) | |
165 | - | then throw("5 tags max.") | |
166 | - | else "" | |
175 | + | else if ((size(cidDisplay) != 46)) | |
176 | + | then throw("This doesn't seem a valid CID!") | |
177 | + | else if (!(validateString(name, 100))) | |
178 | + | then throw("100 Char. max name") | |
179 | + | else if (!(validateString(description, 1000))) | |
180 | + | then throw("1000 Char. max description") | |
181 | + | else if ((size(split(tags, ",")) > 5)) | |
182 | + | then throw("5 tags max.") | |
183 | + | else "" | |
167 | 184 | } | |
168 | 185 | ||
169 | 186 | ||
170 | 187 | func isPayment (i) = if ((size(i.payments) == 0)) | |
171 | 188 | then throw("No payment attached") | |
172 | 189 | else { | |
173 | 190 | let payment = value(i.payments[0]) | |
174 | 191 | let amount = value(payment.amount) | |
175 | 192 | $Tuple2(payment, amount) | |
176 | 193 | } | |
177 | 194 | ||
178 | 195 | ||
179 | 196 | func validatePayment (i) = { | |
180 | 197 | let t089829018 = isPayment(i) | |
181 | 198 | let payment = t089829018._1 | |
182 | 199 | let amount = t089829018._2 | |
183 | 200 | let assetId = if (if (isDefined(payment.assetId)) | |
184 | - | then (payment.assetId == | |
201 | + | then (payment.assetId == USDNAssetId) | |
185 | 202 | else false) | |
186 | 203 | then payment.assetId | |
187 | - | else throw("Only | |
204 | + | else throw("Only USDN token accepted as transaction fee") | |
188 | 205 | if ((amount != currentCertificationPrice)) | |
189 | - | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
206 | + | then throw(((("Payment amount should be " + toString(currentCertificationPrice)) + " but is: ") + toString(amount))) | |
190 | 207 | else $Tuple2(amount, assetId) | |
191 | 208 | } | |
209 | + | ||
210 | + | ||
211 | + | func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) { | |
212 | + | case b: Int => | |
213 | + | if ((b != 0)) | |
214 | + | then true | |
215 | + | else false | |
216 | + | case _ => | |
217 | + | false | |
218 | + | } | |
192 | 219 | ||
193 | 220 | ||
194 | 221 | func validatePriceAssetId (i,priceAssetId,artworkPrice) = { | |
195 | 222 | let t096119647 = isPayment(i) | |
196 | 223 | let payment = t096119647._1 | |
197 | 224 | let amount = t096119647._2 | |
198 | 225 | let assetId = if (!(isDefined(payment.assetId))) | |
199 | 226 | then throw("Wrong asset id") | |
200 | 227 | else if (if ((size(priceAssetId) > 0)) | |
201 | 228 | then (toBase58String(value(payment.assetId)) == priceAssetId) | |
202 | 229 | else false) | |
203 | 230 | then payment.assetId | |
204 | 231 | else throw("Wrong asset id") | |
205 | 232 | if (if ((assetId == unit)) | |
206 | 233 | then (priceAssetId != "") | |
207 | 234 | else false) | |
208 | 235 | then throw("Wrong asset id") | |
209 | 236 | else if ((artworkPrice != amount)) | |
210 | 237 | then throw(((("Payment don't match " + toString(artworkPrice)) + " ") + toString(amount))) | |
211 | 238 | else $Tuple2(amount, assetId) | |
212 | 239 | } | |
213 | 240 | ||
214 | 241 | ||
215 | - | func acceptedAssetIds (assetId) = if ((assetId != toBase58String( | |
216 | - | then throw("Only | |
242 | + | func acceptedAssetIds (assetId) = if ((assetId != toBase58String(USDNAssetId))) | |
243 | + | then throw("Only USDN accepted") | |
217 | 244 | else true | |
218 | 245 | ||
219 | 246 | ||
220 | 247 | func validateMinSell (assetId,price) = { | |
221 | 248 | let minSellSconex = if (unitTest) | |
222 | 249 | then 1 | |
223 | 250 | else (currentCertificationPrice * 2) | |
224 | - | if (if (if ((assetId == toBase58String( | |
251 | + | if (if (if ((assetId == toBase58String(USDNAssetId))) | |
225 | 252 | then (minSellSconex > price) | |
226 | 253 | else false) | |
227 | 254 | then (price != 0) | |
228 | 255 | else false) | |
229 | 256 | then throw(("Wrong minimum sell price " + toString(minSellSconex))) | |
230 | 257 | else true | |
231 | 258 | } | |
232 | 259 | ||
233 | 260 | ||
234 | 261 | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
235 | - | then throw("Only | |
262 | + | then throw("Only USDN is accepted!") | |
236 | 263 | else fromBase58String(assetId) | |
237 | 264 | ||
238 | 265 | ||
239 | 266 | func getPriceAssetIdFromBid (bidDataKey) = { | |
240 | 267 | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
241 | 268 | if ((bidData == "")) | |
242 | 269 | then throw("Bid not found") | |
243 | 270 | else { | |
244 | 271 | let bidDataArr = split(bidData, "_") | |
245 | 272 | let bidAmount = parseIntValue(bidDataArr[1]) | |
246 | 273 | let bidAssetId = getBidAssetId(bidDataArr[0]) | |
247 | 274 | if ((0 >= bidAmount)) | |
248 | 275 | then throw("Wrong amount") | |
249 | 276 | else $Tuple2(bidAmount, bidAssetId) | |
250 | 277 | } | |
251 | 278 | } | |
252 | 279 | ||
253 | 280 | ||
254 | 281 | func idCallerDate (i) = if (!(dappRunning)) | |
255 | 282 | then throw(maintenanceMSG) | |
256 | 283 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
257 | 284 | ||
258 | 285 | ||
286 | + | func isBidCheck (i,issuer,bidOwner,bidId) = if (if (if ((toBase58String(i.caller.bytes) == issuer)) | |
287 | + | then (bidOwner != "") | |
288 | + | else false) | |
289 | + | then (bidId != "") | |
290 | + | else false) | |
291 | + | then true | |
292 | + | else false | |
293 | + | ||
294 | + | ||
259 | 295 | func getArtData (i,issuer,artId,isBid) = { | |
260 | 296 | let callerIsIssuer = (toBase58String(i.caller.bytes) == issuer) | |
261 | 297 | let totalNFT = getIntegerByKey("total_nft_issued") | |
262 | 298 | let artworkName = getStringByKey(keyName(issuer, artId)) | |
263 | 299 | if ((artworkName == "")) | |
264 | 300 | then throw("Art doesn't exist") | |
265 | 301 | else { | |
266 | 302 | let isOnSale = getBooleanByKey(keyOnSale(issuer, artId)) | |
267 | 303 | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
268 | 304 | let artworkPrice = valueOrElse(getIntegerByKey(keyPrice(issuer, artId)), (currentCertificationPrice * 2)) | |
269 | 305 | let priceAssetId = if (callerIsIssuer) | |
270 | - | then toBase58String( | |
306 | + | then toBase58String(USDNAssetId) | |
271 | 307 | else getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
272 | 308 | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
273 | 309 | if (if (if (!(isBid)) | |
274 | 310 | then !(callerIsIssuer) | |
275 | 311 | else false) | |
276 | 312 | then if (if ((0 >= artworkPrice)) | |
277 | 313 | then true | |
278 | 314 | else !(isOnSale)) | |
279 | 315 | then true | |
280 | 316 | else (0 >= maxCanSell) | |
281 | 317 | else false) | |
282 | 318 | then throw("Art not for sale") | |
283 | 319 | else if (if (if (!(isBid)) | |
284 | 320 | then callerIsIssuer | |
285 | 321 | else false) | |
286 | 322 | then (0 >= maxCanSell) | |
287 | 323 | else false) | |
288 | 324 | then throw("Max issuable not set") | |
289 | 325 | else $Tuple7(totalNFT, artworkName, amountSold, artworkPrice, priceAssetId, maxCanSell, isOnSale) | |
290 | 326 | } | |
291 | 327 | } | |
292 | 328 | ||
293 | 329 | ||
294 | 330 | func getBidData (i,caller,issuer,artId,bidOwner,bidId,priceAssetId,artworkPrice,isBid) = { | |
295 | 331 | let checkUser = validateUser(issuer) | |
296 | 332 | if (if (isBid) | |
297 | 333 | then (checkUser != "") | |
298 | 334 | else false) | |
299 | 335 | then throw(checkUser) | |
300 | 336 | else { | |
301 | 337 | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
302 | 338 | let t01351913648 = if (isBid) | |
303 | 339 | then getPriceAssetIdFromBid(bidDataKey) | |
304 | 340 | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
305 | 341 | let amount = t01351913648._1 | |
306 | 342 | let assetId = t01351913648._2 | |
307 | 343 | $Tuple3(bidDataKey, amount, assetId) | |
308 | 344 | } | |
309 | 345 | } | |
310 | 346 | ||
311 | 347 | ||
312 | 348 | func getCommissionData (issuer,assetId,amount,amountSold,maxCanSell) = { | |
313 | 349 | let isWhitelisted = checkWhitelist(issuer) | |
314 | 350 | let cut = if ((isWhitelisted > height)) | |
315 | 351 | then 0 | |
316 | - | else if ((assetId == | |
317 | - | then | |
318 | - | else throw("Only | |
352 | + | else if ((assetId == USDNAssetId)) | |
353 | + | then USDNFirstSellCut | |
354 | + | else throw("Only USDN is accepted!") | |
319 | 355 | let amountForSconex = fraction(amount, cut, 1000) | |
320 | 356 | let amountForCreator = (amount - amountForSconex) | |
321 | 357 | if ((amountSold == maxCanSell)) | |
322 | 358 | then throw("Art sold out") | |
323 | 359 | else { | |
324 | 360 | let newAmountSold = (amountSold + 1) | |
325 | 361 | $Tuple3(amountForSconex, amountForCreator, newAmountSold) | |
326 | 362 | } | |
327 | 363 | } | |
328 | 364 | ||
329 | 365 | ||
330 | 366 | func getIssueData (issuer,artId,artworkName,newAmountSold,maxCanSell,totalNFT,caller,bidOwner,bidId,i,isOnSale) = { | |
331 | 367 | let issueMeta = ((((((((("Creator: " + issuer) + ",ArtID: ") + artId) + ",Artwork name: ") + artworkName) + ",Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
332 | - | let issueNFT = Issue(("SCONEX_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
333 | - | let idNFT = calculateAssetId(issueNFT) | |
334 | 368 | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
335 | 369 | then true | |
336 | 370 | else !(isOnSale)) | |
337 | 371 | then false | |
338 | 372 | else true | |
339 | 373 | let receiveNFT = if ((bidOwner != "")) | |
340 | 374 | then addressFromStringValue(bidOwner) | |
341 | 375 | else i.caller | |
342 | - | $ | |
376 | + | $Tuple3(sellStatus, receiveNFT, issueMeta) | |
343 | 377 | } | |
378 | + | ||
379 | + | ||
380 | + | func calculateRarity (mintIndex) = if ((4 > mintIndex)) | |
381 | + | then "SSR" | |
382 | + | else if ((11 > mintIndex)) | |
383 | + | then "SR" | |
384 | + | else if ((101 > mintIndex)) | |
385 | + | then "R" | |
386 | + | else "N" | |
344 | 387 | ||
345 | 388 | ||
346 | 389 | func getBidKeyVal (assetId,bidDataKey,date) = { | |
347 | 390 | let assetIdBid = if (!(isDefined(assetId))) | |
348 | - | then throw("Only | |
391 | + | then throw("Only USDN is accepted") | |
349 | 392 | else toBase58String(value(assetId)) | |
350 | 393 | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
351 | 394 | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
352 | 395 | let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date))) | |
353 | 396 | $Tuple3(assetIdBid, bidDelOld, bidUpdate) | |
354 | 397 | } | |
355 | 398 | ||
356 | 399 | ||
357 | 400 | func buyMint (i,artId,issuer,bidId,bidOwner,isBid) = { | |
358 | 401 | let callerData = idCallerDate(i) | |
359 | 402 | let id = callerData._1 | |
360 | 403 | let caller = callerData._2 | |
361 | 404 | let date = callerData._3 | |
362 | 405 | let artData = getArtData(i, issuer, artId, isBid) | |
363 | 406 | let totalNFT = artData._1 | |
364 | 407 | let artworkName = artData._2 | |
365 | 408 | let amountSold = artData._3 | |
366 | 409 | let artworkPrice = artData._4 | |
367 | 410 | let priceAssetId = artData._5 | |
368 | 411 | let maxCanSell = artData._6 | |
369 | 412 | let isOnSale = artData._7 | |
370 | 413 | let bidData = getBidData(i, caller, issuer, artId, bidOwner, bidId, priceAssetId, artworkPrice, isBid) | |
371 | 414 | let bidDataKey = bidData._1 | |
372 | 415 | let amount = bidData._2 | |
373 | 416 | let assetId = bidData._3 | |
374 | 417 | let commisionData = getCommissionData(issuer, value(assetId), amount, amountSold, maxCanSell) | |
375 | 418 | let amountForSconex = commisionData._1 | |
376 | 419 | let amountForCreator = commisionData._2 | |
377 | 420 | let newAmountSold = commisionData._3 | |
378 | 421 | let issuerData = getIssueData(issuer, artId, artworkName, newAmountSold, maxCanSell, totalNFT, caller, bidOwner, bidId, i, isOnSale) | |
379 | - | let issueNFT = issuerData._1 | |
380 | - | let idNFT = issuerData._2 | |
381 | - | let sellStatus = issuerData._3 | |
382 | - | let receiveNFT = issuerData._4 | |
383 | - | let bidKeyValue = getBidKeyVal(assetId, bidDataKey, date) | |
384 | - | let assetIdBid = bidKeyValue._1 | |
385 | - | let bidDelOld = bidKeyValue._2 | |
386 | - | let bidUpdate = bidKeyValue._3 | |
387 | - | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
388 | - | let soldValue = if (!(isBid)) | |
389 | - | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
390 | - | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
391 | - | let soldData = StringEntry(soldKey, soldValue) | |
392 | - | let buyRes = [IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSconex, assetId), ScriptTransfer(receiveNFT, 1, idNFT), StringEntry(KeyNftIssuer(toBase58String(idNFT)), issuer)] | |
393 | - | if (isBid) | |
394 | - | then (((buyRes :+ soldData) :+ bidUpdate) :+ bidDelOld) | |
395 | - | else soldData :: buyRes | |
422 | + | let sellStatus = issuerData._1 | |
423 | + | let receiveNFT = issuerData._2 | |
424 | + | let issueMeta = issuerData._3 | |
425 | + | let idNFTInvoke = invoke(this, "mintNft", [totalNFT, issueMeta, toString(receiveNFT)], nil) | |
426 | + | if ((idNFTInvoke == idNFTInvoke)) | |
427 | + | then { | |
428 | + | let idNFT = match idNFTInvoke { | |
429 | + | case r: String => | |
430 | + | r | |
431 | + | case _ => | |
432 | + | throw("Incorrect invoke result") | |
433 | + | } | |
434 | + | let bidKeyValue = getBidKeyVal(assetId, bidDataKey, date) | |
435 | + | let assetIdBid = bidKeyValue._1 | |
436 | + | let bidDelOld = bidKeyValue._2 | |
437 | + | let bidUpdate = bidKeyValue._3 | |
438 | + | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
439 | + | let rarity = calculateRarity(newAmountSold) | |
440 | + | let soldValue = if (!(isBid)) | |
441 | + | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + idNFT) | |
442 | + | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + idNFT) | |
443 | + | let soldData = StringEntry(soldKey, soldValue) | |
444 | + | let buyRes = [IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + idNFT), soldKey), StringEntry(("nft_rarity_" + idNFT), rarity), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyOnSale(issuer, artId), sellStatus), ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSconex, assetId), StringEntry(KeyNftIssuer(idNFT), issuer)] | |
445 | + | let res = invoke(addressFromStringValue(certDapp), "createCert", [toString(receiveNFT), idNFT, issuer], nil) | |
446 | + | if ((res == res)) | |
447 | + | then if (isBid) | |
448 | + | then (((buyRes :+ soldData) :+ bidUpdate) :+ bidDelOld) | |
449 | + | else soldData :: buyRes | |
450 | + | else throw("Strict value is not equal to itself.") | |
451 | + | } | |
452 | + | else throw("Strict value is not equal to itself.") | |
396 | 453 | } | |
397 | 454 | ||
398 | 455 | ||
399 | 456 | func setBidNonTraditional (i,artId,issuer) = { | |
400 | 457 | let t02770927747 = idCallerDate(i) | |
401 | 458 | let id = t02770927747._1 | |
402 | 459 | let caller = t02770927747._2 | |
403 | 460 | let date = t02770927747._3 | |
404 | 461 | let t02775227788 = isPayment(i) | |
405 | 462 | let payment = t02775227788._1 | |
406 | 463 | let amount = t02775227788._2 | |
407 | 464 | let assetId = if (!(isDefined(payment.assetId))) | |
408 | - | then throw("Only | |
465 | + | then throw("Only USDN is accepted!") | |
409 | 466 | else toBase58String(value(payment.assetId)) | |
410 | 467 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
411 | 468 | if (!(acceptedAssetIds(assetId))) | |
412 | 469 | then throw("asset not accepted") | |
413 | 470 | else if (!(validateMinSell(assetId, amount))) | |
414 | 471 | then throw("Wrong min sell") | |
415 | 472 | else { | |
416 | 473 | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
417 | 474 | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
418 | 475 | if ((0 >= maxCanSell)) | |
419 | 476 | then throw("No max edition set for this artwork") | |
420 | 477 | else if ((amountSold >= maxCanSell)) | |
421 | 478 | then throw("Sold out, you cannot bid") | |
422 | 479 | else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr + 1))] | |
423 | 480 | } | |
424 | 481 | } | |
425 | 482 | ||
426 | 483 | ||
427 | 484 | func setBidTraditional (i,artId,issuer) = { | |
428 | 485 | let endHeight = getIntegerByKey(keyEndHeight(issuer, artId)) | |
429 | 486 | let highestBid = getAmountHighestBidByArtId(artId) | |
430 | 487 | if ((height > endHeight)) | |
431 | 488 | then throw("This auction is finished already!") | |
432 | 489 | else { | |
433 | 490 | let callderData = idCallerDate(i) | |
434 | 491 | let id = callderData._1 | |
435 | 492 | let caller = callderData._2 | |
436 | 493 | let date = callderData._3 | |
437 | 494 | let isPaymentVar = isPayment(i) | |
438 | 495 | let payment = isPaymentVar._1 | |
439 | 496 | let amount = isPaymentVar._2 | |
440 | 497 | if ((highestBid >= amount)) | |
441 | - | then throw(("Please place a bid higher | |
498 | + | then throw(("Please place a bid higher than: " + toString(highestBid))) | |
442 | 499 | else { | |
443 | 500 | let assetId = if (!(isDefined(payment.assetId))) | |
444 | - | then throw("Only | |
501 | + | then throw("Only USDN is accepted!") | |
445 | 502 | else toBase58String(value(payment.assetId)) | |
446 | 503 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
447 | 504 | if (!(acceptedAssetIds(assetId))) | |
448 | 505 | then throw("asset not accepted") | |
449 | 506 | else if (!(validateMinSell(assetId, amount))) | |
450 | 507 | then throw("Wrong min sell") | |
451 | 508 | else { | |
452 | 509 | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
453 | 510 | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
454 | 511 | if ((0 >= maxCanSell)) | |
455 | 512 | then throw("No max edition set for this artwork") | |
456 | 513 | else if ((amountSold >= maxCanSell)) | |
457 | 514 | then throw("Sold out, you cannot bid") | |
458 | 515 | else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr + 1)), StringEntry(keyHighestBidBidId(artId), toBase58String(i.transactionId)), IntegerEntry(keyBidId(toBase58String(i.transactionId)), amount)] | |
459 | 516 | } | |
460 | 517 | } | |
461 | 518 | } | |
462 | 519 | } | |
463 | 520 | ||
464 | 521 | ||
465 | 522 | func acceptBidNonTraditional (i,artId,issuer,bidId,bidOwner) = { | |
466 | 523 | let caller = toBase58String(i.caller.bytes) | |
467 | 524 | if ((caller != issuer)) | |
468 | 525 | then throw("You cannot do this action") | |
469 | 526 | else buyMint(i, artId, issuer, bidId, bidOwner, true) | |
470 | 527 | } | |
471 | 528 | ||
472 | 529 | ||
473 | 530 | func restartAuction (artId,issuer) = { | |
474 | 531 | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
475 | 532 | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
476 | 533 | let oldEndHeight = getIntegerByKey(keyEndHeight(issuer, artId)) | |
477 | 534 | let duration = getIntegerByKey(keyDuration(issuer, artId)) | |
478 | 535 | let endHeight = (duration + height) | |
479 | 536 | if ((height > oldEndHeight)) | |
480 | 537 | then if ((amountSold == maxCanSell)) | |
481 | 538 | then throw("Can't restart auction, max amount sold") | |
482 | 539 | else [IntegerEntry(keyEndHeight(issuer, artId), endHeight), DeleteEntry(keyHighestBidBidId(artId))] | |
483 | 540 | else throw("Previous auction isn't completed yet") | |
484 | 541 | } | |
485 | 542 | ||
486 | 543 | ||
487 | 544 | func acceptBidTraditional (i,artId,issuer,bidId,bidOwner) = { | |
488 | 545 | let endHeight = getIntegerByKey(keyEndHeight(issuer, artId)) | |
489 | 546 | let highestBidId = getStringByKey(keyHighestBidBidId(artId)) | |
490 | 547 | if ((height > endHeight)) | |
491 | 548 | then if ((bidId == highestBidId)) | |
492 | 549 | then { | |
493 | 550 | let buyMintData = buyMint(i, artId, issuer, bidId, bidOwner, true) | |
494 | 551 | let restartAuctionData = restartAuction(artId, issuer) | |
495 | 552 | (restartAuctionData ++ buyMintData) | |
496 | 553 | } | |
497 | 554 | else throw("This is not the winning bid!") | |
498 | 555 | else throw("This auction is not yet finished!") | |
499 | 556 | } | |
500 | 557 | ||
501 | 558 | ||
502 | 559 | func cancelBidImpl (i,artId,issuer,bidId) = { | |
503 | 560 | let t02894229094 = idCallerDate(i) | |
504 | 561 | let id = t02894229094._1 | |
505 | 562 | let caller = t02894229094._2 | |
506 | 563 | let date = t02894229094._3 | |
507 | 564 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
508 | 565 | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + bidId) | |
509 | - | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
510 | - | if ((bidData == "")) | |
511 | - | then throw("Bid not found") | |
512 | - | else { | |
513 | - | let bidDataArr = split(bidData, "_") | |
514 | - | let assetId = getBidAssetId(bidDataArr[0]) | |
515 | - | let bidStatus = "CANCELED" | |
566 | + | let bidData = getStringByKeyOrError((bidDataKey + "_OPEN"), "Bid not found") | |
567 | + | let bidDataArr = split(bidData, "_") | |
568 | + | let assetId = getBidAssetId(bidDataArr[0]) | |
569 | + | let bidStatus = "CANCELED" | |
516 | 570 | [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
517 | - | } | |
518 | 571 | } | |
519 | 572 | ||
520 | 573 | ||
521 | 574 | func cancelBidImplTraditional (i,artId,issuer,bidId) = { | |
522 | 575 | let t02894229094 = idCallerDate(i) | |
523 | 576 | let id = t02894229094._1 | |
524 | 577 | let caller = t02894229094._2 | |
525 | 578 | let date = t02894229094._3 | |
526 | 579 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
527 | 580 | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + bidId) | |
528 | - | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
529 | - | if ((bidData == "")) | |
530 | - | then throw("Bid not found") | |
531 | - | else { | |
532 | - | let bidDataArr = split(bidData, "_") | |
533 | - | let assetId = getBidAssetId(bidDataArr[0]) | |
534 | - | let bidStatus = "CANCELED" | |
535 | - | let bidAmount = parseIntValue(bidDataArr[1]) | |
536 | - | let highestBidId = getStringByKey(keyHighestBidBidId(artId)) | |
537 | - | if ((bidId == highestBidId)) | |
538 | - | then throw("You can't cancel the highest bid!") | |
539 | - | else [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(caller)), bidAmount, assetId)] | |
540 | - | } | |
581 | + | let bidData = getStringByKeyOrError((bidDataKey + "_OPEN"), "Bid not found") | |
582 | + | let bidDataArr = split(bidData, "_") | |
583 | + | let assetId = getBidAssetId(bidDataArr[0]) | |
584 | + | let bidStatus = "CANCELED" | |
585 | + | let bidAmount = parseIntValue(bidDataArr[1]) | |
586 | + | let highestBidId = getStringByKey(keyHighestBidBidId(artId)) | |
587 | + | if ((bidId == highestBidId)) | |
588 | + | then throw("You can't cancel the highest bid!") | |
589 | + | else [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(caller)), bidAmount, assetId)] | |
541 | 590 | } | |
591 | + | ||
592 | + | ||
593 | + | @Callable(i) | |
594 | + | func mintNft (totalNFT,issueMeta,receiveNFT) = if ((i.caller == this)) | |
595 | + | then { | |
596 | + | let receiveNFTAddy = Address(fromBase58String(receiveNFT)) | |
597 | + | let issueNFT = Issue(("SCONEX_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
598 | + | let idNFT = calculateAssetId(issueNFT) | |
599 | + | $Tuple2([issueNFT, ScriptTransfer(receiveNFTAddy, 1, idNFT)], toBase58String(idNFT)) | |
600 | + | } | |
601 | + | else throw("Only the dApp can mint NFT's") | |
602 | + | ||
542 | 603 | ||
543 | 604 | ||
544 | 605 | @Callable(i) | |
545 | 606 | func addArtwork (sha256Hash,name,description,tags,type,cidDisplay,entitlement) = { | |
546 | 607 | let t01774017781 = idCallerDate(i) | |
547 | 608 | let artId = t01774017781._1 | |
548 | 609 | let caller = t01774017781._2 | |
549 | 610 | let date = t01774017781._3 | |
550 | 611 | let validateArtwork = validateArtworkData(caller, cidDisplay, name, description, tags) | |
551 | 612 | if ((validateArtwork != "")) | |
552 | 613 | then throw("Something went wrong!") | |
553 | 614 | else { | |
554 | 615 | let t01817018212 = validatePayment(i) | |
555 | 616 | let amount = t01817018212._1 | |
556 | 617 | let assetId = t01817018212._2 | |
557 | 618 | if (!(isDefined(amount))) | |
558 | 619 | then throw("Something went wrong") | |
559 | 620 | else { | |
560 | 621 | let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller)) | |
561 | 622 | if ((entryExist != "")) | |
562 | 623 | then throw("You already added it") | |
563 | 624 | else { | |
564 | 625 | let hashExist = getStringByKey(keyOwnerByHash(sha256Hash)) | |
565 | 626 | if ((hashExist != "")) | |
566 | - | then throw(" | |
627 | + | then throw("This hash is already registered") | |
567 | 628 | else [StringEntry(keyOwnerByHash(sha256Hash), caller), StringEntry(keyTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyDate(caller, artId), date), StringEntry(keyName(caller, artId), name), StringEntry(keyDesc(caller, artId), description), StringEntry(keyDisplayCid(caller, artId), cidDisplay), StringEntry(keyType(caller, artId), type), StringEntry(keyTags(caller, artId), tags), IntegerEntry(keyMaxMint(caller, artId), 0), IntegerEntry(keyIssued(caller, artId), 0), BooleanEntry(keyOnSale(caller, artId), false), StringEntry(keyHashByTxidAddr(caller, artId), sha256Hash), StringEntry(keyEntitlement(caller, artId), entitlement), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
568 | 629 | } | |
569 | 630 | } | |
570 | 631 | } | |
571 | 632 | } | |
572 | 633 | ||
573 | 634 | ||
574 | 635 | ||
575 | 636 | @Callable(i) | |
576 | 637 | func sellArtwork (artId,price,maxMint,assetId,auctionType,minBid,duration) = { | |
577 | 638 | let t02571425747 = idCallerDate(i) | |
578 | 639 | let id = t02571425747._1 | |
579 | 640 | let caller = t02571425747._2 | |
580 | 641 | let artworkName = getStringByKey(keyName(caller, artId)) | |
581 | 642 | if (!(containsElement([auctionType1, auctionType2], auctionType))) | |
582 | - | then throw("We | |
643 | + | then throw("We don't know this auction type") | |
583 | 644 | else if ((artworkName == "")) | |
584 | 645 | then throw("This art doesn't match your account") | |
585 | 646 | else { | |
586 | 647 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
587 | 648 | if (!(acceptedAssetIds(assetId))) | |
588 | 649 | then throw("Something went wrong!") | |
589 | 650 | else if (!(validateMinSell(assetId, price))) | |
590 | 651 | then throw("Something went wrong!") | |
591 | 652 | else { | |
592 | 653 | let checkUser = validateUser(caller) | |
593 | 654 | if ((checkUser != "")) | |
594 | 655 | then throw(checkUser) | |
595 | 656 | else { | |
596 | 657 | let amountSold = getIntegerByKey(keyIssued(caller, artId)) | |
597 | 658 | let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId)) | |
598 | - | if ((maxMint > | |
599 | - | then throw(" | |
659 | + | if ((maxMint > 101)) | |
660 | + | then throw("101 editions max per artwork") | |
600 | 661 | else if (if ((amountSold != 0)) | |
601 | 662 | then (amountSold == maxCanSell) | |
602 | 663 | else false) | |
603 | 664 | then throw("Max edition reached.") | |
604 | 665 | else if (if ((amountSold > 0)) | |
605 | 666 | then (maxCanSell != maxMint) | |
606 | 667 | else false) | |
607 | 668 | then throw("Cannot change maximum issuable anymore") | |
608 | 669 | else if (if ((bidNbr > 0)) | |
609 | 670 | then (maxCanSell != maxMint) | |
610 | 671 | else false) | |
611 | 672 | then throw("Cannot change maximum issuable with active orders") | |
612 | 673 | else { | |
613 | 674 | let sellStatus = if (if ((price > 0)) | |
614 | 675 | then (maxMint > 0) | |
615 | 676 | else false) | |
616 | 677 | then true | |
617 | 678 | else false | |
618 | 679 | let endHeight = (duration + height) | |
619 | 680 | [BooleanEntry(keyOnSale(caller, artId), sellStatus), IntegerEntry(keyPrice(caller, artId), price), IntegerEntry(keyMaxMint(caller, artId), maxMint), IntegerEntry(keyMinPrice(caller, artId), minBid), IntegerEntry(keyDuration(caller, artId), duration), IntegerEntry(keyEndHeight(caller, artId), endHeight), StringEntry(keyAssetIdAccepted(caller, artId), assetId), StringEntry(keyAuctionType(caller, artId), auctionType)] | |
620 | 681 | } | |
621 | 682 | } | |
622 | 683 | } | |
623 | 684 | } | |
624 | 685 | } | |
625 | 686 | ||
626 | 687 | ||
627 | 688 | ||
628 | 689 | @Callable(i) | |
629 | 690 | func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "", false) | |
630 | 691 | ||
631 | 692 | ||
632 | 693 | ||
633 | 694 | @Callable(i) | |
634 | 695 | func deleteEntry (entry) = { | |
635 | 696 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
636 | - | if ((caller | |
697 | + | if (containsElement(owners, caller)) | |
637 | 698 | then [DeleteEntry(entry)] | |
638 | 699 | else throw("no") | |
639 | 700 | } | |
640 | 701 | ||
641 | 702 | ||
642 | 703 | ||
643 | 704 | @Callable(i) | |
644 | 705 | func setBid (artId,issuer) = { | |
645 | 706 | let auctionType = getStringByKey(keyAuctionType(issuer, artId)) | |
646 | 707 | if ((auctionType == auctionType1)) | |
647 | 708 | then setBidNonTraditional(i, artId, issuer) | |
648 | 709 | else if ((auctionType == auctionType2)) | |
649 | 710 | then setBidTraditional(i, artId, issuer) | |
650 | 711 | else throw((("Unknown auction type :" + auctionType) + ", please contact the admins")) | |
651 | 712 | } | |
652 | 713 | ||
653 | 714 | ||
654 | 715 | ||
655 | 716 | @Callable(i) | |
656 | 717 | func acceptBid (artId,issuer,bidId,bidOwner) = { | |
657 | 718 | let auctionType = getStringByKey(keyAuctionType(issuer, artId)) | |
658 | 719 | if ((auctionType == auctionType1)) | |
659 | 720 | then acceptBidNonTraditional(i, artId, issuer, bidId, bidOwner) | |
660 | 721 | else if ((auctionType == auctionType2)) | |
661 | 722 | then acceptBidTraditional(i, artId, issuer, bidId, bidOwner) | |
662 | 723 | else throw((("Unknown auction type :" + auctionType) + ", please contact the admins")) | |
663 | 724 | } | |
664 | 725 | ||
665 | 726 | ||
666 | 727 | ||
667 | 728 | @Callable(i) | |
668 | 729 | func cancelBid (artId,issuer,bidId) = { | |
669 | 730 | let auctionType = getStringByKey(keyAuctionType(issuer, artId)) | |
670 | 731 | if ((auctionType == auctionType1)) | |
671 | 732 | then cancelBidImpl(i, artId, issuer, bidId) | |
672 | 733 | else cancelBidImplTraditional(i, artId, issuer, bidId) | |
673 | 734 | } | |
674 | 735 | ||
675 | 736 |
github/deemru/w8io/026f985 99.40 ms ◑