tx · 7fKG7vgPsYDfKNmWV8BVAzzrUFzJXvZUif2G6jT5JFZY 3NBquYd5fTq8HRDkagrtNLQ3HmWd7wcZoeL: -0.01400000 Waves 2021.01.27 14:15 [1371837] smart account 3NBquYd5fTq8HRDkagrtNLQ3HmWd7wcZoeL > SELF 0.00000000 Waves
{ "type": 13, "id": "7fKG7vgPsYDfKNmWV8BVAzzrUFzJXvZUif2G6jT5JFZY", "fee": 1400000, "feeAssetId": null, "timestamp": 1611746149660, "version": 2, "chainId": 84, "sender": "3NBquYd5fTq8HRDkagrtNLQ3HmWd7wcZoeL", "senderPublicKey": "7irc2VpK5czoyVdwrCuQqr2JU9ZaZnEZn8RPChnfi3yL", "proofs": [ "K1tcSwXF9EtN84u2XcD4PYaPubynwh1jBvkDHmHpDze67w8LMLTN5ubeke2uMekkHHNTvDHF6fHQYqTDCHcPaVf" ], "script": "base64:AAIEAAAAAAAAAFcIAhIOCgwICAgICAgBCAgICAgSDQoLCAgICAgBCAgICAgSBQoDCAgIEgQKAggIEgYKBAgBAQgSBAoCCAgSBAoCCAgSBgoECAgICBIGCgQICAgIEgMKAQgAAABDAAAAAAh1bml0VGVzdAYAAAAACW9yYWNsZUZlZQkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTjJzNVJ0YUhQQmVuQ3N4MkVDY29GUmJZSHgzbm9aaFhXMQAAAAAIc2lnbkRhcHAJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM05DMjhoU2l2cm1zVFVYYVlEMXg2TDM2Mko0WnBVbm9UZEIAAAAAC2ZlZVJlY2VpdmVyAgAAACMzTjFFNnRYZGRSb1ZhUmZROWRRM3ZnNUxhVzJmc2Q4SEt1YgAAAAAIdXNlckRhcHADBQAAAAh1bml0VGVzdAkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTXQ0UkdNRXlqU1dZQW9jVFBxZDU1d2RIUVFCM1BVMlVDbQkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACM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BQAAAANuaWwAAAABaQEAAAALZGVsZXRlRW50cnkAAAABAAAABWVudHJ5BAAAAAZjYWxsZXIJAAQlAAAAAQkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5AwkAAAAAAAACBQAAAAZjYWxsZXIFAAAABWNocmlzCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABWVudHJ5BQAAAANuaWwJAAACAAAAAQIAAAACbm8AAAAA+vMnQQ==", "height": 1371837, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HuArHuEcWy6Mim6Jn1QLWNPEr6HFVyWQHNsqookFduKX Next: FLQeUW8kFqVPCgBrZGG1NgNW69q9G4vL5ibtWLxYWQgn Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let unitTest = | |
4 | + | let unitTest = true | |
5 | 5 | ||
6 | 6 | let oracleFee = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
7 | 7 | ||
88 | 88 | func keyUserStatus (caller) = ("user_status_" + caller) | |
89 | 89 | ||
90 | 90 | ||
91 | - | func | |
91 | + | func keyDate (caller,artId) = ((("art_date_" + artId) + "_") + caller) | |
92 | 92 | ||
93 | 93 | ||
94 | - | func | |
94 | + | func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller) | |
95 | 95 | ||
96 | 96 | ||
97 | - | func | |
97 | + | func keyDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller) | |
98 | 98 | ||
99 | 99 | ||
100 | - | func | |
100 | + | func keyDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller) | |
101 | 101 | ||
102 | 102 | ||
103 | - | func | |
103 | + | func keyExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller) | |
104 | 104 | ||
105 | 105 | ||
106 | - | func | |
106 | + | func keyExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller) | |
107 | 107 | ||
108 | 108 | ||
109 | - | func | |
109 | + | func keyMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller) | |
110 | 110 | ||
111 | 111 | ||
112 | - | func | |
112 | + | func keySignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller) | |
113 | 113 | ||
114 | 114 | ||
115 | - | func | |
115 | + | func keyIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller) | |
116 | 116 | ||
117 | 117 | ||
118 | - | func | |
118 | + | func keyOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller) | |
119 | 119 | ||
120 | 120 | ||
121 | - | func | |
121 | + | func keyLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller) | |
122 | 122 | ||
123 | 123 | ||
124 | - | func | |
124 | + | func keyLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller) | |
125 | 125 | ||
126 | 126 | ||
127 | - | func | |
127 | + | func keyTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller) | |
128 | 128 | ||
129 | 129 | ||
130 | - | func | |
130 | + | func keyType (caller,artId) = ((("art_type_" + artId) + "_") + caller) | |
131 | 131 | ||
132 | 132 | ||
133 | - | func | |
133 | + | func keyPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller) | |
134 | 134 | ||
135 | 135 | ||
136 | - | func | |
136 | + | func keyAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller) | |
137 | 137 | ||
138 | 138 | ||
139 | - | func | |
139 | + | func keyFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller) | |
140 | 140 | ||
141 | 141 | ||
142 | - | func | |
142 | + | func keyHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
145 | + | func keyOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash) | |
146 | 146 | ||
147 | 147 | ||
148 | - | func | |
148 | + | func keyidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller) | |
149 | 149 | ||
150 | 150 | ||
151 | - | func | |
151 | + | func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller))))) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay))) | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | - | func | |
226 | + | func isPayment (i) = if ((size(i.payments) == 0)) | |
227 | 227 | then throw("No payment attached") | |
228 | 228 | else { | |
229 | - | let payment = value( | |
229 | + | let payment = value(i.payments[0]) | |
230 | 230 | let amount = value(payment.amount) | |
231 | - | let assetId = if (if (isDefined(payment.assetId)) | |
232 | - | then (payment.assetId == signAssetId) | |
233 | - | else false) | |
234 | - | then payment.assetId | |
235 | - | else throw("Only SIGN token accepted as transaction fee") | |
236 | - | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
237 | - | if ((amount != currentCertificationPrice)) | |
238 | - | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
239 | - | else $Tuple2(amount, assetId) | |
231 | + | $Tuple2(payment, amount) | |
240 | 232 | } | |
241 | 233 | ||
242 | 234 | ||
243 | - | func isArtMinted (addressToUse,artId) = match getInteger(this, keyArtIssued(addressToUse, artId)) { | |
235 | + | func validatePayment (i) = { | |
236 | + | let $t089028938 = isPayment(i) | |
237 | + | let payment = $t089028938._1 | |
238 | + | let amount = $t089028938._2 | |
239 | + | let assetId = if (if (isDefined(payment.assetId)) | |
240 | + | then (payment.assetId == signAssetId) | |
241 | + | else false) | |
242 | + | then payment.assetId | |
243 | + | else throw("Only SIGN token accepted as transaction fee") | |
244 | + | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
245 | + | if ((amount != currentCertificationPrice)) | |
246 | + | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
247 | + | else $Tuple2(amount, assetId) | |
248 | + | } | |
249 | + | ||
250 | + | ||
251 | + | func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) { | |
244 | 252 | case b: Int => | |
245 | 253 | if ((b != 0)) | |
246 | 254 | then true | |
250 | 258 | } | |
251 | 259 | ||
252 | 260 | ||
253 | - | func validatePriceAssetId (invoke,priceAssetId,artworkPrice) = { | |
254 | - | let payment = value(invoke.payments[0]) | |
255 | - | let amount = value(payment.amount) | |
261 | + | func validatePriceAssetId (i,priceAssetId,artworkPrice) = { | |
262 | + | let $t096389674 = isPayment(i) | |
263 | + | let payment = $t096389674._1 | |
264 | + | let amount = $t096389674._2 | |
256 | 265 | let assetId = if (!(isDefined(payment.assetId))) | |
257 | 266 | then unit | |
258 | 267 | else if (if ((size(priceAssetId) > 0)) | |
270 | 279 | } | |
271 | 280 | ||
272 | 281 | ||
273 | - | func acceptedAssetIds (assetId) = if (if (if ((assetId != toBase58String(signAssetId))) | |
282 | + | func acceptedAssetIds (assetId) = if (if (if (if ((assetId != toBase58String(signAssetId))) | |
274 | 283 | then (assetId != toBase58String(wavesAssetId)) | |
284 | + | else false) | |
285 | + | then (assetId != "WAVES") | |
275 | 286 | else false) | |
276 | 287 | then (assetId != toBase58String(usdnAssetId)) | |
277 | 288 | else false) | |
309 | 320 | } | |
310 | 321 | ||
311 | 322 | ||
312 | - | @Callable(invoke) | |
313 | - | func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning)) | |
323 | + | func getPriceAssetIdFromBid (bidDataKey) = { | |
324 | + | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
325 | + | if ((bidData == "")) | |
326 | + | then throw("Bid not found") | |
327 | + | else { | |
328 | + | let bidDataArr = split(bidData, "_") | |
329 | + | let bidAmount = parseIntValue(bidDataArr[1]) | |
330 | + | let bidAssetId = if ((bidDataArr[0] == "WAVES")) | |
331 | + | then unit | |
332 | + | else fromBase58String(bidDataArr[0]) | |
333 | + | if ((0 >= bidAmount)) | |
334 | + | then throw("Wrong amount") | |
335 | + | else $Tuple2(bidAmount, bidAssetId) | |
336 | + | } | |
337 | + | } | |
338 | + | ||
339 | + | ||
340 | + | func idCallerDate (i) = if (!(dappRunning)) | |
314 | 341 | then throw(maintenanceMSG) | |
315 | - | else { | |
316 | - | let artId = toBase58String(invoke.transactionId) | |
317 | - | let timestamp = lastBlock.timestamp | |
318 | - | let caller = toBase58String(invoke.caller.bytes) | |
319 | - | if (!(validateHash(sha256Hash))) | |
320 | - | then throw("Hash should be 64 characters maximum") | |
321 | - | else { | |
322 | - | let $t01151411583 = setLIcence(cidLicence, sha256Licence) | |
323 | - | let licenceCID = $t01151411583._1 | |
324 | - | let licenceHash = $t01151411583._2 | |
325 | - | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint) | |
326 | - | if ((validateArtwork != "")) | |
327 | - | then throw("Something went wrong!") | |
328 | - | else { | |
329 | - | let $t01181111858 = validatePayment(invoke) | |
330 | - | let amount = $t01181111858._1 | |
331 | - | let assetId = $t01181111858._2 | |
332 | - | if (!(isDefined(amount))) | |
333 | - | then throw("Something went wrong") | |
334 | - | else { | |
335 | - | let entryExist = getStringByKey(keyArtTxidByHashOwner(sha256Hash, caller)) | |
336 | - | if ((entryExist != "")) | |
337 | - | then throw("You already added it") | |
338 | - | else { | |
339 | - | let hashExist = getStringByKey(keyArtOwnerByHash(sha256Hash)) | |
340 | - | if ((hashExist != "")) | |
341 | - | then throw("Hash already registered") | |
342 | - | else { | |
343 | - | let isSignCertified = checkSignCertificate(signID, caller, sha256Hash) | |
344 | - | if (!(isSignCertified)) | |
345 | - | then throw("Sign Certificate not found for this address.") | |
346 | - | else [StringEntry(keyArtOwnerByHash(sha256Hash), caller), StringEntry(keyArtTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyArtDate(caller, artId), timestamp), StringEntry(keyArtName(caller, artId), name), StringEntry(keyArtDesc(caller, artId), description), StringEntry(keyArtDisplayCid(caller, artId), cidDisplay), StringEntry(keyArtExportCid(caller, artId), cidExport), StringEntry(keyArtExportHash(caller, artId), sha256Export), StringEntry(keyArtLicenceHash(caller, artId), licenceHash), StringEntry(keyArtLicenceCid(caller, artId), licenceCID), StringEntry(keyArtType(caller, artId), type), StringEntry(keyArtTags(caller, artId), tags), IntegerEntry(keyArtMaxMint(caller, artId), maxmint), StringEntry(keyArtSignID(caller, artId), signID), IntegerEntry(keyArtIssued(caller, artId), 0), BooleanEntry(keyArtOnSale(caller, artId), false), StringEntry(keyArtArtidBySignid(caller, signID), artId), StringEntry(keyArtHashByTxidAddr(caller, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
347 | - | } | |
348 | - | } | |
349 | - | } | |
350 | - | } | |
351 | - | } | |
352 | - | } | |
342 | + | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
343 | + | ||
344 | + | ||
345 | + | func buyMint (i,artId,issuer,bidId,bidOwner) = { | |
346 | + | let $t01177511813 = idCallerDate(i) | |
347 | + | let id = $t01177511813._1 | |
348 | + | let caller = $t01177511813._2 | |
349 | + | let date = $t01177511813._3 | |
350 | + | let totalNFT = getIntegerByKey("total_nft_issued") | |
351 | + | let signID = getStringByKey(keySignID(issuer, artId)) | |
352 | + | let artworkName = getStringByKey(keyName(issuer, artId)) | |
353 | + | if ((artworkName == "")) | |
354 | + | then throw("Art doesn't exist") | |
355 | + | else { | |
356 | + | let isOnSale = getBooleanByKey(keyOnSale(issuer, artId)) | |
357 | + | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
358 | + | let artworkPrice = getIntegerByKey(keyPrice(issuer, artId)) | |
359 | + | let priceAssetId = getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
360 | + | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
361 | + | let isBid = if (if (if ((caller == issuer)) | |
362 | + | then (bidOwner != "") | |
363 | + | else false) | |
364 | + | then (bidId != "") | |
365 | + | else false) | |
366 | + | then true | |
367 | + | else false | |
368 | + | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
369 | + | if (if (if ((0 >= artworkPrice)) | |
370 | + | then true | |
371 | + | else !(isOnSale)) | |
372 | + | then true | |
373 | + | else (0 >= maxCanSell)) | |
374 | + | then throw("Art not for sale") | |
375 | + | else { | |
376 | + | let $t01266012789 = if (isBid) | |
377 | + | then getPriceAssetIdFromBid(bidDataKey) | |
378 | + | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
379 | + | let amount = $t01266012789._1 | |
380 | + | let assetId = $t01266012789._2 | |
381 | + | let isWhitelisted = checkWhitelist(issuer) | |
382 | + | let cut = if ((isWhitelisted > height)) | |
383 | + | then 0 | |
384 | + | else if ((priceAssetId == toBase58String(signAssetId))) | |
385 | + | then signCut | |
386 | + | else usdnWaveCut | |
387 | + | let amountForSign = fraction(amount, cut, 100) | |
388 | + | let amountForCreator = (amount - amountForSign) | |
389 | + | if ((amountSold == maxCanSell)) | |
390 | + | then throw("Art sold out") | |
391 | + | else { | |
392 | + | let newAmountSold = (amountSold + 1) | |
393 | + | let issueMeta = ((((((((((("Creator: " + issuer) + ", | |
394 | + | ArtID: ") + artId) + ", | |
395 | + | SignID: ") + signID) + ", | |
396 | + | Artwork name: ") + artworkName) + ", | |
397 | + | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
398 | + | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
399 | + | let idNFT = calculateAssetId(issueNFT) | |
400 | + | let sellStatus = if ((newAmountSold == maxCanSell)) | |
401 | + | then false | |
402 | + | else true | |
403 | + | let receiveNFT = if (if (if ((caller == issuer)) | |
404 | + | then (bidOwner != "") | |
405 | + | else false) | |
406 | + | then (bidId != "") | |
407 | + | else false) | |
408 | + | then addressFromStringValue(bidOwner) | |
409 | + | else i.caller | |
410 | + | let buyRes = [IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId), ScriptTransfer(receiveNFT, 1, idNFT)] | |
411 | + | let assetIdBid = if (!(isDefined(assetId))) | |
412 | + | then "WAVES" | |
413 | + | else toBase58String(value(assetId)) | |
414 | + | let getBidData = getStringByKey((bidDataKey + "_OPEN")) | |
415 | + | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
416 | + | let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((getBidData + "_") + toString(date))) | |
417 | + | let soldValue = if (!(isBid)) | |
418 | + | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
419 | + | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
420 | + | let soldData = StringEntry(((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer), soldValue) | |
421 | + | if (isBid) | |
422 | + | then [soldData, bidUpdate, bidDelOld] :: buyRes | |
423 | + | else soldData :: buyRes | |
424 | + | } | |
425 | + | } | |
426 | + | } | |
427 | + | } | |
428 | + | ||
429 | + | ||
430 | + | @Callable(i) | |
431 | + | func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = { | |
432 | + | let $t01581515856 = idCallerDate(i) | |
433 | + | let artId = $t01581515856._1 | |
434 | + | let caller = $t01581515856._2 | |
435 | + | let date = $t01581515856._3 | |
436 | + | if (!(validateHash(sha256Hash))) | |
437 | + | then throw("Hash should be 64 characters maximum") | |
438 | + | else { | |
439 | + | let $t01595716026 = setLIcence(cidLicence, sha256Licence) | |
440 | + | let licenceCID = $t01595716026._1 | |
441 | + | let licenceHash = $t01595716026._2 | |
442 | + | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint) | |
443 | + | if ((validateArtwork != "")) | |
444 | + | then throw("Something went wrong!") | |
445 | + | else { | |
446 | + | let $t01625416296 = validatePayment(i) | |
447 | + | let amount = $t01625416296._1 | |
448 | + | let assetId = $t01625416296._2 | |
449 | + | if (!(isDefined(amount))) | |
450 | + | then throw("Something went wrong") | |
451 | + | else { | |
452 | + | let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller)) | |
453 | + | if ((entryExist != "")) | |
454 | + | then throw("You already added it") | |
455 | + | else { | |
456 | + | let hashExist = getStringByKey(keyOwnerByHash(sha256Hash)) | |
457 | + | if ((hashExist != "")) | |
458 | + | then throw("Hash already registered") | |
459 | + | else { | |
460 | + | let isSignCertified = checkSignCertificate(signID, caller, sha256Hash) | |
461 | + | if (!(isSignCertified)) | |
462 | + | then throw("Sign Certificate not found for this address.") | |
463 | + | 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(keyExportCid(caller, artId), cidExport), StringEntry(keyExportHash(caller, artId), sha256Export), StringEntry(keyLicenceHash(caller, artId), licenceHash), StringEntry(keyLicenceCid(caller, artId), licenceCID), StringEntry(keyType(caller, artId), type), StringEntry(keyTags(caller, artId), tags), IntegerEntry(keyMaxMint(caller, artId), maxmint), StringEntry(keySignID(caller, artId), signID), IntegerEntry(keyIssued(caller, artId), 0), BooleanEntry(keyOnSale(caller, artId), false), StringEntry(keyidBySignid(caller, signID), artId), StringEntry(keyHashByTxidAddr(caller, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
464 | + | } | |
465 | + | } | |
466 | + | } | |
467 | + | } | |
468 | + | } | |
469 | + | } | |
353 | 470 | ||
354 | 471 | ||
355 | 472 | ||
356 | - | @Callable( | |
473 | + | @Callable(i) | |
357 | 474 | func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning)) | |
358 | 475 | then throw(maintenanceMSG) | |
359 | 476 | else { | |
360 | - | let updateId = toBase58String(invoke.transactionId) | |
361 | - | let caller = toBase58String(invoke.caller.bytes) | |
362 | - | let $t01471314782 = setLIcence(cidLicence, sha256Licence) | |
363 | - | let licenceCID = $t01471314782._1 | |
364 | - | let licenceHash = $t01471314782._2 | |
477 | + | let caller = toBase58String(i.caller.bytes) | |
478 | + | let $t01901719086 = setLIcence(cidLicence, sha256Licence) | |
479 | + | let licenceCID = $t01901719086._1 | |
480 | + | let licenceHash = $t01901719086._2 | |
365 | 481 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint) | |
366 | 482 | if ((validateArtwork != "")) | |
367 | 483 | then throw("Something went wrong!") | |
368 | 484 | else { | |
369 | - | let entryExist = getStringByKey( | |
485 | + | let entryExist = getStringByKey(keyName(caller, txid)) | |
370 | 486 | if ((entryExist == "")) | |
371 | 487 | then throw("Entry not found") | |
372 | 488 | else { | |
373 | - | let flag = getStringByKey( | |
489 | + | let flag = getStringByKey(keyFlag(caller, txid)) | |
374 | 490 | if ((flag == "ILLEGAL")) | |
375 | 491 | then throw("Cannot update ILLEGAL artwork") | |
376 | 492 | else if (!(isArtMinted(caller, txid))) | |
377 | - | then [StringEntry( | |
493 | + | then [StringEntry(keyName(caller, txid), name), StringEntry(keyDesc(caller, txid), description), StringEntry(keyDisplayCid(caller, txid), cidDisplay), StringEntry(keyExportCid(caller, txid), cidExport), StringEntry(keyExportHash(caller, txid), sha256Export), StringEntry(keyLicenceCid(caller, txid), licenceCID), StringEntry(keyLicenceHash(caller, txid), licenceHash), IntegerEntry(keyMaxMint(caller, txid), maxmint), StringEntry(keyTags(caller, txid), tags), StringEntry(keyType(caller, txid), type)] | |
378 | 494 | else throw("Already minted") | |
379 | 495 | } | |
380 | 496 | } | |
382 | 498 | ||
383 | 499 | ||
384 | 500 | ||
385 | - | @Callable( | |
501 | + | @Callable(i) | |
386 | 502 | func flagArtwork (artId,addr,flag) = { | |
387 | - | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
388 | - | let id = toBase58String(invoke.transactionId) | |
503 | + | let $t02055920592 = idCallerDate(i) | |
504 | + | let id = $t02055920592._1 | |
505 | + | let caller = $t02055920592._2 | |
389 | 506 | if (containsElement([chris, joep, toString(this)], caller)) | |
390 | 507 | then if ((flag == "CONSENT")) | |
391 | - | then [StringEntry( | |
508 | + | then [StringEntry(keyFlag(addr, artId), flag)] | |
392 | 509 | else if ((flag == "")) | |
393 | - | then [StringEntry( | |
510 | + | then [StringEntry(keyFlag(addr, artId), flag)] | |
394 | 511 | else if ((flag == "CHANGE_REQUIRED")) | |
395 | - | then [StringEntry(keyArtFlag(addr, artId), flag)] | |
396 | - | else if ((flag == "ILLEGAL")) | |
397 | - | then [StringEntry(keyArtFlag(addr, artId), flag), StringEntry(keyArtName(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyArtDesc(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyArtDisplayCid(addr, artId), ""), StringEntry(keyArtExportCid(addr, artId), ""), StringEntry(keyArtLicenceCid(addr, artId), "")] | |
512 | + | then [StringEntry(keyFlag(addr, artId), flag)] | |
513 | + | else if (if ((flag == "ILLEGAL")) | |
514 | + | then containsElement([chris, toString(this)], caller) | |
515 | + | else false) | |
516 | + | then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyName(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyDesc(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyDisplayCid(addr, artId), ""), StringEntry(keyExportCid(addr, artId), ""), StringEntry(keyLicenceCid(addr, artId), "")] | |
398 | 517 | else throw(("Unknow status " + flag)) | |
399 | 518 | else throw("You are not allowed") | |
400 | 519 | } | |
401 | 520 | ||
402 | 521 | ||
403 | 522 | ||
404 | - | @Callable( | |
523 | + | @Callable(i) | |
405 | 524 | func deleteArtwork (artId,addr) = { | |
406 | - | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
407 | - | let id = toBase58String(invoke.transactionId) | |
408 | - | let addressToUse = if (containsElement([chris, joep, toString(this)], caller)) | |
525 | + | let $t02161121644 = idCallerDate(i) | |
526 | + | let id = $t02161121644._1 | |
527 | + | let caller = $t02161121644._2 | |
528 | + | let addrToUse = if (containsElement([chris, joep, toString(this)], caller)) | |
409 | 529 | then addr | |
410 | 530 | else caller | |
411 | - | let entryExist = getStringByKey( | |
531 | + | let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address") | |
412 | 532 | if ((entryExist == "")) | |
413 | 533 | then throw("No art matching for this address") | |
414 | 534 | else { | |
415 | - | let sha256Hash = getStringByKey( | |
535 | + | let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId)) | |
416 | 536 | if ((sha256Hash == "")) | |
417 | 537 | then throw("No art hash matching for this address") | |
418 | 538 | else { | |
419 | - | let signID = getStringByKey( | |
539 | + | let signID = getStringByKey(keySignID(addrToUse, artId)) | |
420 | 540 | if ((signID == "")) | |
421 | 541 | then throw("No SIGN ID matching") | |
422 | 542 | else { | |
423 | - | let dataToDelete = [DeleteEntry( | |
424 | - | if (!(isArtMinted( | |
543 | + | let dataToDelete = [DeleteEntry(keyDate(addrToUse, artId)), DeleteEntry(keyName(addrToUse, artId)), DeleteEntry(keyDesc(addrToUse, artId)), DeleteEntry(keyDisplayCid(addrToUse, artId)), DeleteEntry(keyExportCid(addrToUse, artId)), DeleteEntry(keyExportHash(addrToUse, artId)), DeleteEntry(keyLicenceHash(addrToUse, artId)), DeleteEntry(keyLicenceCid(addrToUse, artId)), DeleteEntry(keyType(addrToUse, artId)), DeleteEntry(keyTags(addrToUse, artId)), DeleteEntry(keyMaxMint(addrToUse, artId)), DeleteEntry(keySignID(addrToUse, artId)), DeleteEntry(keyIssued(addrToUse, artId)), DeleteEntry(keyOnSale(addrToUse, artId)), DeleteEntry(keyFlag(addr, artId)), DeleteEntry(keyPrice(addr, artId)), DeleteEntry(keyAssetIdAccepted(addr, artId)), DeleteEntry(keyOwnerByHash(sha256Hash)), DeleteEntry(keyidBySignid(addrToUse, signID)), DeleteEntry(keyTxidByHashOwner(sha256Hash, addrToUse))] | |
544 | + | if (!(isArtMinted(addrToUse, artId))) | |
425 | 545 | then if (!(dappRunning)) | |
426 | 546 | then throw(maintenanceMSG) | |
427 | 547 | else dataToDelete | |
435 | 555 | ||
436 | 556 | ||
437 | 557 | ||
438 | - | @Callable(invoke) | |
439 | - | func sellArtwork (artId,price,maxMint,assetId) = if (!(dappRunning)) | |
440 | - | then throw(maintenanceMSG) | |
441 | - | else { | |
442 | - | let id = toBase58String(invoke.transactionId) | |
443 | - | let caller = toBase58String(invoke.caller.bytes) | |
444 | - | let sellDate = lastBlock.timestamp | |
445 | - | let artworkName = getStringByKey(keyArtName(caller, artId)) | |
446 | - | if ((artworkName == "")) | |
447 | - | then throw("This art doesn't match match your account") | |
448 | - | else { | |
449 | - | let exportCID = getStringByKey(keyArtExportCid(caller, artId)) | |
450 | - | if ((size(split(exportCID, "/")[0]) != 59)) | |
451 | - | then throw("You cannot sell art with no export file") | |
452 | - | else { | |
453 | - | let exportHash = getStringByKey(keyArtExportHash(caller, artId)) | |
454 | - | if ((size(exportHash) != 64)) | |
455 | - | then throw("You cannot sell art with no export hash") | |
456 | - | else if (!(acceptedAssetIds(assetId))) | |
457 | - | then throw("Something went wrong!") | |
458 | - | else if (!(validateMinSell(assetId, price))) | |
459 | - | then throw("Something went wrong!") | |
460 | - | else { | |
461 | - | let checkUser = validateUser(caller) | |
462 | - | if ((checkUser != "")) | |
463 | - | then throw(checkUser) | |
464 | - | else { | |
465 | - | let amountSold = getIntegerByKey(keyArtIssued(caller, artId)) | |
466 | - | let maxCanSell = getIntegerByKey(keyArtMaxMint(caller, artId)) | |
467 | - | if ((maxMint > 10)) | |
468 | - | then throw("10 editions max per artwork") | |
469 | - | else if (if ((amountSold != 0)) | |
470 | - | then (amountSold == maxCanSell) | |
558 | + | @Callable(i) | |
559 | + | func sellArtwork (artId,price,maxMint,assetId) = { | |
560 | + | let $t02401024043 = idCallerDate(i) | |
561 | + | let id = $t02401024043._1 | |
562 | + | let caller = $t02401024043._2 | |
563 | + | let artworkName = getStringByKey(keyName(caller, artId)) | |
564 | + | if ((artworkName == "")) | |
565 | + | then throw("This art doesn't match your account") | |
566 | + | else { | |
567 | + | let exportCID = getStringByKey(keyExportCid(caller, artId)) | |
568 | + | if ((size(split(exportCID, "/")[0]) != 59)) | |
569 | + | then throw("You cannot sell art with no export file") | |
570 | + | else if (!(acceptedAssetIds(assetId))) | |
571 | + | then throw("Something went wrong!") | |
572 | + | else if (!(validateMinSell(assetId, price))) | |
573 | + | then throw("Something went wrong!") | |
574 | + | else { | |
575 | + | let checkUser = validateUser(caller) | |
576 | + | if ((checkUser != "")) | |
577 | + | then throw(checkUser) | |
578 | + | else { | |
579 | + | let amountSold = getIntegerByKey(keyIssued(caller, artId)) | |
580 | + | let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId)) | |
581 | + | if ((maxMint > 10)) | |
582 | + | then throw("10 editions max per artwork") | |
583 | + | else if (if ((amountSold != 0)) | |
584 | + | then (amountSold == maxCanSell) | |
585 | + | else false) | |
586 | + | then throw("Max edition reached.") | |
587 | + | else if (if ((amountSold > 0)) | |
588 | + | then (maxCanSell != maxMint) | |
589 | + | else false) | |
590 | + | then throw("Cannot change maximum issuable anymore") | |
591 | + | else { | |
592 | + | let sellStatus = if (if ((price > 0)) | |
593 | + | then (maxMint > 0) | |
471 | 594 | else false) | |
472 | - | then throw("Max edition reached.") | |
473 | - | else if (if ((amountSold > 0)) | |
474 | - | then (maxCanSell != maxMint) | |
475 | - | else false) | |
476 | - | then throw("Cannot change maximum issuable anymore") | |
477 | - | else { | |
478 | - | let sellStatus = if (if ((price > 0)) | |
479 | - | then (maxMint > 0) | |
480 | - | else false) | |
481 | - | then true | |
482 | - | else false | |
483 | - | [BooleanEntry(keyArtOnSale(caller, artId), sellStatus), IntegerEntry(keyArtPrice(caller, artId), price), IntegerEntry(keyArtMaxMint(caller, artId), maxMint), StringEntry(keyArtAssetIdAccepted(caller, artId), assetId)] | |
484 | - | } | |
485 | - | } | |
486 | - | } | |
487 | - | } | |
488 | - | } | |
489 | - | } | |
595 | + | then true | |
596 | + | else false | |
597 | + | [BooleanEntry(keyOnSale(caller, artId), sellStatus), IntegerEntry(keyPrice(caller, artId), price), IntegerEntry(keyMaxMint(caller, artId), maxMint), StringEntry(keyAssetIdAccepted(caller, artId), assetId)] | |
598 | + | } | |
599 | + | } | |
600 | + | } | |
601 | + | } | |
602 | + | } | |
490 | 603 | ||
491 | 604 | ||
492 | 605 | ||
493 | - | @Callable(invoke) | |
494 | - | func buyArtwork (artId,issuer) = if (!(dappRunning)) | |
495 | - | then throw(maintenanceMSG) | |
496 | - | else { | |
497 | - | let id = toBase58String(invoke.transactionId) | |
498 | - | let caller = toBase58String(invoke.caller.bytes) | |
499 | - | let totalNFT = getIntegerByKey("total_nft_issued") | |
500 | - | let signID = getStringByKey(keyArtSignID(issuer, artId)) | |
501 | - | let artworkName = getStringByKey(keyArtName(issuer, artId)) | |
502 | - | if ((artworkName == "")) | |
503 | - | then throw("Art doesn't exist") | |
606 | + | @Callable(i) | |
607 | + | func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "") | |
608 | + | ||
609 | + | ||
610 | + | ||
611 | + | @Callable(i) | |
612 | + | func setBid (artId,issuer) = { | |
613 | + | let $t02583925877 = idCallerDate(i) | |
614 | + | let id = $t02583925877._1 | |
615 | + | let caller = $t02583925877._2 | |
616 | + | let date = $t02583925877._3 | |
617 | + | let $t02588225918 = isPayment(i) | |
618 | + | let payment = $t02588225918._1 | |
619 | + | let amount = $t02588225918._2 | |
620 | + | let assetId = if (!(isDefined(payment.assetId))) | |
621 | + | then "WAVES" | |
622 | + | else toBase58String(value(payment.assetId)) | |
623 | + | if (!(acceptedAssetIds(assetId))) | |
624 | + | then throw("Something went wrong!") | |
625 | + | else if (!(validateMinSell(assetId, amount))) | |
626 | + | then throw("Something went wrong!") | |
504 | 627 | else { | |
505 | - | let displayCID = getStringByKey(keyArtDisplayCid(issuer, artId)) | |
506 | - | let exportCID = getStringByKey(keyArtExportCid(issuer, artId)) | |
507 | - | let exportHash = getStringByKey(keyArtExportHash(issuer, artId)) | |
508 | - | let licenceCID = getStringByKey(keyArtLicenceCid(issuer, artId)) | |
509 | - | let licenceHash = getStringByKey(keyArtLicenceHash(issuer, artId)) | |
510 | - | let description = take(getStringByKey(keyArtDesc(issuer, artId)), 50) | |
511 | - | let isOnSale = getBooleanByKey(keyArtOnSale(issuer, artId)) | |
512 | - | let amountSold = getIntegerByKey(keyArtIssued(issuer, artId)) | |
513 | - | let artworkPrice = getIntegerByKey(keyArtPrice(issuer, artId)) | |
514 | - | let priceAssetId = getStringByKey(keyArtAssetIdAccepted(issuer, artId)) | |
515 | - | let sourceHash = getStringByKey(keyArtHashByTxidAddr(issuer, artId)) | |
516 | - | let maxCanSell = getIntegerByKey(keyArtMaxMint(issuer, artId)) | |
517 | - | if (if (if ((0 >= artworkPrice)) | |
518 | - | then true | |
519 | - | else !(isOnSale)) | |
520 | - | then true | |
521 | - | else (0 >= maxCanSell)) | |
522 | - | then throw("Art not for sale") | |
523 | - | else { | |
524 | - | let $t02317523255 = validatePriceAssetId(invoke, priceAssetId, artworkPrice) | |
525 | - | let amount = $t02317523255._1 | |
526 | - | let assetId = $t02317523255._2 | |
527 | - | let isWhitelisted = checkWhitelist(issuer) | |
528 | - | let cut = if ((isWhitelisted > height)) | |
529 | - | then 0 | |
530 | - | else if ((priceAssetId == toBase58String(signAssetId))) | |
531 | - | then signCut | |
532 | - | else usdnWaveCut | |
533 | - | let amountForSign = fraction(amount, cut, 100) | |
534 | - | let amountForCreator = (amount - amountForSign) | |
535 | - | if ((amountSold == maxCanSell)) | |
536 | - | then throw("Art sold out") | |
537 | - | else { | |
538 | - | let newAmountSold = (amountSold + 1) | |
539 | - | let entryDate = lastBlock.timestamp | |
540 | - | let issueMeta = ((((((((((((((((((((((((((("Creator: " + issuer) + ", | |
541 | - | ArtID: ") + artId) + ", | |
542 | - | SignID: ") + signID) + ", | |
543 | - | Artwork name: ") + artworkName) + ", | |
544 | - | Artwork description: ") + description) + ", | |
545 | - | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) + ", | |
546 | - | Max issuable: ") + toString(maxCanSell)) + ", | |
547 | - | Source hash: ") + sourceHash) + ", | |
548 | - | Display cid: ") + displayCID) + ", | |
549 | - | Export cid: ") + exportCID) + ", | |
550 | - | Export hash: ") + exportHash) + ", | |
551 | - | Licence cid: ") + licenceCID) + ", | |
552 | - | Licence hash: ") + licenceHash) | |
553 | - | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
554 | - | let idNFT = calculateAssetId(issueNFT) | |
555 | - | let sellStatus = if ((newAmountSold == maxCanSell)) | |
556 | - | then false | |
557 | - | else true | |
558 | - | [IntegerEntry(keyArtIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)), StringEntry(((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer), ((((((((((caller + "_") + toString(entryDate)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyArtOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId), ScriptTransfer(invoke.caller, 1, idNFT)] | |
559 | - | } | |
560 | - | } | |
628 | + | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
629 | + | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
630 | + | if ((amountSold >= maxCanSell)) | |
631 | + | then throw("Sold out, you cannot bid") | |
632 | + | else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date)))] | |
561 | 633 | } | |
562 | - | } | |
634 | + | } | |
635 | + | ||
636 | + | ||
637 | + | ||
638 | + | @Callable(i) | |
639 | + | func acceptBid (artId,issuer,bidId,bidOwner) = { | |
640 | + | let caller = toBase58String(i.caller.bytes) | |
641 | + | if ((caller != issuer)) | |
642 | + | then throw("You cannot do this action") | |
643 | + | else buyMint(i, artId, issuer, bidId, bidOwner) | |
644 | + | } | |
645 | + | ||
646 | + | ||
647 | + | ||
648 | + | @Callable(i) | |
649 | + | func cancelBid (artId,issuer,bidId,bidOwner) = { | |
650 | + | let $t02689926937 = idCallerDate(i) | |
651 | + | let id = $t02689926937._1 | |
652 | + | let caller = $t02689926937._2 | |
653 | + | let date = $t02689926937._3 | |
654 | + | if (if ((caller != bidOwner)) | |
655 | + | then (caller != issuer) | |
656 | + | else false) | |
657 | + | then throw("You cannot do this action") | |
658 | + | else { | |
659 | + | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
660 | + | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
661 | + | if ((bidData == "")) | |
662 | + | then throw("Bid not found") | |
663 | + | else { | |
664 | + | let bidDataArr = split(bidData, "_") | |
665 | + | let assetId = if ((bidDataArr[0] == "WAVES")) | |
666 | + | then unit | |
667 | + | else fromBase58String(bidDataArr[0]) | |
668 | + | let bidStatus = if ((caller == bidOwner)) | |
669 | + | then "CANCELED" | |
670 | + | else "REJECTED" | |
671 | + | [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), ScriptTransfer(Address(fromBase58String(bidOwner)), parseIntValue(bidDataArr[1]), assetId)] | |
672 | + | } | |
673 | + | } | |
674 | + | } | |
563 | 675 | ||
564 | 676 | ||
565 | 677 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let unitTest = | |
4 | + | let unitTest = true | |
5 | 5 | ||
6 | 6 | let oracleFee = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
7 | 7 | ||
8 | 8 | let signDapp = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB")) | |
9 | 9 | ||
10 | 10 | let feeReceiver = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
11 | 11 | ||
12 | 12 | let userDapp = if (unitTest) | |
13 | 13 | then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm")) | |
14 | 14 | else value(addressFromString("3MwDZagoYEiNfQLc31cGpYoaE54MGMwoFrZ")) | |
15 | 15 | ||
16 | 16 | let whitelistDapp = value(addressFromString("3N6BaV1dCB4zg43goNNHaCtvR13BcyJ5Gsq")) | |
17 | 17 | ||
18 | 18 | let signAssetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
19 | 19 | ||
20 | 20 | let usdnAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
21 | 21 | ||
22 | 22 | let wavesAssetId = base58'' | |
23 | 23 | ||
24 | 24 | let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp" | |
25 | 25 | ||
26 | 26 | let joep = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN" | |
27 | 27 | ||
28 | 28 | let signCut = 7 | |
29 | 29 | ||
30 | 30 | let usdnWaveCut = 10 | |
31 | 31 | ||
32 | 32 | let defaultLicence = "bafybeifuyo4pqu54ismqgtb6e4h6kkvgx7zg4u3zibh2r7y6mb64i7bzza/licence.pdf" | |
33 | 33 | ||
34 | 34 | let defaultHashLicence = "a87758c354e30a9e78fb84fa3a0010a5090ab20df0be11ad45b5720cc187e639" | |
35 | 35 | ||
36 | 36 | let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true) | |
37 | 37 | ||
38 | 38 | let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "") | |
39 | 39 | ||
40 | 40 | let userSuspended = "SUSPENDED" | |
41 | 41 | ||
42 | 42 | let userRemoved = "REMOVED" | |
43 | 43 | ||
44 | 44 | let userUnregistered = "UNREGISTERED" | |
45 | 45 | ||
46 | 46 | let userAllowed = "ALLOWED" | |
47 | 47 | ||
48 | 48 | func getStringByKeyFromUsers (key) = valueOrElse(getString(userDapp, key), "") | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func checkSignCertificate (signID,Owner,sha256Hash) = match getString(signDapp, ((("data_fc_" + signID) + "_") + Owner)) { | |
67 | 67 | case a: String => | |
68 | 68 | if (contains(a, sha256Hash)) | |
69 | 69 | then true | |
70 | 70 | else false | |
71 | 71 | case _ => | |
72 | 72 | false | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func validateCID (cid) = if (contains(cid, "/")) | |
77 | 77 | then if (if ((76 > size(cid))) | |
78 | 78 | then (size(split(cid, "/")[0]) == 59) | |
79 | 79 | else false) | |
80 | 80 | then (16 > size(split(cid, "/")[1])) | |
81 | 81 | else false | |
82 | 82 | else false | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func validateHash (hash) = (size(hash) == 64) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func keyUserStatus (caller) = ("user_status_" + caller) | |
89 | 89 | ||
90 | 90 | ||
91 | - | func | |
91 | + | func keyDate (caller,artId) = ((("art_date_" + artId) + "_") + caller) | |
92 | 92 | ||
93 | 93 | ||
94 | - | func | |
94 | + | func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller) | |
95 | 95 | ||
96 | 96 | ||
97 | - | func | |
97 | + | func keyDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller) | |
98 | 98 | ||
99 | 99 | ||
100 | - | func | |
100 | + | func keyDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller) | |
101 | 101 | ||
102 | 102 | ||
103 | - | func | |
103 | + | func keyExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller) | |
104 | 104 | ||
105 | 105 | ||
106 | - | func | |
106 | + | func keyExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller) | |
107 | 107 | ||
108 | 108 | ||
109 | - | func | |
109 | + | func keyMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller) | |
110 | 110 | ||
111 | 111 | ||
112 | - | func | |
112 | + | func keySignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller) | |
113 | 113 | ||
114 | 114 | ||
115 | - | func | |
115 | + | func keyIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller) | |
116 | 116 | ||
117 | 117 | ||
118 | - | func | |
118 | + | func keyOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller) | |
119 | 119 | ||
120 | 120 | ||
121 | - | func | |
121 | + | func keyLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller) | |
122 | 122 | ||
123 | 123 | ||
124 | - | func | |
124 | + | func keyLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller) | |
125 | 125 | ||
126 | 126 | ||
127 | - | func | |
127 | + | func keyTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller) | |
128 | 128 | ||
129 | 129 | ||
130 | - | func | |
130 | + | func keyType (caller,artId) = ((("art_type_" + artId) + "_") + caller) | |
131 | 131 | ||
132 | 132 | ||
133 | - | func | |
133 | + | func keyPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller) | |
134 | 134 | ||
135 | 135 | ||
136 | - | func | |
136 | + | func keyAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller) | |
137 | 137 | ||
138 | 138 | ||
139 | - | func | |
139 | + | func keyFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller) | |
140 | 140 | ||
141 | 141 | ||
142 | - | func | |
142 | + | func keyHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
145 | + | func keyOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash) | |
146 | 146 | ||
147 | 147 | ||
148 | - | func | |
148 | + | func keyidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller) | |
149 | 149 | ||
150 | 150 | ||
151 | - | func | |
151 | + | func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller))))) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay))) | |
155 | 155 | then throw("Wrong Display CID") | |
156 | 156 | else if (!(validateCID(cidExport))) | |
157 | 157 | then throw("Wrong Export CID") | |
158 | 158 | else if (if ((cidLicence != "")) | |
159 | 159 | then !(validateCID(cidLicence)) | |
160 | 160 | else false) | |
161 | 161 | then throw("Wrong Licence CID") | |
162 | 162 | else true | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func validateAllHash (sha256Export,sha256Licence) = if (!(validateHash(sha256Export))) | |
166 | 166 | then throw("Export Hash 64 char. max") | |
167 | 167 | else if (!(validateHash(sha256Licence))) | |
168 | 168 | then throw("Licence Hash 64 char. max") | |
169 | 169 | else true | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func validateString (str,max) = if ((size(str) == 0)) | |
173 | 173 | then throw("Field cannot be is empty") | |
174 | 174 | else if ((size(str) > max)) | |
175 | 175 | then throw((str + " is too long")) | |
176 | 176 | else true | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func validateUser (caller) = { | |
180 | 180 | let userStatus = valueOrElse(getString(userDapp, keyUserStatus(caller)), userUnregistered) | |
181 | 181 | if (if ((userStatus == userUnregistered)) | |
182 | 182 | then true | |
183 | 183 | else (userStatus == userAllowed)) | |
184 | 184 | then "Register this account first with \"Account\" tab" | |
185 | 185 | else if ((userStatus == userSuspended)) | |
186 | 186 | then "Account suspended" | |
187 | 187 | else if ((userStatus == userRemoved)) | |
188 | 188 | then "Account removed" | |
189 | 189 | else "" | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func setLIcence (cidLicence,sha256Licence) = { | |
194 | 194 | let cid = if ((size(cidLicence) == 0)) | |
195 | 195 | then defaultLicence | |
196 | 196 | else cidLicence | |
197 | 197 | let hash = if ((size(sha256Licence) == 0)) | |
198 | 198 | then defaultHashLicence | |
199 | 199 | else sha256Licence | |
200 | 200 | $Tuple2(cid, hash) | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func validateArtworkData (caller,cidDisplay,cidExport,licenceCID,sha256Export,licenceHash,name,description,tags,maxmint) = { | |
205 | 205 | let checkUser = validateUser(caller) | |
206 | 206 | if ((checkUser != "")) | |
207 | 207 | then throw(checkUser) | |
208 | 208 | else if ((size(cidDisplay) == 0)) | |
209 | 209 | then throw("Display CID cannot be empty") | |
210 | 210 | else if (!(validateAllCID(cidDisplay, cidExport, licenceCID))) | |
211 | 211 | then throw("Problem with CID") | |
212 | 212 | else if (!(validateAllHash(sha256Export, licenceHash))) | |
213 | 213 | then throw("Problem with Hashes") | |
214 | 214 | else if (!(validateString(name, 100))) | |
215 | 215 | then throw("100 Char. max name") | |
216 | 216 | else if (!(validateString(description, 1000))) | |
217 | 217 | then throw("1000 Char. max description") | |
218 | 218 | else if ((size(split(tags, ",")) > 5)) | |
219 | 219 | then throw("5 tags max.") | |
220 | 220 | else if ((maxmint > 10)) | |
221 | 221 | then throw("10 editions max per artwork") | |
222 | 222 | else "" | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | - | func | |
226 | + | func isPayment (i) = if ((size(i.payments) == 0)) | |
227 | 227 | then throw("No payment attached") | |
228 | 228 | else { | |
229 | - | let payment = value( | |
229 | + | let payment = value(i.payments[0]) | |
230 | 230 | let amount = value(payment.amount) | |
231 | - | let assetId = if (if (isDefined(payment.assetId)) | |
232 | - | then (payment.assetId == signAssetId) | |
233 | - | else false) | |
234 | - | then payment.assetId | |
235 | - | else throw("Only SIGN token accepted as transaction fee") | |
236 | - | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
237 | - | if ((amount != currentCertificationPrice)) | |
238 | - | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
239 | - | else $Tuple2(amount, assetId) | |
231 | + | $Tuple2(payment, amount) | |
240 | 232 | } | |
241 | 233 | ||
242 | 234 | ||
243 | - | func isArtMinted (addressToUse,artId) = match getInteger(this, keyArtIssued(addressToUse, artId)) { | |
235 | + | func validatePayment (i) = { | |
236 | + | let $t089028938 = isPayment(i) | |
237 | + | let payment = $t089028938._1 | |
238 | + | let amount = $t089028938._2 | |
239 | + | let assetId = if (if (isDefined(payment.assetId)) | |
240 | + | then (payment.assetId == signAssetId) | |
241 | + | else false) | |
242 | + | then payment.assetId | |
243 | + | else throw("Only SIGN token accepted as transaction fee") | |
244 | + | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
245 | + | if ((amount != currentCertificationPrice)) | |
246 | + | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
247 | + | else $Tuple2(amount, assetId) | |
248 | + | } | |
249 | + | ||
250 | + | ||
251 | + | func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) { | |
244 | 252 | case b: Int => | |
245 | 253 | if ((b != 0)) | |
246 | 254 | then true | |
247 | 255 | else false | |
248 | 256 | case _ => | |
249 | 257 | false | |
250 | 258 | } | |
251 | 259 | ||
252 | 260 | ||
253 | - | func validatePriceAssetId (invoke,priceAssetId,artworkPrice) = { | |
254 | - | let payment = value(invoke.payments[0]) | |
255 | - | let amount = value(payment.amount) | |
261 | + | func validatePriceAssetId (i,priceAssetId,artworkPrice) = { | |
262 | + | let $t096389674 = isPayment(i) | |
263 | + | let payment = $t096389674._1 | |
264 | + | let amount = $t096389674._2 | |
256 | 265 | let assetId = if (!(isDefined(payment.assetId))) | |
257 | 266 | then unit | |
258 | 267 | else if (if ((size(priceAssetId) > 0)) | |
259 | 268 | then (toBase58String(value(payment.assetId)) == priceAssetId) | |
260 | 269 | else false) | |
261 | 270 | then payment.assetId | |
262 | 271 | else throw("Wrong asset id") | |
263 | 272 | if (if ((assetId == unit)) | |
264 | 273 | then (priceAssetId != "") | |
265 | 274 | else false) | |
266 | 275 | then throw("Wrong asset id") | |
267 | 276 | else if ((artworkPrice != amount)) | |
268 | 277 | then throw("Payment don't match") | |
269 | 278 | else $Tuple2(amount, assetId) | |
270 | 279 | } | |
271 | 280 | ||
272 | 281 | ||
273 | - | func acceptedAssetIds (assetId) = if (if (if ((assetId != toBase58String(signAssetId))) | |
282 | + | func acceptedAssetIds (assetId) = if (if (if (if ((assetId != toBase58String(signAssetId))) | |
274 | 283 | then (assetId != toBase58String(wavesAssetId)) | |
284 | + | else false) | |
285 | + | then (assetId != "WAVES") | |
275 | 286 | else false) | |
276 | 287 | then (assetId != toBase58String(usdnAssetId)) | |
277 | 288 | else false) | |
278 | 289 | then throw("Only SIGN, USDN or WAVES accepted") | |
279 | 290 | else true | |
280 | 291 | ||
281 | 292 | ||
282 | 293 | func validateMinSell (assetId,price) = { | |
283 | 294 | let minSellWaves = if (unitTest) | |
284 | 295 | then 1 | |
285 | 296 | else getIntegerByKeyFromOracle("waves_min_sell") | |
286 | 297 | let minSellUsdn = 1000000 | |
287 | 298 | let minSellSign = if (unitTest) | |
288 | 299 | then 1 | |
289 | 300 | else (getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId))) * 2) | |
290 | 301 | if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
291 | 302 | then (minSellUsdn > price) | |
292 | 303 | else false) | |
293 | 304 | then (price != 0) | |
294 | 305 | else false) | |
295 | 306 | then true | |
296 | 307 | else if (if ((assetId == toBase58String(signAssetId))) | |
297 | 308 | then (minSellSign > price) | |
298 | 309 | else false) | |
299 | 310 | then (price != 0) | |
300 | 311 | else false) | |
301 | 312 | then true | |
302 | 313 | else if (if ((assetId == toBase58String(wavesAssetId))) | |
303 | 314 | then (minSellWaves > price) | |
304 | 315 | else false) | |
305 | 316 | then (price != 0) | |
306 | 317 | else false) | |
307 | 318 | then throw("Wrong minimum sell price") | |
308 | 319 | else true | |
309 | 320 | } | |
310 | 321 | ||
311 | 322 | ||
312 | - | @Callable(invoke) | |
313 | - | func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning)) | |
323 | + | func getPriceAssetIdFromBid (bidDataKey) = { | |
324 | + | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
325 | + | if ((bidData == "")) | |
326 | + | then throw("Bid not found") | |
327 | + | else { | |
328 | + | let bidDataArr = split(bidData, "_") | |
329 | + | let bidAmount = parseIntValue(bidDataArr[1]) | |
330 | + | let bidAssetId = if ((bidDataArr[0] == "WAVES")) | |
331 | + | then unit | |
332 | + | else fromBase58String(bidDataArr[0]) | |
333 | + | if ((0 >= bidAmount)) | |
334 | + | then throw("Wrong amount") | |
335 | + | else $Tuple2(bidAmount, bidAssetId) | |
336 | + | } | |
337 | + | } | |
338 | + | ||
339 | + | ||
340 | + | func idCallerDate (i) = if (!(dappRunning)) | |
314 | 341 | then throw(maintenanceMSG) | |
315 | - | else { | |
316 | - | let artId = toBase58String(invoke.transactionId) | |
317 | - | let timestamp = lastBlock.timestamp | |
318 | - | let caller = toBase58String(invoke.caller.bytes) | |
319 | - | if (!(validateHash(sha256Hash))) | |
320 | - | then throw("Hash should be 64 characters maximum") | |
321 | - | else { | |
322 | - | let $t01151411583 = setLIcence(cidLicence, sha256Licence) | |
323 | - | let licenceCID = $t01151411583._1 | |
324 | - | let licenceHash = $t01151411583._2 | |
325 | - | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint) | |
326 | - | if ((validateArtwork != "")) | |
327 | - | then throw("Something went wrong!") | |
328 | - | else { | |
329 | - | let $t01181111858 = validatePayment(invoke) | |
330 | - | let amount = $t01181111858._1 | |
331 | - | let assetId = $t01181111858._2 | |
332 | - | if (!(isDefined(amount))) | |
333 | - | then throw("Something went wrong") | |
334 | - | else { | |
335 | - | let entryExist = getStringByKey(keyArtTxidByHashOwner(sha256Hash, caller)) | |
336 | - | if ((entryExist != "")) | |
337 | - | then throw("You already added it") | |
338 | - | else { | |
339 | - | let hashExist = getStringByKey(keyArtOwnerByHash(sha256Hash)) | |
340 | - | if ((hashExist != "")) | |
341 | - | then throw("Hash already registered") | |
342 | - | else { | |
343 | - | let isSignCertified = checkSignCertificate(signID, caller, sha256Hash) | |
344 | - | if (!(isSignCertified)) | |
345 | - | then throw("Sign Certificate not found for this address.") | |
346 | - | else [StringEntry(keyArtOwnerByHash(sha256Hash), caller), StringEntry(keyArtTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyArtDate(caller, artId), timestamp), StringEntry(keyArtName(caller, artId), name), StringEntry(keyArtDesc(caller, artId), description), StringEntry(keyArtDisplayCid(caller, artId), cidDisplay), StringEntry(keyArtExportCid(caller, artId), cidExport), StringEntry(keyArtExportHash(caller, artId), sha256Export), StringEntry(keyArtLicenceHash(caller, artId), licenceHash), StringEntry(keyArtLicenceCid(caller, artId), licenceCID), StringEntry(keyArtType(caller, artId), type), StringEntry(keyArtTags(caller, artId), tags), IntegerEntry(keyArtMaxMint(caller, artId), maxmint), StringEntry(keyArtSignID(caller, artId), signID), IntegerEntry(keyArtIssued(caller, artId), 0), BooleanEntry(keyArtOnSale(caller, artId), false), StringEntry(keyArtArtidBySignid(caller, signID), artId), StringEntry(keyArtHashByTxidAddr(caller, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
347 | - | } | |
348 | - | } | |
349 | - | } | |
350 | - | } | |
351 | - | } | |
352 | - | } | |
342 | + | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
343 | + | ||
344 | + | ||
345 | + | func buyMint (i,artId,issuer,bidId,bidOwner) = { | |
346 | + | let $t01177511813 = idCallerDate(i) | |
347 | + | let id = $t01177511813._1 | |
348 | + | let caller = $t01177511813._2 | |
349 | + | let date = $t01177511813._3 | |
350 | + | let totalNFT = getIntegerByKey("total_nft_issued") | |
351 | + | let signID = getStringByKey(keySignID(issuer, artId)) | |
352 | + | let artworkName = getStringByKey(keyName(issuer, artId)) | |
353 | + | if ((artworkName == "")) | |
354 | + | then throw("Art doesn't exist") | |
355 | + | else { | |
356 | + | let isOnSale = getBooleanByKey(keyOnSale(issuer, artId)) | |
357 | + | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
358 | + | let artworkPrice = getIntegerByKey(keyPrice(issuer, artId)) | |
359 | + | let priceAssetId = getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
360 | + | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
361 | + | let isBid = if (if (if ((caller == issuer)) | |
362 | + | then (bidOwner != "") | |
363 | + | else false) | |
364 | + | then (bidId != "") | |
365 | + | else false) | |
366 | + | then true | |
367 | + | else false | |
368 | + | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
369 | + | if (if (if ((0 >= artworkPrice)) | |
370 | + | then true | |
371 | + | else !(isOnSale)) | |
372 | + | then true | |
373 | + | else (0 >= maxCanSell)) | |
374 | + | then throw("Art not for sale") | |
375 | + | else { | |
376 | + | let $t01266012789 = if (isBid) | |
377 | + | then getPriceAssetIdFromBid(bidDataKey) | |
378 | + | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
379 | + | let amount = $t01266012789._1 | |
380 | + | let assetId = $t01266012789._2 | |
381 | + | let isWhitelisted = checkWhitelist(issuer) | |
382 | + | let cut = if ((isWhitelisted > height)) | |
383 | + | then 0 | |
384 | + | else if ((priceAssetId == toBase58String(signAssetId))) | |
385 | + | then signCut | |
386 | + | else usdnWaveCut | |
387 | + | let amountForSign = fraction(amount, cut, 100) | |
388 | + | let amountForCreator = (amount - amountForSign) | |
389 | + | if ((amountSold == maxCanSell)) | |
390 | + | then throw("Art sold out") | |
391 | + | else { | |
392 | + | let newAmountSold = (amountSold + 1) | |
393 | + | let issueMeta = ((((((((((("Creator: " + issuer) + ", | |
394 | + | ArtID: ") + artId) + ", | |
395 | + | SignID: ") + signID) + ", | |
396 | + | Artwork name: ") + artworkName) + ", | |
397 | + | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
398 | + | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
399 | + | let idNFT = calculateAssetId(issueNFT) | |
400 | + | let sellStatus = if ((newAmountSold == maxCanSell)) | |
401 | + | then false | |
402 | + | else true | |
403 | + | let receiveNFT = if (if (if ((caller == issuer)) | |
404 | + | then (bidOwner != "") | |
405 | + | else false) | |
406 | + | then (bidId != "") | |
407 | + | else false) | |
408 | + | then addressFromStringValue(bidOwner) | |
409 | + | else i.caller | |
410 | + | let buyRes = [IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId), ScriptTransfer(receiveNFT, 1, idNFT)] | |
411 | + | let assetIdBid = if (!(isDefined(assetId))) | |
412 | + | then "WAVES" | |
413 | + | else toBase58String(value(assetId)) | |
414 | + | let getBidData = getStringByKey((bidDataKey + "_OPEN")) | |
415 | + | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
416 | + | let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((getBidData + "_") + toString(date))) | |
417 | + | let soldValue = if (!(isBid)) | |
418 | + | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
419 | + | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
420 | + | let soldData = StringEntry(((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer), soldValue) | |
421 | + | if (isBid) | |
422 | + | then [soldData, bidUpdate, bidDelOld] :: buyRes | |
423 | + | else soldData :: buyRes | |
424 | + | } | |
425 | + | } | |
426 | + | } | |
427 | + | } | |
428 | + | ||
429 | + | ||
430 | + | @Callable(i) | |
431 | + | func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = { | |
432 | + | let $t01581515856 = idCallerDate(i) | |
433 | + | let artId = $t01581515856._1 | |
434 | + | let caller = $t01581515856._2 | |
435 | + | let date = $t01581515856._3 | |
436 | + | if (!(validateHash(sha256Hash))) | |
437 | + | then throw("Hash should be 64 characters maximum") | |
438 | + | else { | |
439 | + | let $t01595716026 = setLIcence(cidLicence, sha256Licence) | |
440 | + | let licenceCID = $t01595716026._1 | |
441 | + | let licenceHash = $t01595716026._2 | |
442 | + | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint) | |
443 | + | if ((validateArtwork != "")) | |
444 | + | then throw("Something went wrong!") | |
445 | + | else { | |
446 | + | let $t01625416296 = validatePayment(i) | |
447 | + | let amount = $t01625416296._1 | |
448 | + | let assetId = $t01625416296._2 | |
449 | + | if (!(isDefined(amount))) | |
450 | + | then throw("Something went wrong") | |
451 | + | else { | |
452 | + | let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller)) | |
453 | + | if ((entryExist != "")) | |
454 | + | then throw("You already added it") | |
455 | + | else { | |
456 | + | let hashExist = getStringByKey(keyOwnerByHash(sha256Hash)) | |
457 | + | if ((hashExist != "")) | |
458 | + | then throw("Hash already registered") | |
459 | + | else { | |
460 | + | let isSignCertified = checkSignCertificate(signID, caller, sha256Hash) | |
461 | + | if (!(isSignCertified)) | |
462 | + | then throw("Sign Certificate not found for this address.") | |
463 | + | 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(keyExportCid(caller, artId), cidExport), StringEntry(keyExportHash(caller, artId), sha256Export), StringEntry(keyLicenceHash(caller, artId), licenceHash), StringEntry(keyLicenceCid(caller, artId), licenceCID), StringEntry(keyType(caller, artId), type), StringEntry(keyTags(caller, artId), tags), IntegerEntry(keyMaxMint(caller, artId), maxmint), StringEntry(keySignID(caller, artId), signID), IntegerEntry(keyIssued(caller, artId), 0), BooleanEntry(keyOnSale(caller, artId), false), StringEntry(keyidBySignid(caller, signID), artId), StringEntry(keyHashByTxidAddr(caller, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
464 | + | } | |
465 | + | } | |
466 | + | } | |
467 | + | } | |
468 | + | } | |
469 | + | } | |
353 | 470 | ||
354 | 471 | ||
355 | 472 | ||
356 | - | @Callable( | |
473 | + | @Callable(i) | |
357 | 474 | func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning)) | |
358 | 475 | then throw(maintenanceMSG) | |
359 | 476 | else { | |
360 | - | let updateId = toBase58String(invoke.transactionId) | |
361 | - | let caller = toBase58String(invoke.caller.bytes) | |
362 | - | let $t01471314782 = setLIcence(cidLicence, sha256Licence) | |
363 | - | let licenceCID = $t01471314782._1 | |
364 | - | let licenceHash = $t01471314782._2 | |
477 | + | let caller = toBase58String(i.caller.bytes) | |
478 | + | let $t01901719086 = setLIcence(cidLicence, sha256Licence) | |
479 | + | let licenceCID = $t01901719086._1 | |
480 | + | let licenceHash = $t01901719086._2 | |
365 | 481 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint) | |
366 | 482 | if ((validateArtwork != "")) | |
367 | 483 | then throw("Something went wrong!") | |
368 | 484 | else { | |
369 | - | let entryExist = getStringByKey( | |
485 | + | let entryExist = getStringByKey(keyName(caller, txid)) | |
370 | 486 | if ((entryExist == "")) | |
371 | 487 | then throw("Entry not found") | |
372 | 488 | else { | |
373 | - | let flag = getStringByKey( | |
489 | + | let flag = getStringByKey(keyFlag(caller, txid)) | |
374 | 490 | if ((flag == "ILLEGAL")) | |
375 | 491 | then throw("Cannot update ILLEGAL artwork") | |
376 | 492 | else if (!(isArtMinted(caller, txid))) | |
377 | - | then [StringEntry( | |
493 | + | then [StringEntry(keyName(caller, txid), name), StringEntry(keyDesc(caller, txid), description), StringEntry(keyDisplayCid(caller, txid), cidDisplay), StringEntry(keyExportCid(caller, txid), cidExport), StringEntry(keyExportHash(caller, txid), sha256Export), StringEntry(keyLicenceCid(caller, txid), licenceCID), StringEntry(keyLicenceHash(caller, txid), licenceHash), IntegerEntry(keyMaxMint(caller, txid), maxmint), StringEntry(keyTags(caller, txid), tags), StringEntry(keyType(caller, txid), type)] | |
378 | 494 | else throw("Already minted") | |
379 | 495 | } | |
380 | 496 | } | |
381 | 497 | } | |
382 | 498 | ||
383 | 499 | ||
384 | 500 | ||
385 | - | @Callable( | |
501 | + | @Callable(i) | |
386 | 502 | func flagArtwork (artId,addr,flag) = { | |
387 | - | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
388 | - | let id = toBase58String(invoke.transactionId) | |
503 | + | let $t02055920592 = idCallerDate(i) | |
504 | + | let id = $t02055920592._1 | |
505 | + | let caller = $t02055920592._2 | |
389 | 506 | if (containsElement([chris, joep, toString(this)], caller)) | |
390 | 507 | then if ((flag == "CONSENT")) | |
391 | - | then [StringEntry( | |
508 | + | then [StringEntry(keyFlag(addr, artId), flag)] | |
392 | 509 | else if ((flag == "")) | |
393 | - | then [StringEntry( | |
510 | + | then [StringEntry(keyFlag(addr, artId), flag)] | |
394 | 511 | else if ((flag == "CHANGE_REQUIRED")) | |
395 | - | then [StringEntry(keyArtFlag(addr, artId), flag)] | |
396 | - | else if ((flag == "ILLEGAL")) | |
397 | - | then [StringEntry(keyArtFlag(addr, artId), flag), StringEntry(keyArtName(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyArtDesc(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyArtDisplayCid(addr, artId), ""), StringEntry(keyArtExportCid(addr, artId), ""), StringEntry(keyArtLicenceCid(addr, artId), "")] | |
512 | + | then [StringEntry(keyFlag(addr, artId), flag)] | |
513 | + | else if (if ((flag == "ILLEGAL")) | |
514 | + | then containsElement([chris, toString(this)], caller) | |
515 | + | else false) | |
516 | + | then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyName(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyDesc(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyDisplayCid(addr, artId), ""), StringEntry(keyExportCid(addr, artId), ""), StringEntry(keyLicenceCid(addr, artId), "")] | |
398 | 517 | else throw(("Unknow status " + flag)) | |
399 | 518 | else throw("You are not allowed") | |
400 | 519 | } | |
401 | 520 | ||
402 | 521 | ||
403 | 522 | ||
404 | - | @Callable( | |
523 | + | @Callable(i) | |
405 | 524 | func deleteArtwork (artId,addr) = { | |
406 | - | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
407 | - | let id = toBase58String(invoke.transactionId) | |
408 | - | let addressToUse = if (containsElement([chris, joep, toString(this)], caller)) | |
525 | + | let $t02161121644 = idCallerDate(i) | |
526 | + | let id = $t02161121644._1 | |
527 | + | let caller = $t02161121644._2 | |
528 | + | let addrToUse = if (containsElement([chris, joep, toString(this)], caller)) | |
409 | 529 | then addr | |
410 | 530 | else caller | |
411 | - | let entryExist = getStringByKey( | |
531 | + | let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address") | |
412 | 532 | if ((entryExist == "")) | |
413 | 533 | then throw("No art matching for this address") | |
414 | 534 | else { | |
415 | - | let sha256Hash = getStringByKey( | |
535 | + | let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId)) | |
416 | 536 | if ((sha256Hash == "")) | |
417 | 537 | then throw("No art hash matching for this address") | |
418 | 538 | else { | |
419 | - | let signID = getStringByKey( | |
539 | + | let signID = getStringByKey(keySignID(addrToUse, artId)) | |
420 | 540 | if ((signID == "")) | |
421 | 541 | then throw("No SIGN ID matching") | |
422 | 542 | else { | |
423 | - | let dataToDelete = [DeleteEntry( | |
424 | - | if (!(isArtMinted( | |
543 | + | let dataToDelete = [DeleteEntry(keyDate(addrToUse, artId)), DeleteEntry(keyName(addrToUse, artId)), DeleteEntry(keyDesc(addrToUse, artId)), DeleteEntry(keyDisplayCid(addrToUse, artId)), DeleteEntry(keyExportCid(addrToUse, artId)), DeleteEntry(keyExportHash(addrToUse, artId)), DeleteEntry(keyLicenceHash(addrToUse, artId)), DeleteEntry(keyLicenceCid(addrToUse, artId)), DeleteEntry(keyType(addrToUse, artId)), DeleteEntry(keyTags(addrToUse, artId)), DeleteEntry(keyMaxMint(addrToUse, artId)), DeleteEntry(keySignID(addrToUse, artId)), DeleteEntry(keyIssued(addrToUse, artId)), DeleteEntry(keyOnSale(addrToUse, artId)), DeleteEntry(keyFlag(addr, artId)), DeleteEntry(keyPrice(addr, artId)), DeleteEntry(keyAssetIdAccepted(addr, artId)), DeleteEntry(keyOwnerByHash(sha256Hash)), DeleteEntry(keyidBySignid(addrToUse, signID)), DeleteEntry(keyTxidByHashOwner(sha256Hash, addrToUse))] | |
544 | + | if (!(isArtMinted(addrToUse, artId))) | |
425 | 545 | then if (!(dappRunning)) | |
426 | 546 | then throw(maintenanceMSG) | |
427 | 547 | else dataToDelete | |
428 | 548 | else if (containsElement([chris, toString(this)], caller)) | |
429 | 549 | then dataToDelete | |
430 | 550 | else throw("Art already minted, you cannot delete it") | |
431 | 551 | } | |
432 | 552 | } | |
433 | 553 | } | |
434 | 554 | } | |
435 | 555 | ||
436 | 556 | ||
437 | 557 | ||
438 | - | @Callable(invoke) | |
439 | - | func sellArtwork (artId,price,maxMint,assetId) = if (!(dappRunning)) | |
440 | - | then throw(maintenanceMSG) | |
441 | - | else { | |
442 | - | let id = toBase58String(invoke.transactionId) | |
443 | - | let caller = toBase58String(invoke.caller.bytes) | |
444 | - | let sellDate = lastBlock.timestamp | |
445 | - | let artworkName = getStringByKey(keyArtName(caller, artId)) | |
446 | - | if ((artworkName == "")) | |
447 | - | then throw("This art doesn't match match your account") | |
448 | - | else { | |
449 | - | let exportCID = getStringByKey(keyArtExportCid(caller, artId)) | |
450 | - | if ((size(split(exportCID, "/")[0]) != 59)) | |
451 | - | then throw("You cannot sell art with no export file") | |
452 | - | else { | |
453 | - | let exportHash = getStringByKey(keyArtExportHash(caller, artId)) | |
454 | - | if ((size(exportHash) != 64)) | |
455 | - | then throw("You cannot sell art with no export hash") | |
456 | - | else if (!(acceptedAssetIds(assetId))) | |
457 | - | then throw("Something went wrong!") | |
458 | - | else if (!(validateMinSell(assetId, price))) | |
459 | - | then throw("Something went wrong!") | |
460 | - | else { | |
461 | - | let checkUser = validateUser(caller) | |
462 | - | if ((checkUser != "")) | |
463 | - | then throw(checkUser) | |
464 | - | else { | |
465 | - | let amountSold = getIntegerByKey(keyArtIssued(caller, artId)) | |
466 | - | let maxCanSell = getIntegerByKey(keyArtMaxMint(caller, artId)) | |
467 | - | if ((maxMint > 10)) | |
468 | - | then throw("10 editions max per artwork") | |
469 | - | else if (if ((amountSold != 0)) | |
470 | - | then (amountSold == maxCanSell) | |
558 | + | @Callable(i) | |
559 | + | func sellArtwork (artId,price,maxMint,assetId) = { | |
560 | + | let $t02401024043 = idCallerDate(i) | |
561 | + | let id = $t02401024043._1 | |
562 | + | let caller = $t02401024043._2 | |
563 | + | let artworkName = getStringByKey(keyName(caller, artId)) | |
564 | + | if ((artworkName == "")) | |
565 | + | then throw("This art doesn't match your account") | |
566 | + | else { | |
567 | + | let exportCID = getStringByKey(keyExportCid(caller, artId)) | |
568 | + | if ((size(split(exportCID, "/")[0]) != 59)) | |
569 | + | then throw("You cannot sell art with no export file") | |
570 | + | else if (!(acceptedAssetIds(assetId))) | |
571 | + | then throw("Something went wrong!") | |
572 | + | else if (!(validateMinSell(assetId, price))) | |
573 | + | then throw("Something went wrong!") | |
574 | + | else { | |
575 | + | let checkUser = validateUser(caller) | |
576 | + | if ((checkUser != "")) | |
577 | + | then throw(checkUser) | |
578 | + | else { | |
579 | + | let amountSold = getIntegerByKey(keyIssued(caller, artId)) | |
580 | + | let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId)) | |
581 | + | if ((maxMint > 10)) | |
582 | + | then throw("10 editions max per artwork") | |
583 | + | else if (if ((amountSold != 0)) | |
584 | + | then (amountSold == maxCanSell) | |
585 | + | else false) | |
586 | + | then throw("Max edition reached.") | |
587 | + | else if (if ((amountSold > 0)) | |
588 | + | then (maxCanSell != maxMint) | |
589 | + | else false) | |
590 | + | then throw("Cannot change maximum issuable anymore") | |
591 | + | else { | |
592 | + | let sellStatus = if (if ((price > 0)) | |
593 | + | then (maxMint > 0) | |
471 | 594 | else false) | |
472 | - | then throw("Max edition reached.") | |
473 | - | else if (if ((amountSold > 0)) | |
474 | - | then (maxCanSell != maxMint) | |
475 | - | else false) | |
476 | - | then throw("Cannot change maximum issuable anymore") | |
477 | - | else { | |
478 | - | let sellStatus = if (if ((price > 0)) | |
479 | - | then (maxMint > 0) | |
480 | - | else false) | |
481 | - | then true | |
482 | - | else false | |
483 | - | [BooleanEntry(keyArtOnSale(caller, artId), sellStatus), IntegerEntry(keyArtPrice(caller, artId), price), IntegerEntry(keyArtMaxMint(caller, artId), maxMint), StringEntry(keyArtAssetIdAccepted(caller, artId), assetId)] | |
484 | - | } | |
485 | - | } | |
486 | - | } | |
487 | - | } | |
488 | - | } | |
489 | - | } | |
595 | + | then true | |
596 | + | else false | |
597 | + | [BooleanEntry(keyOnSale(caller, artId), sellStatus), IntegerEntry(keyPrice(caller, artId), price), IntegerEntry(keyMaxMint(caller, artId), maxMint), StringEntry(keyAssetIdAccepted(caller, artId), assetId)] | |
598 | + | } | |
599 | + | } | |
600 | + | } | |
601 | + | } | |
602 | + | } | |
490 | 603 | ||
491 | 604 | ||
492 | 605 | ||
493 | - | @Callable(invoke) | |
494 | - | func buyArtwork (artId,issuer) = if (!(dappRunning)) | |
495 | - | then throw(maintenanceMSG) | |
496 | - | else { | |
497 | - | let id = toBase58String(invoke.transactionId) | |
498 | - | let caller = toBase58String(invoke.caller.bytes) | |
499 | - | let totalNFT = getIntegerByKey("total_nft_issued") | |
500 | - | let signID = getStringByKey(keyArtSignID(issuer, artId)) | |
501 | - | let artworkName = getStringByKey(keyArtName(issuer, artId)) | |
502 | - | if ((artworkName == "")) | |
503 | - | then throw("Art doesn't exist") | |
606 | + | @Callable(i) | |
607 | + | func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "") | |
608 | + | ||
609 | + | ||
610 | + | ||
611 | + | @Callable(i) | |
612 | + | func setBid (artId,issuer) = { | |
613 | + | let $t02583925877 = idCallerDate(i) | |
614 | + | let id = $t02583925877._1 | |
615 | + | let caller = $t02583925877._2 | |
616 | + | let date = $t02583925877._3 | |
617 | + | let $t02588225918 = isPayment(i) | |
618 | + | let payment = $t02588225918._1 | |
619 | + | let amount = $t02588225918._2 | |
620 | + | let assetId = if (!(isDefined(payment.assetId))) | |
621 | + | then "WAVES" | |
622 | + | else toBase58String(value(payment.assetId)) | |
623 | + | if (!(acceptedAssetIds(assetId))) | |
624 | + | then throw("Something went wrong!") | |
625 | + | else if (!(validateMinSell(assetId, amount))) | |
626 | + | then throw("Something went wrong!") | |
504 | 627 | else { | |
505 | - | let displayCID = getStringByKey(keyArtDisplayCid(issuer, artId)) | |
506 | - | let exportCID = getStringByKey(keyArtExportCid(issuer, artId)) | |
507 | - | let exportHash = getStringByKey(keyArtExportHash(issuer, artId)) | |
508 | - | let licenceCID = getStringByKey(keyArtLicenceCid(issuer, artId)) | |
509 | - | let licenceHash = getStringByKey(keyArtLicenceHash(issuer, artId)) | |
510 | - | let description = take(getStringByKey(keyArtDesc(issuer, artId)), 50) | |
511 | - | let isOnSale = getBooleanByKey(keyArtOnSale(issuer, artId)) | |
512 | - | let amountSold = getIntegerByKey(keyArtIssued(issuer, artId)) | |
513 | - | let artworkPrice = getIntegerByKey(keyArtPrice(issuer, artId)) | |
514 | - | let priceAssetId = getStringByKey(keyArtAssetIdAccepted(issuer, artId)) | |
515 | - | let sourceHash = getStringByKey(keyArtHashByTxidAddr(issuer, artId)) | |
516 | - | let maxCanSell = getIntegerByKey(keyArtMaxMint(issuer, artId)) | |
517 | - | if (if (if ((0 >= artworkPrice)) | |
518 | - | then true | |
519 | - | else !(isOnSale)) | |
520 | - | then true | |
521 | - | else (0 >= maxCanSell)) | |
522 | - | then throw("Art not for sale") | |
523 | - | else { | |
524 | - | let $t02317523255 = validatePriceAssetId(invoke, priceAssetId, artworkPrice) | |
525 | - | let amount = $t02317523255._1 | |
526 | - | let assetId = $t02317523255._2 | |
527 | - | let isWhitelisted = checkWhitelist(issuer) | |
528 | - | let cut = if ((isWhitelisted > height)) | |
529 | - | then 0 | |
530 | - | else if ((priceAssetId == toBase58String(signAssetId))) | |
531 | - | then signCut | |
532 | - | else usdnWaveCut | |
533 | - | let amountForSign = fraction(amount, cut, 100) | |
534 | - | let amountForCreator = (amount - amountForSign) | |
535 | - | if ((amountSold == maxCanSell)) | |
536 | - | then throw("Art sold out") | |
537 | - | else { | |
538 | - | let newAmountSold = (amountSold + 1) | |
539 | - | let entryDate = lastBlock.timestamp | |
540 | - | let issueMeta = ((((((((((((((((((((((((((("Creator: " + issuer) + ", | |
541 | - | ArtID: ") + artId) + ", | |
542 | - | SignID: ") + signID) + ", | |
543 | - | Artwork name: ") + artworkName) + ", | |
544 | - | Artwork description: ") + description) + ", | |
545 | - | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) + ", | |
546 | - | Max issuable: ") + toString(maxCanSell)) + ", | |
547 | - | Source hash: ") + sourceHash) + ", | |
548 | - | Display cid: ") + displayCID) + ", | |
549 | - | Export cid: ") + exportCID) + ", | |
550 | - | Export hash: ") + exportHash) + ", | |
551 | - | Licence cid: ") + licenceCID) + ", | |
552 | - | Licence hash: ") + licenceHash) | |
553 | - | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
554 | - | let idNFT = calculateAssetId(issueNFT) | |
555 | - | let sellStatus = if ((newAmountSold == maxCanSell)) | |
556 | - | then false | |
557 | - | else true | |
558 | - | [IntegerEntry(keyArtIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)), StringEntry(((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer), ((((((((((caller + "_") + toString(entryDate)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyArtOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId), ScriptTransfer(invoke.caller, 1, idNFT)] | |
559 | - | } | |
560 | - | } | |
628 | + | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
629 | + | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
630 | + | if ((amountSold >= maxCanSell)) | |
631 | + | then throw("Sold out, you cannot bid") | |
632 | + | else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date)))] | |
561 | 633 | } | |
562 | - | } | |
634 | + | } | |
635 | + | ||
636 | + | ||
637 | + | ||
638 | + | @Callable(i) | |
639 | + | func acceptBid (artId,issuer,bidId,bidOwner) = { | |
640 | + | let caller = toBase58String(i.caller.bytes) | |
641 | + | if ((caller != issuer)) | |
642 | + | then throw("You cannot do this action") | |
643 | + | else buyMint(i, artId, issuer, bidId, bidOwner) | |
644 | + | } | |
645 | + | ||
646 | + | ||
647 | + | ||
648 | + | @Callable(i) | |
649 | + | func cancelBid (artId,issuer,bidId,bidOwner) = { | |
650 | + | let $t02689926937 = idCallerDate(i) | |
651 | + | let id = $t02689926937._1 | |
652 | + | let caller = $t02689926937._2 | |
653 | + | let date = $t02689926937._3 | |
654 | + | if (if ((caller != bidOwner)) | |
655 | + | then (caller != issuer) | |
656 | + | else false) | |
657 | + | then throw("You cannot do this action") | |
658 | + | else { | |
659 | + | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
660 | + | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
661 | + | if ((bidData == "")) | |
662 | + | then throw("Bid not found") | |
663 | + | else { | |
664 | + | let bidDataArr = split(bidData, "_") | |
665 | + | let assetId = if ((bidDataArr[0] == "WAVES")) | |
666 | + | then unit | |
667 | + | else fromBase58String(bidDataArr[0]) | |
668 | + | let bidStatus = if ((caller == bidOwner)) | |
669 | + | then "CANCELED" | |
670 | + | else "REJECTED" | |
671 | + | [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), ScriptTransfer(Address(fromBase58String(bidOwner)), parseIntValue(bidDataArr[1]), assetId)] | |
672 | + | } | |
673 | + | } | |
674 | + | } | |
563 | 675 | ||
564 | 676 | ||
565 | 677 | ||
566 | 678 | @Callable(i) | |
567 | 679 | func deleteEntry (entry) = { | |
568 | 680 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
569 | 681 | if ((caller == chris)) | |
570 | 682 | then [DeleteEntry(entry)] | |
571 | 683 | else throw("no") | |
572 | 684 | } | |
573 | 685 | ||
574 | 686 |
github/deemru/w8io/026f985 106.55 ms ◑