tx · 6dAyneXWeqL89wpCGYDX3eSFuZrM91wL3mkaP8tcfNMq 3My7JvybytBTv6LBND2MeZCbkeUS7jR3PiK: -0.01000000 Waves 2022.11.10 08:56 [2310652] smart account 3My7JvybytBTv6LBND2MeZCbkeUS7jR3PiK > SELF 0.00000000 Waves
{ "type": 13, "id": "6dAyneXWeqL89wpCGYDX3eSFuZrM91wL3mkaP8tcfNMq", "fee": 1000000, "feeAssetId": null, "timestamp": 1668059778296, "version": 2, "chainId": 84, "sender": "3My7JvybytBTv6LBND2MeZCbkeUS7jR3PiK", "senderPublicKey": "FVTpXbDNs3kNEiYy4vjvjfzxbQim8PuN6fNLFntwM31j", "proofs": [ "4rKY48req45eXp6NmK9hRLVugbVmuEBATTMpJtzCQGJKAemfp2jU5eCPHWhXmu9HdJJZ55CU7wCyEE4YpSQKcavo" ], "script": "base64:AAIFAAAAAAAAABAIAhIFCgMICAESAwoBCBIAAAAABQAAAAAJc2VwYXJhdG9yAgAAAAFfAAAAAARrQnV5AgAAAANidXkAAAAABWtTZWxsAgAAAARzZWxsAAAAAAZrUHJpY2UCAAAABXByaWNlAQAAAAVpc05mdAAAAAEAAAAHYXNzZXRJZAQAAAAHJG1hdGNoMAkAA+wAAAABBQAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAVBc3NldAQAAAAFdG9rZW4FAAAAByRtYXRjaDADAwkAAAAAAAACCAUAAAAFdG9rZW4AAAAIZGVjaW1hbHMAAAAAAAAAAAAJAAAAAAAAAggFAAAABXRva2VuAAAACHF1YW50aXR5AAAAAAAAAAABBwkAAAAAAAACCAUAAAAFdG9rZW4AAAAKcmVpc3N1YWJsZQcHBwAAAAMAAAABaQEAAAAIaXNzdWVOZnQAAAADAAAABG5hbWUAAAAEbWV0YQAAAAVwcmljZQQAAAAIbmV3VG9rZW4JAARCAAAABQUAAAAEbmFtZQUAAAAEbWV0YQAAAAAAAAAAAQAAAAAAAAAAAAcEAAAAB2lzc3VlSWQJAAQ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udAUAAAADbmlsAAAAAWkBAAAAB3NlbGxORlQAAAAABAAAAAskdDAxMTczMTI1OAkABRQAAAACCQEAAAAFdmFsdWUAAAABCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAdhc3NldElkCQEAAAAFdmFsdWUAAAABCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQEAAAABnRva2VuMAgFAAAACyR0MDExNzMxMjU4AAAAAl8xBAAAAAdhbW91bnQwCAUAAAALJHQwMTE3MzEyNTgAAAACXzIEAAAABXByaWNlCQEAAAARQGV4dHJOYXRpdmUoMTA1OCkAAAABCQABLAAAAAIJAAEsAAAAAgUAAAAGa1ByaWNlBQAAAAlzZXBhcmF0b3IJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkAAlgAAAABBQAAAAZ0b2tlbjACAAAAHlRoZXJlIGlzIG5vIHByaWNlIGZvciB0aGlzIG5mdAMJAQAAAAEhAAAAAQkBAAAABWlzTmZ0AAAAAQUAAAAGdG9rZW4wCQAAAgAAAAECAAAAEFRva2VuIGlzIG5vdCBORlQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyCQEAAAANcGFyc2VJbnRWYWx1ZQAAAAEFAAAABXByaWNlBQAAAAR1bml0CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgUAAAAJc2VwYXJhdG9yBQAAAAVrU2VsbAkAASwAAAACCQABLAAAAAIJAAJYAAAAAQUAAAAGdG9rZW4wBQAAAAlzZXBhcmF0b3IJAAGkAAAAAQUAAAAHYW1vdW50MAUAAAADbmlsAAAAAMC2gcI=", "height": 2310652, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6x4aY6ZaNaZzGgKHPUr7VAyyDKQEBckyroE3JGAE3Hp2 Next: 7CPpvKifNrYRatTqKnSQveksxB1gZo3e93spMEDPoxaT Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
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) = { | |
29 | 29 | let m = Issue(j, k, 1, 0, false) | |
30 | 30 | let n = calculateAssetId(m) | |
31 | 31 | [m, StringEntry(((d + a) + toBase58String(n)), toString(l))] | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func buyNFT (o) = { | |
38 | 38 | let f = fromBase58String(o) | |
39 | 39 | let p = value(i.payments[0].amount) | |
40 | 40 | let l = valueOrErrorMessage(getString(((d + a) + o)), "There is no price for this nft") | |
41 | 41 | if ((i.payments[0].assetId != unit)) | |
42 | 42 | then throw("pay in waves") | |
43 | 43 | else if ((parseIntValue(l) > p)) | |
44 | 44 | then throw("Invalid payment") | |
45 | 45 | else [ScriptTransfer(i.caller, 1, f), StringEntry(((toString(i.caller) + a) + b), ((o + a) + toString(p)))] | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(i) | |
51 | 51 | func sellNFT () = { | |
52 | 52 | let q = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
53 | 53 | let r = q._1 | |
54 | 54 | let s = q._2 | |
55 | 55 | let l = getStringValue(((d + a) + valueOrErrorMessage(toBase58String(r), "There is no price for this nft"))) | |
56 | 56 | if (!(e(r))) | |
57 | 57 | then throw("Token is not NFT") | |
58 | 58 | else [ScriptTransfer(i.caller, parseIntValue(l), unit), StringEntry(((toString(i.caller) + a) + c), ((toBase58String(r) + a) + toString(s)))] | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 |
github/deemru/w8io/169f3d6 197.72 ms ◑