tx · DCujGG8XkELWk45tzZvPEXb6WPJzW7wSvdoRVRfQGN5V

3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p:  -0.01400000 Waves

2021.06.28 12:43 [1590068] smart account 3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p > SELF 0.00000000 Waves

{ "type": 13, "id": "DCujGG8XkELWk45tzZvPEXb6WPJzW7wSvdoRVRfQGN5V", "fee": 1400000, "feeAssetId": null, "timestamp": 1624873455609, "version": 2, "chainId": 84, "sender": "3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p", "senderPublicKey": "Hh3eFP2XFetZSfTxQiM1Ps96f68zi8Zh5ghhCZdjgdFs", "proofs": [ "3FERpsJhdW8z11sHcysYG7tTJXLehxZZvmF3MQX6knbx5xx3bDmdRauxn2HeGb4H1nyFmW8Qbkc6oDJ2AGvtAy8V" ], "script": "base64:AAIEAAAAAAAAAB8IAhIECgIECBIECgIBCBIFCgMIAQgSAwoBCBIDCgEIAAAAMgAAAAAIdW5pdFRlc3QHAAAAAAlvcmFjbGVGZWUJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAACHNpZ25EYXBwCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNOQzI4aFNpdnJtc1RVWGFZRDF4NkwzNjJKNFpwVW5vVGRCAAAAAAxhcnR3b3Jrc0RhcHAJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM05CeW5mYlhDMkthc3RVeGh1a2NNVWFFNThLOWNCZEI5VVkAAAAAC2ZlZVJlY2VpdmVyAgAAACMzTjFFNnRYZGRSb1ZhUmZROWRRM3ZnNUxhVzJmc2Q4SEt1YgAAAAAIdXNlckRhcHADBQAAAAh1bml0VGVzdAkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTXQ0UkdNRXlqU1dZQW9jVFBxZDU1d2RIUVFCM1BVM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JlYXRvckZlZQgFAAAADSR0MDEzNzQ4MTM4NzYAAAACXzIEAAAACG93bmVyRmVlCAUAAAANJHQwMTM3NDgxMzg3NgAAAAJfMwQAAAAMY29sbGVjdG9yTkZUCAUAAAANJHQwMTM3NDgxMzg3NgAAAAJfNAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAAB3NhbGVLZXkCAAAABV9PUEVOCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAD3NhbGUybmRfc3RhdHVzXwUAAAAJc2FsZU93bmVyAgAAAAFfBQAAAAVuZnRJZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAICAAAAFmN1cnJlbnRfb3duZXJfb25fZGFwcF8FAAAABW5mdElkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAAB3NhbGVLZXkCAAAAAV8FAAAAAmlkAgAAAAdfQ0xPU0VECQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAhzYWxlSW5mbwIAAAAIX0NMT1NFRF8JAAGkAAAAAQUAAAAEZGF0ZQIAAAABXwUAAAACaWQCAAAAAV8FAAAABmNhbGxlcgkABEwAAAACCQEAAAAOdXBkYXRlTnVtU2FsZXMAAAAACQAETAAAAAIFAAAAB3NpZ25GZWUJAARMAAAAAgUAAAAKY3JlYXRvckZlZQkABEwAAAACBQAAAAhvd25lckZlZQkABEwAAAACBQAAAAxjb2xsZWN0b3JORlQFAAAAA25pbAAAAADR2fa5", "height": 1590068, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CNJgPTSDRkBuNZPkNSPHFKyqoXD3MAtcXetXpeurLSfm Next: BYfHbe3ZnUDTCmJvdv1kjEf2dB7skXZi4q3KRrm9kBMV Diff:
OldNewDifferences
2929
3030 let creatorCut = 10
3131
32-let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true)
33-
34-let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "")
35-
3632 let userSuspended = "SUSPENDED"
3733
3834 let userRemoved = "REMOVED"
4036 let artIllegal = "ILLEGAL"
4137
4238 let artSuspended = "SUSPENDED"
39+
40+let dappRunningKey = "conf_dapp_is_running"
41+
42+let maintenanceMSGKey = "conf_maintenance_msg"
43+
44+let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
45+
46+let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
47+
48+let numSalesK = "num_sales"
4349
4450 func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error")
4551
8793 }
8894
8995
96+func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1))
97+ then (assetDetails.decimals == 0)
98+ else false)
99+ then (assetDetails.reissuable == false)
100+ else false)
101+ then (assetDetails.issuer == artworksDapp)
102+ else false
103+
104+
90105 func isSignArtNFT (id) = {
91106 let assetDetails = value(assetInfo(id))
92- if (if (if (if ((assetDetails.quantity != 1))
93- then true
94- else (assetDetails.decimals != 0))
95- then true
96- else (assetDetails.reissuable != false))
97- then true
98- else (assetDetails.issuer != artworksDapp))
99- then false
100- else true
107+ assetIsValid(assetDetails)
101108 }
102109
103110
110117 else false)
111118 then false
112119 else true
120+
121+
122+func getBidAssetId (assetId) = if ((assetId == "WAVES"))
123+ then unit
124+ else fromBase58String(assetId)
113125
114126
115127 func getSaleOwnerAndStatus (nftid) = {
125137 }
126138
127139
140+func getBidData (key) = {
141+ let bidData = getStrByK((key + "_OPEN"))
142+ if ((bidData == ""))
143+ then throw("Offer not found")
144+ else {
145+ let bidDataArr = split(bidData, "_")
146+ let assetId = getBidAssetId(bidDataArr[2])
147+ $Tuple3(bidDataArr, assetId, bidData)
148+ }
149+ }
150+
151+
152+func artIsValid (artStatus) = if ((artStatus != artIllegal))
153+ then (artStatus != artSuspended)
154+ else false
155+
156+
128157 func checkArtStatus (addr,id) = {
129158 let artStatus = getArtStrByK(keyFlag(addr, id))
130- if (if ((artStatus == artIllegal))
159+ if (artIsValid(artStatus))
131160 then true
132- else (artStatus == artSuspended))
133- then throw(("Original Artwork flagged as " + artStatus))
134- else true
161+ else throw(("Original Artwork flagged as " + artStatus))
135162 }
136163
137164
210237 }
211238
212239
240+func provideBaseData (i,nftId) = {
241+ let $t083128351 = idCallerDate(i)
242+ let id = $t083128351._1
243+ let caller = $t083128351._2
244+ let date = $t083128351._3
245+ let $t083548423 = checkNFTInfo(nftId)
246+ let isValidNFT = $t083548423._1
247+ let artId = $t083548423._2
248+ let creatorAddr = $t083548423._3
249+ let artSignID = $t083548423._4
250+ $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID)
251+ }
252+
253+
254+func updateNumSales () = {
255+ let numSales = getIntByK(numSalesK)
256+ IntegerEntry(numSalesK, (numSales + 1))
257+ }
258+
259+
260+@Callable(invoke)
261+func appRunning (isLive,message) = {
262+ let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
263+ let id = toBase58String(invoke.transactionId)
264+ if (containsElement([chris, toString(this)], caller))
265+ then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
266+ else throw("You are not allowed to change this")
267+ }
268+
269+
270+
213271 @Callable(i)
214272 func sellNFT (price,asset) = {
215- let $t077167755 = idCallerDate(i)
216- let id = $t077167755._1
217- let caller = $t077167755._2
218- let date = $t077167755._3
219- let $t077617797 = isPayment(i)
220- let payment = $t077617797._1
221- let amount = $t077617797._2
273+ let $t091379173 = isPayment(i)
274+ let payment = $t091379173._1
275+ let amount = $t091379173._2
222276 let nftId = if (if (isDefined(payment.assetId))
223277 then isSignArtNFT(value(payment.assetId))
224278 else false)
225279 then toBase58String(value(payment.assetId))
226280 else throw("Only SIGN Art NFT accepted.")
227- let $t079768045 = checkNFTInfo(nftId)
228- let isValidNFT = $t079768045._1
229- let artId = $t079768045._2
230- let creatorAddr = $t079768045._3
231- let artSignID = $t079768045._4
281+ let $t093529444 = provideBaseData(i, nftId)
282+ let id = $t093529444._1
283+ let caller = $t093529444._2
284+ let date = $t093529444._3
285+ let isValidNFT = $t093529444._4
286+ let artId = $t093529444._5
287+ let creatorAddr = $t093529444._6
288+ let artSignID = $t093529444._7
232289 if ((size(artSignID) == 0))
233290 then throw("Artwork not found on SIGN Art")
234291 else if (!(isValidNFT))
235- then throw("Something went wrong")
292+ then throw("Not a valid nft")
236293 else if (!(acceptedAssetIds(asset)))
237294 then throw("Only SIGN, USDN or WAVES accepted")
238295 else if ((price == 0))
246303
247304 @Callable(i)
248305 func updateSalePrice (nftId,price,asset) = {
249- let $t089218960 = idCallerDate(i)
250- let id = $t089218960._1
251- let caller = $t089218960._2
252- let date = $t089218960._3
253- let $t089669035 = checkNFTInfo(nftId)
254- let isValidNFT = $t089669035._1
255- let artId = $t089669035._2
256- let creatorAddr = $t089669035._3
257- let artSignID = $t089669035._4
306+ let $t01031710409 = provideBaseData(i, nftId)
307+ let id = $t01031710409._1
308+ let caller = $t01031710409._2
309+ let date = $t01031710409._3
310+ let isValidNFT = $t01031710409._4
311+ let artId = $t01031710409._5
312+ let creatorAddr = $t01031710409._6
313+ let artSignID = $t01031710409._7
258314 if ((size(artSignID) == 0))
259315 then throw("Artwork not found on SIGN Art, cancel your sale.")
260316 else if (!(isValidNFT))
261- then throw("Something went wrong")
317+ then throw("Not a valid nft")
262318 else {
263319 let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
264320 if ((saleOwner != caller))
286342
287343 @Callable(i)
288344 func cancelSale (nftId) = {
289- let $t01017410213 = idCallerDate(i)
290- let id = $t01017410213._1
291- let caller = $t01017410213._2
292- let date = $t01017410213._3
293- let $t01021910441 = checkNFTInfo(nftId)
294- let isValidNFT = $t01021910441._1
295- let artId = $t01021910441._2
296- let creatorAddr = $t01021910441._3
297- let artSignID = $t01021910441._4
345+ let $t01154911789 = provideBaseData(i, nftId)
346+ let id = $t01154911789._1
347+ let caller = $t01154911789._2
348+ let date = $t01154911789._3
349+ let isValidNFT = $t01154911789._4
350+ let artId = $t01154911789._5
351+ let creatorAddr = $t01154911789._6
352+ let artSignID = $t01154911789._7
298353 let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
299354 if ((saleOwner != caller))
300355 then throw("You don't own this NFT")
314369
315370 @Callable(i)
316371 func buyNFT (nftId) = {
317- let $t01127211311 = idCallerDate(i)
318- let id = $t01127211311._1
319- let caller = $t01127211311._2
320- let date = $t01127211311._3
321- let saleOwner = getSaleOwnerAndStatus(nftId)
322- let $t01136511434 = checkNFTInfo(nftId)
323- let isValidNFT = $t01136511434._1
324- let artId = $t01136511434._2
325- let creatorAddr = $t01136511434._3
326- let artSignID = $t01136511434._4
372+ let $t01262012712 = provideBaseData(i, nftId)
373+ let id = $t01262012712._1
374+ let caller = $t01262012712._2
375+ let date = $t01262012712._3
376+ let isValidNFT = $t01262012712._4
377+ let artId = $t01262012712._5
378+ let creatorAddr = $t01262012712._6
379+ let artSignID = $t01262012712._7
327380 if ((size(artSignID) == 0))
328381 then throw("Artwork not found on SIGN Art, cancel your sale.")
329382 else if (!(isValidNFT))
330- then throw("Something went wrong")
383+ then throw("Not a valid nft")
331384 else {
385+ let saleOwner = getSaleOwnerAndStatus(nftId)
332386 let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr)
333387 let saleInfo = getStrByK((saleKey + "_OPEN"))
334388 if ((size(saleInfo) == 0))
338392 if ((parseInt(saleInfoArray[1]) == 0))
339393 then throw("Offer only")
340394 else {
341- let $t01188611922 = isPayment(i)
342- let payment = $t01188611922._1
343- let amount = $t01188611922._2
395+ let $t01320913245 = isPayment(i)
396+ let payment = $t01320913245._1
397+ let amount = $t01320913245._2
344398 let paymentAssetStr = if (isDefined(payment.assetId))
345399 then toBase58String(value(payment.assetId))
346400 else ""
352406 let amountForSign = fraction(amount, signCut, 100)
353407 let amountForCreator = fraction(amount, creatorCut, 100)
354408 let amountForOwner = (amount - (amountForSign + amountForCreator))
355- let $t01242512553 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller)
356- let signFee = $t01242512553._1
357- let creatorFee = $t01242512553._2
358- let ownerFee = $t01242512553._3
359- let collectorNFT = $t01242512553._4
360-[DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((makeString(saleInfoArray, "_") + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), signFee, creatorFee, ownerFee, collectorNFT]
409+ let $t01374813876 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller)
410+ let signFee = $t01374813876._1
411+ let creatorFee = $t01374813876._2
412+ let ownerFee = $t01374813876._3
413+ let collectorNFT = $t01374813876._4
414+[DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), signFee, creatorFee, ownerFee, collectorNFT]
361415 }
362416 }
363417 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let unitTest = false
55
66 let oracleFee = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1"))
77
88 let signDapp = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB"))
99
1010 let artworksDapp = value(addressFromString("3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY"))
1111
1212 let feeReceiver = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
1313
1414 let userDapp = if (unitTest)
1515 then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm"))
1616 else value(addressFromString("3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj"))
1717
1818 let whitelistDapp = value(addressFromString("3N6BaV1dCB4zg43goNNHaCtvR13BcyJ5Gsq"))
1919
2020 let signAssetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
2121
2222 let usdnAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
2323
2424 let wavesAssetId = base58''
2525
2626 let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp"
2727
2828 let signCut = 3
2929
3030 let creatorCut = 10
3131
32-let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true)
33-
34-let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "")
35-
3632 let userSuspended = "SUSPENDED"
3733
3834 let userRemoved = "REMOVED"
3935
4036 let artIllegal = "ILLEGAL"
4137
4238 let artSuspended = "SUSPENDED"
39+
40+let dappRunningKey = "conf_dapp_is_running"
41+
42+let maintenanceMSGKey = "conf_maintenance_msg"
43+
44+let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
45+
46+let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
47+
48+let numSalesK = "num_sales"
4349
4450 func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error")
4551
4652
4753 func getArtStrByK (key) = valueOrElse(getString(artworksDapp, key), "")
4854
4955
5056 func getStrByK (key) = valueOrElse(getString(this, key), "")
5157
5258
5359 func getIntByK (key) = valueOrElse(getInteger(this, key), 0)
5460
5561
5662 func keyUserStatus (addr) = ("user_status_" + addr)
5763
5864
5965 func keySignID (artistAddr,artId) = ((("art_signid_" + artId) + "_") + artistAddr)
6066
6167
6268 func keyFlag (artistAddr,artId) = ((("art_flag_" + artId) + "_") + artistAddr)
6369
6470
6571 func keyNFTData (id) = ("nft_" + id)
6672
6773
6874 func getSaleKey (caller,nftId,artId,creatorAddr) = ((((((("sale2nd_info_" + caller) + "_") + nftId) + "_") + artId) + "_") + creatorAddr)
6975
7076
7177 func getIntByKFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
7278
7379
7480 let currentCertificationPrice = getIntByKFromOracle(("certification_fee_" + toBase58String(signAssetId)))
7581
7682 func idCallerDate (i) = if (!(dappRunning))
7783 then throw(maintenanceMSG)
7884 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
7985
8086
8187 func isPayment (i) = if ((size(i.payments) == 0))
8288 then throw("No payment attached")
8389 else {
8490 let payment = value(i.payments[0])
8591 let amount = value(payment.amount)
8692 $Tuple2(payment, amount)
8793 }
8894
8995
96+func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1))
97+ then (assetDetails.decimals == 0)
98+ else false)
99+ then (assetDetails.reissuable == false)
100+ else false)
101+ then (assetDetails.issuer == artworksDapp)
102+ else false
103+
104+
90105 func isSignArtNFT (id) = {
91106 let assetDetails = value(assetInfo(id))
92- if (if (if (if ((assetDetails.quantity != 1))
93- then true
94- else (assetDetails.decimals != 0))
95- then true
96- else (assetDetails.reissuable != false))
97- then true
98- else (assetDetails.issuer != artworksDapp))
99- then false
100- else true
107+ assetIsValid(assetDetails)
101108 }
102109
103110
104111 func acceptedAssetIds (assetId) = if (if (if (if ((assetId != toBase58String(signAssetId)))
105112 then (assetId != toBase58String(wavesAssetId))
106113 else false)
107114 then (assetId != "WAVES")
108115 else false)
109116 then (assetId != toBase58String(usdnAssetId))
110117 else false)
111118 then false
112119 else true
120+
121+
122+func getBidAssetId (assetId) = if ((assetId == "WAVES"))
123+ then unit
124+ else fromBase58String(assetId)
113125
114126
115127 func getSaleOwnerAndStatus (nftid) = {
116128 let saleOwner = getStrByK(("current_owner_on_dapp_" + nftid))
117129 if ((size(saleOwner) == 0))
118130 then throw("NFT not found")
119131 else {
120132 let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + nftid))
121133 if ((saleStatus != "OPEN"))
122134 then throw("NFT not for sale")
123135 else saleOwner
124136 }
125137 }
126138
127139
140+func getBidData (key) = {
141+ let bidData = getStrByK((key + "_OPEN"))
142+ if ((bidData == ""))
143+ then throw("Offer not found")
144+ else {
145+ let bidDataArr = split(bidData, "_")
146+ let assetId = getBidAssetId(bidDataArr[2])
147+ $Tuple3(bidDataArr, assetId, bidData)
148+ }
149+ }
150+
151+
152+func artIsValid (artStatus) = if ((artStatus != artIllegal))
153+ then (artStatus != artSuspended)
154+ else false
155+
156+
128157 func checkArtStatus (addr,id) = {
129158 let artStatus = getArtStrByK(keyFlag(addr, id))
130- if (if ((artStatus == artIllegal))
159+ if (artIsValid(artStatus))
131160 then true
132- else (artStatus == artSuspended))
133- then throw(("Original Artwork flagged as " + artStatus))
134- else true
161+ else throw(("Original Artwork flagged as " + artStatus))
135162 }
136163
137164
138165 func checkArtistStatus (addr) = {
139166 let artistStatus = getUserStrByK(keyUserStatus(addr))
140167 if (containsElement([userSuspended, userRemoved], artistStatus))
141168 then throw(("Original Artist " + artistStatus))
142169 else true
143170 }
144171
145172
146173 func checkNFTInfo (assetId) = {
147174 let nftData = split(getArtStrByK(keyNFTData(assetId)), "_")
148175 let artSignID = getArtStrByK(keySignID(nftData[6], nftData[5]))
149176 if (if (!(checkArtStatus(nftData[6], nftData[5])))
150177 then !(checkArtistStatus(nftData[6]))
151178 else false)
152179 then $Tuple4(false, nftData[5], nftData[6], artSignID)
153180 else $Tuple4(true, nftData[5], nftData[6], artSignID)
154181 }
155182
156183
157184 func checkARTExist (artId,creatorAddr) = {
158185 let artSignID = getArtStrByK(keySignID(creatorAddr, artId))
159186 if ((size(artSignID) == 0))
160187 then throw("Artwork not found on SIGN Art")
161188 else if (if (!(checkArtStatus(creatorAddr, artId)))
162189 then !(checkArtistStatus(creatorAddr))
163190 else false)
164191 then false
165192 else true
166193 }
167194
168195
169196 func setTransfers (amount,assetId,nftid,creatorAddr,saleOwner,caller) = {
170197 let amountForSign = fraction(amount, signCut, 100)
171198 let amountForCreator = fraction(amount, creatorCut, 100)
172199 let amountForOwner = (amount - (amountForSign + amountForCreator))
173200 let signFee = ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)
174201 let creatorFee = ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId)
175202 let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId)
176203 let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid))
177204 $Tuple4(signFee, creatorFee, ownerFee, collectorNFT)
178205 }
179206
180207
181208 func validateMinSell (assetId,price) = {
182209 let minSellWaves = if (unitTest)
183210 then 10
184211 else getIntByKFromOracle("waves_min_sell")
185212 let minSellUsdn = 1000000
186213 let minSellSign = if (unitTest)
187214 then 1
188215 else (currentCertificationPrice * 2)
189216 if (if (if (if (if ((assetId == toBase58String(usdnAssetId)))
190217 then (minSellUsdn > price)
191218 else false)
192219 then (price != 0)
193220 else false)
194221 then true
195222 else if (if ((assetId == toBase58String(signAssetId)))
196223 then (minSellSign > price)
197224 else false)
198225 then (price != 0)
199226 else false)
200227 then true
201228 else if (if (if ((assetId == toBase58String(wavesAssetId)))
202229 then true
203230 else (assetId == "WAVES"))
204231 then (minSellWaves > price)
205232 else false)
206233 then (price != 0)
207234 else false)
208235 then false
209236 else true
210237 }
211238
212239
240+func provideBaseData (i,nftId) = {
241+ let $t083128351 = idCallerDate(i)
242+ let id = $t083128351._1
243+ let caller = $t083128351._2
244+ let date = $t083128351._3
245+ let $t083548423 = checkNFTInfo(nftId)
246+ let isValidNFT = $t083548423._1
247+ let artId = $t083548423._2
248+ let creatorAddr = $t083548423._3
249+ let artSignID = $t083548423._4
250+ $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID)
251+ }
252+
253+
254+func updateNumSales () = {
255+ let numSales = getIntByK(numSalesK)
256+ IntegerEntry(numSalesK, (numSales + 1))
257+ }
258+
259+
260+@Callable(invoke)
261+func appRunning (isLive,message) = {
262+ let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
263+ let id = toBase58String(invoke.transactionId)
264+ if (containsElement([chris, toString(this)], caller))
265+ then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
266+ else throw("You are not allowed to change this")
267+ }
268+
269+
270+
213271 @Callable(i)
214272 func sellNFT (price,asset) = {
215- let $t077167755 = idCallerDate(i)
216- let id = $t077167755._1
217- let caller = $t077167755._2
218- let date = $t077167755._3
219- let $t077617797 = isPayment(i)
220- let payment = $t077617797._1
221- let amount = $t077617797._2
273+ let $t091379173 = isPayment(i)
274+ let payment = $t091379173._1
275+ let amount = $t091379173._2
222276 let nftId = if (if (isDefined(payment.assetId))
223277 then isSignArtNFT(value(payment.assetId))
224278 else false)
225279 then toBase58String(value(payment.assetId))
226280 else throw("Only SIGN Art NFT accepted.")
227- let $t079768045 = checkNFTInfo(nftId)
228- let isValidNFT = $t079768045._1
229- let artId = $t079768045._2
230- let creatorAddr = $t079768045._3
231- let artSignID = $t079768045._4
281+ let $t093529444 = provideBaseData(i, nftId)
282+ let id = $t093529444._1
283+ let caller = $t093529444._2
284+ let date = $t093529444._3
285+ let isValidNFT = $t093529444._4
286+ let artId = $t093529444._5
287+ let creatorAddr = $t093529444._6
288+ let artSignID = $t093529444._7
232289 if ((size(artSignID) == 0))
233290 then throw("Artwork not found on SIGN Art")
234291 else if (!(isValidNFT))
235- then throw("Something went wrong")
292+ then throw("Not a valid nft")
236293 else if (!(acceptedAssetIds(asset)))
237294 then throw("Only SIGN, USDN or WAVES accepted")
238295 else if ((price == 0))
239296 then throw("Wrong minimum sell price")
240297 else if (!(validateMinSell(asset, price)))
241298 then throw("Wrong minimum sell price")
242299 else [StringEntry((getSaleKey(caller, nftId, artId, creatorAddr) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(price)) + "_") + asset) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)]
243300 }
244301
245302
246303
247304 @Callable(i)
248305 func updateSalePrice (nftId,price,asset) = {
249- let $t089218960 = idCallerDate(i)
250- let id = $t089218960._1
251- let caller = $t089218960._2
252- let date = $t089218960._3
253- let $t089669035 = checkNFTInfo(nftId)
254- let isValidNFT = $t089669035._1
255- let artId = $t089669035._2
256- let creatorAddr = $t089669035._3
257- let artSignID = $t089669035._4
306+ let $t01031710409 = provideBaseData(i, nftId)
307+ let id = $t01031710409._1
308+ let caller = $t01031710409._2
309+ let date = $t01031710409._3
310+ let isValidNFT = $t01031710409._4
311+ let artId = $t01031710409._5
312+ let creatorAddr = $t01031710409._6
313+ let artSignID = $t01031710409._7
258314 if ((size(artSignID) == 0))
259315 then throw("Artwork not found on SIGN Art, cancel your sale.")
260316 else if (!(isValidNFT))
261- then throw("Something went wrong")
317+ then throw("Not a valid nft")
262318 else {
263319 let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
264320 if ((saleOwner != caller))
265321 then throw("You don't own this NFT")
266322 else {
267323 let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
268324 if ((saleStatus != "OPEN"))
269325 then throw("Sale not active")
270326 else if (!(acceptedAssetIds(asset)))
271327 then throw("Only SIGN, USDN or WAVES accepted")
272328 else if ((price == 0))
273329 then throw("Wrong minimum sell price")
274330 else if (!(validateMinSell(asset, price)))
275331 then throw("Wrong minimum sell price")
276332 else {
277333 let saleKey = getSaleKey(caller, nftId, artId, creatorAddr)
278334 let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_")
279335 [StringEntry((saleKey + "_OPEN"), ((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]))]
280336 }
281337 }
282338 }
283339 }
284340
285341
286342
287343 @Callable(i)
288344 func cancelSale (nftId) = {
289- let $t01017410213 = idCallerDate(i)
290- let id = $t01017410213._1
291- let caller = $t01017410213._2
292- let date = $t01017410213._3
293- let $t01021910441 = checkNFTInfo(nftId)
294- let isValidNFT = $t01021910441._1
295- let artId = $t01021910441._2
296- let creatorAddr = $t01021910441._3
297- let artSignID = $t01021910441._4
345+ let $t01154911789 = provideBaseData(i, nftId)
346+ let id = $t01154911789._1
347+ let caller = $t01154911789._2
348+ let date = $t01154911789._3
349+ let isValidNFT = $t01154911789._4
350+ let artId = $t01154911789._5
351+ let creatorAddr = $t01154911789._6
352+ let artSignID = $t01154911789._7
298353 let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
299354 if ((saleOwner != caller))
300355 then throw("You don't own this NFT")
301356 else {
302357 let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
303358 if ((saleStatus != "OPEN"))
304359 then throw("Sale not active")
305360 else {
306361 let saleKey = getSaleKey(caller, nftId, artId, creatorAddr)
307362 let saleInfo = getStrByK((saleKey + "_OPEN"))
308363 [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + caller) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CANCELLED"), ((((saleInfo + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftId))]
309364 }
310365 }
311366 }
312367
313368
314369
315370 @Callable(i)
316371 func buyNFT (nftId) = {
317- let $t01127211311 = idCallerDate(i)
318- let id = $t01127211311._1
319- let caller = $t01127211311._2
320- let date = $t01127211311._3
321- let saleOwner = getSaleOwnerAndStatus(nftId)
322- let $t01136511434 = checkNFTInfo(nftId)
323- let isValidNFT = $t01136511434._1
324- let artId = $t01136511434._2
325- let creatorAddr = $t01136511434._3
326- let artSignID = $t01136511434._4
372+ let $t01262012712 = provideBaseData(i, nftId)
373+ let id = $t01262012712._1
374+ let caller = $t01262012712._2
375+ let date = $t01262012712._3
376+ let isValidNFT = $t01262012712._4
377+ let artId = $t01262012712._5
378+ let creatorAddr = $t01262012712._6
379+ let artSignID = $t01262012712._7
327380 if ((size(artSignID) == 0))
328381 then throw("Artwork not found on SIGN Art, cancel your sale.")
329382 else if (!(isValidNFT))
330- then throw("Something went wrong")
383+ then throw("Not a valid nft")
331384 else {
385+ let saleOwner = getSaleOwnerAndStatus(nftId)
332386 let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr)
333387 let saleInfo = getStrByK((saleKey + "_OPEN"))
334388 if ((size(saleInfo) == 0))
335389 then throw("Sale Not found!")
336390 else {
337391 let saleInfoArray = split(saleInfo, "_")
338392 if ((parseInt(saleInfoArray[1]) == 0))
339393 then throw("Offer only")
340394 else {
341- let $t01188611922 = isPayment(i)
342- let payment = $t01188611922._1
343- let amount = $t01188611922._2
395+ let $t01320913245 = isPayment(i)
396+ let payment = $t01320913245._1
397+ let amount = $t01320913245._2
344398 let paymentAssetStr = if (isDefined(payment.assetId))
345399 then toBase58String(value(payment.assetId))
346400 else ""
347401 if (if ((saleInfoArray[1] != toString(amount)))
348402 then true
349403 else (saleInfoArray[2] != paymentAssetStr))
350404 then throw("Payment infos don't match.")
351405 else {
352406 let amountForSign = fraction(amount, signCut, 100)
353407 let amountForCreator = fraction(amount, creatorCut, 100)
354408 let amountForOwner = (amount - (amountForSign + amountForCreator))
355- let $t01242512553 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller)
356- let signFee = $t01242512553._1
357- let creatorFee = $t01242512553._2
358- let ownerFee = $t01242512553._3
359- let collectorNFT = $t01242512553._4
360-[DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((makeString(saleInfoArray, "_") + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), signFee, creatorFee, ownerFee, collectorNFT]
409+ let $t01374813876 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller)
410+ let signFee = $t01374813876._1
411+ let creatorFee = $t01374813876._2
412+ let ownerFee = $t01374813876._3
413+ let collectorNFT = $t01374813876._4
414+[DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), signFee, creatorFee, ownerFee, collectorNFT]
361415 }
362416 }
363417 }
364418 }
365419 }
366420
367421

github/deemru/w8io/169f3d6 
107.59 ms