tx · 48xskAHzutcnA19wWcGHp2UFaSoH54ia5DxEcd8sGZLn 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H: -0.01000000 Waves 2022.11.11 13:07 [2312335] smart account 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H > SELF 0.00000000 Waves
{ "type": 13, "id": "48xskAHzutcnA19wWcGHp2UFaSoH54ia5DxEcd8sGZLn", "fee": 1000000, "feeAssetId": null, "timestamp": 1668161286099, "version": 2, "chainId": 84, "sender": "3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H", "senderPublicKey": "BDeCphaaC4MZvfmbJqQZ78EvuEBZTJ1VEW7fbxue8BUu", "proofs": [ "2ELiXCFq2bU1XdfajfrM74XBeay2BfmRFsaki4j2ZGVupQLCgXtoe9qNgytPntteSxSZkgJnK55wizsHR6K1hNwS" ], "script": "base64:BgISCAISBAoCCAgSAwoBCBIDCgEBBQAJc2VwYXJhdG9yAgFfAARrQnV5AgNidXkABWtTZWxsAgRzZWxsAAZrUHJpY2UCBXByaWNlAQVpc05mdAEHYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAV0b2tlbgUHJG1hdGNoMAMDCQAAAggFBXRva2VuCGRlY2ltYWxzAAAJAAACCAUFdG9rZW4IcXVhbnRpdHkAAQcJAAACCAUFdG9rZW4KcmVpc3N1YWJsZQcHBwMBaQEIaXNzdWVOZnQCBG5hbWUEbWV0YQQIbmV3VG9rZW4JAMIIBQUEbmFtZQUEbWV0YQABAAAHBAdpc3N1ZUlkCQC4CAEFCG5ld1Rva2VuCQDMCAIFCG5ld1Rva2VuCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgABBQdpc3N1ZUlkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQDYBAEFB2lzc3VlSWQFCXNlcGFyYXRvcgIFT3duZXIJAKUIAQgFAWkGY2FsbGVyBQNuaW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CQEFaXNOZnQBBQZ0b2tlbjAJAAIBAhBUb2tlbiBpcyBub3QgTkZUCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICBQZrUHJpY2UFCXNlcGFyYXRvcgkA2AQBCQEFdmFsdWUBCAkAkQMCCAUBaQhwYXltZW50cwAAB2Fzc2V0SWQJAKQDAQUFcHJpY2UJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJAKUIAQgFAWkGY2FsbGVyBQlzZXBhcmF0b3IFBWtTZWxsCQCsAgIJAKwCAgkA2AQBBQZ0b2tlbjAFCXNlcGFyYXRvcgkApAMBBQdhbW91bnQwBQNuaWwA77hsug==", "height": 2312335, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EcxZeLzmt4g7gXgLDKVKYjy5N3iiZzKPWZtH1RUkYV8r Next: E8HzhmX6gT8ikkWCo1GU8PNzmTgnYumZdpeXmZRQmQAF Full:
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) = { | |
29 | 29 | let l = Issue(j, k, 1, 0, false) | |
30 | 30 | let m = calculateAssetId(l) | |
31 | 31 | [l, ScriptTransfer(i.caller, 1, m), StringEntry(((toBase58String(m) + a) + "Owner"), toString(i.caller))] | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func buyNFT (n) = { | |
38 | 38 | let f = fromBase58String(n) | |
39 | 39 | let o = value(i.payments[0].amount) | |
40 | 40 | let p = valueOrErrorMessage(getString(((d + a) + n)), "There is no price for this NFT") | |
41 | 41 | let q = valueOrErrorMessage(getStringValue(((n + a) + "Owner")), "No owner") | |
42 | 42 | if ((i.payments[0].assetId != unit)) | |
43 | 43 | then throw("Pay in waves") | |
44 | 44 | else if ((parseIntValue(p) > o)) | |
45 | 45 | then throw("Invalid payment") | |
46 | 46 | else [ScriptTransfer(i.caller, 1, f), ScriptTransfer(value(addressFromString(q)), parseIntValue(p), unit), StringEntry(((toString(i.caller) + a) + b), ((n + a) + toString(o)))] | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(i) | |
52 | 52 | func sellNFT (p) = { | |
53 | 53 | let r = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
54 | 54 | let s = r._1 | |
55 | 55 | let t = r._2 | |
56 | 56 | if (!(e(s))) | |
57 | 57 | then throw("Token is not NFT") | |
58 | 58 | else [StringEntry(((d + a) + toBase58String(value(i.payments[0].assetId))), toString(p)), StringEntry(((toString(i.caller) + a) + c), ((toBase58String(s) + a) + toString(t)))] | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 |
github/deemru/w8io/026f985 38.28 ms ◑