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+8e7siBhMf6HIMEABHRVU0QBIKskSmq2Qkbr0vzjebBhusOuaVdNUnrKRRynQB0RsCkOBgFpAQlpc3N1ZUJpbGwCCXByb3ZpZGluZwRzaXplBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEDWN1cnJlbnRBbW91bnQEByRtYXRjaDAJAJoIAgUEdGhpcwUKY3VycmVudEtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQRbWluQmlsbERlcG9zaXRTdHIEByRtYXRjaDAJAJ0IAgUMb3B0aW9uc19hZGRyAhBtaW5fYmlsbF9kZXBvc2l0AwkAAQIFByRtYXRjaDACBFVuaXQCATADCQABAgUHJG1hdGNoMAIGU3RyaW5nBAF4BQckbWF0Y2gwBQF4CQACAQILTWF0Y2ggZXJyb3IED2V4Y2hhbmdlUmF0ZVN0cgQHJG1hdGN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xsZXJBZGRyZXNzU3RyOiAFEGNhbGxlckFkZHJlc3NTdHICAiwgCQACAQIQVW5zZXQgYWRtaW4gbGlzdAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkToGjo", "height": 2478413, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GF7ZjKbMbMU39ckahaE9wLTz4tGNaFMAoUnMnbS7LuLB Next: 49XtyS85XjTeLT4bqe1jDDMS9QMcVHwvRUetZ7HHCmRr Diff:
OldNewDifferences
4646 case _ =>
4747 throw("Match error")
4848 }
49+ let tRUB_min = (currentAmount * exchangeRate)
4950 let newAmount = (currentAmount - providing)
5051 if (((minBillDeposit * 100) > providing))
5152 then throw((((("The security deposit must be more than " + minBillDepositStr) + ". You set the size: ") + toString((providing / 100))) + ".00"))
5253 else if ((0 > newAmount))
5354 then throw("Not enough balance")
54- else if ((size > (currentAmount * exchangeRate)))
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)"))
5657 else {
5758 let issue = Issue(("bill for:" + toString((providing / 100))), ((currentKey + ":") + toString(size)), 1, 0, false)
5859 let id = calculateAssetId(issue)
135136 throw("Match error")
136137 }
137138 func addStringEntry (accum,nextValue) = {
138- let $t052975320 = accum
139- let result = $t052975320._1
140- let j = $t052975320._2
139+ let $t053595382 = accum
140+ let result = $t053595382._1
141+ let j = $t053595382._2
141142 $Tuple2((result :+ IntegerEntry(opts[j], nextValue)), (j + 1))
142143 }
143144
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let options_addr = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
55
66 let tUSD = base58'CX4p6XcuSBUvv44r1avCqYka5PYAVzBK5hSXaT7maU85'
77
88 @Callable(i)
99 func issueBill (providing,size) = {
1010 let currentKey = toBase58String(i.caller.bytes)
1111 let currentAmount = match getInteger(this, currentKey) {
1212 case a: Int =>
1313 a
1414 case _ =>
1515 0
1616 }
1717 let minBillDepositStr = match getString(options_addr, "min_bill_deposit") {
1818 case _: Unit =>
1919 "0"
2020 case x: String =>
2121 x
2222 case _ =>
2323 throw("Match error")
2424 }
2525 let exchangeRateStr = match getString(options_addr, "exchange_rate") {
2626 case _: Unit =>
2727 "0"
2828 case x: String =>
2929 x
3030 case _ =>
3131 throw("Match error")
3232 }
3333 let minBillDeposit = match parseInt(split(minBillDepositStr, ".")[0]) {
3434 case _: Unit =>
3535 0
3636 case t: Int =>
3737 t
3838 case _ =>
3939 throw("Match error")
4040 }
4141 let exchangeRate = match parseInt(split(exchangeRateStr, ".")[0]) {
4242 case _: Unit =>
4343 0
4444 case t: Int =>
4545 t
4646 case _ =>
4747 throw("Match error")
4848 }
49+ let tRUB_min = (currentAmount * exchangeRate)
4950 let newAmount = (currentAmount - providing)
5051 if (((minBillDeposit * 100) > providing))
5152 then throw((((("The security deposit must be more than " + minBillDepositStr) + ". You set the size: ") + toString((providing / 100))) + ".00"))
5253 else if ((0 > newAmount))
5354 then throw("Not enough balance")
54- else if ((size > (currentAmount * exchangeRate)))
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)"))
5657 else {
5758 let issue = Issue(("bill for:" + toString((providing / 100))), ((currentKey + ":") + toString(size)), 1, 0, false)
5859 let id = calculateAssetId(issue)
5960 $Tuple2([IntegerEntry(currentKey, newAmount), issue, ScriptTransfer(i.caller, 1, id), IntegerEntry(("l_u_" + toBase58String(id)), providing)], unit)
6061 }
6162 }
6263
6364
6465
6566 @Callable(i)
6667 func deposit () = if ((size(i.payments) == 0))
6768 then throw("Payment not attached")
6869 else {
6970 let pmt = value(i.payments)[0]
7071 let minDepositStr = match getString(options_addr, "min_deposit") {
7172 case _: Unit =>
7273 "0"
7374 case x: String =>
7475 x
7576 case _ =>
7677 throw("Match error")
7778 }
7879 let minDeposit = match parseInt(split(minDepositStr, ".")[0]) {
7980 case _: Unit =>
8081 0
8182 case t: Int =>
8283 t
8384 case _ =>
8485 throw("Match error")
8586 }
8687 if ((pmt.assetId != tUSD))
8788 then throw("holded payment not tUSD")
8889 else if (((minDeposit * 100) > pmt.amount))
8990 then throw((((("You have set the deposit amount to " + toString((pmt.amount / 100))) + ".00, which is less than the minimum (") + minDepositStr) + ")"))
9091 else {
9192 let currentKey = toBase58String(i.caller.bytes)
9293 let currentAmount = match getInteger(this, currentKey) {
9394 case a: Int =>
9495 a
9596 case _ =>
9697 0
9798 }
9899 let newAmount = (currentAmount + pmt.amount)
99100 [IntegerEntry(currentKey, newAmount)]
100101 }
101102 }
102103
103104
104105
105106 @Callable(i)
106107 func withdraw (amount) = {
107108 let currentKey = toBase58String(i.caller.bytes)
108109 let currentAmount = match getInteger(this, currentKey) {
109110 case a: Int =>
110111 a
111112 case _ =>
112113 0
113114 }
114115 let newAmount = (currentAmount - amount)
115116 if ((0 > amount))
116117 then throw("Can't withdraw negative amount")
117118 else if ((0 > newAmount))
118119 then throw("Not enough balance")
119120 else $Tuple2([IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, tUSD)], unit)
120121 }
121122
122123
123124
124125 @Callable(i)
125126 func setOptions (opts,vals) = {
126127 let opt_size = size(opts)
127128 if ((100 >= opt_size))
128129 then {
129130 let adminList = match getString(options_addr, "admin_list") {
130131 case _: Unit =>
131132 "unset"
132133 case x: String =>
133134 x
134135 case _ =>
135136 throw("Match error")
136137 }
137138 func addStringEntry (accum,nextValue) = {
138- let $t052975320 = accum
139- let result = $t052975320._1
140- let j = $t052975320._2
139+ let $t053595382 = accum
140+ let result = $t053595382._1
141+ let j = $t053595382._2
141142 $Tuple2((result :+ IntegerEntry(opts[j], nextValue)), (j + 1))
142143 }
143144
144145 let r = {
145146 let $l = vals
146147 let $s = size($l)
147148 let $acc0 = $Tuple2(nil, 0)
148149 func $f0_1 ($a,$i) = if (($i >= $s))
149150 then $a
150151 else addStringEntry($a, $l[$i])
151152
152153 func $f0_2 ($a,$i) = if (($i >= $s))
153154 then $a
154155 else throw("List size exceeds 100")
155156
156157 $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)
157158 }
158159 let callerAddressStr = toString(i.caller)
159160 if ((adminList != "unset"))
160161 then {
161162 let test = getString(addressFromStringValue(adminList), callerAddressStr)
162163 let isAdmin = match test {
163164 case x: String =>
164165 x
165166 case _: Unit =>
166167 "no admin"
167168 case _ =>
168169 throw("Match error")
169170 }
170171 func add_elm (options) = {
171172 let opt = split(options, "|")
172173 StringEntry(opt[0], opt[1])
173174 }
174175
175176 if ((isAdmin != "no admin"))
176177 then r
177178 else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", "))
178179 }
179180 else throw("Unset admin list")
180181 }
181182 else throw("The number of list elements must not exceed 100")
182183 }
183184
184185
185186
186187 @Callable(i)
187188 func setOption (variable,value) = {
188189 let adminList = match getString(options_addr, "admin_list") {
189190 case _: Unit =>
190191 "unset"
191192 case x: String =>
192193 x
193194 case _ =>
194195 throw("Match error")
195196 }
196197 let callerAddressStr = toString(i.caller)
197198 if ((adminList != "unset"))
198199 then {
199200 let test = getString(addressFromStringValue(adminList), callerAddressStr)
200201 let isAdmin = match test {
201202 case x: String =>
202203 x
203204 case _: Unit =>
204205 "no admin"
205206 case _ =>
206207 throw("Match error")
207208 }
208209 if ((isAdmin != "no admin"))
209210 then $Tuple2([StringEntry(variable, value)], unit)
210211 else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", "))
211212 }
212213 else throw("Unset admin list")
213214 }
214215
215216
216217
217218 @Callable(i)
218219 func delOption (variable) = {
219220 let adminList = match getString(options_addr, "admin_list") {
220221 case _: Unit =>
221222 "unset"
222223 case x: String =>
223224 x
224225 case _ =>
225226 throw("Match error")
226227 }
227228 let callerAddressStr = toString(i.caller)
228229 if ((adminList != "unset"))
229230 then {
230231 let test = getString(addressFromStringValue(adminList), callerAddressStr)
231232 let isAdmin = match test {
232233 case x: String =>
233234 x
234235 case _: Unit =>
235236 "no admin"
236237 case _ =>
237238 throw("Match error")
238239 }
239240 if ((isAdmin != "no admin"))
240241 then $Tuple2([DeleteEntry(variable)], unit)
241242 else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", "))
242243 }
243244 else throw("Unset admin list")
244245 }
245246
246247
247248 @Verifier(tx)
248249 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
249250

github/deemru/w8io/169f3d6 
47.62 ms