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