tx · 8UbejayJi9LVB82mvqJxikTYhtgoJ7D5vNPWLksotApM 3Mzz3QCpMamT89CaFaovqXpnCdiUaKtLZ4D: -0.01000000 Waves 2019.06.22 14:35 [553190] smart account 3Mzz3QCpMamT89CaFaovqXpnCdiUaKtLZ4D > SELF 0.00000000 Waves
{ "type": 13, "id": "8UbejayJi9LVB82mvqJxikTYhtgoJ7D5vNPWLksotApM", "fee": 1000000, "feeAssetId": null, "timestamp": 1561203324523, "version": 1, "sender": "3Mzz3QCpMamT89CaFaovqXpnCdiUaKtLZ4D", "senderPublicKey": "BJRaSW2saRv7CcFs3mSYpaVFQSFpZq9rGKnCcRKuKgWv", "proofs": [ "2Za1aGfgtj4g5oYxuxJNUs1jAPoZveoV8uE4oWdHDE6mEYKoJfgLuk2Jy7NXunmS29oyrtNCVx1JLDf8ANBnTnLB" ], "script": "base64:AAIDAAAAAAAAAAAAAAAHAAAAAAROT05FAgAAAARub25lAQAAAApnZXRLZXlJdGVtAAAAAgAAAAhzdXBwbGllcgAAAAV0aXRsZQkAASwAAAACAgAAAAVpdGVtXwkAAlgAAAABCQAB9wAAAAEJAAGbAAAAAQkAASwAAAACBQAAAAhzdXBwbGllcgUAAAAFdGl0bGUBAAAAEmdldEtleUl0ZW1TdXBwbGllcgAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfb3duZXIBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAADmdldEtleUl0ZW1EYXRhAAAAAQAAAARpdGVtCQABLAAAAAIFAAAABGl0ZW0CAAAABV9kYXRhAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PT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Jlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAUcHJpY2U6cHVyY2hhc2VfaXRlbV8FAAAABHR5cGUCAAAACl9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwUAAAAFcHJpY2UFAAAAA25pbAAAAAFpAQAAAAdhZGRJdGVtAAAAAwAAAAV0aXRsZQAAAAVwcmljZQAAAARkYXRhBAAAAA9zdXBwbGllckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAEaXRlbQkBAAAACmdldEtleUl0ZW0AAAACBQAAAA9zdXBwbGllckFkZHJlc3MFAAAABXRpdGxlAwkAAGcAAAACAAAAAAAAAAAABQAAAAVwcmljZQkAAAIAAAABAgAAAC5wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbiBpdGVtIHByaWNlAwkBAAAAAiE9AAAAAgkBAAAAFGdldFZhbHVlSXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQUAAAAETk9ORQkAAAIAAAABAgAAABlhbiBpdGVtcyBpcyBhbHJlYWR5IGV4aXN0CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAASZ2V0S2V5SXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQUAAAAPc3VwcGxpZXJBZGRyZXNzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQUAAAAEaXRlbQUAAAAFcHJpY2UJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA5nZXRLZXlJdGVtRGF0YQAAAAEFAAAABGl0ZW0FAAAABGRhdGEFAAAAA25pbAAAAACSJs3s", "chainId": 84, "height": 553190, "spentComplexity": 0 } View: original | compacted Prev: none Next: EKC61cF24UvhESRWABKAvwmG1BiZ1EMjb7zDrUh39kdc Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = "none" | |
5 | + | ||
6 | + | func b (c,d) = ("item_" + toBase58String(sha256(toBytes((c + d))))) | |
7 | + | ||
8 | + | ||
9 | + | func e (f) = (f + "_owner") | |
10 | + | ||
11 | + | ||
12 | + | func g (f) = (f + "_price") | |
13 | + | ||
14 | + | ||
15 | + | func h (f) = (f + "_data") | |
16 | + | ||
17 | + | ||
18 | + | func i (j) = { | |
19 | + | let k = { | |
20 | + | let l = getString(this, j) | |
21 | + | if ($isInstanceOf(l, "String")) | |
22 | + | then { | |
23 | + | let m = l | |
24 | + | m | |
25 | + | } | |
26 | + | else a | |
27 | + | } | |
28 | + | k | |
29 | + | } | |
30 | + | ||
31 | + | ||
32 | + | func n (f) = i(e(f)) | |
33 | + | ||
34 | + | ||
35 | + | @Callable(o) | |
36 | + | func purchase (p) = { | |
37 | + | let q = extract(o.payment) | |
38 | + | if (isDefined(q.assetId)) | |
39 | + | then throw("can use WAVES only at the moment") | |
40 | + | else { | |
41 | + | let r = toBase58String(o.caller.bytes) | |
42 | + | let s = { | |
43 | + | let l = getInteger(this, (("item_" + p) + "_coupon_price")) | |
44 | + | if ($isInstanceOf(l, "Int")) | |
45 | + | then { | |
46 | + | let m = l | |
47 | + | m | |
48 | + | } | |
49 | + | else 0 | |
50 | + | } | |
51 | + | if ((s > q.amount)) | |
52 | + | then throw("purschase amount cannot be less than item price") | |
53 | + | else if ((q.amount > s)) | |
54 | + | then throw("purchase amount cannot be higher than item price") | |
55 | + | else WriteSet([DataEntry(((("status:purchase_item_" + p) + "_customer_") + r), "confirmed"), DataEntry(((("price:purchase_item_" + p) + "_customer_") + r), s)]) | |
56 | + | } | |
57 | + | } | |
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | @Callable(o) | |
62 | + | func addItem (d,s,t) = { | |
63 | + | let u = toBase58String(o.caller.bytes) | |
64 | + | let f = b(u, d) | |
65 | + | if ((0 >= s)) | |
66 | + | then throw("purchase amount cannot be less than item price") | |
67 | + | else if ((n(f) != a)) | |
68 | + | then throw("an items is already exist") | |
69 | + | else WriteSet([DataEntry(e(f), u), DataEntry(g(f), s), DataEntry(h(f), t)]) | |
70 | + | } | |
71 | + | ||
72 | + |
github/deemru/w8io/169f3d6 33.20 ms ◑