tx · DFRTPFnUanQgUyoLbxExrRgPpPFEAQ1b8s5iqfe4im5j 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw: -0.01000000 Waves 2023.01.23 14:28 [2417532] smart account 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw > SELF 0.00000000 Waves
{ "type": 13, "id": "DFRTPFnUanQgUyoLbxExrRgPpPFEAQ1b8s5iqfe4im5j", "fee": 1000000, "feeAssetId": null, "timestamp": 1674473411601, "version": 2, "chainId": 84, "sender": "3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw", "senderPublicKey": "4NDsd3dGKXuKLCoSbYvcWCX276K9ShP75cs9HTBMLJEN", "proofs": [ "3DRHqHJeQuw8WtoopURo9r5F8DaV36aMuKVmAzJYgGBXPTyLNeVn7aBW1NRsZWiNkt3TNkvBpZmyKPEkwJBrkp3j" ], "script": "base64:BgIbCAISCwoJCAgICAgBCAgIEgQKAggIEgQKAggICQAJc2VwYXJhdG9yAgFfAARrQnV5AgNidXkABmtQcmljZQIFcHJpY2UABWtTZWxsAgRzZWxsABJtYXhBdWN0aW9uRHVyYXRpb24ABwAEa0JpZAIDYmlkAAxzdGF0dXNGb3JORlQJAJYKBAIET1BFTgIGQ0xPU0VEAghSRVdBUkRFRAIIQ0FOQ0VMRUQAC2RBcHBBZGRyZXNzARoBVEq4T2zewtqT7fSO6Uo2+NVPf5XVVVtdoAEFaXNOZnQBB2Fzc2V0SWQEByRtYXRjaDAJAOwHAQUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgVBc3NldAQFdG9rZW4FByRtYXRjaDADAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwcDAWkBCWNyZWF0ZU5mdAkIbmZ0X25hbWUJbmZ0X293bmVyD25mdF9kQXBwQWRkcmVzcwhuZnRfdHlwZQhuZnRfdGFncxFuZnRfc2VsbGluZ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mtQcmljZQUJc2VwYXJhdG9yBQVuZnRJRAIBXwURY3VycmVudF9uZnRfb3duZXIDCQECIT0CCAkAkQMCCAUBaQhwYXltZW50cwAAB2Fzc2V0SWQFBHVuaXQJAAIBAiNPbmx5IHBheSBpbiBBU0lNSSBvciBXQVZFUyBhY2NlcHRlZAMJAAACBRFjdXJyZW50X25mdF9vd25lcgkApQgBCAUBaQZjYWxsZXIJAAIBAiljdXJyZW50IE93bmVyIG9mIE5GVCBub3QgYWJsZSB0byBwdXJjaGFzZQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAAQUHYXNzZXRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQURY3VycmVudF9uZnRfb3duZXIFBmFtb3VudAUEdW5pdAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkApQgBCAUBaQZjYWxsZXIFCXNlcGFyYXRvcgUEa0J1eQkArAICCQCsAgIFBW5mdElEBQlzZXBhcmF0b3IJAKQDAQUGYW1vdW50CQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgUFbmZ0SUQFCXNlcGFyYXRvcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgUDbmlsAKtuT88=", "height": 2417532, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7QiuvxFLEf4dRpUJkD3JQhxnAREpSE2H2KCHdWSirzqj Next: JC4PqRSKzEA2HSxasJ1WoXBKBejcdFNJc46Vw5F1CFF6 Diff:
Old | New | Differences | |
---|---|---|---|
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(m) | |
46 | - | func sellNFT (z) = { | |
46 | + | func sellNFT (z,A) = { | |
47 | 47 | let y = m.transactionId | |
48 | - | let | |
49 | - | let | |
50 | - | let | |
51 | - | let | |
52 | - | if (!(i( | |
48 | + | let B = m.caller.bytes | |
49 | + | let C = $Tuple2(value(m.payments[0].assetId), value(m.payments[0].amount)) | |
50 | + | let D = C._1 | |
51 | + | let E = C._2 | |
52 | + | if (!(i(D))) | |
53 | 53 | then throw("Token is not NFT") | |
54 | - | else [StringEntry(((c + a) + toBase58String(value(m.payments[0].assetId))), z), StringEntry(((toString(m.caller) + a) + d), ((toBase58String( | |
54 | + | else [StringEntry(((c + a) + toBase58String(value(m.payments[0].assetId))), z), StringEntry(((toString(m.caller) + a) + d), ((toBase58String(D) + a) + toString(E)))] | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | ||
59 | 59 | @Callable(m) | |
60 | - | func buyNFT ( | |
61 | - | let j = fromBase58String( | |
62 | - | let | |
63 | - | let | |
64 | - | let k = getString(this, (("nft_" + | |
60 | + | func buyNFT (F,G) = { | |
61 | + | let j = fromBase58String(F) | |
62 | + | let H = value(m.payments[0].amount) | |
63 | + | let I = { | |
64 | + | let k = getString(this, (("nft_" + G) + "_owner")) | |
65 | 65 | if ($isInstanceOf(k, "String")) | |
66 | 66 | then { | |
67 | - | let | |
68 | - | | |
67 | + | let J = k | |
68 | + | J | |
69 | 69 | } | |
70 | 70 | else false | |
71 | 71 | } | |
72 | - | let z = getStringValue(((((c + a) + E) + "_") + F)) | |
73 | - | if ((F == toString(m.caller))) | |
74 | - | then throw("current Owner of NFT not able to purchase") | |
75 | - | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(F)), G, unit), StringEntry(((toString(m.caller) + a) + b), ((E + a) + toString(G))), DeleteEntry((("nft_" + F) + "_owner")), StringEntry((("nft_" + F) + "_owner"), toString(m.caller)), StringEntry(((E + a) + "_owner"), toString(m.caller))] | |
72 | + | let z = getStringValue(((((c + a) + F) + "_") + G)) | |
73 | + | if ((m.payments[0].assetId != unit)) | |
74 | + | then throw("Only pay in ASIMI or WAVES accepted") | |
75 | + | else if ((G == toString(m.caller))) | |
76 | + | then throw("current Owner of NFT not able to purchase") | |
77 | + | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(G)), H, unit), StringEntry(((toString(m.caller) + a) + b), ((F + a) + toString(H))), DeleteEntry((("nft_" + G) + "_owner")), StringEntry((("nft_" + G) + "_owner"), toString(m.caller)), StringEntry(((F + a) + "_owner"), toString(m.caller))] | |
76 | 78 | } | |
77 | 79 | ||
78 | 80 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "_" | |
5 | 5 | ||
6 | 6 | let b = "buy" | |
7 | 7 | ||
8 | 8 | let c = "price" | |
9 | 9 | ||
10 | 10 | let d = "sell" | |
11 | 11 | ||
12 | 12 | let e = 7 | |
13 | 13 | ||
14 | 14 | let f = "bid" | |
15 | 15 | ||
16 | 16 | let g = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
17 | 17 | ||
18 | 18 | let h = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
19 | 19 | ||
20 | 20 | func i (j) = { | |
21 | 21 | let k = assetInfo(j) | |
22 | 22 | if ($isInstanceOf(k, "Asset")) | |
23 | 23 | then { | |
24 | 24 | let l = k | |
25 | 25 | if (if ((l.decimals == 0)) | |
26 | 26 | then (l.quantity == 1) | |
27 | 27 | else false) | |
28 | 28 | then (l.reissuable == false) | |
29 | 29 | else false | |
30 | 30 | } | |
31 | 31 | else false | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(m) | |
36 | 36 | func createNft (n,o,p,q,r,s,t,u,v) = { | |
37 | 37 | let w = Issue(n, t, 1, 0, false) | |
38 | 38 | let x = calculateAssetId(w) | |
39 | 39 | let y = m.transactionId | |
40 | 40 | [w, ScriptTransfer(m.caller, 1, x), StringEntry(((toBase58String(x) + a) + "Owner"), toString(m.caller)), StringEntry(((toBase58String(x) + a) + "nft_type"), q), StringEntry(((toBase58String(x) + a) + "nft_tags"), r), StringEntry(((toBase58String(x) + a) + "nft_dAppAddress"), p), IntegerEntry(((toBase58String(x) + a) + "nft_selling_price"), s), StringEntry(((toBase58String(x) + a) + "nft_onSell"), u), StringEntry(((toBase58String(x) + a) + "nft_data"), v), StringEntry(((toBase58String(y) + a) + "issue_nft"), toBase58String(x))] | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(m) | |
46 | - | func sellNFT (z) = { | |
46 | + | func sellNFT (z,A) = { | |
47 | 47 | let y = m.transactionId | |
48 | - | let | |
49 | - | let | |
50 | - | let | |
51 | - | let | |
52 | - | if (!(i( | |
48 | + | let B = m.caller.bytes | |
49 | + | let C = $Tuple2(value(m.payments[0].assetId), value(m.payments[0].amount)) | |
50 | + | let D = C._1 | |
51 | + | let E = C._2 | |
52 | + | if (!(i(D))) | |
53 | 53 | then throw("Token is not NFT") | |
54 | - | else [StringEntry(((c + a) + toBase58String(value(m.payments[0].assetId))), z), StringEntry(((toString(m.caller) + a) + d), ((toBase58String( | |
54 | + | else [StringEntry(((c + a) + toBase58String(value(m.payments[0].assetId))), z), StringEntry(((toString(m.caller) + a) + d), ((toBase58String(D) + a) + toString(E)))] | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | ||
59 | 59 | @Callable(m) | |
60 | - | func buyNFT ( | |
61 | - | let j = fromBase58String( | |
62 | - | let | |
63 | - | let | |
64 | - | let k = getString(this, (("nft_" + | |
60 | + | func buyNFT (F,G) = { | |
61 | + | let j = fromBase58String(F) | |
62 | + | let H = value(m.payments[0].amount) | |
63 | + | let I = { | |
64 | + | let k = getString(this, (("nft_" + G) + "_owner")) | |
65 | 65 | if ($isInstanceOf(k, "String")) | |
66 | 66 | then { | |
67 | - | let | |
68 | - | | |
67 | + | let J = k | |
68 | + | J | |
69 | 69 | } | |
70 | 70 | else false | |
71 | 71 | } | |
72 | - | let z = getStringValue(((((c + a) + E) + "_") + F)) | |
73 | - | if ((F == toString(m.caller))) | |
74 | - | then throw("current Owner of NFT not able to purchase") | |
75 | - | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(F)), G, unit), StringEntry(((toString(m.caller) + a) + b), ((E + a) + toString(G))), DeleteEntry((("nft_" + F) + "_owner")), StringEntry((("nft_" + F) + "_owner"), toString(m.caller)), StringEntry(((E + a) + "_owner"), toString(m.caller))] | |
72 | + | let z = getStringValue(((((c + a) + F) + "_") + G)) | |
73 | + | if ((m.payments[0].assetId != unit)) | |
74 | + | then throw("Only pay in ASIMI or WAVES accepted") | |
75 | + | else if ((G == toString(m.caller))) | |
76 | + | then throw("current Owner of NFT not able to purchase") | |
77 | + | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(G)), H, unit), StringEntry(((toString(m.caller) + a) + b), ((F + a) + toString(H))), DeleteEntry((("nft_" + G) + "_owner")), StringEntry((("nft_" + G) + "_owner"), toString(m.caller)), StringEntry(((F + a) + "_owner"), toString(m.caller))] | |
76 | 78 | } | |
77 | 79 | ||
78 | 80 |
github/deemru/w8io/026f985 56.05 ms ◑