tx · BwpMAdzDApyQH2yPfTvRS5kxYPkPCRobxq7pV1rJ6rDQ 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq: -0.01000000 Waves 2022.11.22 12:30 [2328148] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves
{ "type": 13, "id": "BwpMAdzDApyQH2yPfTvRS5kxYPkPCRobxq7pV1rJ6rDQ", "fee": 1000000, "feeAssetId": null, "timestamp": 1669109507244, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "3BKLSnMv4G6fVKgENn5zPYR85BhSHNNWMRx16omeuyeQjDzQXAQ1Uyb7gb7WL9fS4wVbSgoVWVnV1qEhAQMgZ2Ah" ], "script": "base64:BgIfCAISCwoJCAgICAgBCAgIEgQKAggIEgMKAQgSAwoBAQUACXNlcGFyYXRvcgIBXwAEa0J1eQIDYnV5AAVrU2VsbAIEc2VsbAAGa1ByaWNlAgVwcmljZQEFaXNOZnQBB2Fzc2V0SWQEByRtYXRjaDAJAOwHAQUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgVBc3NldAQFdG9rZW4FByRtYXRjaDADAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwcEAWkBCGlzc3VlTmZ0CQhuZnRfbmFtZQluZnRfb3duZXIPbmZ0X2RBcHBBZGRyZXNzCG5mdF90eXBlCG5mdF90YWdzEW5mdF9zZWxsaW5nX3ByaWNlD25mdF9kZXNjcmlwdGlvbgpuZnRfb25TZWxsCG5mdF9kYXRhBAhuZXdUb2tlbgkAwggFBQhuZnRfbmFtZQUPbmZ0X2Rlc2NyaXB0aW9uAAEAAAcEBHR4SWQIBQFpDXRyYW5zYWN0aW9uSWQEB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NlbGxORlQBBXByaWNlBAskdDAyNDkzMjU3OAkAlAoCCQEFdmFsdWUBCAkAkQMCCAUBaQhwYXltZW50cwAAB2Fzc2V0SWQJAQV2YWx1ZQEICQCRAwIIBQFpCHBheW1lbnRzAAAGYW1vdW50BAZ0b2tlbjAIBQskdDAyNDkzMjU3OAJfMQQHYW1vdW50MAgFCyR0MDI0OTMyNTc4Al8yBAdhc3NldGlkCQEFdmFsdWUBCAkAkQMCCAUBaQhwYXltZW50cwAAB2Fzc2V0SWQDCQEBIQEJAQVpc05mdAEFBnRva2VuMAkAAgECEFRva2VuIGlzIG5vdCBORlQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQDYBAEFB2Fzc2V0aWQCBl9vd25lcgkApQgBCAUBaQZjYWxsZXIJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkA2AQBBQdhc3NldGlkAhJfbmZ0X3NlbGxpbmdfcHJpY2UFBXByaWNlCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkA2AQBBQdhc3NldGlkAgdfb25zZWxsAgR0cnVlCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIJAKwCAgUGa1ByaWNlBQlzZXBhcmF0b3IJANgEAQkBBXZhbHVlAQgJAJEDAggFAWkIcGF5bWVudHMAAAdhc3NldElkBQVwcmljZQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkApQgBCAUBaQZjYWxsZXIFCXNlcGFyYXRvcgUFa1NlbGwJAKwCAgkArAICCQDYBAEFBnRva2VuMAUJc2VwYXJhdG9yCQCkAwEFB2Ftb3VudDAFA25pbACTdSzQ", "height": 2328148, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6ZBFVJgRPxwqbNF3tCyL5yFArGuFUgGQRrzVkzmqJgPj Next: ERF1sLvsJ76NijdJw7hbdWw7drbvMxX8NLzhddCfdzDR Diff:
Old | New | Differences | |
---|---|---|---|
66 | 66 | let E = value(i.payments[0].assetId) | |
67 | 67 | if (!(e(C))) | |
68 | 68 | then throw("Token is not NFT") | |
69 | - | else [StringEntry((toBase58String(E) + "_owner"), toString(i.caller)), | |
69 | + | else [StringEntry((toBase58String(E) + "_owner"), toString(i.caller)), IntegerEntry((toBase58String(E) + "_nft_selling_price"), z), StringEntry((toBase58String(E) + "_onsell"), "true"), IntegerEntry(((d + a) + toBase58String(value(i.payments[0].assetId))), z), StringEntry(((toString(i.caller) + a) + c), ((toBase58String(C) + a) + toString(D)))] | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 |
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 = "sell" | |
9 | 9 | ||
10 | 10 | let d = "price" | |
11 | 11 | ||
12 | 12 | func e (f) = { | |
13 | 13 | let g = assetInfo(f) | |
14 | 14 | if ($isInstanceOf(g, "Asset")) | |
15 | 15 | then { | |
16 | 16 | let h = g | |
17 | 17 | if (if ((h.decimals == 0)) | |
18 | 18 | then (h.quantity == 1) | |
19 | 19 | else false) | |
20 | 20 | then (h.reissuable == false) | |
21 | 21 | else false | |
22 | 22 | } | |
23 | 23 | else false | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | @Callable(i) | |
28 | 28 | func issueNft (j,k,l,m,n,o,p,q,r) = { | |
29 | 29 | let s = Issue(j, p, 1, 0, false) | |
30 | 30 | let t = i.transactionId | |
31 | 31 | let u = calculateAssetId(s) | |
32 | 32 | [s, ScriptTransfer(i.caller, 1, u), StringEntry(((toBase58String(u) + a) + "Owner"), toString(i.caller)), StringEntry(((toBase58String(u) + a) + "nft_type"), m), StringEntry(((toBase58String(u) + a) + "nft_tags"), n), StringEntry(((toBase58String(u) + a) + "nft_dAppAddress"), l), IntegerEntry(((toBase58String(u) + a) + "nft_selling_price"), o), StringEntry(((toBase58String(u) + a) + "nft_onSell"), q), StringEntry(((toBase58String(u) + a) + "nft_data"), r), StringEntry(((toBase58String(t) + a) + "issue_nft"), toBase58String(u))] | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(i) | |
38 | 38 | func createNFT (v,w) = { | |
39 | 39 | let s = Issue(v, w, 1, 0, false) | |
40 | 40 | let u = calculateAssetId(s) | |
41 | 41 | [s, ScriptTransfer(i.caller, 1, u), StringEntry(((toBase58String(u) + a) + "Owner"), toString(i.caller))] | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func buyNFT (x) = { | |
48 | 48 | let f = fromBase58String(x) | |
49 | 49 | let y = value(i.payments[0].amount) | |
50 | 50 | let z = valueOrErrorMessage(getString(((d + a) + x)), "There is no price for this NFT") | |
51 | 51 | let A = valueOrErrorMessage(getStringValue(((x + a) + "Owner")), "No owner") | |
52 | 52 | if ((i.payments[0].assetId != unit)) | |
53 | 53 | then throw("Pay in waves") | |
54 | 54 | else if ((parseIntValue(z) > y)) | |
55 | 55 | then throw("Invalid payment") | |
56 | 56 | else [ScriptTransfer(i.caller, 1, f), ScriptTransfer(value(addressFromString(A)), parseIntValue(z), unit), StringEntry(((toString(i.caller) + a) + b), ((x + a) + toString(y)))] | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | 61 | @Callable(i) | |
62 | 62 | func sellNFT (z) = { | |
63 | 63 | let B = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
64 | 64 | let C = B._1 | |
65 | 65 | let D = B._2 | |
66 | 66 | let E = value(i.payments[0].assetId) | |
67 | 67 | if (!(e(C))) | |
68 | 68 | then throw("Token is not NFT") | |
69 | - | else [StringEntry((toBase58String(E) + "_owner"), toString(i.caller)), | |
69 | + | else [StringEntry((toBase58String(E) + "_owner"), toString(i.caller)), IntegerEntry((toBase58String(E) + "_nft_selling_price"), z), StringEntry((toBase58String(E) + "_onsell"), "true"), IntegerEntry(((d + a) + toBase58String(value(i.payments[0].assetId))), z), StringEntry(((toString(i.caller) + a) + c), ((toBase58String(C) + a) + toString(D)))] | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 |
github/deemru/w8io/169f3d6 43.78 ms ◑