tx · BEXHRai6xeiLR9w13KSLjZEPaiWXhgtAAMBPY4eB7GTJ 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx: -0.01000000 Waves 2023.03.02 01:34 [2471613] smart account 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx > SELF 0.00000000 Waves
{ "type": 13, "id": "BEXHRai6xeiLR9w13KSLjZEPaiWXhgtAAMBPY4eB7GTJ", "fee": 1000000, "feeAssetId": null, "timestamp": 1677710122918, "version": 2, "chainId": 84, "sender": "3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx", "senderPublicKey": "D35PGQCSSdrp9pvujggj7b2DaCK1BhcU3kho7tikKJYs", "proofs": [ "3mVQhkHKMSCke4399ZQHHFNfvnsn6STqjBZRYFvaqyBeLpjyeaaYmocZiJtTTYhNSA6vKjXdf36d2sJLy7V2Yw5e" ], "script": "base64:BgIfCAISAwoBARIAEgMKAQESBAoCGBESBAoCCAESAwoBCAIADG9wdGlvbnNfYWRkcgkBB0FkZHJlc3MBARoBVEFb+Cv2F+oqocvEivH7x7uyIGEx/ocgwQAEdFVTRAEgqyRKarZCRuvS/ON5sGG6w65pV01SespFHKdAHRGwKQ4GAWkBCWlzc3VlQmlsbAEJcHJvdmlkaW5nBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEDWN1cnJlbnRBbW91bnQEByRtYXRjaDAJAJoIAgUEdGhpcwUKY3VycmVudEtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQRbWluQmlsbERlcG9zaXRTdHIEByRtYXRjaDAJAJ0IAgUMb3B0aW9uc19hZGRyAhBtaW5fYmlsbF9kZXBvc2l0AwkAAQIFByRtYXRjaDACBFVuaXQCATADCQABAgUHJG1hdGNoMAIGU3RyaW5nBAF4BQckbWF0Y2gwBQF4CQACAQILTWF0Y2ggZXJyb3IEDm1pbkJpbGxEZXBvc2l0BAckbWF0Y2gwCQC2CQEJ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jYWxsZXIDCQECIT0CBQlhZG1pbkxpc3QCBXVuc2V0BAR0ZXN0CQCdCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCWFkbWluTGlzdAUQY2FsbGVyQWRkcmVzc1N0cgQHaXNBZG1pbgQHJG1hdGNoMAUEdGVzdAMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAXgFByRtYXRjaDAFAXgDCQABAgUHJG1hdGNoMAIEVW5pdAIIbm8gYWRtaW4JAAIBAgtNYXRjaCBlcnJvcgMJAQIhPQIFB2lzQWRtaW4CCG5vIGFkbWluCQCUCgIJAMwIAgkBC0RlbGV0ZUVudHJ5AQUIdmFyaWFibGUFA25pbAUEdW5pdAkAAgEJAKwCAgkArAICCQCsAgIJAKwCAgkArAICCQCsAgICD1lvdSBub3QgYWRtaW46IAUJYWRtaW5MaXN0AgssIGlzQWRtaW46IAUHaXNBZG1pbgIULCBjYWxsZXJBZGRyZXNzU3RyOiAFEGNhbGxlckFkZHJlc3NTdHICAiwgCQACAQIQVW5zZXQgYWRtaW4gbGlzdAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmMLAgU", "height": 2471613, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4f2TFHQyqoZsoDgKMBuwUBpLa6FczAvDu8XYDrQ1RrqF Next: GD6KdATuGQAnjuxNi4UmyokT9rp14dLCCEkFznxRUUsr Diff:
Old | New | Differences | |
---|---|---|---|
47 | 47 | else { | |
48 | 48 | let n = Issue(("bill for:" + toString((d / 100))), e, 1, 0, false) | |
49 | 49 | let o = calculateAssetId(n) | |
50 | - | $Tuple2([IntegerEntry(e, m), n, ScriptTransfer(c.caller, 1, o)], unit) | |
50 | + | $Tuple2([IntegerEntry(e, m), n, ScriptTransfer(c.caller, 1, o), IntegerEntry(("l_" + toBase58String(o)), m)], unit) | |
51 | 51 | } | |
52 | 52 | } | |
53 | 53 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6') | |
5 | 5 | ||
6 | 6 | let b = base58'CX4p6XcuSBUvv44r1avCqYka5PYAVzBK5hSXaT7maU85' | |
7 | 7 | ||
8 | 8 | @Callable(c) | |
9 | 9 | func issueBill (d) = { | |
10 | 10 | let e = toBase58String(c.caller.bytes) | |
11 | 11 | let f = { | |
12 | 12 | let g = getInteger(this, e) | |
13 | 13 | if ($isInstanceOf(g, "Int")) | |
14 | 14 | then { | |
15 | 15 | let h = g | |
16 | 16 | h | |
17 | 17 | } | |
18 | 18 | else 0 | |
19 | 19 | } | |
20 | 20 | let i = { | |
21 | 21 | let g = getString(a, "min_bill_deposit") | |
22 | 22 | if ($isInstanceOf(g, "Unit")) | |
23 | 23 | then "0" | |
24 | 24 | else if ($isInstanceOf(g, "String")) | |
25 | 25 | then { | |
26 | 26 | let j = g | |
27 | 27 | j | |
28 | 28 | } | |
29 | 29 | else throw("Match error") | |
30 | 30 | } | |
31 | 31 | let k = { | |
32 | 32 | let g = parseInt(split(i, ".")[0]) | |
33 | 33 | if ($isInstanceOf(g, "Unit")) | |
34 | 34 | then 0 | |
35 | 35 | else if ($isInstanceOf(g, "Int")) | |
36 | 36 | then { | |
37 | 37 | let l = g | |
38 | 38 | l | |
39 | 39 | } | |
40 | 40 | else throw("Match error") | |
41 | 41 | } | |
42 | 42 | let m = (f - d) | |
43 | 43 | if (((k * 100) > d)) | |
44 | 44 | then throw((((("The security deposit must be more than " + i) + ". You set the size: ") + toString((d / 100))) + ".00")) | |
45 | 45 | else if ((0 > m)) | |
46 | 46 | then throw("Not enough balance") | |
47 | 47 | else { | |
48 | 48 | let n = Issue(("bill for:" + toString((d / 100))), e, 1, 0, false) | |
49 | 49 | let o = calculateAssetId(n) | |
50 | - | $Tuple2([IntegerEntry(e, m), n, ScriptTransfer(c.caller, 1, o)], unit) | |
50 | + | $Tuple2([IntegerEntry(e, m), n, ScriptTransfer(c.caller, 1, o), IntegerEntry(("l_" + toBase58String(o)), m)], unit) | |
51 | 51 | } | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(c) | |
57 | 57 | func deposit () = if ((size(c.payments) == 0)) | |
58 | 58 | then throw("Payment not attached") | |
59 | 59 | else { | |
60 | 60 | let p = value(c.payments)[0] | |
61 | 61 | let q = { | |
62 | 62 | let g = getString(a, "min_deposit") | |
63 | 63 | if ($isInstanceOf(g, "Unit")) | |
64 | 64 | then "0" | |
65 | 65 | else if ($isInstanceOf(g, "String")) | |
66 | 66 | then { | |
67 | 67 | let j = g | |
68 | 68 | j | |
69 | 69 | } | |
70 | 70 | else throw("Match error") | |
71 | 71 | } | |
72 | 72 | let r = { | |
73 | 73 | let g = parseInt(split(q, ".")[0]) | |
74 | 74 | if ($isInstanceOf(g, "Unit")) | |
75 | 75 | then 0 | |
76 | 76 | else if ($isInstanceOf(g, "Int")) | |
77 | 77 | then { | |
78 | 78 | let l = g | |
79 | 79 | l | |
80 | 80 | } | |
81 | 81 | else throw("Match error") | |
82 | 82 | } | |
83 | 83 | if ((p.assetId != b)) | |
84 | 84 | then throw("holded payment not tUSD") | |
85 | 85 | else if (((r * 100) > p.amount)) | |
86 | 86 | then throw((((("You have set the deposit amount to " + toString((p.amount / 100))) + ".00, which is less than the minimum (") + q) + ")")) | |
87 | 87 | else { | |
88 | 88 | let e = toBase58String(c.caller.bytes) | |
89 | 89 | let f = { | |
90 | 90 | let g = getInteger(this, e) | |
91 | 91 | if ($isInstanceOf(g, "Int")) | |
92 | 92 | then { | |
93 | 93 | let h = g | |
94 | 94 | h | |
95 | 95 | } | |
96 | 96 | else 0 | |
97 | 97 | } | |
98 | 98 | let m = (f + p.amount) | |
99 | 99 | [IntegerEntry(e, m)] | |
100 | 100 | } | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | ||
105 | 105 | @Callable(c) | |
106 | 106 | func withdraw (s) = { | |
107 | 107 | let e = toBase58String(c.caller.bytes) | |
108 | 108 | let f = { | |
109 | 109 | let g = getInteger(this, e) | |
110 | 110 | if ($isInstanceOf(g, "Int")) | |
111 | 111 | then { | |
112 | 112 | let h = g | |
113 | 113 | h | |
114 | 114 | } | |
115 | 115 | else 0 | |
116 | 116 | } | |
117 | 117 | let m = (f - s) | |
118 | 118 | if ((0 > s)) | |
119 | 119 | then throw("Can't withdraw negative amount") | |
120 | 120 | else if ((0 > m)) | |
121 | 121 | then throw("Not enough balance") | |
122 | 122 | else $Tuple2([IntegerEntry(e, m), ScriptTransfer(c.caller, s, b)], unit) | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | ||
127 | 127 | @Callable(c) | |
128 | 128 | func setOptions (t,u) = { | |
129 | 129 | let v = size(t) | |
130 | 130 | if ((100 >= v)) | |
131 | 131 | then { | |
132 | 132 | let w = { | |
133 | 133 | let g = getString(a, "admin_list") | |
134 | 134 | if ($isInstanceOf(g, "Unit")) | |
135 | 135 | then "unset" | |
136 | 136 | else if ($isInstanceOf(g, "String")) | |
137 | 137 | then { | |
138 | 138 | let j = g | |
139 | 139 | j | |
140 | 140 | } | |
141 | 141 | else throw("Match error") | |
142 | 142 | } | |
143 | 143 | func x (y,z) = { | |
144 | 144 | let A = y | |
145 | 145 | let B = A._1 | |
146 | 146 | let C = A._2 | |
147 | 147 | $Tuple2((B :+ IntegerEntry(t[C], z)), (C + 1)) | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | let D = { | |
151 | 151 | let E = u | |
152 | 152 | let F = size(E) | |
153 | 153 | let G = $Tuple2(nil, 0) | |
154 | 154 | func H (I,J) = if ((J >= F)) | |
155 | 155 | then I | |
156 | 156 | else x(I, E[J]) | |
157 | 157 | ||
158 | 158 | func K (I,J) = if ((J >= F)) | |
159 | 159 | then I | |
160 | 160 | else throw("List size exceeds 100") | |
161 | 161 | ||
162 | 162 | K(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(H(G, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
163 | 163 | } | |
164 | 164 | let L = toString(c.caller) | |
165 | 165 | if ((w != "unset")) | |
166 | 166 | then { | |
167 | 167 | let M = getString(addressFromStringValue(w), L) | |
168 | 168 | let N = { | |
169 | 169 | let g = M | |
170 | 170 | if ($isInstanceOf(g, "String")) | |
171 | 171 | then { | |
172 | 172 | let j = g | |
173 | 173 | j | |
174 | 174 | } | |
175 | 175 | else if ($isInstanceOf(g, "Unit")) | |
176 | 176 | then "no admin" | |
177 | 177 | else throw("Match error") | |
178 | 178 | } | |
179 | 179 | func O (P) = { | |
180 | 180 | let Q = split(P, "|") | |
181 | 181 | StringEntry(Q[0], Q[1]) | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | if ((N != "no admin")) | |
185 | 185 | then D | |
186 | 186 | else throw((((((("You not admin: " + w) + ", isAdmin: ") + N) + ", callerAddressStr: ") + L) + ", ")) | |
187 | 187 | } | |
188 | 188 | else throw("Unset admin list") | |
189 | 189 | } | |
190 | 190 | else throw("The number of list elements must not exceed 100") | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | ||
195 | 195 | @Callable(c) | |
196 | 196 | func setOption (R,S) = { | |
197 | 197 | let w = { | |
198 | 198 | let g = getString(a, "admin_list") | |
199 | 199 | if ($isInstanceOf(g, "Unit")) | |
200 | 200 | then "unset" | |
201 | 201 | else if ($isInstanceOf(g, "String")) | |
202 | 202 | then { | |
203 | 203 | let j = g | |
204 | 204 | j | |
205 | 205 | } | |
206 | 206 | else throw("Match error") | |
207 | 207 | } | |
208 | 208 | let L = toString(c.caller) | |
209 | 209 | if ((w != "unset")) | |
210 | 210 | then { | |
211 | 211 | let M = getString(addressFromStringValue(w), L) | |
212 | 212 | let N = { | |
213 | 213 | let g = M | |
214 | 214 | if ($isInstanceOf(g, "String")) | |
215 | 215 | then { | |
216 | 216 | let j = g | |
217 | 217 | j | |
218 | 218 | } | |
219 | 219 | else if ($isInstanceOf(g, "Unit")) | |
220 | 220 | then "no admin" | |
221 | 221 | else throw("Match error") | |
222 | 222 | } | |
223 | 223 | if ((N != "no admin")) | |
224 | 224 | then $Tuple2([IntegerEntry(R, S)], unit) | |
225 | 225 | else throw((((((("You not admin: " + w) + ", isAdmin: ") + N) + ", callerAddressStr: ") + L) + ", ")) | |
226 | 226 | } | |
227 | 227 | else throw("Unset admin list") | |
228 | 228 | } | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | ||
232 | 232 | @Callable(c) | |
233 | 233 | func delOption (R) = { | |
234 | 234 | let w = { | |
235 | 235 | let g = getString(a, "admin_list") | |
236 | 236 | if ($isInstanceOf(g, "Unit")) | |
237 | 237 | then "unset" | |
238 | 238 | else if ($isInstanceOf(g, "String")) | |
239 | 239 | then { | |
240 | 240 | let j = g | |
241 | 241 | j | |
242 | 242 | } | |
243 | 243 | else throw("Match error") | |
244 | 244 | } | |
245 | 245 | let L = toString(c.caller) | |
246 | 246 | if ((w != "unset")) | |
247 | 247 | then { | |
248 | 248 | let M = getString(addressFromStringValue(w), L) | |
249 | 249 | let N = { | |
250 | 250 | let g = M | |
251 | 251 | if ($isInstanceOf(g, "String")) | |
252 | 252 | then { | |
253 | 253 | let j = g | |
254 | 254 | j | |
255 | 255 | } | |
256 | 256 | else if ($isInstanceOf(g, "Unit")) | |
257 | 257 | then "no admin" | |
258 | 258 | else throw("Match error") | |
259 | 259 | } | |
260 | 260 | if ((N != "no admin")) | |
261 | 261 | then $Tuple2([DeleteEntry(R)], unit) | |
262 | 262 | else throw((((((("You not admin: " + w) + ", isAdmin: ") + N) + ", callerAddressStr: ") + L) + ", ")) | |
263 | 263 | } | |
264 | 264 | else throw("Unset admin list") | |
265 | 265 | } | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | @Verifier(T) | |
269 | 269 | func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey) | |
270 | 270 |
github/deemru/w8io/169f3d6 54.39 ms ◑