tx · Ekmu7FTLfcuz5ukSt4u2E5DZg2KuS5thazwUArfwmh3Y 3N9cKCHp6ZLMgz7rRgF8Q8DEt8zbtd1Ht7F: -0.01000000 Waves 2022.12.14 08:08 [2359539] smart account 3N9cKCHp6ZLMgz7rRgF8Q8DEt8zbtd1Ht7F > SELF 0.00000000 Waves
{ "type": 13, "id": "Ekmu7FTLfcuz5ukSt4u2E5DZg2KuS5thazwUArfwmh3Y", "fee": 1000000, "feeAssetId": null, "timestamp": 1670994635652, "version": 2, "chainId": 84, "sender": "3N9cKCHp6ZLMgz7rRgF8Q8DEt8zbtd1Ht7F", "senderPublicKey": "3V22YUj3GF4AeBxdWx8rgGdG4groE4W6P2s4sAkshe7R", "proofs": [ "SdkNNc5GCGtxt7gaXCsGrfFEAFdMrrdStnCUpv5cCcNDPg4vZn4jQcqZpUyeERvbMWMy5TFRUj5Y6uyAJfdash3" ], "script": "base64:BgIaCAISCwoJCAgICAgBCAgIEgMKAQESBAoCCAgJAAlzZXBhcmF0b3ICAV8ABGtCdXkCA2J1eQAGa1ByaWNlAgVwcmljZQAFa1NlbGwCBHNlbGwAEm1heEF1Y3Rpb25EdXJhdGlvbgAHAARrQmlkAgNiaWQADHN0YXR1c0Zvck5GVAkAlgoEAgRPUEVOAgZDTE9TRUQCCFJFV0FSREVEAghDQU5DRUxFRAALZEFwcEFkZHJlc3MBGgFUSrhPbN7C2pPt9I7pSjb41U9/ldVVW12gAQVpc05mdAEHYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAV0b2tlbgUHJG1hdGNoMAMDCQAAAggFBXRva2VuCGRlY2ltYWxzAAAJAAACCAUFdG9rZW4IcXVhbnRpdHkAAQcJAAACCAUFdG9rZW4KcmVpc3N1YWJsZQcHBwMBaQEJY3JlYXRlTmZ0CQhuZnRfbmFtZQluZnRfb3duZXIPbmZ0X2RBcHBBZGRyZXNzCG5mdF90eXBlCG5mdF90YWdzEW5md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CsAgIJAKwCAgkArAICBQZrUHJpY2UFCXNlcGFyYXRvcgUFbmZ0SUQCAV8FEWN1cnJlbnRfbmZ0X293bmVyBAVvd25lcgkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQERQGV4dHJOYXRpdmUoMTA1OCkBCQCsAgIJAKwCAgUFbmZ0SUQFCXNlcGFyYXRvcgIFT3duZXICCE5vIG93bmVyAwkAAAIICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAUEdW5pdAkAAgECDFBheSBpbiB3YXZlcwMJAAACBRBjaGVja093bmVySXNTYW1lCQClCAEIBQFpBmNhbGxlcgkAAgECIU93bmVyIG9mIE5GVCBub3QgYWJsZSB0byBwdXJjaGFzZQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAAQUHYXNzZXRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUFb3duZXIFBmFtb3VudAUEdW5pdAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkApQgBCAUBaQZjYWxsZXIFCXNlcGFyYXRvcgUEa0J1eQkArAICCQCsAgIFBW5mdElEBQlzZXBhcmF0b3IJAKQDAQUGYW1vdW50CQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyBQNuaWwAPZXznw==", "height": 2359539, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3PuUa8uTcJMEXfpaEg13mXoYeRr1WBcVUCtJ2yCKuC4j Next: B9KNTgEvRb8PDtC5xa5YrfyoqmAbiw2xRkcophLapEjb Diff:
Old | New | Differences | |
---|---|---|---|
71 | 71 | } | |
72 | 72 | let z = getStringValue(((((c + a) + E) + "_") + F)) | |
73 | 73 | let J = valueOrErrorMessage(getStringValue(((E + a) + "Owner")), "No owner") | |
74 | - | if ((m.payments[0].assetId | |
74 | + | if ((m.payments[0].assetId == unit)) | |
75 | 75 | then throw("Pay in waves") | |
76 | 76 | else if ((H == toString(m.caller))) | |
77 | 77 | then throw("Owner of NFT not able to purchase") |
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 | 46 | func sellNFT (z) = { | |
47 | 47 | let y = m.transactionId | |
48 | 48 | let A = m.caller.bytes | |
49 | 49 | let B = $Tuple2(value(m.payments[0].assetId), value(m.payments[0].amount)) | |
50 | 50 | let C = B._1 | |
51 | 51 | let D = B._2 | |
52 | 52 | if (!(i(C))) | |
53 | 53 | then throw("Token is not NFT") | |
54 | 54 | else [StringEntry(((c + a) + toBase58String(value(m.payments[0].assetId))), toString(z)), StringEntry(((toString(m.caller) + a) + d), ((toBase58String(C) + a) + toString(D)))] | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | ||
59 | 59 | @Callable(m) | |
60 | 60 | func buyNFT (E,F) = { | |
61 | 61 | let j = fromBase58String(E) | |
62 | 62 | let G = value(m.payments[0].amount) | |
63 | 63 | let H = { | |
64 | 64 | let k = getString(this, (("nft_" + F) + "_owner")) | |
65 | 65 | if ($isInstanceOf(k, "String")) | |
66 | 66 | then { | |
67 | 67 | let I = k | |
68 | 68 | I | |
69 | 69 | } | |
70 | 70 | else false | |
71 | 71 | } | |
72 | 72 | let z = getStringValue(((((c + a) + E) + "_") + F)) | |
73 | 73 | let J = valueOrErrorMessage(getStringValue(((E + a) + "Owner")), "No owner") | |
74 | - | if ((m.payments[0].assetId | |
74 | + | if ((m.payments[0].assetId == unit)) | |
75 | 75 | then throw("Pay in waves") | |
76 | 76 | else if ((H == toString(m.caller))) | |
77 | 77 | then throw("Owner of NFT not able to purchase") | |
78 | 78 | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(J)), G, unit), StringEntry(((toString(m.caller) + a) + b), ((E + a) + toString(G))), DeleteEntry((("nft_" + F) + "_owner"))] | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 |
github/deemru/w8io/026f985 28.56 ms ◑