tx · 49XtyS85XjTeLT4bqe1jDDMS9QMcVHwvRUetZ7HHCmRr 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx: -0.01000000 Waves 2023.03.06 18:36 [2478415] smart account 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx > SELF 0.00000000 Waves
{ "type": 13, "id": "49XtyS85XjTeLT4bqe1jDDMS9QMcVHwvRUetZ7HHCmRr", "fee": 1000000, "feeAssetId": null, "timestamp": 1678116977108, "version": 2, "chainId": 84, "sender": "3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx", "senderPublicKey": "D35PGQCSSdrp9pvujggj7b2DaCK1BhcU3kho7tikKJYs", "proofs": [ "HHPZ7VxYBxYHPn8HGsERbCbwSFec3eEAx43FxgQRRmCkgdFs97gVU47gRjaAQZUWFjup4wi66YwFGiB5ipoifB1" ], "script": "base64:BgIgCAISBAoCAQESABIDCgEBEgQKAhgREgQKAggIEgMKAQgCAAxvcHRpb25zX2FkZHIJAQdBZGRyZXNzAQEaAVRBW/gr9hfqKqHLxIrx+8e7siBhMf6HIMEABHRVU0QBIKskSmq2Qkbr0vzjebBhusOuaVdNUnrKRRynQB0RsCkOBgFpAQlpc3N1ZUJpbGwCCXByb3ZpZGluZwRzaXplBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEDWN1cnJlbnRBbW91bnQEByRtYXRjaDAJAJoIAgUEdGhpcwUKY3VycmVudEtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQRbWluQmlsbERlcG9zaXRTdHIEByRtYXRjaDAJAJ0IAgUMb3B0aW9uc19hZGRyAhBtaW5fYmlsbF9kZXBvc2l0AwkAAQIFByRtYXRjaDACBFVuaXQCATADCQABAgUHJG1hdGNoMAIGU3RyaW5nBAF4BQckbWF0Y2gwBQF4CQACAQILTWF0Y2ggZXJyb3IEDm1pbkJpbGxEZXBvc2l0BAckbWF0Y2gwCQC2C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NzU3RyCQClCAEIBQFpBmNhbGxlcgMJAQIhPQIFCWFkbWluTGlzdAIFdW5zZXQEBHRlc3QJAJ0IAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUJYWRtaW5MaXN0BRBjYWxsZXJBZGRyZXNzU3RyBAdpc0FkbWluBAckbWF0Y2gwBQR0ZXN0AwkAAQIFByRtYXRjaDACBlN0cmluZwQBeAUHJG1hdGNoMAUBeAMJAAECBQckbWF0Y2gwAgRVbml0AghubyBhZG1pbgkAAgECC01hdGNoIGVycm9yAwkBAiE9AgUHaXNBZG1pbgIIbm8gYWRtaW4JAJQKAgkAzAgCCQELRGVsZXRlRW50cnkBBQh2YXJpYWJsZQUDbmlsBQR1bml0CQACAQkArAICCQCsAgIJAKwCAgkArAICCQCsAgIJAKwCAgIPWW91IG5vdCBhZG1pbjogBQlhZG1pbkxpc3QCCywgaXNBZG1pbjogBQdpc0FkbWluAhQsIGNhbGxlckFkZHJlc3NTdHI6IAUQY2FsbGVyQWRkcmVzc1N0cgICLCAJAAIBAhBVbnNldCBhZG1pbiBsaXN0AQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQ2Soo8=", "height": 2478415, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ENSaAqFBmZqcNXXLwV2rq6MohGAmVMqK6AkD7gtm8RFo Next: 6Na7e7bog5dv49AXQ4WsekJxzQbJ7g853QGYXryPurbQ Diff:
Old | New | Differences | |
---|---|---|---|
22 | 22 | case _ => | |
23 | 23 | throw("Match error") | |
24 | 24 | } | |
25 | + | let minBillDeposit = match parseInt(split(minBillDepositStr, ".")[0]) { | |
26 | + | case _: Unit => | |
27 | + | 0 | |
28 | + | case t: Int => | |
29 | + | t | |
30 | + | case _ => | |
31 | + | throw("Match error") | |
32 | + | } | |
25 | 33 | let exchangeRateStr = match getString(options_addr, "exchange_rate") { | |
26 | 34 | case _: Unit => | |
27 | 35 | "0" | |
28 | 36 | case x: String => | |
29 | 37 | x | |
30 | - | case _ => | |
31 | - | throw("Match error") | |
32 | - | } | |
33 | - | let minBillDeposit = match parseInt(split(minBillDepositStr, ".")[0]) { | |
34 | - | case _: Unit => | |
35 | - | 0 | |
36 | - | case t: Int => | |
37 | - | t | |
38 | 38 | case _ => | |
39 | 39 | throw("Match error") | |
40 | 40 | } | |
46 | 46 | case _ => | |
47 | 47 | throw("Match error") | |
48 | 48 | } | |
49 | - | let tRUB_min = (currentAmount * exchangeRate) | |
49 | + | let shareGuaranteeFeeStr = match getString(options_addr, "share_guarantee_fee") { | |
50 | + | case _: Unit => | |
51 | + | "0" | |
52 | + | case x: String => | |
53 | + | x | |
54 | + | case _ => | |
55 | + | throw("Match error") | |
56 | + | } | |
57 | + | let shareGuaranteeFee = match parseInt(split(shareGuaranteeFeeStr, ".")[0]) { | |
58 | + | case _: Unit => | |
59 | + | 0 | |
60 | + | case t: Int => | |
61 | + | t | |
62 | + | case _ => | |
63 | + | throw("Match error") | |
64 | + | } | |
65 | + | let tRUB_min = ((currentAmount * exchangeRate) * shareGuaranteeFee) | |
50 | 66 | let newAmount = (currentAmount - providing) | |
51 | 67 | if (((minBillDeposit * 100) > providing)) | |
52 | 68 | then throw((((("The security deposit must be more than " + minBillDepositStr) + ". You set the size: ") + toString((providing / 100))) + ".00")) | |
136 | 152 | throw("Match error") | |
137 | 153 | } | |
138 | 154 | func addStringEntry (accum,nextValue) = { | |
139 | - | let $ | |
140 | - | let result = $ | |
141 | - | let j = $ | |
155 | + | let $t056745697 = accum | |
156 | + | let result = $t056745697._1 | |
157 | + | let j = $t056745697._2 | |
142 | 158 | $Tuple2((result :+ IntegerEntry(opts[j], nextValue)), (j + 1)) | |
143 | 159 | } | |
144 | 160 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let options_addr = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6') | |
5 | 5 | ||
6 | 6 | let tUSD = base58'CX4p6XcuSBUvv44r1avCqYka5PYAVzBK5hSXaT7maU85' | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func issueBill (providing,size) = { | |
10 | 10 | let currentKey = toBase58String(i.caller.bytes) | |
11 | 11 | let currentAmount = match getInteger(this, currentKey) { | |
12 | 12 | case a: Int => | |
13 | 13 | a | |
14 | 14 | case _ => | |
15 | 15 | 0 | |
16 | 16 | } | |
17 | 17 | let minBillDepositStr = match getString(options_addr, "min_bill_deposit") { | |
18 | 18 | case _: Unit => | |
19 | 19 | "0" | |
20 | 20 | case x: String => | |
21 | 21 | x | |
22 | 22 | case _ => | |
23 | 23 | throw("Match error") | |
24 | 24 | } | |
25 | + | let minBillDeposit = match parseInt(split(minBillDepositStr, ".")[0]) { | |
26 | + | case _: Unit => | |
27 | + | 0 | |
28 | + | case t: Int => | |
29 | + | t | |
30 | + | case _ => | |
31 | + | throw("Match error") | |
32 | + | } | |
25 | 33 | let exchangeRateStr = match getString(options_addr, "exchange_rate") { | |
26 | 34 | case _: Unit => | |
27 | 35 | "0" | |
28 | 36 | case x: String => | |
29 | 37 | x | |
30 | - | case _ => | |
31 | - | throw("Match error") | |
32 | - | } | |
33 | - | let minBillDeposit = match parseInt(split(minBillDepositStr, ".")[0]) { | |
34 | - | case _: Unit => | |
35 | - | 0 | |
36 | - | case t: Int => | |
37 | - | t | |
38 | 38 | case _ => | |
39 | 39 | throw("Match error") | |
40 | 40 | } | |
41 | 41 | let exchangeRate = match parseInt(split(exchangeRateStr, ".")[0]) { | |
42 | 42 | case _: Unit => | |
43 | 43 | 0 | |
44 | 44 | case t: Int => | |
45 | 45 | t | |
46 | 46 | case _ => | |
47 | 47 | throw("Match error") | |
48 | 48 | } | |
49 | - | let tRUB_min = (currentAmount * exchangeRate) | |
49 | + | let shareGuaranteeFeeStr = match getString(options_addr, "share_guarantee_fee") { | |
50 | + | case _: Unit => | |
51 | + | "0" | |
52 | + | case x: String => | |
53 | + | x | |
54 | + | case _ => | |
55 | + | throw("Match error") | |
56 | + | } | |
57 | + | let shareGuaranteeFee = match parseInt(split(shareGuaranteeFeeStr, ".")[0]) { | |
58 | + | case _: Unit => | |
59 | + | 0 | |
60 | + | case t: Int => | |
61 | + | t | |
62 | + | case _ => | |
63 | + | throw("Match error") | |
64 | + | } | |
65 | + | let tRUB_min = ((currentAmount * exchangeRate) * shareGuaranteeFee) | |
50 | 66 | let newAmount = (currentAmount - providing) | |
51 | 67 | if (((minBillDeposit * 100) > providing)) | |
52 | 68 | then throw((((("The security deposit must be more than " + minBillDepositStr) + ". You set the size: ") + toString((providing / 100))) + ".00")) | |
53 | 69 | else if ((0 > newAmount)) | |
54 | 70 | then throw("Not enough balance") | |
55 | 71 | else if ((size > tRUB_min)) | |
56 | 72 | then throw((((("The nominal value of the promissory bill exceeds the collateral minimum" + toString(tRUB_min)) + "₽ (") + minBillDepositStr) + "tUSD)")) | |
57 | 73 | else { | |
58 | 74 | let issue = Issue(("bill for:" + toString((providing / 100))), ((currentKey + ":") + toString(size)), 1, 0, false) | |
59 | 75 | let id = calculateAssetId(issue) | |
60 | 76 | $Tuple2([IntegerEntry(currentKey, newAmount), issue, ScriptTransfer(i.caller, 1, id), IntegerEntry(("l_u_" + toBase58String(id)), providing)], unit) | |
61 | 77 | } | |
62 | 78 | } | |
63 | 79 | ||
64 | 80 | ||
65 | 81 | ||
66 | 82 | @Callable(i) | |
67 | 83 | func deposit () = if ((size(i.payments) == 0)) | |
68 | 84 | then throw("Payment not attached") | |
69 | 85 | else { | |
70 | 86 | let pmt = value(i.payments)[0] | |
71 | 87 | let minDepositStr = match getString(options_addr, "min_deposit") { | |
72 | 88 | case _: Unit => | |
73 | 89 | "0" | |
74 | 90 | case x: String => | |
75 | 91 | x | |
76 | 92 | case _ => | |
77 | 93 | throw("Match error") | |
78 | 94 | } | |
79 | 95 | let minDeposit = match parseInt(split(minDepositStr, ".")[0]) { | |
80 | 96 | case _: Unit => | |
81 | 97 | 0 | |
82 | 98 | case t: Int => | |
83 | 99 | t | |
84 | 100 | case _ => | |
85 | 101 | throw("Match error") | |
86 | 102 | } | |
87 | 103 | if ((pmt.assetId != tUSD)) | |
88 | 104 | then throw("holded payment not tUSD") | |
89 | 105 | else if (((minDeposit * 100) > pmt.amount)) | |
90 | 106 | then throw((((("You have set the deposit amount to " + toString((pmt.amount / 100))) + ".00, which is less than the minimum (") + minDepositStr) + ")")) | |
91 | 107 | else { | |
92 | 108 | let currentKey = toBase58String(i.caller.bytes) | |
93 | 109 | let currentAmount = match getInteger(this, currentKey) { | |
94 | 110 | case a: Int => | |
95 | 111 | a | |
96 | 112 | case _ => | |
97 | 113 | 0 | |
98 | 114 | } | |
99 | 115 | let newAmount = (currentAmount + pmt.amount) | |
100 | 116 | [IntegerEntry(currentKey, newAmount)] | |
101 | 117 | } | |
102 | 118 | } | |
103 | 119 | ||
104 | 120 | ||
105 | 121 | ||
106 | 122 | @Callable(i) | |
107 | 123 | func withdraw (amount) = { | |
108 | 124 | let currentKey = toBase58String(i.caller.bytes) | |
109 | 125 | let currentAmount = match getInteger(this, currentKey) { | |
110 | 126 | case a: Int => | |
111 | 127 | a | |
112 | 128 | case _ => | |
113 | 129 | 0 | |
114 | 130 | } | |
115 | 131 | let newAmount = (currentAmount - amount) | |
116 | 132 | if ((0 > amount)) | |
117 | 133 | then throw("Can't withdraw negative amount") | |
118 | 134 | else if ((0 > newAmount)) | |
119 | 135 | then throw("Not enough balance") | |
120 | 136 | else $Tuple2([IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, tUSD)], unit) | |
121 | 137 | } | |
122 | 138 | ||
123 | 139 | ||
124 | 140 | ||
125 | 141 | @Callable(i) | |
126 | 142 | func setOptions (opts,vals) = { | |
127 | 143 | let opt_size = size(opts) | |
128 | 144 | if ((100 >= opt_size)) | |
129 | 145 | then { | |
130 | 146 | let adminList = match getString(options_addr, "admin_list") { | |
131 | 147 | case _: Unit => | |
132 | 148 | "unset" | |
133 | 149 | case x: String => | |
134 | 150 | x | |
135 | 151 | case _ => | |
136 | 152 | throw("Match error") | |
137 | 153 | } | |
138 | 154 | func addStringEntry (accum,nextValue) = { | |
139 | - | let $ | |
140 | - | let result = $ | |
141 | - | let j = $ | |
155 | + | let $t056745697 = accum | |
156 | + | let result = $t056745697._1 | |
157 | + | let j = $t056745697._2 | |
142 | 158 | $Tuple2((result :+ IntegerEntry(opts[j], nextValue)), (j + 1)) | |
143 | 159 | } | |
144 | 160 | ||
145 | 161 | let r = { | |
146 | 162 | let $l = vals | |
147 | 163 | let $s = size($l) | |
148 | 164 | let $acc0 = $Tuple2(nil, 0) | |
149 | 165 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
150 | 166 | then $a | |
151 | 167 | else addStringEntry($a, $l[$i]) | |
152 | 168 | ||
153 | 169 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
154 | 170 | then $a | |
155 | 171 | else throw("List size exceeds 100") | |
156 | 172 | ||
157 | 173 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 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) | |
158 | 174 | } | |
159 | 175 | let callerAddressStr = toString(i.caller) | |
160 | 176 | if ((adminList != "unset")) | |
161 | 177 | then { | |
162 | 178 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
163 | 179 | let isAdmin = match test { | |
164 | 180 | case x: String => | |
165 | 181 | x | |
166 | 182 | case _: Unit => | |
167 | 183 | "no admin" | |
168 | 184 | case _ => | |
169 | 185 | throw("Match error") | |
170 | 186 | } | |
171 | 187 | func add_elm (options) = { | |
172 | 188 | let opt = split(options, "|") | |
173 | 189 | StringEntry(opt[0], opt[1]) | |
174 | 190 | } | |
175 | 191 | ||
176 | 192 | if ((isAdmin != "no admin")) | |
177 | 193 | then r | |
178 | 194 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
179 | 195 | } | |
180 | 196 | else throw("Unset admin list") | |
181 | 197 | } | |
182 | 198 | else throw("The number of list elements must not exceed 100") | |
183 | 199 | } | |
184 | 200 | ||
185 | 201 | ||
186 | 202 | ||
187 | 203 | @Callable(i) | |
188 | 204 | func setOption (variable,value) = { | |
189 | 205 | let adminList = match getString(options_addr, "admin_list") { | |
190 | 206 | case _: Unit => | |
191 | 207 | "unset" | |
192 | 208 | case x: String => | |
193 | 209 | x | |
194 | 210 | case _ => | |
195 | 211 | throw("Match error") | |
196 | 212 | } | |
197 | 213 | let callerAddressStr = toString(i.caller) | |
198 | 214 | if ((adminList != "unset")) | |
199 | 215 | then { | |
200 | 216 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
201 | 217 | let isAdmin = match test { | |
202 | 218 | case x: String => | |
203 | 219 | x | |
204 | 220 | case _: Unit => | |
205 | 221 | "no admin" | |
206 | 222 | case _ => | |
207 | 223 | throw("Match error") | |
208 | 224 | } | |
209 | 225 | if ((isAdmin != "no admin")) | |
210 | 226 | then $Tuple2([StringEntry(variable, value)], unit) | |
211 | 227 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
212 | 228 | } | |
213 | 229 | else throw("Unset admin list") | |
214 | 230 | } | |
215 | 231 | ||
216 | 232 | ||
217 | 233 | ||
218 | 234 | @Callable(i) | |
219 | 235 | func delOption (variable) = { | |
220 | 236 | let adminList = match getString(options_addr, "admin_list") { | |
221 | 237 | case _: Unit => | |
222 | 238 | "unset" | |
223 | 239 | case x: String => | |
224 | 240 | x | |
225 | 241 | case _ => | |
226 | 242 | throw("Match error") | |
227 | 243 | } | |
228 | 244 | let callerAddressStr = toString(i.caller) | |
229 | 245 | if ((adminList != "unset")) | |
230 | 246 | then { | |
231 | 247 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
232 | 248 | let isAdmin = match test { | |
233 | 249 | case x: String => | |
234 | 250 | x | |
235 | 251 | case _: Unit => | |
236 | 252 | "no admin" | |
237 | 253 | case _ => | |
238 | 254 | throw("Match error") | |
239 | 255 | } | |
240 | 256 | if ((isAdmin != "no admin")) | |
241 | 257 | then $Tuple2([DeleteEntry(variable)], unit) | |
242 | 258 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
243 | 259 | } | |
244 | 260 | else throw("Unset admin list") | |
245 | 261 | } | |
246 | 262 | ||
247 | 263 | ||
248 | 264 | @Verifier(tx) | |
249 | 265 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
250 | 266 |
github/deemru/w8io/169f3d6 53.62 ms ◑