tx · HprKhLGCEfvsMuJGHuhEsbV2aZ26MtKCueoX9vsXHEtk 3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6: -0.01000000 Waves 2023.03.09 04:31 [2481895] smart account 3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6 > SELF 0.00000000 Waves
{ "type": 13, "id": "HprKhLGCEfvsMuJGHuhEsbV2aZ26MtKCueoX9vsXHEtk", "fee": 1000000, "feeAssetId": null, "timestamp": 1678325467735, "version": 2, "chainId": 84, "sender": "3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6", "senderPublicKey": "GmYZFRssDr88KiZt3x4LsJ6qfqaTfMUycQTKZVdipUgS", "proofs": [ "57fA7fb8V1B2WpWx9F9ketSQATTUCUxddHcUEWYEAYpwawFZzZCGbn3sp1c6irvWdicujjG29YDnCR8P92CpVide" ], "script": "base64:BgIlCAISAwoBARIECgIIARIECgIYGBIECgIICBIDCgEIEgUKAwgICAMADG9wdGlvbnNfYWRkcgkBB0FkZHJlc3MBARoBVEFb+Cv2F+oqocvEivH7x7uyIGEx/ocgwQAEdFJVQgEgv7I1LEj/fS4nZAGEmW42z/vK94nfeiKN08fw7a6U2ZsABHRVU0QBIKskSmq2Qkbr0vzjebBhusOuaVdNUnrKRRynQB0RsCkOBgFpARFyZWlzc3VlRm9yRGVwQWRkcgEIcXVhbnRpdHkECWFkbWluTGlzdAQHJG1hdGNoMAkAnQgCBQxvcHRpb25zX2FkZHICCmFkbWluX2xpc3QDCQABAgUHJG1hdGNoMAIEVW5pdAIFdW5zZXQDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAF4BQckbWF0Y2gwBQF4CQACAQILTWF0Y2ggZXJyb3IEEGNhbGxlckFkZHJlc3NTdHIJAKUIAQgFAWkGY2FsbGVyAwkBAiE9AgUJYWRtaW5MaXN0AgV1bnNldAQEdGVzdAkAnQgCCQERQGV4dHJOYXRpdmUoMTA2MikBBQlhZG1pbkxpc3QFEGNhbGxlckFkZHJlc3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gUHJG1hdGNoMAIGU3RyaW5nBARoaXN0BQckbWF0Y2gwBQRoaXN0AgV1bnNldAMJAQIhPQIFDWlzS25vd25DYWxsZXICBXVuc2V0CQCUCgIJAMwIAgkBC1N0cmluZ0VudHJ5AgkA2AQBCAgFAWkGY2FsbGVyBWJ5dGVzCQCsAgIJAKwCAgkArAICCQCsAgIFBG5hbWUCAXwFA2lubgIBfAUEb2dybgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAwIQ9BQR1bml0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgDAhD0FBHRVU0QFA25pbAUEdW5pdAkAAgECFUNhbiBiZSB1c2VkIG9ubHkgb25jZQECdHgBBnZlcmlmeQAEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACD0RhdGFUcmFuc2FjdGlvbgQDZHR4BQckbWF0Y2gwBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleYP5xZ8=", "height": 2481895, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C3bC8nrvSTkg9mgfPnoou13FLk48LYTP6uUhZ2taz9dh Next: Be3BEo29WKnXRfKLq5mgfk6S7zhx8zqkPFw1mwVXtkDB Diff:
Old | New | Differences | |
---|---|---|---|
33 | 33 | then { | |
34 | 34 | let reissue = Reissue(tRUB, quantity, true) | |
35 | 35 | if ((reissue == reissue)) | |
36 | - | then $Tuple2([reissue], "Reissue error :(") | |
36 | + | then $Tuple2([reissue, ScriptTransfer(i.caller, quantity, tRUB)], "Reissue error :(") | |
37 | 37 | else throw("Strict value is not equal to itself.") | |
38 | 38 | } | |
39 | 39 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
91 | 91 | throw("Match error") | |
92 | 92 | } | |
93 | 93 | func addStringEntry (accum,nextValue) = { | |
94 | - | let $ | |
95 | - | let result = $ | |
96 | - | let j = $ | |
94 | + | let $t029863009 = accum | |
95 | + | let result = $t029863009._1 | |
96 | + | let j = $t029863009._2 | |
97 | 97 | $Tuple2((result :+ StringEntry(opts[j], nextValue)), (j + 1)) | |
98 | 98 | } | |
99 | 99 |
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 tRUB = base58'DuJUjEZJWmpFUo3bubFX8tomUVitqZZNAPuhd6KWgJNE' | |
7 | 7 | ||
8 | 8 | let tUSD = base58'CX4p6XcuSBUvv44r1avCqYka5PYAVzBK5hSXaT7maU85' | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func reissueForDepAddr (quantity) = { | |
12 | 12 | let adminList = match getString(options_addr, "admin_list") { | |
13 | 13 | case _: Unit => | |
14 | 14 | "unset" | |
15 | 15 | case x: String => | |
16 | 16 | x | |
17 | 17 | case _ => | |
18 | 18 | throw("Match error") | |
19 | 19 | } | |
20 | 20 | let callerAddressStr = toString(i.caller) | |
21 | 21 | if ((adminList != "unset")) | |
22 | 22 | then { | |
23 | 23 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
24 | 24 | let isAdmin = match test { | |
25 | 25 | case x: String => | |
26 | 26 | x | |
27 | 27 | case _: Unit => | |
28 | 28 | "no admin" | |
29 | 29 | case _ => | |
30 | 30 | throw("Match error") | |
31 | 31 | } | |
32 | 32 | if ((isAdmin != "no admin")) | |
33 | 33 | then { | |
34 | 34 | let reissue = Reissue(tRUB, quantity, true) | |
35 | 35 | if ((reissue == reissue)) | |
36 | - | then $Tuple2([reissue], "Reissue error :(") | |
36 | + | then $Tuple2([reissue, ScriptTransfer(i.caller, quantity, tRUB)], "Reissue error :(") | |
37 | 37 | else throw("Strict value is not equal to itself.") | |
38 | 38 | } | |
39 | 39 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
40 | 40 | } | |
41 | 41 | else throw("Unset admin list") | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func reissueTokens (token,quantity) = { | |
48 | 48 | let adminList = match getString(options_addr, "admin_list") { | |
49 | 49 | case _: Unit => | |
50 | 50 | "unset" | |
51 | 51 | case x: String => | |
52 | 52 | x | |
53 | 53 | case _ => | |
54 | 54 | throw("Match error") | |
55 | 55 | } | |
56 | 56 | let callerAddressStr = toString(i.caller) | |
57 | 57 | if ((adminList != "unset")) | |
58 | 58 | then { | |
59 | 59 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
60 | 60 | let isAdmin = match test { | |
61 | 61 | case x: String => | |
62 | 62 | x | |
63 | 63 | case _: Unit => | |
64 | 64 | "no admin" | |
65 | 65 | case _ => | |
66 | 66 | throw("Match error") | |
67 | 67 | } | |
68 | 68 | if ((isAdmin != "no admin")) | |
69 | 69 | then { | |
70 | 70 | let reissue = Reissue(fromBase58String(token), quantity, true) | |
71 | 71 | $Tuple2([reissue], (((((((("Reissue error for param: token => " + token) + ", quantity:") + toString(quantity)) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ".")) | |
72 | 72 | } | |
73 | 73 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
74 | 74 | } | |
75 | 75 | else throw("Unset admin list") | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(i) | |
81 | 81 | func setOptions (opts,vals) = { | |
82 | 82 | let opt_size = size(opts) | |
83 | 83 | if ((100 >= opt_size)) | |
84 | 84 | then { | |
85 | 85 | let adminList = match getString(this, "admin_list") { | |
86 | 86 | case _: Unit => | |
87 | 87 | "unset" | |
88 | 88 | case x: String => | |
89 | 89 | x | |
90 | 90 | case _ => | |
91 | 91 | throw("Match error") | |
92 | 92 | } | |
93 | 93 | func addStringEntry (accum,nextValue) = { | |
94 | - | let $ | |
95 | - | let result = $ | |
96 | - | let j = $ | |
94 | + | let $t029863009 = accum | |
95 | + | let result = $t029863009._1 | |
96 | + | let j = $t029863009._2 | |
97 | 97 | $Tuple2((result :+ StringEntry(opts[j], nextValue)), (j + 1)) | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | let r = { | |
101 | 101 | let $l = vals | |
102 | 102 | let $s = size($l) | |
103 | 103 | let $acc0 = $Tuple2(nil, 0) | |
104 | 104 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
105 | 105 | then $a | |
106 | 106 | else addStringEntry($a, $l[$i]) | |
107 | 107 | ||
108 | 108 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
109 | 109 | then $a | |
110 | 110 | else throw("List size exceeds 100") | |
111 | 111 | ||
112 | 112 | $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) | |
113 | 113 | } | |
114 | 114 | let callerAddressStr = toString(i.caller) | |
115 | 115 | if ((adminList != "unset")) | |
116 | 116 | then { | |
117 | 117 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
118 | 118 | let isAdmin = match test { | |
119 | 119 | case x: String => | |
120 | 120 | x | |
121 | 121 | case _: Unit => | |
122 | 122 | "no admin" | |
123 | 123 | case _ => | |
124 | 124 | throw("Match error") | |
125 | 125 | } | |
126 | 126 | func add_elm (options) = { | |
127 | 127 | let opt = split(options, "|") | |
128 | 128 | StringEntry(opt[0], opt[1]) | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | if ((isAdmin != "no admin")) | |
132 | 132 | then r | |
133 | 133 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
134 | 134 | } | |
135 | 135 | else throw("Unset admin list") | |
136 | 136 | } | |
137 | 137 | else throw("The number of list elements must not exceed 100") | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
142 | 142 | @Callable(i) | |
143 | 143 | func setOption (variable,value) = { | |
144 | 144 | let adminList = match getString(this, "admin_list") { | |
145 | 145 | case _: Unit => | |
146 | 146 | "unset" | |
147 | 147 | case x: String => | |
148 | 148 | x | |
149 | 149 | case _ => | |
150 | 150 | throw("Match error") | |
151 | 151 | } | |
152 | 152 | let callerAddressStr = toString(i.caller) | |
153 | 153 | if ((adminList != "unset")) | |
154 | 154 | then { | |
155 | 155 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
156 | 156 | let isAdmin = match test { | |
157 | 157 | case x: String => | |
158 | 158 | x | |
159 | 159 | case _: Unit => | |
160 | 160 | "no admin" | |
161 | 161 | case _ => | |
162 | 162 | throw("Match error") | |
163 | 163 | } | |
164 | 164 | if ((isAdmin != "no admin")) | |
165 | 165 | then $Tuple2([StringEntry(variable, value)], unit) | |
166 | 166 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
167 | 167 | } | |
168 | 168 | else throw("Unset admin list") | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | ||
173 | 173 | @Callable(i) | |
174 | 174 | func delOption (variable) = { | |
175 | 175 | let adminList = match getString(this, "admin_list") { | |
176 | 176 | case _: Unit => | |
177 | 177 | "unset" | |
178 | 178 | case x: String => | |
179 | 179 | x | |
180 | 180 | case _ => | |
181 | 181 | throw("Match error") | |
182 | 182 | } | |
183 | 183 | let callerAddressStr = toString(i.caller) | |
184 | 184 | if ((adminList != "unset")) | |
185 | 185 | then { | |
186 | 186 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
187 | 187 | let isAdmin = match test { | |
188 | 188 | case x: String => | |
189 | 189 | x | |
190 | 190 | case _: Unit => | |
191 | 191 | "no admin" | |
192 | 192 | case _ => | |
193 | 193 | throw("Match error") | |
194 | 194 | } | |
195 | 195 | if ((isAdmin != "no admin")) | |
196 | 196 | then $Tuple2([DeleteEntry(variable)], unit) | |
197 | 197 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
198 | 198 | } | |
199 | 199 | else throw("Unset admin list") | |
200 | 200 | } | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | ||
204 | 204 | @Callable(i) | |
205 | 205 | func regProvider (name,inn,ogrn) = { | |
206 | 206 | let isKnownCaller = match getString(this, toBase58String(i.caller.bytes)) { | |
207 | 207 | case hist: String => | |
208 | 208 | hist | |
209 | 209 | case _ => | |
210 | 210 | "unset" | |
211 | 211 | } | |
212 | 212 | if ((isKnownCaller != "unset")) | |
213 | 213 | then $Tuple2([StringEntry(toBase58String(i.caller.bytes), ((((name + "|") + inn) + "|") + ogrn)), ScriptTransfer(i.caller, 1000000, unit), ScriptTransfer(i.caller, 1000000, tUSD)], unit) | |
214 | 214 | else throw("Can be used only once") | |
215 | 215 | } | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | @Verifier(tx) | |
219 | 219 | func verify () = match tx { | |
220 | 220 | case dtx: DataTransaction => | |
221 | 221 | false | |
222 | 222 | case _ => | |
223 | 223 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
224 | 224 | } | |
225 | 225 |
github/deemru/w8io/169f3d6 46.68 ms ◑