tx · FTDLWBgCoFTywtZZzEWhQ9qDfbLsKJVEVZEu7s7kXGJx 3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p: -0.01500000 Waves 2022.11.30 07:14 [2339352] smart account 3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p > SELF 0.00000000 Waves
{ "type": 13, "id": "FTDLWBgCoFTywtZZzEWhQ9qDfbLsKJVEVZEu7s7kXGJx", "fee": 1500000, "feeAssetId": null, "timestamp": 1669781684588, "version": 2, "chainId": 84, "sender": "3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p", "senderPublicKey": "Hh3eFP2XFetZSfTxQiM1Ps96f68zi8Zh5ghhCZdjgdFs", "proofs": [ "44qECYDoTLRxLrhwzkQ68d3X3VKXY2Buva7NaSb6DYZh1MjtTete2Z2vcqstKTzuJoScNjgypTfVR3aBa6eLYMg1" ], "script": "base64:BgI5CAISBAoCCAgSBAoCBAgSBAoCAQgSBQoDCAEIEgMKAQgSAwoBCBIDCgEIEgUKAwgICBIGCgQICAgINAEJZ2V0U3RyQnlLAQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgAACHVuaXRUZXN0BwAJb3JhY2xlRmVlCQEFdmFsdWUBCQCmCAEJAQlnZXRTdHJCeUsBAg9jb25mX29yYWNsZV9mZWUAC2ZlZVJlY2VpdmVyCQEJZ2V0U3RyQnlLAQIRY29uZl9mZWVfcmVjZWl2ZXIADGFydHdvcmtzRGFwcAkBBXZhbHVlAQkApggBCQEJZ2V0U3RyQnlLAQISY29uZl9hcnR3b3Jrc19kYXBwAAh1c2VyRGFwcAMFCHVuaXRUZXN0CQEFdmFsdWUBCQCmCAECIzNNdDRSR01FeWpTV1lBb2NUUHFkNTV3ZEhRUUIzUFUyVUNtCQEFdmFsdWUBCQCmCAEJAQlnZXRTdHJCeUsBAg9jb25mX3VzZXJzX2RhcHAAC3NpZ25Bc3NldElkCQDZBAEJAQlnZXRTdHJCeUsBAhhjb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mdFbnRyeQIJAKwCAgUGYmlkS2V5AgpfQ0FOQ0VMTEVECQCsAgIJAKwCAgkArAICCQCsAgIFB2JpZERhdGECC19DQU5DRUxMRURfCQCkAwEFBGRhdGUCAV8FAmlkCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQkA2QQBBQZjYWxsZXIJAQ1wYXJzZUludFZhbHVlAQkAkQMCBQpiaWREYXRhQXJyAAEFB2Fzc2V0SWQFA25pbADgQvXp", "height": 2339352, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 44SrtBzDEFfnGGEAvDf84MYfdzbXGyNjsoAam6Vg7rC7 Next: 5Lcsh7p6YFtDxz5fktwyXHhWZqkXsW9NVQVSofdENWbR Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStrByK (key) = valueOrElse(getString(this, key), "") | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let unitTest = false | |
8 | 8 | ||
9 | 9 | let oracleFee = value(addressFromString(getStrByK("conf_oracle_fee"))) | |
10 | 10 | ||
11 | 11 | let feeReceiver = getStrByK("conf_fee_receiver") | |
12 | 12 | ||
13 | 13 | let artworksDapp = value(addressFromString(getStrByK("conf_artworks_dapp"))) | |
14 | 14 | ||
15 | 15 | let userDapp = if (unitTest) | |
16 | 16 | then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm")) | |
17 | 17 | else value(addressFromString(getStrByK("conf_users_dapp"))) | |
18 | 18 | ||
19 | 19 | let signAssetId = fromBase58String(getStrByK("conf_accepted_asset_SIGN")) | |
20 | 20 | ||
21 | 21 | let usdnAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDN")) | |
22 | 22 | ||
23 | 23 | let usdtAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDT")) | |
24 | 24 | ||
25 | 25 | let wavesAssetId = base58'' | |
26 | 26 | ||
27 | 27 | let chris = getStrByK("conf_admin_1") | |
28 | 28 | ||
29 | 29 | let signCut = 3 | |
30 | 30 | ||
31 | 31 | let userSuspended = "SUSPENDED" | |
32 | 32 | ||
33 | 33 | let userRemoved = "REMOVED" | |
34 | 34 | ||
35 | 35 | let artIllegal = "ILLEGAL" | |
36 | 36 | ||
37 | 37 | let artSuspended = "SUSPENDED" | |
38 | 38 | ||
39 | 39 | let dappRunningKey = "conf_dapp_is_running" | |
40 | 40 | ||
41 | 41 | let maintenanceMSGKey = "conf_maintenance_msg" | |
42 | 42 | ||
43 | 43 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
44 | 44 | ||
45 | 45 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
46 | 46 | ||
47 | 47 | let numSalesK = "num_sales" | |
48 | 48 | ||
49 | 49 | func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error") | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getArtworkRoyalties (key) = valueOrElse(getInteger(artworksDapp, key), 1000) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getArtStrByK (key) = valueOrElse(getString(artworksDapp, key), "") | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getIntByK (key) = valueOrElse(getInteger(this, key), 0) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyUserStatus (addr) = ("user_status_" + addr) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func keyArtworkRoyalties (caller,artId) = ((("art_royalties_" + artId) + "_") + caller) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func keySignID (artistAddr,artId) = ((("art_signid_" + artId) + "_") + artistAddr) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func keyFlag (artistAddr,artId) = ((("art_flag_" + artId) + "_") + artistAddr) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func keyNFTData (id) = ("nft_" + id) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getSaleKey (caller,nftId,artId,creatorAddr) = ((((((("sale2nd_info_" + caller) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getBidKey (offerOwner,nftId,saleOwner,offerId) = ((((((("offer2nd_" + offerOwner) + "_") + nftId) + "_") + saleOwner) + "_") + offerId) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getIntByKFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | let currentCertificationPrice = getIntByKFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
86 | 86 | ||
87 | 87 | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func idCallerDate (i) = if (!(dappRunning)) | |
94 | 94 | then throw(maintenanceMSG) | |
95 | 95 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func isPayment (i) = if ((size(i.payments) == 0)) | |
99 | 99 | then throw("No payment attached") | |
100 | 100 | else { | |
101 | 101 | let payment = value(i.payments[0]) | |
102 | 102 | let amount = value(payment.amount) | |
103 | 103 | $Tuple2(payment, amount) | |
104 | 104 | } | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
108 | 108 | then (assetDetails.decimals == 0) | |
109 | 109 | else false) | |
110 | 110 | then (assetDetails.reissuable == false) | |
111 | 111 | else false) | |
112 | 112 | then (assetDetails.issuer == artworksDapp) | |
113 | 113 | else false | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func isSignArtNFT (id) = { | |
117 | 117 | let assetDetails = value(assetInfo(id)) | |
118 | 118 | assetIsValid(assetDetails) | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func acceptedAssetIds (assetId) = if (if (if (if (if ((assetId != toBase58String(signAssetId))) | |
123 | 123 | then (assetId != toBase58String(wavesAssetId)) | |
124 | 124 | else false) | |
125 | 125 | then (assetId != "WAVES") | |
126 | 126 | else false) | |
127 | 127 | then (assetId != toBase58String(usdnAssetId)) | |
128 | 128 | else false) | |
129 | 129 | then (assetId != toBase58String(usdtAssetId)) | |
130 | 130 | else false) | |
131 | 131 | then false | |
132 | 132 | else true | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
136 | 136 | then unit | |
137 | 137 | else fromBase58String(assetId) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func getSaleOwnerAndStatus (nftid) = { | |
141 | 141 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftid)) | |
142 | 142 | if ((size(saleOwner) == 0)) | |
143 | 143 | then throw("NFT not found") | |
144 | 144 | else { | |
145 | 145 | let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + nftid)) | |
146 | 146 | if ((saleStatus != "OPEN")) | |
147 | 147 | then throw("NFT not for sale") | |
148 | 148 | else saleOwner | |
149 | 149 | } | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func getBidData (key) = { | |
154 | 154 | let bidData = getStrByK((key + "_OPEN")) | |
155 | 155 | if ((bidData == "")) | |
156 | 156 | then throw("Offer not found") | |
157 | 157 | else { | |
158 | 158 | let bidDataArr = split(bidData, "_") | |
159 | 159 | let assetId = getBidAssetId(bidDataArr[2]) | |
160 | 160 | $Tuple3(bidDataArr, assetId, bidData) | |
161 | 161 | } | |
162 | 162 | } | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func artIsValid (artStatus) = if ((artStatus != artIllegal)) | |
166 | 166 | then (artStatus != artSuspended) | |
167 | 167 | else false | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func checkArtStatus (addr,id) = { | |
171 | 171 | let artStatus = getArtStrByK(keyFlag(addr, id)) | |
172 | 172 | if (artIsValid(artStatus)) | |
173 | 173 | then true | |
174 | 174 | else throw(("Original Artwork flagged as " + artStatus)) | |
175 | 175 | } | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func checkArtistStatus (addr) = { | |
179 | 179 | let artistStatus = getUserStrByK(keyUserStatus(addr)) | |
180 | 180 | if (containsElement([userSuspended, userRemoved], artistStatus)) | |
181 | 181 | then throw(("Original Artist " + artistStatus)) | |
182 | 182 | else true | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func checkNFTInfo (assetId) = { | |
187 | 187 | let nftData = split(getArtStrByK(keyNFTData(assetId)), "_") | |
188 | 188 | let artSignID = getArtStrByK(keySignID(nftData[6], nftData[5])) | |
189 | 189 | if (if (!(checkArtStatus(nftData[6], nftData[5]))) | |
190 | 190 | then !(checkArtistStatus(nftData[6])) | |
191 | 191 | else false) | |
192 | 192 | then $Tuple4(false, nftData[5], nftData[6], artSignID) | |
193 | 193 | else $Tuple4(true, nftData[5], nftData[6], artSignID) | |
194 | 194 | } | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func setTransfers (amount,assetId,nftid,creatorAddr,saleOwner,caller) = { | |
198 | 198 | let creatorCut = getArtworkRoyalties(keyArtworkRoyalties(creatorAddr, nftid)) | |
199 | 199 | if (true) | |
200 | 200 | then throw(((((keyArtworkRoyalties(creatorAddr, nftid) + " / ") + toString(amount)) + " / ") + toString(creatorCut))) | |
201 | 201 | else { | |
202 | 202 | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(creatorAddr)), feeReceiver) | |
203 | 203 | let agentShare = valueOrElse(getInteger(userDapp, keySecondaryShare(creatorAddr)), 0) | |
204 | 204 | let amountForSign = fraction(amount, signCut, 100) | |
205 | 205 | let amountForCreator = fraction(amount, creatorCut, 10000) | |
206 | 206 | let amountForOwner = (amount - (amountForSign + amountForCreator)) | |
207 | 207 | let amountForAgent = if (if ((agent != feeReceiver)) | |
208 | 208 | then (agentShare > 0) | |
209 | 209 | else false) | |
210 | 210 | then fraction(amount, agentShare, 100) | |
211 | 211 | else 0 | |
212 | 212 | let commissions = if ((amountForAgent != 0)) | |
213 | 213 | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
214 | 214 | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
215 | 215 | let creatorFee = ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId) | |
216 | 216 | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
217 | 217 | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid)) | |
218 | 218 | $Tuple4(commissions, creatorFee, ownerFee, collectorNFT) | |
219 | 219 | } | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func validateMinSell (assetId,price) = { | |
224 | 224 | let minSellWaves = if (unitTest) | |
225 | 225 | then 10 | |
226 | 226 | else getIntByKFromOracle("waves_min_sell") | |
227 | 227 | let minSellUsdn = 1000000 | |
228 | 228 | let minSellSign = if (unitTest) | |
229 | 229 | then 1 | |
230 | 230 | else (currentCertificationPrice * 2) | |
231 | 231 | if (if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
232 | 232 | then (minSellUsdn > price) | |
233 | 233 | else false) | |
234 | 234 | then (price != 0) | |
235 | 235 | else false) | |
236 | 236 | then true | |
237 | 237 | else if (if ((assetId == toBase58String(usdtAssetId))) | |
238 | 238 | then (minSellUsdn > price) | |
239 | 239 | else false) | |
240 | 240 | then (price != 0) | |
241 | 241 | else false) | |
242 | 242 | then true | |
243 | 243 | else if (if ((assetId == toBase58String(signAssetId))) | |
244 | 244 | then (minSellSign > price) | |
245 | 245 | else false) | |
246 | 246 | then (price != 0) | |
247 | 247 | else false) | |
248 | 248 | then true | |
249 | 249 | else if (if (if ((assetId == toBase58String(wavesAssetId))) | |
250 | 250 | then true | |
251 | 251 | else (assetId == "WAVES")) | |
252 | 252 | then (minSellWaves > price) | |
253 | 253 | else false) | |
254 | 254 | then (price != 0) | |
255 | 255 | else false) | |
256 | 256 | then false | |
257 | 257 | else true | |
258 | 258 | } | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | func provideBaseData (i,nftId) = { | |
262 | 262 | let $t098259865 = idCallerDate(i) | |
263 | 263 | let id = $t098259865._1 | |
264 | 264 | let caller = $t098259865._2 | |
265 | 265 | let date = $t098259865._3 | |
266 | 266 | let $t098699938 = checkNFTInfo(nftId) | |
267 | 267 | let isValidNFT = $t098699938._1 | |
268 | 268 | let artId = $t098699938._2 | |
269 | 269 | let creatorAddr = $t098699938._3 | |
270 | 270 | let artSignID = $t098699938._4 | |
271 | 271 | $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID) | |
272 | 272 | } | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func updateNumSales () = { | |
276 | 276 | let numSales = getIntByK(numSalesK) | |
277 | 277 | IntegerEntry(numSalesK, (numSales + 1)) | |
278 | 278 | } | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | @Callable(invoke) | |
282 | 282 | func setConf (key,val) = { | |
283 | 283 | let caller = toString(invoke.caller) | |
284 | 284 | if (containsElement([chris, toString(this)], caller)) | |
285 | 285 | then if (contains(key, "conf_")) | |
286 | 286 | then [StringEntry(key, val)] | |
287 | 287 | else throw("Entries starting with conf_ only") | |
288 | 288 | else throw("You are not allowed to change this") | |
289 | 289 | } | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | ||
293 | 293 | @Callable(invoke) | |
294 | 294 | func appRunning (isLive,message) = { | |
295 | 295 | let caller = toString(invoke.caller) | |
296 | 296 | let id = toBase58String(invoke.transactionId) | |
297 | 297 | if (containsElement([chris, toString(this)], caller)) | |
298 | 298 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
299 | 299 | else throw("You are not allowed to change this") | |
300 | 300 | } | |
301 | 301 | ||
302 | 302 | ||
303 | 303 | ||
304 | 304 | @Callable(i) | |
305 | 305 | func sellNFT (price,asset) = { | |
306 | 306 | let $t01104311079 = isPayment(i) | |
307 | 307 | let payment = $t01104311079._1 | |
308 | 308 | let amount = $t01104311079._2 | |
309 | 309 | if ((amount != 1)) | |
310 | 310 | then throw("No NFT attached") | |
311 | 311 | else { | |
312 | 312 | let nftId = if (if (isDefined(payment.assetId)) | |
313 | 313 | then isSignArtNFT(value(payment.assetId)) | |
314 | 314 | else false) | |
315 | 315 | then toBase58String(value(payment.assetId)) | |
316 | 316 | else throw("Only SIGN Art NFT accepted.") | |
317 | 317 | let $t01131711410 = provideBaseData(i, nftId) | |
318 | 318 | let id = $t01131711410._1 | |
319 | 319 | let caller = $t01131711410._2 | |
320 | 320 | let date = $t01131711410._3 | |
321 | 321 | let isValidNFT = $t01131711410._4 | |
322 | 322 | let artId = $t01131711410._5 | |
323 | 323 | let creatorAddr = $t01131711410._6 | |
324 | 324 | let artSignID = $t01131711410._7 | |
325 | 325 | if ((size(artSignID) == 0)) | |
326 | 326 | then throw("Artwork not found on SIGN Art") | |
327 | 327 | else if (!(isValidNFT)) | |
328 | 328 | then throw("Not a valid nft") | |
329 | 329 | else if (!(acceptedAssetIds(asset))) | |
330 | 330 | then throw("Only SIGN, USDN, USDT or WAVES accepted") | |
331 | 331 | else if (!(validateMinSell(asset, price))) | |
332 | 332 | then throw("Wrong minimum sell price") | |
333 | 333 | 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)] | |
334 | 334 | } | |
335 | 335 | } | |
336 | 336 | ||
337 | 337 | ||
338 | 338 | ||
339 | 339 | @Callable(i) | |
340 | 340 | func updateSalePrice (nftId,price,asset) = { | |
341 | 341 | let $t01231412407 = provideBaseData(i, nftId) | |
342 | 342 | let id = $t01231412407._1 | |
343 | 343 | let caller = $t01231412407._2 | |
344 | 344 | let date = $t01231412407._3 | |
345 | 345 | let isValidNFT = $t01231412407._4 | |
346 | 346 | let artId = $t01231412407._5 | |
347 | 347 | let creatorAddr = $t01231412407._6 | |
348 | 348 | let artSignID = $t01231412407._7 | |
349 | 349 | if ((size(artSignID) == 0)) | |
350 | 350 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
351 | 351 | else if (!(isValidNFT)) | |
352 | 352 | then throw("Not a valid nft") | |
353 | 353 | else { | |
354 | 354 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
355 | 355 | if ((saleOwner != caller)) | |
356 | 356 | then throw("You don't own this NFT") | |
357 | 357 | else { | |
358 | 358 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
359 | 359 | if ((saleStatus != "OPEN")) | |
360 | 360 | then throw("Sale not active") | |
361 | 361 | else if (!(acceptedAssetIds(asset))) | |
362 | 362 | then throw("Only SIGN, USDN, USDT or WAVES accepted") | |
363 | 363 | else if (!(validateMinSell(asset, price))) | |
364 | 364 | then throw("Wrong minimum sell price") | |
365 | 365 | else { | |
366 | 366 | let saleKey = getSaleKey(caller, nftId, artId, creatorAddr) | |
367 | 367 | let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_") | |
368 | 368 | [StringEntry((saleKey + "_OPEN"), ((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]))] | |
369 | 369 | } | |
370 | 370 | } | |
371 | 371 | } | |
372 | 372 | } | |
373 | 373 | ||
374 | 374 | ||
375 | 375 | ||
376 | 376 | @Callable(i) | |
377 | 377 | func cancelSale (nftId) = { | |
378 | 378 | let $t01358413828 = provideBaseData(i, nftId) | |
379 | 379 | let id = $t01358413828._1 | |
380 | 380 | let caller = $t01358413828._2 | |
381 | 381 | let date = $t01358413828._3 | |
382 | 382 | let isValidNFT = $t01358413828._4 | |
383 | 383 | let artId = $t01358413828._5 | |
384 | 384 | let creatorAddr = $t01358413828._6 | |
385 | 385 | let artSignID = $t01358413828._7 | |
386 | 386 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
387 | 387 | if ((saleOwner != caller)) | |
388 | 388 | then throw("You don't own this NFT") | |
389 | 389 | else { | |
390 | 390 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
391 | 391 | if ((saleStatus != "OPEN")) | |
392 | 392 | then throw("Sale not active") | |
393 | 393 | else { | |
394 | 394 | let saleKey = getSaleKey(caller, nftId, artId, creatorAddr) | |
395 | 395 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
396 | 396 | [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))] | |
397 | 397 | } | |
398 | 398 | } | |
399 | 399 | } | |
400 | 400 | ||
401 | 401 | ||
402 | 402 | ||
403 | 403 | @Callable(i) | |
404 | 404 | func buyNFT (nftId) = { | |
405 | 405 | let $t01468214775 = provideBaseData(i, nftId) | |
406 | 406 | let id = $t01468214775._1 | |
407 | 407 | let caller = $t01468214775._2 | |
408 | 408 | let date = $t01468214775._3 | |
409 | 409 | let isValidNFT = $t01468214775._4 | |
410 | 410 | let artId = $t01468214775._5 | |
411 | 411 | let creatorAddr = $t01468214775._6 | |
412 | 412 | let artSignID = $t01468214775._7 | |
413 | 413 | if ((size(artSignID) == 0)) | |
414 | 414 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
415 | 415 | else if (!(isValidNFT)) | |
416 | 416 | then throw("Not a valid nft") | |
417 | 417 | else { | |
418 | 418 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
419 | 419 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
420 | 420 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
421 | 421 | if ((size(saleInfo) == 0)) | |
422 | 422 | then throw("Sale Not found!") | |
423 | 423 | else { | |
424 | 424 | let saleInfoArray = split(saleInfo, "_") | |
425 | 425 | if ((parseInt(saleInfoArray[1]) == 0)) | |
426 | 426 | then throw("Offer only") | |
427 | 427 | else { | |
428 | 428 | let $t01528415320 = isPayment(i) | |
429 | 429 | let payment = $t01528415320._1 | |
430 | 430 | let amount = $t01528415320._2 | |
431 | 431 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
432 | 432 | then toBase58String(value(payment.assetId)) | |
433 | 433 | else "" | |
434 | 434 | if (if ((saleInfoArray[1] != toString(amount))) | |
435 | 435 | then true | |
436 | 436 | else (saleInfoArray[2] != paymentAssetStr)) | |
437 | 437 | then throw("Payment infos don't match.") | |
438 | 438 | else { | |
439 | 439 | let $t01583415966 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller) | |
440 | 440 | let commissions = $t01583415966._1 | |
441 | 441 | let creatorFee = $t01583415966._2 | |
442 | 442 | let ownerFee = $t01583415966._3 | |
443 | 443 | let collectorNFT = $t01583415966._4 | |
444 | 444 | ([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(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
445 | 445 | } | |
446 | 446 | } | |
447 | 447 | } | |
448 | 448 | } | |
449 | 449 | } | |
450 | 450 | ||
451 | 451 | ||
452 | 452 | ||
453 | 453 | @Callable(i) | |
454 | 454 | func setOffer (nftId) = { | |
455 | 455 | let $t01639416491 = provideBaseData(i, nftId) | |
456 | 456 | let id = $t01639416491._1 | |
457 | 457 | let offerOwner = $t01639416491._2 | |
458 | 458 | let date = $t01639416491._3 | |
459 | 459 | let isValidNFT = $t01639416491._4 | |
460 | 460 | let artId = $t01639416491._5 | |
461 | 461 | let creatorAddr = $t01639416491._6 | |
462 | 462 | let artSignID = $t01639416491._7 | |
463 | 463 | if (!(isValidNFT)) | |
464 | 464 | then throw("Not a valid nft") | |
465 | 465 | else { | |
466 | 466 | let $t01655516591 = isPayment(i) | |
467 | 467 | let payment = $t01655516591._1 | |
468 | 468 | let amount = $t01655516591._2 | |
469 | 469 | let assetId = if (!(isDefined(payment.assetId))) | |
470 | 470 | then "WAVES" | |
471 | 471 | else toBase58String(value(payment.assetId)) | |
472 | 472 | if (!(acceptedAssetIds(assetId))) | |
473 | 473 | then throw("asset not accepted") | |
474 | 474 | else if ((amount == 0)) | |
475 | 475 | then throw("Offer of 0 not allowed") | |
476 | 476 | else if (!(validateMinSell(assetId, amount))) | |
477 | 477 | then throw("Wrong minimum sell price") | |
478 | 478 | else { | |
479 | 479 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
480 | 480 | [StringEntry((getBidKey(offerOwner, nftId, saleOwner, id) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + offerOwner) + "_") + id))] | |
481 | 481 | } | |
482 | 482 | } | |
483 | 483 | } | |
484 | 484 | ||
485 | 485 | ||
486 | 486 | ||
487 | 487 | @Callable(i) | |
488 | 488 | func acceptOffer (nftId,offerId,offerOwner) = { | |
489 | 489 | let $t01741217505 = provideBaseData(i, nftId) | |
490 | 490 | let id = $t01741217505._1 | |
491 | 491 | let caller = $t01741217505._2 | |
492 | 492 | let date = $t01741217505._3 | |
493 | 493 | let isValidNFT = $t01741217505._4 | |
494 | 494 | let artId = $t01741217505._5 | |
495 | 495 | let creatorAddr = $t01741217505._6 | |
496 | 496 | let artSignID = $t01741217505._7 | |
497 | 497 | if (!(isValidNFT)) | |
498 | 498 | then throw("Not a valid nft") | |
499 | 499 | else { | |
500 | 500 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
501 | 501 | if ((caller != saleOwner)) | |
502 | 502 | then throw("Only sale owner can accept offer") | |
503 | 503 | else { | |
504 | 504 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
505 | 505 | let $t01776617821 = getBidData(bidKey) | |
506 | 506 | let bidDataArr = $t01776617821._1 | |
507 | 507 | let assetId = $t01776617821._2 | |
508 | 508 | let bidData = $t01776617821._3 | |
509 | 509 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
510 | 510 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
511 | 511 | if ((size(saleInfo) == 0)) | |
512 | 512 | then throw("Sale Not found!") | |
513 | 513 | else { | |
514 | 514 | let amount = value(parseInt(bidDataArr[1])) | |
515 | 515 | let $t01806418195 = setTransfers(amount, assetId, nftId, creatorAddr, saleOwner, bidDataArr[6]) | |
516 | 516 | let commissions = $t01806418195._1 | |
517 | 517 | let creatorFee = $t01806418195._2 | |
518 | 518 | let ownerFee = $t01806418195._3 | |
519 | 519 | let collectorNFT = $t01806418195._4 | |
520 | 520 | let assetIdStr = if (isDefined(assetId)) | |
521 | 521 | then toBase58String(value(assetId)) | |
522 | 522 | else "WAVES" | |
523 | 523 | ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry((bidKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((bidKey + "_CLOSED"), ((((bidData + "_CLOSED_") + toString(date)) + "_") + id)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((((((saleInfo + "_CLOSED-OFFER_") + toString(date)) + "_") + id) + "_") + offerOwner) + "_") + toString(amount)) + "_") + assetIdStr)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
524 | 524 | } | |
525 | 525 | } | |
526 | 526 | } | |
527 | 527 | } | |
528 | 528 | ||
529 | 529 | ||
530 | 530 | ||
531 | 531 | @Callable(i) | |
532 | 532 | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
533 | 533 | let $t01901519090 = idCallerDate(i) | |
534 | 534 | let id = $t01901519090._1 | |
535 | 535 | let caller = $t01901519090._2 | |
536 | 536 | let date = $t01901519090._3 | |
537 | 537 | if (if ((caller != offerOwner)) | |
538 | 538 | then (caller != saleOwner) | |
539 | 539 | else false) | |
540 | 540 | then throw("You cannot cancel this offer.") | |
541 | 541 | else { | |
542 | 542 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
543 | 543 | let $t01926419319 = getBidData(bidKey) | |
544 | 544 | let bidDataArr = $t01926419319._1 | |
545 | 545 | let assetId = $t01926419319._2 | |
546 | 546 | let bidData = $t01926419319._3 | |
547 | 547 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
548 | 548 | } | |
549 | 549 | } | |
550 | 550 | ||
551 | 551 |
github/deemru/w8io/169f3d6 46.68 ms ◑