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