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