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