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