tx · BoC8J9uPdoHtqqnsDJEE4StKVTQUC5RTCxMSHgPs4TCN 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx: -0.01000000 Waves 2023.02.21 16:44 [2459488] smart account 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx > SELF 0.00000000 Waves
{ "type": 13, "id": "BoC8J9uPdoHtqqnsDJEE4StKVTQUC5RTCxMSHgPs4TCN", "fee": 1000000, "feeAssetId": null, "timestamp": 1676987102530, "version": 2, "chainId": 84, "sender": "3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx", "senderPublicKey": "D35PGQCSSdrp9pvujggj7b2DaCK1BhcU3kho7tikKJYs", "proofs": [ "aXsSE5qXYeE5NYHmRtb65mdCmJv739s87tEEf92Ba5WRR7yuHpNmqxNiWg1y8vCDdsp51Q4sV3Ee3uoVjUX8RX2" ], "script": "base64:BgIfCAISAwoBARIAEgMKAQESBAoCGBESBAoCCAESAwoBCAIADG9wdGlvbnNfYWRkcgkBB0FkZHJlc3MBARoBVEFb+Cv2F+oqocvEivH7x7uyIGEx/ocgwQAEdFVTRAEgqyRKarZCRuvS/ON5sGG6w65pV01SespFHKdAHRGwKQ4GAWkBCWlzc3VlQmlsbAEJcHJvdmlkaW5nBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEDWN1cnJlbnRBbW91bnQEByRtYXRjaDAJAJoIAgUEdGhpcwUKY3VycmVudEtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQRbWluQmlsbERlcG9zaXRTdHIEByRtYXRjaDAJAJ0IAgUMb3B0aW9uc19hZGRyAhBtaW5fYmlsbF9kZXBvc2l0AwkAAQIFByRtYXRjaDACBFVuaXQCATADCQABAgUHJG1hdGNoMAIGU3RyaW5nBAF4BQckbWF0Y2gwBQF4CQACAQILTWF0Y2ggZXJyb3IEDm1pbkJpbGxEZXBvc2l0CQENcGFyc2VJbnRWYWx1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V5j3oUnA==", "height": 2459488, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DjNSC2VYkZBcDaDWVf4V42FGMujSeu3vQAVarDSx4K6J Next: A54inJ5zo53K8J7Meo5keDqpwUYAas7K6DhFZNBoJpQC Diff:
Old | New | Differences | |
---|---|---|---|
22 | 22 | case _ => | |
23 | 23 | throw("Match error") | |
24 | 24 | } | |
25 | - | let minBillDeposit = | |
25 | + | let minBillDeposit = parseIntValue(minBillDepositStr) | |
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))) | |
102 | 102 | throw("Match error") | |
103 | 103 | } | |
104 | 104 | func addStringEntry (accum,nextValue) = { | |
105 | - | let $ | |
106 | - | let result = $ | |
107 | - | let j = $ | |
105 | + | let $t042034226 = accum | |
106 | + | let result = $t042034226._1 | |
107 | + | let j = $t042034226._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 | - | let minBillDeposit = | |
25 | + | let minBillDeposit = parseIntValue(minBillDepositStr) | |
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 $t042034226 = accum | |
106 | + | let result = $t042034226._1 | |
107 | + | let j = $t042034226._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 60.63 ms ◑