tx · 8nmgYaHyfNsaxdAawuxm3ouPqEm241XfRFVwy2LUsoyi 3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH: -0.03700000 Waves 2023.05.24 17:20 [2592174] smart account 3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH > SELF 0.00000000 Waves
{ "type": 13, "id": "8nmgYaHyfNsaxdAawuxm3ouPqEm241XfRFVwy2LUsoyi", "fee": 3700000, "feeAssetId": null, "timestamp": 1684938039217, "version": 2, "chainId": 84, "sender": "3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH", "senderPublicKey": "3mgJJUcUNFHYP2pNkbkfB2C8D4gSEKEGisFByu2i6xoM", "proofs": [ "5mV9i8hhy86aVKCKN1c1zKCtuam4LV1vuPZtTEXCozFrekWfP7GzzXmfVBrYxdPzzES3HD6iXnTpRXveLvC9qYjF" ], "script": "base64:BgIlCAISBQoDCAgIEgASABIECgIICBIECgIIARIAEgMKAQgSAwoBCBsAB2tfZnVuZHMCB2tfZnVuZHMAF2tfYXNzZXRfbWFuYWdlcl9hZGRyZXNzAhdrX2Fzc2V0X21hbmFnZXJfYWRkcmVzcwAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzABBrX29yZGVyc19hZGRyZXNzAhBrX29yZGVyc19hZGRyZXNzAA9rX3ZhdWx0X2FkZHJlc3MCD2tfdmF1bHRfYWRkcmVzcwAFa19hbW0CBWtfYW1tAA9rX2FkbWluX2FkZHJlc3MCD2tfYWRtaW5fYWRkcmVzcwARa19zdGFraW5nX2FkZHJlc3MCEWtfc3Rha2luZ19hZGRyZXNzAA5rX3Nwb3RfYWRkcmVzcwIOa19zcG90X2FkZHJlc3MAB2tfdmF1bHQCB2tfdmF1bHQADWtfaW5pdGlhbGl6ZWQCDWtfaW5pdGlhbGl6ZWQACGtfcGF1c2VkAghrX3BhdXNlZAEOdG9Db21wb3NpdGVLZXkCBF9rZXkIX2FkZHJlc3MJAKwCAgkArAICBQR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JAKwCAgkArAICCQCsAgIJAKwCAgkApAMBCQEJYmFsYW5jZU9mAQUIX2Fzc2V0SWQCASwJAKQDAQkAZAIJAQliYWxhbmNlT2YBBQhfYXNzZXRJZAUGcHJvZml0AgEsCQCkAwEFBnByb2ZpdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAEDmNvb3JkaW5hdG9yU3RyCQCdCAIFBHRoaXMFFGtfY29vcmRpbmF0b3JBZGRyZXNzAwkBCWlzRGVmaW5lZAEFDmNvb3JkaW5hdG9yU3RyBAVhZG1pbgkAnQgCCQERQGV4dHJOYXRpdmUoMTA2MikBCQEFdmFsdWUBBQ5jb29yZGluYXRvclN0cgUPa19hZG1pbl9hZGRyZXNzAwkBCWlzRGVmaW5lZAEFBWFkbWluCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEJAQV2YWx1ZQEFBWFkbWluCQCsAgIJAKwCAgkArAICAgdzdGF0dXNfCQClCAEFBHRoaXMCAV8JANgEAQgFAnR4AmlkBwkAAgECLnVuYWJsZSB0byB2ZXJpZnk6IGFkbWluIG5vdCBzZXQgaW4gY29vcmRpbmF0b3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlhcEU+", "height": 2592174, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: N5ssUMT8Fns9yjdpdYC5ZD7X3oe51WsHYt2M13AX8rq Next: 7JoPAmgmrpJCCmwogFEme1tWkkHonnvGaXc4UfzhwHRC Diff:
Old | New | Differences | |
---|---|---|---|
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | - | func C (o) = if (if ((o == toString(v()))) | |
67 | + | func C (o) = if (if (if ((o == toString(v()))) | |
68 | 68 | then true | |
69 | 69 | else (o == toString(s()))) | |
70 | 70 | then true | |
71 | - | else (o == toString(t())) | |
71 | + | else (o == toString(t()))) | |
72 | + | then true | |
73 | + | else A(o) | |
72 | 74 | ||
73 | 75 | ||
74 | 76 | func D (q,E) = [IntegerEntry(m(a, q), E)] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "k_funds" | |
5 | 5 | ||
6 | 6 | let b = "k_asset_manager_address" | |
7 | 7 | ||
8 | 8 | let c = "k_coordinatorAddress" | |
9 | 9 | ||
10 | 10 | let d = "k_orders_address" | |
11 | 11 | ||
12 | 12 | let e = "k_vault_address" | |
13 | 13 | ||
14 | 14 | let f = "k_amm" | |
15 | 15 | ||
16 | 16 | let g = "k_admin_address" | |
17 | 17 | ||
18 | 18 | let h = "k_staking_address" | |
19 | 19 | ||
20 | 20 | let i = "k_spot_address" | |
21 | 21 | ||
22 | 22 | let j = "k_vault" | |
23 | 23 | ||
24 | 24 | let k = "k_initialized" | |
25 | 25 | ||
26 | 26 | let l = "k_paused" | |
27 | 27 | ||
28 | 28 | func m (n,o) = ((n + "_") + o) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func p (q) = valueOrElse(getInteger(this, m(a, q)), 0) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func r () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, c), "Coordinator not set Manager")), "Coordinator address invalid") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func s () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(r(), e), "Vault address not set")), "Vault address invalid") | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func t () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(r(), d), "Orders address not set")), "Orders address invalid") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func u () = addressFromString(valueOrErrorMessage(getString(r(), g), "Admin address not set")) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func v () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(r(), h), "Staking address not set")), "Staking address invalid") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func w () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(r(), i), "Spot address not set")), "Spot address invalid") | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func x () = valueOrElse(getBoolean(this, k), false) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func y () = valueOrElse(getBoolean(this, l), false) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func z (q) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, m(b, q)), ("No asset manager for token " + q))), ("Invalid asset manager address for token " + q)) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func A (o) = { | |
62 | 62 | let B = w() | |
63 | 63 | valueOrElse(getBoolean(B, m(j, o)), false) | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | - | func C (o) = if (if ((o == toString(v()))) | |
67 | + | func C (o) = if (if (if ((o == toString(v()))) | |
68 | 68 | then true | |
69 | 69 | else (o == toString(s()))) | |
70 | 70 | then true | |
71 | - | else (o == toString(t())) | |
71 | + | else (o == toString(t()))) | |
72 | + | then true | |
73 | + | else A(o) | |
72 | 74 | ||
73 | 75 | ||
74 | 76 | func D (q,E) = [IntegerEntry(m(a, q), E)] | |
75 | 77 | ||
76 | 78 | ||
77 | 79 | func F (G) = if (isDefined(G)) | |
78 | 80 | then toBase58String(value(G)) | |
79 | 81 | else "WAVES" | |
80 | 82 | ||
81 | 83 | ||
82 | 84 | @Callable(H) | |
83 | 85 | func initialize (I,J,K) = if (if (x()) | |
84 | 86 | then true | |
85 | 87 | else (H.caller != this)) | |
86 | 88 | then throw("Unable to initialize") | |
87 | 89 | else [StringEntry(c, toString(addressFromStringValue(I))), StringEntry(m(b, J), toString(addressFromStringValue(K))), BooleanEntry(k, true)] | |
88 | 90 | ||
89 | 91 | ||
90 | 92 | ||
91 | 93 | @Callable(H) | |
92 | 94 | func unpause () = if ((H.caller != u())) | |
93 | 95 | then throw("Invalid unpause params") | |
94 | 96 | else [BooleanEntry(l, false)] | |
95 | 97 | ||
96 | 98 | ||
97 | 99 | ||
98 | 100 | @Callable(H) | |
99 | 101 | func pause () = if ((H.caller != u())) | |
100 | 102 | then throw("Invalid pause params") | |
101 | 103 | else [BooleanEntry(l, true)] | |
102 | 104 | ||
103 | 105 | ||
104 | 106 | ||
105 | 107 | @Callable(H) | |
106 | 108 | func addAssetManager (q,L) = if (if (if (!(x())) | |
107 | 109 | then true | |
108 | 110 | else (H.caller != u())) | |
109 | 111 | then true | |
110 | 112 | else if (isDefined(getString(m(b, q)))) | |
111 | 113 | then (p(q) > 0) | |
112 | 114 | else false) | |
113 | 115 | then throw("Invalid addTokenVault params") | |
114 | 116 | else [StringEntry(m(b, q), toString(addressFromStringValue(L)))] | |
115 | 117 | ||
116 | 118 | ||
117 | 119 | ||
118 | 120 | @Callable(H) | |
119 | 121 | func withdraw (q,M) = if (if (if (if (!(C(toString(H.caller)))) | |
120 | 122 | then true | |
121 | 123 | else !(x())) | |
122 | 124 | then true | |
123 | 125 | else y()) | |
124 | 126 | then true | |
125 | 127 | else (M > p(q))) | |
126 | 128 | then throw(((("Invalid withdraw params (manager) " + toString(M)) + " > ") + toString(p(q)))) | |
127 | 129 | else { | |
128 | 130 | let N = invoke(z(q), "withdraw", [q, M], nil) | |
129 | 131 | if ((N == N)) | |
130 | 132 | then { | |
131 | 133 | let O = (p(q) - M) | |
132 | 134 | (D(q, O) ++ [ScriptTransfer(H.caller, M, if ((q == "WAVES")) | |
133 | 135 | then unit | |
134 | 136 | else fromBase58String(q))]) | |
135 | 137 | } | |
136 | 138 | else throw("Strict value is not equal to itself.") | |
137 | 139 | } | |
138 | 140 | ||
139 | 141 | ||
140 | 142 | ||
141 | 143 | @Callable(H) | |
142 | 144 | func deposit () = { | |
143 | 145 | let M = H.payments[0].amount | |
144 | 146 | let q = F(H.payments[0].assetId) | |
145 | 147 | if (if (if (if (!(x())) | |
146 | 148 | then true | |
147 | 149 | else if (!(C(toString(H.caller)))) | |
148 | 150 | then (H.caller != u()) | |
149 | 151 | else false) | |
150 | 152 | then true | |
151 | 153 | else y()) | |
152 | 154 | then true | |
153 | 155 | else (size(H.payments) != 1)) | |
154 | 156 | then throw("Invalid deposit params (manager)") | |
155 | 157 | else { | |
156 | 158 | let P = invoke(z(q), "deposit", nil, [AttachedPayment(H.payments[0].assetId, M)]) | |
157 | 159 | if ((P == P)) | |
158 | 160 | then { | |
159 | 161 | let O = (p(q) + M) | |
160 | 162 | D(q, O) | |
161 | 163 | } | |
162 | 164 | else throw("Strict value is not equal to itself.") | |
163 | 165 | } | |
164 | 166 | } | |
165 | 167 | ||
166 | 168 | ||
167 | 169 | ||
168 | 170 | @Callable(H) | |
169 | 171 | func claimProfit (q) = if (if (!(x())) | |
170 | 172 | then true | |
171 | 173 | else (H.caller != s())) | |
172 | 174 | then throw("Invalid claimProfit params (manager)") | |
173 | 175 | else { | |
174 | 176 | let Q = invoke(z(q), "claimProfit", [q], nil) | |
175 | 177 | if ((Q == Q)) | |
176 | 178 | then { | |
177 | 179 | let R = { | |
178 | 180 | let S = Q | |
179 | 181 | if ($isInstanceOf(S, "Int")) | |
180 | 182 | then { | |
181 | 183 | let T = S | |
182 | 184 | T | |
183 | 185 | } | |
184 | 186 | else throw("Invalid claimProfit result type") | |
185 | 187 | } | |
186 | 188 | $Tuple2([ScriptTransfer(H.caller, R, if ((q == "WAVES")) | |
187 | 189 | then unit | |
188 | 190 | else fromBase58String(q))], R) | |
189 | 191 | } | |
190 | 192 | else throw("Strict value is not equal to itself.") | |
191 | 193 | } | |
192 | 194 | ||
193 | 195 | ||
194 | 196 | ||
195 | 197 | @Callable(H) | |
196 | 198 | func view_claimProfit (q) = if (!(x())) | |
197 | 199 | then throw("Invalid view_claimProfit params (manager)") | |
198 | 200 | else { | |
199 | 201 | let Q = invoke(z(q), "claimProfit", [q], nil) | |
200 | 202 | if ((Q == Q)) | |
201 | 203 | then { | |
202 | 204 | let R = { | |
203 | 205 | let S = Q | |
204 | 206 | if ($isInstanceOf(S, "Int")) | |
205 | 207 | then { | |
206 | 208 | let T = S | |
207 | 209 | T | |
208 | 210 | } | |
209 | 211 | else throw("Invalid claimProfit result type") | |
210 | 212 | } | |
211 | 213 | throw(((((toString(p(q)) + ",") + toString((p(q) + R))) + ",") + toString(R))) | |
212 | 214 | } | |
213 | 215 | else throw("Strict value is not equal to itself.") | |
214 | 216 | } | |
215 | 217 | ||
216 | 218 | ||
217 | 219 | @Verifier(U) | |
218 | 220 | func V () = { | |
219 | 221 | let W = getString(this, c) | |
220 | 222 | if (isDefined(W)) | |
221 | 223 | then { | |
222 | 224 | let X = getString(addressFromStringValue(value(W)), g) | |
223 | 225 | if (isDefined(X)) | |
224 | 226 | then valueOrElse(getBoolean(addressFromStringValue(value(X)), ((("status_" + toString(this)) + "_") + toBase58String(U.id))), false) | |
225 | 227 | else throw("unable to verify: admin not set in coordinator") | |
226 | 228 | } | |
227 | 229 | else sigVerify(U.bodyBytes, U.proofs[0], U.senderPublicKey) | |
228 | 230 | } | |
229 | 231 |
github/deemru/w8io/169f3d6 50.08 ms ◑