tx · 2xGPBNsfLpWVTGPcd9QBJEUf8A5wb7Xy4cP3DgEimFtx 3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o: -0.05000000 Waves 2019.08.06 15:16 [619040] smart account 3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o > SELF 0.00000000 Waves
{ "type": 13, "id": "2xGPBNsfLpWVTGPcd9QBJEUf8A5wb7Xy4cP3DgEimFtx", "fee": 5000000, "feeAssetId": null, "timestamp": 1565093837847, "version": 1, "sender": "3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o", "senderPublicKey": "Ebb2ffqL8cMnNmXPNvHLy53xrK7t5WaSFhneCPBSoxop", "proofs": [ "48MshA7qEQsEAwadArZtVGPqaV6QWXrzsWBEHmS9bg1qTKTVhREKjsDawN6pW2ZzTLGH389g64WhQ3M87nitXEz7" ], "script": "base64:AAIDAAAAAAAAAAAAAAANAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWkFAAAAByRtYXRjaDAFAAAAAWkAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzBQAAAAROT05FBQAAAANzdHIBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAAEWdldFZhbHVlSXRlbVByaWNlAAAAAQAAAARpdGVtCQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABCQEAAAAPZ2V0S2V5SXR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W0EAAAAD3N1cHBsaWVyQWRkcmVzcwkBAAAAFGdldFZhbHVlSXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQMJAABmAAAAAgUAAAAFcHJpY2UIBQAAAAdwYXltZW50AAAABmFtb3VudAkAAAIAAAABAgAAAB5QbGVhc2Ugc2VuZCBleGFjdCBjb3Vwb24gcHJpY2UDCQAAZgAAAAIIBQAAAAdwYXltZW50AAAABmFtb3VudAUAAAAFcHJpY2UJAAACAAAAAQIAAAAeUGxlYXNlIHNlbmQgZXhhY3QgY291cG9uIHByaWNlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAVZ2V0S2V5VXNlckl0ZW1Db3VudGVyAAAAAgUAAAALdXNlckFkZHJlc3MFAAAABGl0ZW0JAABkAAAAAgkBAAAAF2dldFZhbHVlVXNlckl0ZW1Db3VudGVyAAAAAgUAAAALdXNlckFkZHJlc3MFAAAABGl0ZW0AAAAAAAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABVnZXRLZXlCYWxhbmNlU3VwcGxpZXIAAAABBQAAAA9zdXBwbGllckFkZHJlc3MJAABkAAAAAgkBAAAAFmdldFZhbHVlQmFsYW5jZVN1cGxpZXIAAAABBQAAAA9zdXBwbGllckFkZHJlc3MIBQAAAAdwYXltZW50AAAABmFtb3VudAUAAAADbmlsAAAAAH42dDs=", "chainId": 84, "height": 619040, "spentComplexity": 0 } View: original | compacted Prev: 4ue3bbAyLyduYEfhLWf7K87Bqy8jJeqMwDqenqpw24rd Next: 3HGTZWJH9WeaqStV5m2Aezjv6wBqqNX6486mUJD8yo1y Diff:
Old | New | Differences | |
---|---|---|---|
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | + | ||
77 | + | @Callable(y) | |
78 | + | func purchase (k) = { | |
79 | + | let C = extract(y.payment) | |
80 | + | if (isDefined(C.assetId)) | |
81 | + | then throw("Only payments in WAVES are avalible") | |
82 | + | else { | |
83 | + | let D = toBase58String(y.caller.bytes) | |
84 | + | let z = l(k) | |
85 | + | let B = u(k) | |
86 | + | if ((z > C.amount)) | |
87 | + | then throw("Please send exact coupon price") | |
88 | + | else if ((C.amount > z)) | |
89 | + | then throw("Please send exact coupon price") | |
90 | + | else WriteSet([DataEntry(m(D, k), (o(D, k) + 1)), DataEntry(v(B), (x(B) + C.amount))]) | |
91 | + | } | |
92 | + | } | |
93 | + | ||
94 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "none" | |
5 | 5 | ||
6 | 6 | func b (c) = { | |
7 | 7 | let d = { | |
8 | 8 | let e = getInteger(this, c) | |
9 | 9 | if ($isInstanceOf(e, "Int")) | |
10 | 10 | then { | |
11 | 11 | let f = e | |
12 | 12 | f | |
13 | 13 | } | |
14 | 14 | else 0 | |
15 | 15 | } | |
16 | 16 | d | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func g (c) = { | |
21 | 21 | let h = { | |
22 | 22 | let e = getString(this, c) | |
23 | 23 | if ($isInstanceOf(e, "String")) | |
24 | 24 | then { | |
25 | 25 | let i = e | |
26 | 26 | i | |
27 | 27 | } | |
28 | 28 | else a | |
29 | 29 | } | |
30 | 30 | h | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func j (k) = (k + "_price") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func l (k) = b(j(k)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func m (n,k) = (((k + "_") + n) + "_cnt") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func o (n,k) = b(m(n, k)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func p (q,r) = ("ietm_" + toBase58String(sha256(toBytes((q + r))))) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func s (k) = (k + "_data") | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func t (k) = (k + "_owner") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func u (k) = g(t(k)) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func v (w) = (w + "_balance") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func x (w) = b(v(w)) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | @Callable(y) | |
65 | 65 | func addItem (r,z,A) = { | |
66 | 66 | let B = toBase58String(y.caller.bytes) | |
67 | 67 | let k = p(B, r) | |
68 | 68 | if ((0 >= z)) | |
69 | 69 | then throw("Please add valid price") | |
70 | 70 | else if ((u(k) != a)) | |
71 | 71 | then throw((k + " - item already exists")) | |
72 | 72 | else WriteSet([DataEntry(t(k), B), DataEntry(j(k), z), DataEntry(s(k), A)]) | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | + | ||
77 | + | @Callable(y) | |
78 | + | func purchase (k) = { | |
79 | + | let C = extract(y.payment) | |
80 | + | if (isDefined(C.assetId)) | |
81 | + | then throw("Only payments in WAVES are avalible") | |
82 | + | else { | |
83 | + | let D = toBase58String(y.caller.bytes) | |
84 | + | let z = l(k) | |
85 | + | let B = u(k) | |
86 | + | if ((z > C.amount)) | |
87 | + | then throw("Please send exact coupon price") | |
88 | + | else if ((C.amount > z)) | |
89 | + | then throw("Please send exact coupon price") | |
90 | + | else WriteSet([DataEntry(m(D, k), (o(D, k) + 1)), DataEntry(v(B), (x(B) + C.amount))]) | |
91 | + | } | |
92 | + | } | |
93 | + | ||
94 | + |
github/deemru/w8io/169f3d6 31.48 ms ◑