tx · GuLjEdb1jRSvvv3sF8BXGGNf9b4iz9pBazRzvKeo3Hff 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx: -0.01000000 Waves 2023.02.21 16:34 [2459478] smart account 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx > SELF 0.00000000 Waves
{ "type": 13, "id": "GuLjEdb1jRSvvv3sF8BXGGNf9b4iz9pBazRzvKeo3Hff", "fee": 1000000, "feeAssetId": null, "timestamp": 1676986496038, "version": 2, "chainId": 84, "sender": "3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx", "senderPublicKey": "D35PGQCSSdrp9pvujggj7b2DaCK1BhcU3kho7tikKJYs", "proofs": [ "2C1S5oXciau7TKF4hKefte9nuM3AM1ijjs9qvnnFNAhzYy4Xuo7ysyCvwGg5sb34FTubFuEncrc3TdvVuGNoCutj" ], "script": "base64:BgIfCAISAwoBARIAEgMKAQESBAoCGBESBAoCCAESAwoBCAIADG9wdGlvbnNfYWRkcgkBB0FkZHJlc3MBARoBVEFb+Cv2F+oqocvEivH7x7uyIGEx/ocgwQAEdFVTRAEgqyRKarZCRuvS/ON5sGG6w65pV01SespFHKdAHRGwKQ4GAWkBCWlzc3VlQmlsbAEJcHJvdmlkaW5nBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEDWN1cnJlbnRBbW91bnQEByRtYXRjaDAJAJoIAgUEdGhpcwUKY3VycmVudEtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQRbWluQmlsbERlcG9zaXRTdHIEByRtYXRjaDAJAJ0IAgUMb3B0aW9uc19hZGRyAhBtaW5fYmlsbF9kZXBvc2l0AwkAAQIFByRtYXRjaDACBFVuaXQCATADCQABAgUHJG1hdGNoMAIGU3RyaW5nBAF4BQckbWF0Y2gwBQF4CQACAQILTWF0Y2ggZXJyb3IEDm1pbkJpbGxEZXBvc2l0CQBoAgkAsQkBCQCbAwEFEW1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zZXQgYWRtaW4gbGlzdAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlc5pYk", "height": 2459478, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B7XVF8KjpUncmT2XUqohRmvjJtpE7pCJhZQyvHPfW7gc Next: DjNSC2VYkZBcDaDWVf4V42FGMujSeu3vQAVarDSx4K6J Diff:
Old | New | Differences | |
---|---|---|---|
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 _ => | |
102 | 102 | throw("Match error") | |
103 | 103 | } | |
104 | 104 | func addStringEntry (accum,nextValue) = { | |
105 | - | let $ | |
106 | - | let result = $ | |
107 | - | let j = $ | |
105 | + | let $t042164239 = accum | |
106 | + | let result = $t042164239._1 | |
107 | + | let j = $t042164239._2 | |
108 | 108 | $Tuple2((result :+ IntegerEntry(opts[j], nextValue)), (j + 1)) | |
109 | 109 | } | |
110 | 110 |
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) = { | |
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 minBillDeposit = (toInt(toBytes(minBillDepositStr)) * 100) | |
26 | 26 | let newAmount = (currentAmount - providing) | |
27 | 27 | if ((minBillDeposit > providing)) | |
28 | 28 | then throw(((("The security deposit must be more than " + minBillDepositStr) + ". You set the size: ") + toString(providing))) | |
29 | 29 | else if ((0 > newAmount)) | |
30 | 30 | then throw("Not enough balance") | |
31 | 31 | else { | |
32 | 32 | let issue = Issue(("bill for:" + toString((providing / 100))), currentKey, 1, 0, false) | |
33 | 33 | let id = calculateAssetId(issue) | |
34 | 34 | $Tuple2([IntegerEntry(currentKey, newAmount), issue, ScriptTransfer(i.caller, 1, id)], unit) | |
35 | 35 | } | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | ||
40 | 40 | @Callable(i) | |
41 | 41 | func deposit () = if ((size(i.payments) == 0)) | |
42 | 42 | then throw("Payment not attached") | |
43 | 43 | else { | |
44 | 44 | let pmt = value(i.payments)[0] | |
45 | 45 | let adminList = match getString(options_addr, "admin_list") { | |
46 | 46 | case _: Unit => | |
47 | 47 | "unset" | |
48 | 48 | case x: String => | |
49 | 49 | x | |
50 | 50 | case _ => | |
51 | 51 | throw("Match error") | |
52 | 52 | } | |
53 | 53 | if ((pmt.assetId != tUSD)) | |
54 | 54 | then throw("holded payment not tUSD") | |
55 | 55 | else if ((1000 > pmt.amount)) | |
56 | 56 | then throw("holded payment < 10.00") | |
57 | 57 | else { | |
58 | 58 | let currentKey = toBase58String(i.caller.bytes) | |
59 | 59 | let currentAmount = match getInteger(this, currentKey) { | |
60 | 60 | case a: Int => | |
61 | 61 | a | |
62 | 62 | case _ => | |
63 | 63 | 0 | |
64 | 64 | } | |
65 | 65 | let newAmount = (currentAmount + pmt.amount) | |
66 | 66 | [IntegerEntry(currentKey, newAmount)] | |
67 | 67 | } | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | ||
72 | 72 | @Callable(i) | |
73 | 73 | func withdraw (amount) = { | |
74 | 74 | let currentKey = toBase58String(i.caller.bytes) | |
75 | 75 | let currentAmount = match getInteger(this, currentKey) { | |
76 | 76 | case a: Int => | |
77 | 77 | a | |
78 | 78 | case _ => | |
79 | 79 | 0 | |
80 | 80 | } | |
81 | 81 | let newAmount = (currentAmount - amount) | |
82 | 82 | if ((0 > amount)) | |
83 | 83 | then throw("Can't withdraw negative amount") | |
84 | 84 | else if ((0 > newAmount)) | |
85 | 85 | then throw("Not enough balance") | |
86 | 86 | else $Tuple2([IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, tUSD)], unit) | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
91 | 91 | @Callable(i) | |
92 | 92 | func setOptions (opts,vals) = { | |
93 | 93 | let opt_size = size(opts) | |
94 | 94 | if ((100 >= opt_size)) | |
95 | 95 | then { | |
96 | 96 | let adminList = match getString(options_addr, "admin_list") { | |
97 | 97 | case _: Unit => | |
98 | 98 | "unset" | |
99 | 99 | case x: String => | |
100 | 100 | x | |
101 | 101 | case _ => | |
102 | 102 | throw("Match error") | |
103 | 103 | } | |
104 | 104 | func addStringEntry (accum,nextValue) = { | |
105 | - | let $ | |
106 | - | let result = $ | |
107 | - | let j = $ | |
105 | + | let $t042164239 = accum | |
106 | + | let result = $t042164239._1 | |
107 | + | let j = $t042164239._2 | |
108 | 108 | $Tuple2((result :+ IntegerEntry(opts[j], nextValue)), (j + 1)) | |
109 | 109 | } | |
110 | 110 | ||
111 | 111 | let r = { | |
112 | 112 | let $l = vals | |
113 | 113 | let $s = size($l) | |
114 | 114 | let $acc0 = $Tuple2(nil, 0) | |
115 | 115 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
116 | 116 | then $a | |
117 | 117 | else addStringEntry($a, $l[$i]) | |
118 | 118 | ||
119 | 119 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
120 | 120 | then $a | |
121 | 121 | else throw("List size exceeds 100") | |
122 | 122 | ||
123 | 123 | $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) | |
124 | 124 | } | |
125 | 125 | let callerAddressStr = toString(i.caller) | |
126 | 126 | if ((adminList != "unset")) | |
127 | 127 | then { | |
128 | 128 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
129 | 129 | let isAdmin = match test { | |
130 | 130 | case x: String => | |
131 | 131 | x | |
132 | 132 | case _: Unit => | |
133 | 133 | "no admin" | |
134 | 134 | case _ => | |
135 | 135 | throw("Match error") | |
136 | 136 | } | |
137 | 137 | func add_elm (options) = { | |
138 | 138 | let opt = split(options, "|") | |
139 | 139 | StringEntry(opt[0], opt[1]) | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | if ((isAdmin != "no admin")) | |
143 | 143 | then r | |
144 | 144 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
145 | 145 | } | |
146 | 146 | else throw("Unset admin list") | |
147 | 147 | } | |
148 | 148 | else throw("The number of list elements must not exceed 100") | |
149 | 149 | } | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | 153 | @Callable(i) | |
154 | 154 | func setOption (variable,value) = { | |
155 | 155 | let adminList = match getString(options_addr, "admin_list") { | |
156 | 156 | case _: Unit => | |
157 | 157 | "unset" | |
158 | 158 | case x: String => | |
159 | 159 | x | |
160 | 160 | case _ => | |
161 | 161 | throw("Match error") | |
162 | 162 | } | |
163 | 163 | let callerAddressStr = toString(i.caller) | |
164 | 164 | if ((adminList != "unset")) | |
165 | 165 | then { | |
166 | 166 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
167 | 167 | let isAdmin = match test { | |
168 | 168 | case x: String => | |
169 | 169 | x | |
170 | 170 | case _: Unit => | |
171 | 171 | "no admin" | |
172 | 172 | case _ => | |
173 | 173 | throw("Match error") | |
174 | 174 | } | |
175 | 175 | if ((isAdmin != "no admin")) | |
176 | 176 | then $Tuple2([IntegerEntry(variable, value)], unit) | |
177 | 177 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
178 | 178 | } | |
179 | 179 | else throw("Unset admin list") | |
180 | 180 | } | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | ||
184 | 184 | @Callable(i) | |
185 | 185 | func delOption (variable) = { | |
186 | 186 | let adminList = match getString(options_addr, "admin_list") { | |
187 | 187 | case _: Unit => | |
188 | 188 | "unset" | |
189 | 189 | case x: String => | |
190 | 190 | x | |
191 | 191 | case _ => | |
192 | 192 | throw("Match error") | |
193 | 193 | } | |
194 | 194 | let callerAddressStr = toString(i.caller) | |
195 | 195 | if ((adminList != "unset")) | |
196 | 196 | then { | |
197 | 197 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
198 | 198 | let isAdmin = match test { | |
199 | 199 | case x: String => | |
200 | 200 | x | |
201 | 201 | case _: Unit => | |
202 | 202 | "no admin" | |
203 | 203 | case _ => | |
204 | 204 | throw("Match error") | |
205 | 205 | } | |
206 | 206 | if ((isAdmin != "no admin")) | |
207 | 207 | then $Tuple2([DeleteEntry(variable)], unit) | |
208 | 208 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
209 | 209 | } | |
210 | 210 | else throw("Unset admin list") | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | @Verifier(tx) | |
215 | 215 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
216 | 216 |
github/deemru/w8io/169f3d6 38.59 ms ◑