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