tx · EgKs4AaKg79xcC5qaAqcTQ8WwAZk8vHZsCXKXeUuvagp 3Mx9FcvbywzbM3uTGL1ocnC6Yz4LwG6VNnQ: -0.01400000 Waves 2020.09.23 08:24 [1189522] smart account 3Mx9FcvbywzbM3uTGL1ocnC6Yz4LwG6VNnQ > SELF 0.00000000 Waves
{ "type": 13, "id": "EgKs4AaKg79xcC5qaAqcTQ8WwAZk8vHZsCXKXeUuvagp", "fee": 1400000, "feeAssetId": null, "timestamp": 1600838706918, "version": 2, "chainId": 84, "sender": "3Mx9FcvbywzbM3uTGL1ocnC6Yz4LwG6VNnQ", "senderPublicKey": "3rxJnS9mVKpfLXyuwkosSTVgnu1cZ6cGj1WTVNqrhcyd", "proofs": [ "64uq5XUDTqkFXwCgHe6nXNv8f9MiVYrwmHp7S6BZcWF2mDM7qWBdA39WBEhe697atUwkRGvorK7UxngRU29YzHF5" ], "script": "base64:AAIEAAAAAAAAACEIAhIECgIIARIDCgEIEgMKAQgSBAoCCAgSBQoDCAgIEgAAAAAHAAAAAAZMRVNTT04BAAAAIOjnSHw4js1vrbOhaypqBgUMh7yKo+Dj/vvXlCSDAODpAAAAAARQQVI3AQAAACDOWED9mOK0xZN34xzFUmgrQZwssasR1XxpyjfnkulHjAAAAAAUbGVzc29uQ29hY2hQdWJsaWNLZXkBAAAAIJEV1LNN0Z9m46J3ebNUFkD8Hn3i3U/7YD3XLgZSbu1vAAAAAAdwZW5kaW5nAAAAAAAAAAAAAAAAAAVzdGFydAAAAAAAAAAAAQAAAAADZW5kAAAAAAAAAAACAAAAAAxwYXltZW50VG9rZW4FAAAABFBBUjcAAAAGAAAAAWkBAAAAEWlzc3VlTGVzc29uVGlja2V0AAAAAgAAAARqc29uAAAABXByaWNlBAAAAANwbXQJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABkxFU1NPTgkAAAIAAAABAgAAABZ3b3Jr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YAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAAhvd25lcktleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACAAAAAAAAAAAABQAAAA1jdXJyZW50QW1vdW50CQAAAgAAAAECAAAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAIb3duZXJLZXkAAAAAAAAAAAAJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA1jdXJyZW50QW1vdW50BQAAAARQQVI3BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRuW9DA=", "height": 1189522, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5N4w5gAVo7s6RBj4c3LihKgx1UtnPL9h7FPx8EAZP1E3 Next: Ad9jxEXHCKN4xK8n3HBp6vLCFVbGuH4q1LZ5jzGuJHYu Diff:
Old | New | Differences | |
---|---|---|---|
151 | 151 | } | |
152 | 152 | else 0 | |
153 | 153 | } | |
154 | - | let L = (I | |
154 | + | let L = (I * x) | |
155 | 155 | let M = ("owner_balance_" + toBase58String(h.caller.bytes)) | |
156 | 156 | let N = { | |
157 | 157 | let n = getInteger(this, M) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'GgA8mL3SEYvuhYoZFd418Li4bqXAasGbYCKJshTt2MGU' | |
5 | 5 | ||
6 | 6 | let b = base58'EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm' | |
7 | 7 | ||
8 | 8 | let c = base58'AmMRZeqDosA2ygpV6GTCJrK3KVvrf4ST7ECPj9pub4mU' | |
9 | 9 | ||
10 | 10 | let d = 0 | |
11 | 11 | ||
12 | 12 | let e = 1 | |
13 | 13 | ||
14 | 14 | let f = 2 | |
15 | 15 | ||
16 | 16 | let g = b | |
17 | 17 | ||
18 | 18 | @Callable(h) | |
19 | 19 | func issueLessonTicket (i,j) = { | |
20 | 20 | let k = h.payments[0] | |
21 | 21 | if ((k.assetId != a)) | |
22 | 22 | then throw("works with LESSON only") | |
23 | 23 | else { | |
24 | 24 | let l = "issueNumber" | |
25 | 25 | let m = { | |
26 | 26 | let n = getInteger(this, l) | |
27 | 27 | if ($isInstanceOf(n, "Int")) | |
28 | 28 | then { | |
29 | 29 | let o = n | |
30 | 30 | o | |
31 | 31 | } | |
32 | 32 | else 0 | |
33 | 33 | } | |
34 | 34 | let p = (m + 1) | |
35 | 35 | let q = toString(p) | |
36 | 36 | let r = (("TICKET_" + q) + "_details") | |
37 | 37 | let s = (("TICKET_" + q) + "_price") | |
38 | 38 | let t = (("TICKET_" + q) + "_balance") | |
39 | 39 | let u = { | |
40 | 40 | let n = getInteger(this, t) | |
41 | 41 | if ($isInstanceOf(n, "Int")) | |
42 | 42 | then { | |
43 | 43 | let o = n | |
44 | 44 | o | |
45 | 45 | } | |
46 | 46 | else 0 | |
47 | 47 | } | |
48 | 48 | let v = (u + k.amount) | |
49 | 49 | [IntegerEntry(s, j), IntegerEntry(l, p), StringEntry(r, i), IntegerEntry(t, v)] | |
50 | 50 | } | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | ||
55 | 55 | @Callable(h) | |
56 | 56 | func buyTicket (w) = { | |
57 | 57 | let k = h.payments[0] | |
58 | 58 | let s = (("TICKET_" + w) + "_price") | |
59 | 59 | let x = { | |
60 | 60 | let n = getInteger(this, s) | |
61 | 61 | if ($isInstanceOf(n, "Int")) | |
62 | 62 | then { | |
63 | 63 | let o = n | |
64 | 64 | o | |
65 | 65 | } | |
66 | 66 | else 0 | |
67 | 67 | } | |
68 | 68 | let y = x | |
69 | 69 | let z = (k.amount / y) | |
70 | 70 | if ((k.assetId != g)) | |
71 | 71 | then throw("works with PAR7 only") | |
72 | 72 | else { | |
73 | 73 | let A = ("buy_" + toBase58String(h.caller.bytes)) | |
74 | 74 | let B = { | |
75 | 75 | let n = getInteger(this, A) | |
76 | 76 | if ($isInstanceOf(n, "Int")) | |
77 | 77 | then { | |
78 | 78 | let o = n | |
79 | 79 | o | |
80 | 80 | } | |
81 | 81 | else 0 | |
82 | 82 | } | |
83 | 83 | let C = (B + z) | |
84 | 84 | let t = (("TICKET_" + w) + "_balance") | |
85 | 85 | let u = { | |
86 | 86 | let n = getInteger(this, t) | |
87 | 87 | if ($isInstanceOf(n, "Int")) | |
88 | 88 | then { | |
89 | 89 | let o = n | |
90 | 90 | o | |
91 | 91 | } | |
92 | 92 | else 0 | |
93 | 93 | } | |
94 | 94 | let v = (u - z) | |
95 | 95 | [IntegerEntry(A, C), IntegerEntry(t, v), ScriptTransfer(h.caller, z, a)] | |
96 | 96 | } | |
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | ||
101 | 101 | @Callable(h) | |
102 | 102 | func lessonSubscription (D) = { | |
103 | 103 | let k = h.payments[0] | |
104 | 104 | let E = k.assetId | |
105 | 105 | let F = toBase58String(h.caller.bytes) | |
106 | 106 | let G = ((("status_" + D) + "_") + F) | |
107 | 107 | let H = ((("payment_" + D) + "_") + F) | |
108 | 108 | let I = { | |
109 | 109 | let n = getInteger(this, H) | |
110 | 110 | if ($isInstanceOf(n, "Int")) | |
111 | 111 | then { | |
112 | 112 | let o = n | |
113 | 113 | o | |
114 | 114 | } | |
115 | 115 | else 0 | |
116 | 116 | } | |
117 | 117 | let J = (I + k.amount) | |
118 | 118 | [IntegerEntry(G, d), IntegerEntry(H, J)] | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | ||
123 | 123 | @Callable(h) | |
124 | 124 | func lessonStart (D,F) = { | |
125 | 125 | let G = ((("status_" + D) + "_") + F) | |
126 | 126 | [IntegerEntry(G, e)] | |
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | ||
131 | 131 | @Callable(h) | |
132 | 132 | func lessonFinish (D,F,w) = { | |
133 | 133 | let K = toBase58String(value(a)) | |
134 | 134 | let H = ((("payment_" + D) + "_") + F) | |
135 | 135 | let I = { | |
136 | 136 | let n = getInteger(this, H) | |
137 | 137 | if ($isInstanceOf(n, "Int")) | |
138 | 138 | then { | |
139 | 139 | let o = n | |
140 | 140 | o | |
141 | 141 | } | |
142 | 142 | else 0 | |
143 | 143 | } | |
144 | 144 | let s = (("TICKET_" + w) + "_price") | |
145 | 145 | let x = { | |
146 | 146 | let n = getInteger(this, s) | |
147 | 147 | if ($isInstanceOf(n, "Int")) | |
148 | 148 | then { | |
149 | 149 | let o = n | |
150 | 150 | o | |
151 | 151 | } | |
152 | 152 | else 0 | |
153 | 153 | } | |
154 | - | let L = (I | |
154 | + | let L = (I * x) | |
155 | 155 | let M = ("owner_balance_" + toBase58String(h.caller.bytes)) | |
156 | 156 | let N = { | |
157 | 157 | let n = getInteger(this, M) | |
158 | 158 | if ($isInstanceOf(n, "Int")) | |
159 | 159 | then { | |
160 | 160 | let o = n | |
161 | 161 | o | |
162 | 162 | } | |
163 | 163 | else 0 | |
164 | 164 | } | |
165 | 165 | let O = (N + L) | |
166 | 166 | let G = ((("status_" + D) + "_") + F) | |
167 | 167 | let P = ((K + "_") + F) | |
168 | 168 | let Q = { | |
169 | 169 | let n = getInteger(this, P) | |
170 | 170 | if ($isInstanceOf(n, "Int")) | |
171 | 171 | then { | |
172 | 172 | let o = n | |
173 | 173 | o | |
174 | 174 | } | |
175 | 175 | else 0 | |
176 | 176 | } | |
177 | 177 | let R = fromBase58String(K) | |
178 | 178 | [IntegerEntry(M, O), IntegerEntry(G, f), Burn(a, I)] | |
179 | 179 | } | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | ||
183 | 183 | @Callable(h) | |
184 | 184 | func ownerWithdraw () = { | |
185 | 185 | let M = toBase58String(h.caller.bytes) | |
186 | 186 | let S = { | |
187 | 187 | let n = getInteger(this, M) | |
188 | 188 | if ($isInstanceOf(n, "Int")) | |
189 | 189 | then { | |
190 | 190 | let o = n | |
191 | 191 | o | |
192 | 192 | } | |
193 | 193 | else 0 | |
194 | 194 | } | |
195 | 195 | if ((0 > S)) | |
196 | 196 | then throw("Can't withdraw negative amount") | |
197 | 197 | else [IntegerEntry(M, 0), ScriptTransfer(h.caller, S, b)] | |
198 | 198 | } | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | @Verifier(T) | |
202 | 202 | func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey) | |
203 | 203 |
github/deemru/w8io/169f3d6 52.65 ms ◑