tx · Gc5tudrv7hneBBX1HK4h9t98WVwT8bbPxgSqWYjMPQjK 3MpBLQnAfhnyUMggAmVwDeUYqQukAGopQEk: -0.01000000 Waves 2022.03.18 10:17 [1969088] smart account 3MpBLQnAfhnyUMggAmVwDeUYqQukAGopQEk > SELF 0.00000000 Waves
{ "type": 13, "id": "Gc5tudrv7hneBBX1HK4h9t98WVwT8bbPxgSqWYjMPQjK", "fee": 1000000, "feeAssetId": null, "timestamp": 1647587854880, "version": 2, "chainId": 84, "sender": "3MpBLQnAfhnyUMggAmVwDeUYqQukAGopQEk", "senderPublicKey": "AJm3KtF3VKTiJ4UdDr3EG6ZoC2FgtGQvNsvJjn543RX8", "proofs": [ "3wTxQgu5mMfbrj1Ne63Vg33QP7A8bf7NN6gFzi3EY1WseGhfJWDbbN6KrNbrVLG6fXUM3gywozDiDJCWhkZ7bQpw" ], "script": "base64:AAIFAAAAAAAAABAIAhIFCgMIAQgSAwoBCBIAAAAAEAAAAAAETk9ORQIAAAAEbm9uZQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQUAAAADc3RyAQAAAA9nZXRLZXlJdGVtUHJpY2UAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX3ByaWNlAQAAABFnZXRWYWx1ZUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkBAAAADmdldE51bWJlck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AAAJDMgUAAAACQjMHBgMFAAAAAkMzBQAAAAJCMQcGAwUAAAACQzMFAAAAAkIyBwQAAAAHJG1hdGNoMAUAAAACdHgDAwUAAAACQUIGBQAAAAJBQwYFAAAAAkJDmhKuVw==", "height": 1969088, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = "none" | |
5 | + | ||
6 | + | func b (c) = { | |
7 | + | let d = { | |
8 | + | let e = getInteger(this, c) | |
9 | + | if ($isInstanceOf(e, "Int")) | |
10 | + | then { | |
11 | + | let f = e | |
12 | + | f | |
13 | + | } | |
14 | + | else 0 | |
15 | + | } | |
16 | + | d | |
17 | + | } | |
18 | + | ||
19 | + | ||
20 | + | func g (c) = { | |
21 | + | let h = { | |
22 | + | let e = getString(this, c) | |
23 | + | if ($isInstanceOf(e, "String")) | |
24 | + | then { | |
25 | + | let f = e | |
26 | + | f | |
27 | + | } | |
28 | + | else a | |
29 | + | } | |
30 | + | h | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func i (j) = (j + "_price") | |
35 | + | ||
36 | + | ||
37 | + | func k (j) = b(i(j)) | |
38 | + | ||
39 | + | ||
40 | + | func l (m,j) = (((j + "_") + m) + "_cnt") | |
41 | + | ||
42 | + | ||
43 | + | func n (m,j) = b(l(m, j)) | |
44 | + | ||
45 | + | ||
46 | + | func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q))))) | |
47 | + | ||
48 | + | ||
49 | + | func r (j) = (j + "_data") | |
50 | + | ||
51 | + | ||
52 | + | func s (j) = (j + "_owner") | |
53 | + | ||
54 | + | ||
55 | + | func t (j) = g(s(j)) | |
56 | + | ||
57 | + | ||
58 | + | func u (v) = (v + "_balance") | |
59 | + | ||
60 | + | ||
61 | + | func w (v) = b(u(v)) | |
62 | + | ||
63 | + | ||
64 | + | let x = base58'U3xmXuwXdeCeAJSQdhJaeqHPS5LPkxfxRfrAn9c2MQZ' | |
65 | + | ||
66 | + | let y = base58'5FjFLEkXW5LRE1NFTJBTus2TxvCbmvw9mgnnDwhkfvpJ' | |
67 | + | ||
68 | + | let z = base58'8DASziFWXkcTr7ZfP7Etr9y4iFWD3iNCmA9SgjfRmTZ4' | |
69 | + | ||
70 | + | @Callable(A) | |
71 | + | func addItem (q,B,C) = { | |
72 | + | let D = toBase58String(A.caller.bytes) | |
73 | + | let j = o(D, q) | |
74 | + | if ((0 >= B)) | |
75 | + | then throw("purchase amount cannot be less than item price") | |
76 | + | else if ((t(j) != a)) | |
77 | + | then throw("an item is already exist") | |
78 | + | else $Tuple2([StringEntry(s(j), D), IntegerEntry(i(j), B), StringEntry(r(j), C)], unit) | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | ||
83 | + | @Callable(A) | |
84 | + | func purchase (j) = { | |
85 | + | let E = A.payments[0] | |
86 | + | if (isDefined(E.assetId)) | |
87 | + | then throw("can use WAVES only at the moment") | |
88 | + | else { | |
89 | + | let F = toBase58String(A.caller.bytes) | |
90 | + | let B = k(j) | |
91 | + | let D = t(j) | |
92 | + | if ((B > E.amount)) | |
93 | + | then throw("purchase amount cannot be less than item price") | |
94 | + | else if ((E.amount > B)) | |
95 | + | then throw("purchase amount cannot be higher than item price") | |
96 | + | else if ((D == a)) | |
97 | + | then throw("supplier does not exist") | |
98 | + | else $Tuple2([IntegerEntry(l(F, j), (n(F, j) + 1)), IntegerEntry(u(D), (w(D) + E.amount))], unit) | |
99 | + | } | |
100 | + | } | |
101 | + | ||
102 | + | ||
103 | + | ||
104 | + | @Callable(A) | |
105 | + | func withdraw () = { | |
106 | + | let D = toBase58String(A.caller.bytes) | |
107 | + | let G = w(D) | |
108 | + | if ((0 >= G)) | |
109 | + | then throw("insufficient balance") | |
110 | + | else $Tuple2([IntegerEntry(u(D), 0), ScriptTransfer(addressFromStringValue(D), G, unit)], unit) | |
111 | + | } | |
112 | + | ||
113 | + | ||
114 | + | @Verifier(H) | |
115 | + | func I () = { | |
116 | + | let J = sigVerify(H.bodyBytes, H.proofs[0], x) | |
117 | + | let K = sigVerify(H.bodyBytes, H.proofs[1], x) | |
118 | + | let L = sigVerify(H.bodyBytes, H.proofs[2], x) | |
119 | + | let M = sigVerify(H.bodyBytes, H.proofs[0], y) | |
120 | + | let N = sigVerify(H.bodyBytes, H.proofs[1], y) | |
121 | + | let O = sigVerify(H.bodyBytes, H.proofs[2], y) | |
122 | + | let P = sigVerify(H.bodyBytes, H.proofs[0], z) | |
123 | + | let Q = sigVerify(H.bodyBytes, H.proofs[1], z) | |
124 | + | let R = sigVerify(H.bodyBytes, H.proofs[2], z) | |
125 | + | let S = if (if (if (if (if (if (J) | |
126 | + | then N | |
127 | + | else false) | |
128 | + | then true | |
129 | + | else if (J) | |
130 | + | then O | |
131 | + | else false) | |
132 | + | then true | |
133 | + | else if (K) | |
134 | + | then M | |
135 | + | else false) | |
136 | + | then true | |
137 | + | else if (K) | |
138 | + | then O | |
139 | + | else false) | |
140 | + | then true | |
141 | + | else if (L) | |
142 | + | then M | |
143 | + | else false) | |
144 | + | then true | |
145 | + | else if (L) | |
146 | + | then N | |
147 | + | else false | |
148 | + | let T = if (if (if (if (if (if (J) | |
149 | + | then Q | |
150 | + | else false) | |
151 | + | then true | |
152 | + | else if (J) | |
153 | + | then R | |
154 | + | else false) | |
155 | + | then true | |
156 | + | else if (K) | |
157 | + | then P | |
158 | + | else false) | |
159 | + | then true | |
160 | + | else if (K) | |
161 | + | then R | |
162 | + | else false) | |
163 | + | then true | |
164 | + | else if (L) | |
165 | + | then P | |
166 | + | else false) | |
167 | + | then true | |
168 | + | else if (L) | |
169 | + | then Q | |
170 | + | else false | |
171 | + | let U = if (if (if (if (if (if (P) | |
172 | + | then N | |
173 | + | else false) | |
174 | + | then true | |
175 | + | else if (P) | |
176 | + | then O | |
177 | + | else false) | |
178 | + | then true | |
179 | + | else if (Q) | |
180 | + | then M | |
181 | + | else false) | |
182 | + | then true | |
183 | + | else if (Q) | |
184 | + | then O | |
185 | + | else false) | |
186 | + | then true | |
187 | + | else if (R) | |
188 | + | then M | |
189 | + | else false) | |
190 | + | then true | |
191 | + | else if (R) | |
192 | + | then N | |
193 | + | else false | |
194 | + | let e = H | |
195 | + | if (if (S) | |
196 | + | then true | |
197 | + | else T) | |
198 | + | then true | |
199 | + | else U | |
200 | + | } | |
201 | + |
github/deemru/w8io/026f985 17.92 ms ◑