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