tx · 9WJktdE62BH7CJFxNKo9hJjbBoy1gUgnTTy5R5i39caW 3NADcxHXbecCheinqFbvhDjfzZhsMFZJUuH: -0.03700000 Waves 2023.02.11 09:49 [2444617] smart account 3NADcxHXbecCheinqFbvhDjfzZhsMFZJUuH > SELF 0.00000000 Waves
{ "type": 13, "id": "9WJktdE62BH7CJFxNKo9hJjbBoy1gUgnTTy5R5i39caW", "fee": 3700000, "feeAssetId": null, "timestamp": 1676098206262, "version": 2, "chainId": 84, "sender": "3NADcxHXbecCheinqFbvhDjfzZhsMFZJUuH", "senderPublicKey": "DKfzQgvVdTqPHgGbdZptWYA8G5xVfmSMAwL3UnhwQmdy", "proofs": [ "48pQQF7YVrq9S6xBbavJwAyPtod1SBsvHH8uqp4LPssJxSpsVQZKXHcXGSQiER895ig395NJ1EvQkJcbuMVR4SGb" ], "script": "base64:BgIxCAISAwoBCBIAEgMKAQESABIAEgASAwoBARIDCgEBEgASABIDCgEIEgMKAQgSAwoBCFQADWtfdG90YWxTdXBwbHkCDWtfdG90YWxTdXBwbHkAD2tfcmV3YXJkQmFsYW5jZQIPa19yZXdhcmRCYWxhbmNlAA9rX2xvY2tlZEJhbGFuY2UCD2tfbG9ja2VkQmFsYW5jZQANa19mcmVlQmFsYW5jZQINa19mcmVlQmFsYW5jZQAGa19yYXRlAgZrX3JhdGUAEGtfbGFzdFVwZGF0ZVRpbWUCEGtfbGFzdFVwZGF0ZVRpbWUAFmtfcmV3YXJkUGVyVG9rZW5TdG9yZWQCFmtfcmV3YXJkUGVyVG9rZW5TdG9yZWQADGtfcmV3YXJkUmF0ZQIMa19yZXdhcmRSYXRlAA5rX3BlcmlvZEZpbmlzaAIOa19wZXJpb2RGaW5pc2gAFGtfdXNlclJld2FyZFBlclRva2VuAhRrX3VzZXJSZXdhcmRQZXJUb2tlbgAMa191c2VyUmV3YXJkAgxrX3VzZXJSZXdhcmQACWtfYmFsYW5jZQIJa19iYWxhbmNlAA5rX2F2ZXJhZ2VfcmF0ZQI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s6 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
43 | 43 | ||
44 | 44 | let u = "k_quote_asset" | |
45 | 45 | ||
46 | - | let v = "k_admin_ | |
46 | + | let v = "k_admin_address" | |
47 | 47 | ||
48 | - | let w = "k_ | |
48 | + | let w = "k_manager_address" | |
49 | 49 | ||
50 | - | let x = "k_ | |
50 | + | let x = "k_collateral_address" | |
51 | 51 | ||
52 | - | let y = "k_collateral_address" | |
53 | - | ||
54 | - | func z (A,B) = ((A + "_") + B) | |
52 | + | func y (z,A) = ((z + "_") + A) | |
55 | 53 | ||
56 | 54 | ||
57 | - | func | |
55 | + | func B () = valueOrErrorMessage(addressFromString(getStringValue(this, r)), "Coordinator not set") | |
58 | 56 | ||
59 | 57 | ||
60 | - | func | |
58 | + | func C (A) = valueOrElse(getBoolean(B(), y(s, A)), false) | |
61 | 59 | ||
62 | 60 | ||
63 | - | func | |
61 | + | func D () = fromBase58String(getStringValue(B(), t)) | |
64 | 62 | ||
65 | 63 | ||
66 | - | func | |
64 | + | func E () = addressFromString(valueOrErrorMessage(getString(B(), v), "Admin address not set")) | |
67 | 65 | ||
68 | 66 | ||
69 | - | func | |
67 | + | func F () = fromBase58String(getStringValue(B(), u)) | |
70 | 68 | ||
71 | 69 | ||
72 | - | func | |
70 | + | func G () = valueOrErrorMessage(addressFromString(getStringValue(B(), w)), "Manager not set") | |
73 | 71 | ||
74 | 72 | ||
75 | - | func I () = valueOrErrorMessage(addressFromString(getStringValue(C(), x)), "Manager not set") | |
73 | + | let H = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) | |
74 | + | ||
75 | + | let I = (((7 * 60) * 60) * 24) | |
76 | + | ||
77 | + | let J = "" | |
78 | + | ||
79 | + | let K = 0 | |
80 | + | ||
81 | + | func L (M) = (M / 100) | |
76 | 82 | ||
77 | 83 | ||
78 | - | let J = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) | |
79 | - | ||
80 | - | let K = (((7 * 60) * 60) * 24) | |
81 | - | ||
82 | - | let L = "" | |
83 | - | ||
84 | - | let M = 0 | |
85 | - | ||
86 | - | func N (O) = (O / 100) | |
84 | + | func N (M) = (M * 100) | |
87 | 85 | ||
88 | 86 | ||
89 | - | func | |
87 | + | func O (P,Q) = fraction(P, H, Q, HALFEVEN) | |
90 | 88 | ||
91 | 89 | ||
92 | - | func | |
90 | + | func R (P,Q) = fraction(P, Q, H, HALFEVEN) | |
93 | 91 | ||
94 | 92 | ||
95 | - | func T (R,S) = fraction(R, S, J, HALFEVEN) | |
93 | + | func S (P) = if ((P > 0)) | |
94 | + | then P | |
95 | + | else -(P) | |
96 | 96 | ||
97 | 97 | ||
98 | - | func | |
99 | - | then | |
100 | - | else | |
98 | + | func T (P,Q) = if ((P > Q)) | |
99 | + | then Q | |
100 | + | else P | |
101 | 101 | ||
102 | 102 | ||
103 | - | func V (R,S) = if ((R > S)) | |
104 | - | then S | |
105 | - | else R | |
103 | + | let U = (86400 * 1000) | |
104 | + | ||
105 | + | let V = O((1 * H), (4 * H)) | |
106 | + | ||
107 | + | func W (X) = valueOrErrorMessage(getInteger(this, X), ("no value for " + X)) | |
106 | 108 | ||
107 | 109 | ||
108 | - | let W = (86400 * 1000) | |
109 | - | ||
110 | - | let X = Q((1 * J), (4 * J)) | |
111 | - | ||
112 | - | func Y (Z) = valueOrErrorMessage(getInteger(this, Z), ("no value for " + Z)) | |
110 | + | func Y (X) = valueOrElse(getInteger(this, X), 0) | |
113 | 111 | ||
114 | 112 | ||
115 | - | func | |
113 | + | func Z (X) = valueOrElse(getInteger(this, X), H) | |
116 | 114 | ||
117 | 115 | ||
118 | - | func | |
116 | + | func aa () = Y(a) | |
119 | 117 | ||
120 | 118 | ||
121 | - | func | |
119 | + | func ab () = Z(e) | |
122 | 120 | ||
123 | 121 | ||
124 | - | func | |
122 | + | func ac (ad) = Y(y(l, ad)) | |
125 | 123 | ||
126 | 124 | ||
127 | - | func ae ( | |
125 | + | func ae (ad) = Y(y(m, ad)) | |
128 | 126 | ||
129 | 127 | ||
130 | - | func | |
128 | + | func af (ad) = Y(y(n, ad)) | |
131 | 129 | ||
132 | 130 | ||
133 | - | func | |
131 | + | func ag (ad) = Y(y(p, ad)) | |
134 | 132 | ||
135 | 133 | ||
136 | - | func | |
134 | + | func ah (ad) = Y(y(o, ad)) | |
137 | 135 | ||
138 | 136 | ||
139 | - | func | |
137 | + | func ai () = Y(d) | |
140 | 138 | ||
141 | 139 | ||
142 | - | func | |
140 | + | func aj () = Y(c) | |
143 | 141 | ||
144 | 142 | ||
145 | - | func | |
143 | + | func ak () = Y(g) | |
146 | 144 | ||
147 | 145 | ||
148 | - | func | |
146 | + | func al () = Y(f) | |
149 | 147 | ||
150 | 148 | ||
151 | - | func | |
149 | + | func am () = Y(h) | |
152 | 150 | ||
153 | 151 | ||
154 | - | func | |
152 | + | func an () = Y(i) | |
155 | 153 | ||
156 | 154 | ||
157 | - | func | |
155 | + | func ao () = Y(b) | |
158 | 156 | ||
159 | 157 | ||
160 | - | func | |
158 | + | func ap (ad) = Y(y(k, ad)) | |
161 | 159 | ||
162 | 160 | ||
163 | - | func | |
161 | + | func aq (ad) = Y(y(j, ad)) | |
164 | 162 | ||
165 | 163 | ||
166 | - | func | |
164 | + | func ar () = valueOrElse(getBoolean(this, q), false) | |
167 | 165 | ||
168 | 166 | ||
169 | - | func | |
167 | + | func as () = lastBlock.timestamp | |
170 | 168 | ||
171 | 169 | ||
172 | - | func | |
170 | + | func at () = (as() / 1000) | |
173 | 171 | ||
174 | 172 | ||
175 | - | func av () = (au() / 1000) | |
176 | - | ||
177 | - | ||
178 | - | func aw (af) = { | |
179 | - | let ax = au() | |
180 | - | let ay = aj(af) | |
181 | - | let az = if (((ax - ay) > W)) | |
182 | - | then $Tuple2(ax, ah(af)) | |
183 | - | else $Tuple2(ay, (ah(af) - ai(af))) | |
184 | - | let aA = az._1 | |
185 | - | let aB = az._2 | |
186 | - | $Tuple2(aA, aB) | |
173 | + | func au (ad) = { | |
174 | + | let av = as() | |
175 | + | let aw = ah(ad) | |
176 | + | let ax = if (((av - aw) > U)) | |
177 | + | then $Tuple3(av, af(ad), 0) | |
178 | + | else $Tuple3(aw, (af(ad) - ag(ad)), ag(ad)) | |
179 | + | let ay = ax._1 | |
180 | + | let az = ax._2 | |
181 | + | let aA = ax._3 | |
182 | + | $Tuple3(ay, az, aA) | |
187 | 183 | } | |
188 | 184 | ||
189 | 185 | ||
190 | - | func | |
191 | - | let | |
192 | - | then | |
193 | - | else | |
194 | - | | |
186 | + | func aB (aC) = { | |
187 | + | let aD = if ((aa() > 0)) | |
188 | + | then O((ai() + aC), aa()) | |
189 | + | else H | |
190 | + | aD | |
195 | 191 | } | |
196 | 192 | ||
197 | 193 | ||
198 | - | func | |
194 | + | func aE () = T(at(), an()) | |
199 | 195 | ||
200 | 196 | ||
201 | - | func | |
202 | - | then | |
197 | + | func aF (aG) = if (((aa() + aG) == 0)) | |
198 | + | then ak() | |
203 | 199 | else { | |
204 | - | let | |
205 | - | let | |
200 | + | let aH = (aE() - al()) | |
201 | + | let aI = if ((0 > aH)) | |
206 | 202 | then 0 | |
207 | - | else | |
208 | - | let | |
209 | - | ( | |
203 | + | else aH | |
204 | + | let aJ = O((am() * aI), (aa() + aG)) | |
205 | + | (ak() + aJ) | |
210 | 206 | } | |
211 | 207 | ||
212 | 208 | ||
213 | - | func | |
214 | - | let | |
215 | - | ( | |
209 | + | func aK (ad,aG) = { | |
210 | + | let aL = (aF(aG) - aq(ad)) | |
211 | + | (R((ac(ad) + aG), aL) + ap(ad)) | |
216 | 212 | } | |
217 | 213 | ||
218 | 214 | ||
219 | - | func | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | then $Tuple2( | |
215 | + | func aM (ad,aG) = { | |
216 | + | let aN = aF(aG) | |
217 | + | let aO = at() | |
218 | + | let aP = if ((ad != "")) | |
219 | + | then $Tuple2(aK(ad, aG), aN) | |
224 | 220 | else $Tuple2(0, 0) | |
225 | - | let | |
226 | - | let | |
227 | - | $Tuple4(aO, | |
221 | + | let aQ = aP._1 | |
222 | + | let aR = aP._2 | |
223 | + | $Tuple4(aN, aO, aQ, aR) | |
228 | 224 | } | |
229 | 225 | ||
230 | 226 | ||
231 | - | func | |
227 | + | func aS (aT,aU) = [IntegerEntry(y(l, aT), (ac(aT) + aU))] | |
232 | 228 | ||
233 | 229 | ||
234 | - | func | |
230 | + | func aV (aT,aW) = [IntegerEntry(y(n, aT), aW)] | |
235 | 231 | ||
236 | 232 | ||
237 | - | func | |
233 | + | func aX (aT,aW) = [IntegerEntry(y(m, aT), aW)] | |
238 | 234 | ||
239 | 235 | ||
240 | - | func aZ (aV) = [IntegerEntry(d, (ak() + aV))] | |
241 | - | ||
242 | - | ||
243 | - | func ba (aV) = { | |
244 | - | let bb = al() | |
245 | - | if (((bb + aV) >= 0)) | |
246 | - | then [IntegerEntry(c, (bb + aV))] | |
247 | - | else throw(((("Vault: can not update locked balance. Balance: " + toString(bb)) + " change: ") + toString(aV))) | |
236 | + | func aY (aU) = { | |
237 | + | let aZ = ai() | |
238 | + | if (((aZ + aU) >= 0)) | |
239 | + | then [IntegerEntry(d, (aZ + aU))] | |
240 | + | else throw(((("Vault: can not update free balance. Balance: " + toString(aZ)) + " change: ") + toString(aU))) | |
248 | 241 | } | |
249 | 242 | ||
250 | 243 | ||
251 | - | func | |
252 | - | let | |
253 | - | if ((( | |
254 | - | then [IntegerEntry(c, ( | |
255 | - | else | |
244 | + | func ba (aU) = { | |
245 | + | let aZ = aj() | |
246 | + | if (((aZ + aU) >= 0)) | |
247 | + | then [IntegerEntry(c, (aZ + aU))] | |
248 | + | else throw(((("Vault: can not update locked balance. Balance: " + toString(aZ)) + " change: ") + toString(aU))) | |
256 | 249 | } | |
257 | 250 | ||
258 | 251 | ||
259 | - | func | |
252 | + | func bb (aU) = [IntegerEntry(a, (aa() + aU))] | |
260 | 253 | ||
261 | 254 | ||
262 | - | func | |
255 | + | func bc (aW) = [IntegerEntry(e, aW)] | |
263 | 256 | ||
264 | 257 | ||
265 | - | func | |
258 | + | func bd (aT,be,bf) = [IntegerEntry(y(o, aT), be), IntegerEntry(y(p, aT), bf)] | |
266 | 259 | ||
267 | 260 | ||
268 | - | func | |
261 | + | func bg (bh) = [IntegerEntry(b, (ao() + bh))] | |
269 | 262 | ||
270 | 263 | ||
271 | - | func | |
264 | + | func bi (bj) = [IntegerEntry(h, bj)] | |
272 | 265 | ||
273 | 266 | ||
274 | - | func | |
267 | + | func bk (bl,bm) = [IntegerEntry(f, bl), IntegerEntry(i, bm)] | |
275 | 268 | ||
276 | 269 | ||
277 | - | func | |
270 | + | func bn (bo) = [IntegerEntry(g, bo)] | |
278 | 271 | ||
279 | 272 | ||
280 | - | func | |
273 | + | func bp (ad,bq,br) = [IntegerEntry(y(k, ad), bq), IntegerEntry(y(j, ad), br)] | |
281 | 274 | ||
282 | 275 | ||
283 | - | @Callable(bu) | |
284 | - | func initialize (bv) = if (at()) | |
285 | - | then throw("Already initialized") | |
286 | - | else [StringEntry(r, bv), BooleanEntry(q, true)] | |
276 | + | @Callable(bs) | |
277 | + | func initialize (bt) = if (if (ar()) | |
278 | + | then true | |
279 | + | else (bs.caller != this)) | |
280 | + | then throw("Unable to initialize") | |
281 | + | else [StringEntry(r, toString(valueOrErrorMessage(addressFromString(bt), "Invalid coordinator address"))), BooleanEntry(q, true)] | |
287 | 282 | ||
288 | 283 | ||
289 | 284 | ||
290 | - | @Callable( | |
285 | + | @Callable(bs) | |
291 | 286 | func stake () = { | |
292 | - | let | |
293 | - | let | |
294 | - | if (if (( | |
287 | + | let ad = toString(bs.caller) | |
288 | + | let M = N(bs.payments[0].amount) | |
289 | + | if (if (if ((bs.payments[0].assetId != F())) | |
295 | 290 | then true | |
296 | - | else !(at())) | |
291 | + | else (size(bs.payments) != 1)) | |
292 | + | then true | |
293 | + | else !(ar())) | |
297 | 294 | then throw("Invalid call to stake") | |
298 | 295 | else { | |
299 | - | let | |
300 | - | let | |
301 | - | let | |
302 | - | let | |
303 | - | let | |
304 | - | let | |
305 | - | let | |
306 | - | let | |
307 | - | let | |
308 | - | let | |
309 | - | let | |
310 | - | let | |
311 | - | if (( | |
312 | - | then ((((((( | |
296 | + | let bu = aM(ad, 0) | |
297 | + | let aN = bu._1 | |
298 | + | let aO = bu._2 | |
299 | + | let aQ = bu._3 | |
300 | + | let aR = bu._4 | |
301 | + | let bv = ab() | |
302 | + | let bw = ae(ad) | |
303 | + | let bx = O(M, bv) | |
304 | + | let by = O((R(bx, bv) + R(ac(ad), bw)), (bx + ac(ad))) | |
305 | + | let bz = (bx + ac(ad)) | |
306 | + | let bA = R(bz, V) | |
307 | + | let bB = invoke(G(), "deposit", nil, [AttachedPayment(F(), L(M))]) | |
308 | + | if ((bB == bB)) | |
309 | + | then (((((((bp(ad, aQ, aR) ++ bn(aN)) ++ bk(aO, an())) ++ aY(M)) ++ aS(ad, bx)) ++ aX(ad, by)) ++ aV(ad, bA)) ++ bb(bx)) | |
313 | 310 | else throw("Strict value is not equal to itself.") | |
314 | 311 | } | |
315 | 312 | } | |
316 | 313 | ||
317 | 314 | ||
318 | 315 | ||
319 | - | @Callable( | |
320 | - | func unStake ( | |
321 | - | let | |
322 | - | let | |
323 | - | if (if (if (( | |
316 | + | @Callable(bs) | |
317 | + | func unStake (M) = { | |
318 | + | let ad = toString(bs.caller) | |
319 | + | let bC = N(M) | |
320 | + | if (if (if ((bs.payments != nil)) | |
324 | 321 | then true | |
325 | - | else (0 >= | |
322 | + | else (0 >= bC)) | |
326 | 323 | then true | |
327 | - | else !( | |
324 | + | else !(ar())) | |
328 | 325 | then throw("Invalid call to unStake") | |
329 | 326 | else { | |
330 | - | let bF = aN(af, 0) | |
331 | - | let aO = bF._1 | |
332 | - | let aP = bF._2 | |
333 | - | let aR = bF._3 | |
334 | - | let aS = bF._4 | |
335 | - | let bG = aw(af) | |
336 | - | let aA = bG._1 | |
337 | - | let aB = bG._2 | |
338 | - | let bz = Q(bE, ad()) | |
339 | - | if ((bz > aB)) | |
327 | + | let bD = aM(ad, 0) | |
328 | + | let aN = bD._1 | |
329 | + | let aO = bD._2 | |
330 | + | let aQ = bD._3 | |
331 | + | let aR = bD._4 | |
332 | + | let bE = au(ad) | |
333 | + | let ay = bE._1 | |
334 | + | let az = bE._2 | |
335 | + | let aA = bE._3 | |
336 | + | let bx = O(bC, ab()) | |
337 | + | if ((bx > az)) | |
340 | 338 | then throw("Invalid call to unStake: withdraw over limit") | |
341 | 339 | else { | |
342 | - | let | |
343 | - | if (( | |
340 | + | let bF = (aA + bx) | |
341 | + | if ((bC > ai())) | |
344 | 342 | then throw("Invalid call to unStake: balance too low") | |
345 | 343 | else { | |
346 | - | let | |
347 | - | if (( | |
348 | - | then ((((((( | |
344 | + | let bG = invoke(G(), "withdraw", [toBase58String(F()), L(bC)], nil) | |
345 | + | if ((bG == bG)) | |
346 | + | then (((((((bp(ad, aQ, aR) ++ bn(aN)) ++ bk(aO, an())) ++ aY(-(bC))) ++ aS(ad, -(bx))) ++ bb(-(bx))) ++ bd(ad, ay, bF)) ++ [ScriptTransfer(bs.caller, L(bC), F())]) | |
349 | 347 | else throw("Strict value is not equal to itself.") | |
350 | 348 | } | |
351 | 349 | } | |
354 | 352 | ||
355 | 353 | ||
356 | 354 | ||
357 | - | @Callable( | |
355 | + | @Callable(bs) | |
358 | 356 | func withdrawRewards () = { | |
359 | - | let | |
360 | - | let | |
361 | - | let | |
362 | - | let | |
363 | - | let | |
364 | - | let | |
365 | - | if (if ((0 >= | |
357 | + | let ad = toString(bs.caller) | |
358 | + | let bH = aM(ad, 0) | |
359 | + | let aN = bH._1 | |
360 | + | let aO = bH._2 | |
361 | + | let aQ = bH._3 | |
362 | + | let aR = bH._4 | |
363 | + | if (if ((0 >= aQ)) | |
366 | 364 | then true | |
367 | - | else !( | |
365 | + | else !(ar())) | |
368 | 366 | then throw("No reward: Vault") | |
369 | - | else (((( | |
367 | + | else ((((bp(ad, 0, aR) ++ bn(aN)) ++ bk(aO, an())) ++ bg(-(aQ))) ++ [ScriptTransfer(bs.caller, aQ, D())]) | |
370 | 368 | } | |
371 | 369 | ||
372 | 370 | ||
373 | 371 | ||
374 | - | @Callable( | |
372 | + | @Callable(bs) | |
375 | 373 | func addFree () = { | |
376 | - | let | |
377 | - | if (if (if (( | |
374 | + | let M = N(bs.payments[0].amount) | |
375 | + | if (if (if (if ((bs.payments[0].assetId != F())) | |
378 | 376 | then true | |
379 | - | else ! | |
377 | + | else (size(bs.payments) != 1)) | |
380 | 378 | then true | |
381 | - | else !(if (D(toString(bu.caller))) | |
379 | + | else !(ar())) | |
380 | + | then true | |
381 | + | else !(if (C(toString(bs.caller))) | |
382 | 382 | then true | |
383 | - | else ( | |
383 | + | else (bs.caller == E()))) | |
384 | 384 | then throw("Invalid addFree params") | |
385 | 385 | else { | |
386 | - | let aE = if ((ac() > 0)) | |
387 | - | then Q((ak() + O), ac()) | |
388 | - | else J | |
389 | - | let bI = invoke(I(), "deposit", nil, [AttachedPayment(H(), N(O))]) | |
390 | - | if ((bI == bI)) | |
391 | - | then (aZ(O) ++ be(aE)) | |
386 | + | let aD = aB(M) | |
387 | + | let bB = invoke(G(), "deposit", nil, [AttachedPayment(F(), L(M))]) | |
388 | + | if ((bB == bB)) | |
389 | + | then (aY(M) ++ bc(aD)) | |
392 | 390 | else throw("Strict value is not equal to itself.") | |
393 | 391 | } | |
394 | 392 | } | |
395 | 393 | ||
396 | 394 | ||
397 | 395 | ||
398 | - | @Callable( | |
396 | + | @Callable(bs) | |
399 | 397 | func addLocked () = { | |
400 | - | let | |
401 | - | if (if (if (( | |
398 | + | let M = N(bs.payments[0].amount) | |
399 | + | if (if (if (if ((bs.payments[0].assetId != F())) | |
402 | 400 | then true | |
403 | - | else ! | |
401 | + | else (size(bs.payments) != 1)) | |
404 | 402 | then true | |
405 | - | else !(if (D(toString(bu.caller))) | |
403 | + | else !(ar())) | |
404 | + | then true | |
405 | + | else !(if (C(toString(bs.caller))) | |
406 | 406 | then true | |
407 | - | else ( | |
407 | + | else (bs.caller == E()))) | |
408 | 408 | then throw("Invalid addLocked params") | |
409 | 409 | else { | |
410 | - | let | |
411 | - | if (( | |
412 | - | then ba( | |
410 | + | let bG = invoke(G(), "deposit", nil, [AttachedPayment(F(), L(M))]) | |
411 | + | if ((bG == bG)) | |
412 | + | then ba(M) | |
413 | 413 | else throw("Strict value is not equal to itself.") | |
414 | 414 | } | |
415 | 415 | } | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | ||
419 | - | @Callable( | |
420 | - | func exchangeFreeAndLocked ( | |
419 | + | @Callable(bs) | |
420 | + | func exchangeFreeAndLocked (M) = if (if (!(ar())) | |
421 | 421 | then true | |
422 | - | else !(if (D(toString(bu.caller))) | |
423 | - | then true | |
424 | - | else (bu.caller == G()))) | |
422 | + | else !(C(toString(bs.caller)))) | |
425 | 423 | then throw("Invalid exchangeFreeAndLocked params") | |
426 | 424 | else { | |
427 | - | let bE = P(O) | |
428 | - | let bK = -(bE) | |
429 | - | let aE = aC(bK) | |
430 | - | ((bc(bE) ++ aZ(bK)) ++ be(aE)) | |
425 | + | let bC = N(M) | |
426 | + | let aD = aB(-(bC)) | |
427 | + | ((ba(bC) ++ aY(-(bC))) ++ bc(aD)) | |
431 | 428 | } | |
432 | 429 | ||
433 | 430 | ||
434 | 431 | ||
435 | - | @Callable( | |
436 | - | func withdrawLocked ( | |
432 | + | @Callable(bs) | |
433 | + | func withdrawLocked (M) = if (if (if (!(ar())) | |
437 | 434 | then true | |
438 | - | else (0 >= | |
435 | + | else (0 >= M)) | |
439 | 436 | then true | |
440 | - | else !( | |
437 | + | else !(C(toString(bs.caller)))) | |
441 | 438 | then throw("Invalid withdrawLocked params") | |
442 | 439 | else { | |
443 | - | let bE = P(O) | |
444 | - | let bI = invoke(I(), "withdraw", [toBase58String(H()), N(bE)], nil) | |
445 | - | if ((bI == bI)) | |
446 | - | then { | |
447 | - | let bL = al() | |
448 | - | let bM = if ((bE > bL)) | |
449 | - | then $Tuple2(bL, (bE - bL)) | |
450 | - | else $Tuple2(bE, 0) | |
451 | - | let bN = bM._1 | |
452 | - | let bO = bM._2 | |
453 | - | (((if ((bO > 0)) | |
454 | - | then { | |
455 | - | let aE = aC(-(bO)) | |
456 | - | (aZ(-(bO)) ++ be(aE)) | |
457 | - | } | |
458 | - | else nil) ++ ba(-(bN))) ++ [ScriptTransfer(bu.caller, N(bE), H())]) | |
459 | - | } | |
440 | + | let bC = N(M) | |
441 | + | let bG = invoke(G(), "withdraw", [toBase58String(F()), L(bC)], nil) | |
442 | + | if ((bG == bG)) | |
443 | + | then (ba(-(bC)) ++ [ScriptTransfer(bs.caller, L(bC), F())]) | |
460 | 444 | else throw("Strict value is not equal to itself.") | |
461 | 445 | } | |
462 | 446 | ||
463 | 447 | ||
464 | 448 | ||
465 | - | @Callable( | |
466 | - | func addRewards () = if (if (( | |
449 | + | @Callable(bs) | |
450 | + | func addRewards () = if (if (if ((bs.payments[0].assetId != D())) | |
467 | 451 | then true | |
468 | - | else !(at())) | |
452 | + | else (size(bs.payments) != 1)) | |
453 | + | then true | |
454 | + | else !(ar())) | |
469 | 455 | then throw("Invalid addRewards params") | |
470 | 456 | else { | |
471 | - | let | |
472 | - | let | |
473 | - | let | |
474 | - | let | |
475 | - | then ( | |
457 | + | let bq = bs.payments[0].amount | |
458 | + | let aN = aM(J, K)._1 | |
459 | + | let bI = at() | |
460 | + | let bJ = if ((bI > an())) | |
461 | + | then (bq / I) | |
476 | 462 | else { | |
477 | - | let | |
478 | - | let | |
479 | - | (( | |
463 | + | let bK = (an() - bI) | |
464 | + | let bL = (am() * bK) | |
465 | + | ((bq + bL) / I) | |
480 | 466 | } | |
481 | - | ((( | |
467 | + | (((bi(bJ) ++ bn(aN)) ++ bg(bq)) ++ bk(bI, (bI + I))) | |
482 | 468 | } | |
483 | 469 | ||
484 | 470 | ||
485 | 471 | ||
486 | - | @Callable(bu) | |
487 | - | func view_reward (af) = { | |
488 | - | let bb = ae(af) | |
489 | - | let bT = T(ag(af), bb) | |
490 | - | let bU = T(ad(), bb) | |
491 | - | let bV = (bU - bT) | |
492 | - | throw(toString(bV)) | |
472 | + | @Callable(bs) | |
473 | + | func ackRewards () = { | |
474 | + | let bM = invoke(G(), "claimProfit", [toBase58String(F())], nil) | |
475 | + | if ((bM == bM)) | |
476 | + | then { | |
477 | + | let bN = { | |
478 | + | let bO = bM | |
479 | + | if ($isInstanceOf(bO, "Int")) | |
480 | + | then { | |
481 | + | let bP = bO | |
482 | + | N(bP) | |
483 | + | } | |
484 | + | else throw("Invalid claimProfit response") | |
485 | + | } | |
486 | + | let bQ = if ((bN > 0)) | |
487 | + | then { | |
488 | + | let aD = aB(bN) | |
489 | + | let bB = invoke(G(), "deposit", nil, [AttachedPayment(F(), L(bN))]) | |
490 | + | if ((bB == bB)) | |
491 | + | then (aY(bN) ++ bc(aD)) | |
492 | + | else throw("Strict value is not equal to itself.") | |
493 | + | } | |
494 | + | else nil | |
495 | + | if ((bQ == bQ)) | |
496 | + | then bQ | |
497 | + | else throw("Strict value is not equal to itself.") | |
498 | + | } | |
499 | + | else throw("Strict value is not equal to itself.") | |
493 | 500 | } | |
494 | 501 | ||
495 | 502 | ||
496 | 503 | ||
497 | - | @Callable(bu) | |
498 | - | func view_stakingReward (af) = { | |
499 | - | let aR = aN(af, 0)._3 | |
500 | - | throw(toString(N(aR))) | |
504 | + | @Callable(bs) | |
505 | + | func view_reward (ad) = { | |
506 | + | let aZ = ac(ad) | |
507 | + | let bR = R(ae(ad), aZ) | |
508 | + | let bS = R(ab(), aZ) | |
509 | + | let bT = (bS - bR) | |
510 | + | throw(toString(bT)) | |
501 | 511 | } | |
502 | 512 | ||
503 | 513 | ||
504 | 514 | ||
505 | - | @Callable(bu) | |
506 | - | func view_withdrawLimit (af) = { | |
507 | - | let aB = aw(af)._2 | |
508 | - | let bW = N(T(aB, ad())) | |
509 | - | throw(toString(bW)) | |
515 | + | @Callable(bs) | |
516 | + | func view_stakingReward (ad) = { | |
517 | + | let aQ = aM(ad, 0)._3 | |
518 | + | throw(toString(L(aQ))) | |
510 | 519 | } | |
511 | 520 | ||
512 | 521 | ||
513 | - | @Verifier(bX) | |
514 | - | func bY () = sigVerify(bX.bodyBytes, bX.proofs[0], E()) | |
522 | + | ||
523 | + | @Callable(bs) | |
524 | + | func view_withdrawLimit (ad) = { | |
525 | + | let az = au(ad)._2 | |
526 | + | let bU = L(R(az, ab())) | |
527 | + | throw(toString(bU)) | |
528 | + | } | |
529 | + | ||
530 | + | ||
531 | + | @Verifier(bV) | |
532 | + | func bW () = { | |
533 | + | let bX = getString(this, r) | |
534 | + | if (isDefined(bX)) | |
535 | + | then { | |
536 | + | let bY = getString(addressFromStringValue(value(bX)), v) | |
537 | + | if (isDefined(bY)) | |
538 | + | then valueOrElse(getBoolean(addressFromStringValue(value(bY)), ((("status_" + toString(this)) + "_") + toBase58String(bV.id))), false) | |
539 | + | else throw("unable to verify: admin not set in coordinator") | |
540 | + | } | |
541 | + | else sigVerify(bV.bodyBytes, bV.proofs[0], bV.senderPublicKey) | |
542 | + | } | |
515 | 543 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "k_totalSupply" | |
5 | 5 | ||
6 | 6 | let b = "k_rewardBalance" | |
7 | 7 | ||
8 | 8 | let c = "k_lockedBalance" | |
9 | 9 | ||
10 | 10 | let d = "k_freeBalance" | |
11 | 11 | ||
12 | 12 | let e = "k_rate" | |
13 | 13 | ||
14 | 14 | let f = "k_lastUpdateTime" | |
15 | 15 | ||
16 | 16 | let g = "k_rewardPerTokenStored" | |
17 | 17 | ||
18 | 18 | let h = "k_rewardRate" | |
19 | 19 | ||
20 | 20 | let i = "k_periodFinish" | |
21 | 21 | ||
22 | 22 | let j = "k_userRewardPerToken" | |
23 | 23 | ||
24 | 24 | let k = "k_userReward" | |
25 | 25 | ||
26 | 26 | let l = "k_balance" | |
27 | 27 | ||
28 | 28 | let m = "k_average_rate" | |
29 | 29 | ||
30 | 30 | let n = "k_withdraw_limit" | |
31 | 31 | ||
32 | 32 | let o = "k_last_withdraw_date" | |
33 | 33 | ||
34 | 34 | let p = "k_withdraw_in_period" | |
35 | 35 | ||
36 | 36 | let q = "k_initialized" | |
37 | 37 | ||
38 | 38 | let r = "k_coordinatorAddress" | |
39 | 39 | ||
40 | 40 | let s = "k_amm" | |
41 | 41 | ||
42 | 42 | let t = "k_gov_asset" | |
43 | 43 | ||
44 | 44 | let u = "k_quote_asset" | |
45 | 45 | ||
46 | - | let v = "k_admin_ | |
46 | + | let v = "k_admin_address" | |
47 | 47 | ||
48 | - | let w = "k_ | |
48 | + | let w = "k_manager_address" | |
49 | 49 | ||
50 | - | let x = "k_ | |
50 | + | let x = "k_collateral_address" | |
51 | 51 | ||
52 | - | let y = "k_collateral_address" | |
53 | - | ||
54 | - | func z (A,B) = ((A + "_") + B) | |
52 | + | func y (z,A) = ((z + "_") + A) | |
55 | 53 | ||
56 | 54 | ||
57 | - | func | |
55 | + | func B () = valueOrErrorMessage(addressFromString(getStringValue(this, r)), "Coordinator not set") | |
58 | 56 | ||
59 | 57 | ||
60 | - | func | |
58 | + | func C (A) = valueOrElse(getBoolean(B(), y(s, A)), false) | |
61 | 59 | ||
62 | 60 | ||
63 | - | func | |
61 | + | func D () = fromBase58String(getStringValue(B(), t)) | |
64 | 62 | ||
65 | 63 | ||
66 | - | func | |
64 | + | func E () = addressFromString(valueOrErrorMessage(getString(B(), v), "Admin address not set")) | |
67 | 65 | ||
68 | 66 | ||
69 | - | func | |
67 | + | func F () = fromBase58String(getStringValue(B(), u)) | |
70 | 68 | ||
71 | 69 | ||
72 | - | func | |
70 | + | func G () = valueOrErrorMessage(addressFromString(getStringValue(B(), w)), "Manager not set") | |
73 | 71 | ||
74 | 72 | ||
75 | - | func I () = valueOrErrorMessage(addressFromString(getStringValue(C(), x)), "Manager not set") | |
73 | + | let H = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) | |
74 | + | ||
75 | + | let I = (((7 * 60) * 60) * 24) | |
76 | + | ||
77 | + | let J = "" | |
78 | + | ||
79 | + | let K = 0 | |
80 | + | ||
81 | + | func L (M) = (M / 100) | |
76 | 82 | ||
77 | 83 | ||
78 | - | let J = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) | |
79 | - | ||
80 | - | let K = (((7 * 60) * 60) * 24) | |
81 | - | ||
82 | - | let L = "" | |
83 | - | ||
84 | - | let M = 0 | |
85 | - | ||
86 | - | func N (O) = (O / 100) | |
84 | + | func N (M) = (M * 100) | |
87 | 85 | ||
88 | 86 | ||
89 | - | func | |
87 | + | func O (P,Q) = fraction(P, H, Q, HALFEVEN) | |
90 | 88 | ||
91 | 89 | ||
92 | - | func | |
90 | + | func R (P,Q) = fraction(P, Q, H, HALFEVEN) | |
93 | 91 | ||
94 | 92 | ||
95 | - | func T (R,S) = fraction(R, S, J, HALFEVEN) | |
93 | + | func S (P) = if ((P > 0)) | |
94 | + | then P | |
95 | + | else -(P) | |
96 | 96 | ||
97 | 97 | ||
98 | - | func | |
99 | - | then | |
100 | - | else | |
98 | + | func T (P,Q) = if ((P > Q)) | |
99 | + | then Q | |
100 | + | else P | |
101 | 101 | ||
102 | 102 | ||
103 | - | func V (R,S) = if ((R > S)) | |
104 | - | then S | |
105 | - | else R | |
103 | + | let U = (86400 * 1000) | |
104 | + | ||
105 | + | let V = O((1 * H), (4 * H)) | |
106 | + | ||
107 | + | func W (X) = valueOrErrorMessage(getInteger(this, X), ("no value for " + X)) | |
106 | 108 | ||
107 | 109 | ||
108 | - | let W = (86400 * 1000) | |
109 | - | ||
110 | - | let X = Q((1 * J), (4 * J)) | |
111 | - | ||
112 | - | func Y (Z) = valueOrErrorMessage(getInteger(this, Z), ("no value for " + Z)) | |
110 | + | func Y (X) = valueOrElse(getInteger(this, X), 0) | |
113 | 111 | ||
114 | 112 | ||
115 | - | func | |
113 | + | func Z (X) = valueOrElse(getInteger(this, X), H) | |
116 | 114 | ||
117 | 115 | ||
118 | - | func | |
116 | + | func aa () = Y(a) | |
119 | 117 | ||
120 | 118 | ||
121 | - | func | |
119 | + | func ab () = Z(e) | |
122 | 120 | ||
123 | 121 | ||
124 | - | func | |
122 | + | func ac (ad) = Y(y(l, ad)) | |
125 | 123 | ||
126 | 124 | ||
127 | - | func ae ( | |
125 | + | func ae (ad) = Y(y(m, ad)) | |
128 | 126 | ||
129 | 127 | ||
130 | - | func | |
128 | + | func af (ad) = Y(y(n, ad)) | |
131 | 129 | ||
132 | 130 | ||
133 | - | func | |
131 | + | func ag (ad) = Y(y(p, ad)) | |
134 | 132 | ||
135 | 133 | ||
136 | - | func | |
134 | + | func ah (ad) = Y(y(o, ad)) | |
137 | 135 | ||
138 | 136 | ||
139 | - | func | |
137 | + | func ai () = Y(d) | |
140 | 138 | ||
141 | 139 | ||
142 | - | func | |
140 | + | func aj () = Y(c) | |
143 | 141 | ||
144 | 142 | ||
145 | - | func | |
143 | + | func ak () = Y(g) | |
146 | 144 | ||
147 | 145 | ||
148 | - | func | |
146 | + | func al () = Y(f) | |
149 | 147 | ||
150 | 148 | ||
151 | - | func | |
149 | + | func am () = Y(h) | |
152 | 150 | ||
153 | 151 | ||
154 | - | func | |
152 | + | func an () = Y(i) | |
155 | 153 | ||
156 | 154 | ||
157 | - | func | |
155 | + | func ao () = Y(b) | |
158 | 156 | ||
159 | 157 | ||
160 | - | func | |
158 | + | func ap (ad) = Y(y(k, ad)) | |
161 | 159 | ||
162 | 160 | ||
163 | - | func | |
161 | + | func aq (ad) = Y(y(j, ad)) | |
164 | 162 | ||
165 | 163 | ||
166 | - | func | |
164 | + | func ar () = valueOrElse(getBoolean(this, q), false) | |
167 | 165 | ||
168 | 166 | ||
169 | - | func | |
167 | + | func as () = lastBlock.timestamp | |
170 | 168 | ||
171 | 169 | ||
172 | - | func | |
170 | + | func at () = (as() / 1000) | |
173 | 171 | ||
174 | 172 | ||
175 | - | func av () = (au() / 1000) | |
176 | - | ||
177 | - | ||
178 | - | func aw (af) = { | |
179 | - | let ax = au() | |
180 | - | let ay = aj(af) | |
181 | - | let az = if (((ax - ay) > W)) | |
182 | - | then $Tuple2(ax, ah(af)) | |
183 | - | else $Tuple2(ay, (ah(af) - ai(af))) | |
184 | - | let aA = az._1 | |
185 | - | let aB = az._2 | |
186 | - | $Tuple2(aA, aB) | |
173 | + | func au (ad) = { | |
174 | + | let av = as() | |
175 | + | let aw = ah(ad) | |
176 | + | let ax = if (((av - aw) > U)) | |
177 | + | then $Tuple3(av, af(ad), 0) | |
178 | + | else $Tuple3(aw, (af(ad) - ag(ad)), ag(ad)) | |
179 | + | let ay = ax._1 | |
180 | + | let az = ax._2 | |
181 | + | let aA = ax._3 | |
182 | + | $Tuple3(ay, az, aA) | |
187 | 183 | } | |
188 | 184 | ||
189 | 185 | ||
190 | - | func | |
191 | - | let | |
192 | - | then | |
193 | - | else | |
194 | - | | |
186 | + | func aB (aC) = { | |
187 | + | let aD = if ((aa() > 0)) | |
188 | + | then O((ai() + aC), aa()) | |
189 | + | else H | |
190 | + | aD | |
195 | 191 | } | |
196 | 192 | ||
197 | 193 | ||
198 | - | func | |
194 | + | func aE () = T(at(), an()) | |
199 | 195 | ||
200 | 196 | ||
201 | - | func | |
202 | - | then | |
197 | + | func aF (aG) = if (((aa() + aG) == 0)) | |
198 | + | then ak() | |
203 | 199 | else { | |
204 | - | let | |
205 | - | let | |
200 | + | let aH = (aE() - al()) | |
201 | + | let aI = if ((0 > aH)) | |
206 | 202 | then 0 | |
207 | - | else | |
208 | - | let | |
209 | - | ( | |
203 | + | else aH | |
204 | + | let aJ = O((am() * aI), (aa() + aG)) | |
205 | + | (ak() + aJ) | |
210 | 206 | } | |
211 | 207 | ||
212 | 208 | ||
213 | - | func | |
214 | - | let | |
215 | - | ( | |
209 | + | func aK (ad,aG) = { | |
210 | + | let aL = (aF(aG) - aq(ad)) | |
211 | + | (R((ac(ad) + aG), aL) + ap(ad)) | |
216 | 212 | } | |
217 | 213 | ||
218 | 214 | ||
219 | - | func | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | then $Tuple2( | |
215 | + | func aM (ad,aG) = { | |
216 | + | let aN = aF(aG) | |
217 | + | let aO = at() | |
218 | + | let aP = if ((ad != "")) | |
219 | + | then $Tuple2(aK(ad, aG), aN) | |
224 | 220 | else $Tuple2(0, 0) | |
225 | - | let | |
226 | - | let | |
227 | - | $Tuple4(aO, | |
221 | + | let aQ = aP._1 | |
222 | + | let aR = aP._2 | |
223 | + | $Tuple4(aN, aO, aQ, aR) | |
228 | 224 | } | |
229 | 225 | ||
230 | 226 | ||
231 | - | func | |
227 | + | func aS (aT,aU) = [IntegerEntry(y(l, aT), (ac(aT) + aU))] | |
232 | 228 | ||
233 | 229 | ||
234 | - | func | |
230 | + | func aV (aT,aW) = [IntegerEntry(y(n, aT), aW)] | |
235 | 231 | ||
236 | 232 | ||
237 | - | func | |
233 | + | func aX (aT,aW) = [IntegerEntry(y(m, aT), aW)] | |
238 | 234 | ||
239 | 235 | ||
240 | - | func aZ (aV) = [IntegerEntry(d, (ak() + aV))] | |
241 | - | ||
242 | - | ||
243 | - | func ba (aV) = { | |
244 | - | let bb = al() | |
245 | - | if (((bb + aV) >= 0)) | |
246 | - | then [IntegerEntry(c, (bb + aV))] | |
247 | - | else throw(((("Vault: can not update locked balance. Balance: " + toString(bb)) + " change: ") + toString(aV))) | |
236 | + | func aY (aU) = { | |
237 | + | let aZ = ai() | |
238 | + | if (((aZ + aU) >= 0)) | |
239 | + | then [IntegerEntry(d, (aZ + aU))] | |
240 | + | else throw(((("Vault: can not update free balance. Balance: " + toString(aZ)) + " change: ") + toString(aU))) | |
248 | 241 | } | |
249 | 242 | ||
250 | 243 | ||
251 | - | func | |
252 | - | let | |
253 | - | if ((( | |
254 | - | then [IntegerEntry(c, ( | |
255 | - | else | |
244 | + | func ba (aU) = { | |
245 | + | let aZ = aj() | |
246 | + | if (((aZ + aU) >= 0)) | |
247 | + | then [IntegerEntry(c, (aZ + aU))] | |
248 | + | else throw(((("Vault: can not update locked balance. Balance: " + toString(aZ)) + " change: ") + toString(aU))) | |
256 | 249 | } | |
257 | 250 | ||
258 | 251 | ||
259 | - | func | |
252 | + | func bb (aU) = [IntegerEntry(a, (aa() + aU))] | |
260 | 253 | ||
261 | 254 | ||
262 | - | func | |
255 | + | func bc (aW) = [IntegerEntry(e, aW)] | |
263 | 256 | ||
264 | 257 | ||
265 | - | func | |
258 | + | func bd (aT,be,bf) = [IntegerEntry(y(o, aT), be), IntegerEntry(y(p, aT), bf)] | |
266 | 259 | ||
267 | 260 | ||
268 | - | func | |
261 | + | func bg (bh) = [IntegerEntry(b, (ao() + bh))] | |
269 | 262 | ||
270 | 263 | ||
271 | - | func | |
264 | + | func bi (bj) = [IntegerEntry(h, bj)] | |
272 | 265 | ||
273 | 266 | ||
274 | - | func | |
267 | + | func bk (bl,bm) = [IntegerEntry(f, bl), IntegerEntry(i, bm)] | |
275 | 268 | ||
276 | 269 | ||
277 | - | func | |
270 | + | func bn (bo) = [IntegerEntry(g, bo)] | |
278 | 271 | ||
279 | 272 | ||
280 | - | func | |
273 | + | func bp (ad,bq,br) = [IntegerEntry(y(k, ad), bq), IntegerEntry(y(j, ad), br)] | |
281 | 274 | ||
282 | 275 | ||
283 | - | @Callable(bu) | |
284 | - | func initialize (bv) = if (at()) | |
285 | - | then throw("Already initialized") | |
286 | - | else [StringEntry(r, bv), BooleanEntry(q, true)] | |
276 | + | @Callable(bs) | |
277 | + | func initialize (bt) = if (if (ar()) | |
278 | + | then true | |
279 | + | else (bs.caller != this)) | |
280 | + | then throw("Unable to initialize") | |
281 | + | else [StringEntry(r, toString(valueOrErrorMessage(addressFromString(bt), "Invalid coordinator address"))), BooleanEntry(q, true)] | |
287 | 282 | ||
288 | 283 | ||
289 | 284 | ||
290 | - | @Callable( | |
285 | + | @Callable(bs) | |
291 | 286 | func stake () = { | |
292 | - | let | |
293 | - | let | |
294 | - | if (if (( | |
287 | + | let ad = toString(bs.caller) | |
288 | + | let M = N(bs.payments[0].amount) | |
289 | + | if (if (if ((bs.payments[0].assetId != F())) | |
295 | 290 | then true | |
296 | - | else !(at())) | |
291 | + | else (size(bs.payments) != 1)) | |
292 | + | then true | |
293 | + | else !(ar())) | |
297 | 294 | then throw("Invalid call to stake") | |
298 | 295 | else { | |
299 | - | let | |
300 | - | let | |
301 | - | let | |
302 | - | let | |
303 | - | let | |
304 | - | let | |
305 | - | let | |
306 | - | let | |
307 | - | let | |
308 | - | let | |
309 | - | let | |
310 | - | let | |
311 | - | if (( | |
312 | - | then ((((((( | |
296 | + | let bu = aM(ad, 0) | |
297 | + | let aN = bu._1 | |
298 | + | let aO = bu._2 | |
299 | + | let aQ = bu._3 | |
300 | + | let aR = bu._4 | |
301 | + | let bv = ab() | |
302 | + | let bw = ae(ad) | |
303 | + | let bx = O(M, bv) | |
304 | + | let by = O((R(bx, bv) + R(ac(ad), bw)), (bx + ac(ad))) | |
305 | + | let bz = (bx + ac(ad)) | |
306 | + | let bA = R(bz, V) | |
307 | + | let bB = invoke(G(), "deposit", nil, [AttachedPayment(F(), L(M))]) | |
308 | + | if ((bB == bB)) | |
309 | + | then (((((((bp(ad, aQ, aR) ++ bn(aN)) ++ bk(aO, an())) ++ aY(M)) ++ aS(ad, bx)) ++ aX(ad, by)) ++ aV(ad, bA)) ++ bb(bx)) | |
313 | 310 | else throw("Strict value is not equal to itself.") | |
314 | 311 | } | |
315 | 312 | } | |
316 | 313 | ||
317 | 314 | ||
318 | 315 | ||
319 | - | @Callable( | |
320 | - | func unStake ( | |
321 | - | let | |
322 | - | let | |
323 | - | if (if (if (( | |
316 | + | @Callable(bs) | |
317 | + | func unStake (M) = { | |
318 | + | let ad = toString(bs.caller) | |
319 | + | let bC = N(M) | |
320 | + | if (if (if ((bs.payments != nil)) | |
324 | 321 | then true | |
325 | - | else (0 >= | |
322 | + | else (0 >= bC)) | |
326 | 323 | then true | |
327 | - | else !( | |
324 | + | else !(ar())) | |
328 | 325 | then throw("Invalid call to unStake") | |
329 | 326 | else { | |
330 | - | let bF = aN(af, 0) | |
331 | - | let aO = bF._1 | |
332 | - | let aP = bF._2 | |
333 | - | let aR = bF._3 | |
334 | - | let aS = bF._4 | |
335 | - | let bG = aw(af) | |
336 | - | let aA = bG._1 | |
337 | - | let aB = bG._2 | |
338 | - | let bz = Q(bE, ad()) | |
339 | - | if ((bz > aB)) | |
327 | + | let bD = aM(ad, 0) | |
328 | + | let aN = bD._1 | |
329 | + | let aO = bD._2 | |
330 | + | let aQ = bD._3 | |
331 | + | let aR = bD._4 | |
332 | + | let bE = au(ad) | |
333 | + | let ay = bE._1 | |
334 | + | let az = bE._2 | |
335 | + | let aA = bE._3 | |
336 | + | let bx = O(bC, ab()) | |
337 | + | if ((bx > az)) | |
340 | 338 | then throw("Invalid call to unStake: withdraw over limit") | |
341 | 339 | else { | |
342 | - | let | |
343 | - | if (( | |
340 | + | let bF = (aA + bx) | |
341 | + | if ((bC > ai())) | |
344 | 342 | then throw("Invalid call to unStake: balance too low") | |
345 | 343 | else { | |
346 | - | let | |
347 | - | if (( | |
348 | - | then ((((((( | |
344 | + | let bG = invoke(G(), "withdraw", [toBase58String(F()), L(bC)], nil) | |
345 | + | if ((bG == bG)) | |
346 | + | then (((((((bp(ad, aQ, aR) ++ bn(aN)) ++ bk(aO, an())) ++ aY(-(bC))) ++ aS(ad, -(bx))) ++ bb(-(bx))) ++ bd(ad, ay, bF)) ++ [ScriptTransfer(bs.caller, L(bC), F())]) | |
349 | 347 | else throw("Strict value is not equal to itself.") | |
350 | 348 | } | |
351 | 349 | } | |
352 | 350 | } | |
353 | 351 | } | |
354 | 352 | ||
355 | 353 | ||
356 | 354 | ||
357 | - | @Callable( | |
355 | + | @Callable(bs) | |
358 | 356 | func withdrawRewards () = { | |
359 | - | let | |
360 | - | let | |
361 | - | let | |
362 | - | let | |
363 | - | let | |
364 | - | let | |
365 | - | if (if ((0 >= | |
357 | + | let ad = toString(bs.caller) | |
358 | + | let bH = aM(ad, 0) | |
359 | + | let aN = bH._1 | |
360 | + | let aO = bH._2 | |
361 | + | let aQ = bH._3 | |
362 | + | let aR = bH._4 | |
363 | + | if (if ((0 >= aQ)) | |
366 | 364 | then true | |
367 | - | else !( | |
365 | + | else !(ar())) | |
368 | 366 | then throw("No reward: Vault") | |
369 | - | else (((( | |
367 | + | else ((((bp(ad, 0, aR) ++ bn(aN)) ++ bk(aO, an())) ++ bg(-(aQ))) ++ [ScriptTransfer(bs.caller, aQ, D())]) | |
370 | 368 | } | |
371 | 369 | ||
372 | 370 | ||
373 | 371 | ||
374 | - | @Callable( | |
372 | + | @Callable(bs) | |
375 | 373 | func addFree () = { | |
376 | - | let | |
377 | - | if (if (if (( | |
374 | + | let M = N(bs.payments[0].amount) | |
375 | + | if (if (if (if ((bs.payments[0].assetId != F())) | |
378 | 376 | then true | |
379 | - | else ! | |
377 | + | else (size(bs.payments) != 1)) | |
380 | 378 | then true | |
381 | - | else !(if (D(toString(bu.caller))) | |
379 | + | else !(ar())) | |
380 | + | then true | |
381 | + | else !(if (C(toString(bs.caller))) | |
382 | 382 | then true | |
383 | - | else ( | |
383 | + | else (bs.caller == E()))) | |
384 | 384 | then throw("Invalid addFree params") | |
385 | 385 | else { | |
386 | - | let aE = if ((ac() > 0)) | |
387 | - | then Q((ak() + O), ac()) | |
388 | - | else J | |
389 | - | let bI = invoke(I(), "deposit", nil, [AttachedPayment(H(), N(O))]) | |
390 | - | if ((bI == bI)) | |
391 | - | then (aZ(O) ++ be(aE)) | |
386 | + | let aD = aB(M) | |
387 | + | let bB = invoke(G(), "deposit", nil, [AttachedPayment(F(), L(M))]) | |
388 | + | if ((bB == bB)) | |
389 | + | then (aY(M) ++ bc(aD)) | |
392 | 390 | else throw("Strict value is not equal to itself.") | |
393 | 391 | } | |
394 | 392 | } | |
395 | 393 | ||
396 | 394 | ||
397 | 395 | ||
398 | - | @Callable( | |
396 | + | @Callable(bs) | |
399 | 397 | func addLocked () = { | |
400 | - | let | |
401 | - | if (if (if (( | |
398 | + | let M = N(bs.payments[0].amount) | |
399 | + | if (if (if (if ((bs.payments[0].assetId != F())) | |
402 | 400 | then true | |
403 | - | else ! | |
401 | + | else (size(bs.payments) != 1)) | |
404 | 402 | then true | |
405 | - | else !(if (D(toString(bu.caller))) | |
403 | + | else !(ar())) | |
404 | + | then true | |
405 | + | else !(if (C(toString(bs.caller))) | |
406 | 406 | then true | |
407 | - | else ( | |
407 | + | else (bs.caller == E()))) | |
408 | 408 | then throw("Invalid addLocked params") | |
409 | 409 | else { | |
410 | - | let | |
411 | - | if (( | |
412 | - | then ba( | |
410 | + | let bG = invoke(G(), "deposit", nil, [AttachedPayment(F(), L(M))]) | |
411 | + | if ((bG == bG)) | |
412 | + | then ba(M) | |
413 | 413 | else throw("Strict value is not equal to itself.") | |
414 | 414 | } | |
415 | 415 | } | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | ||
419 | - | @Callable( | |
420 | - | func exchangeFreeAndLocked ( | |
419 | + | @Callable(bs) | |
420 | + | func exchangeFreeAndLocked (M) = if (if (!(ar())) | |
421 | 421 | then true | |
422 | - | else !(if (D(toString(bu.caller))) | |
423 | - | then true | |
424 | - | else (bu.caller == G()))) | |
422 | + | else !(C(toString(bs.caller)))) | |
425 | 423 | then throw("Invalid exchangeFreeAndLocked params") | |
426 | 424 | else { | |
427 | - | let bE = P(O) | |
428 | - | let bK = -(bE) | |
429 | - | let aE = aC(bK) | |
430 | - | ((bc(bE) ++ aZ(bK)) ++ be(aE)) | |
425 | + | let bC = N(M) | |
426 | + | let aD = aB(-(bC)) | |
427 | + | ((ba(bC) ++ aY(-(bC))) ++ bc(aD)) | |
431 | 428 | } | |
432 | 429 | ||
433 | 430 | ||
434 | 431 | ||
435 | - | @Callable( | |
436 | - | func withdrawLocked ( | |
432 | + | @Callable(bs) | |
433 | + | func withdrawLocked (M) = if (if (if (!(ar())) | |
437 | 434 | then true | |
438 | - | else (0 >= | |
435 | + | else (0 >= M)) | |
439 | 436 | then true | |
440 | - | else !( | |
437 | + | else !(C(toString(bs.caller)))) | |
441 | 438 | then throw("Invalid withdrawLocked params") | |
442 | 439 | else { | |
443 | - | let bE = P(O) | |
444 | - | let bI = invoke(I(), "withdraw", [toBase58String(H()), N(bE)], nil) | |
445 | - | if ((bI == bI)) | |
446 | - | then { | |
447 | - | let bL = al() | |
448 | - | let bM = if ((bE > bL)) | |
449 | - | then $Tuple2(bL, (bE - bL)) | |
450 | - | else $Tuple2(bE, 0) | |
451 | - | let bN = bM._1 | |
452 | - | let bO = bM._2 | |
453 | - | (((if ((bO > 0)) | |
454 | - | then { | |
455 | - | let aE = aC(-(bO)) | |
456 | - | (aZ(-(bO)) ++ be(aE)) | |
457 | - | } | |
458 | - | else nil) ++ ba(-(bN))) ++ [ScriptTransfer(bu.caller, N(bE), H())]) | |
459 | - | } | |
440 | + | let bC = N(M) | |
441 | + | let bG = invoke(G(), "withdraw", [toBase58String(F()), L(bC)], nil) | |
442 | + | if ((bG == bG)) | |
443 | + | then (ba(-(bC)) ++ [ScriptTransfer(bs.caller, L(bC), F())]) | |
460 | 444 | else throw("Strict value is not equal to itself.") | |
461 | 445 | } | |
462 | 446 | ||
463 | 447 | ||
464 | 448 | ||
465 | - | @Callable( | |
466 | - | func addRewards () = if (if (( | |
449 | + | @Callable(bs) | |
450 | + | func addRewards () = if (if (if ((bs.payments[0].assetId != D())) | |
467 | 451 | then true | |
468 | - | else !(at())) | |
452 | + | else (size(bs.payments) != 1)) | |
453 | + | then true | |
454 | + | else !(ar())) | |
469 | 455 | then throw("Invalid addRewards params") | |
470 | 456 | else { | |
471 | - | let | |
472 | - | let | |
473 | - | let | |
474 | - | let | |
475 | - | then ( | |
457 | + | let bq = bs.payments[0].amount | |
458 | + | let aN = aM(J, K)._1 | |
459 | + | let bI = at() | |
460 | + | let bJ = if ((bI > an())) | |
461 | + | then (bq / I) | |
476 | 462 | else { | |
477 | - | let | |
478 | - | let | |
479 | - | (( | |
463 | + | let bK = (an() - bI) | |
464 | + | let bL = (am() * bK) | |
465 | + | ((bq + bL) / I) | |
480 | 466 | } | |
481 | - | ((( | |
467 | + | (((bi(bJ) ++ bn(aN)) ++ bg(bq)) ++ bk(bI, (bI + I))) | |
482 | 468 | } | |
483 | 469 | ||
484 | 470 | ||
485 | 471 | ||
486 | - | @Callable(bu) | |
487 | - | func view_reward (af) = { | |
488 | - | let bb = ae(af) | |
489 | - | let bT = T(ag(af), bb) | |
490 | - | let bU = T(ad(), bb) | |
491 | - | let bV = (bU - bT) | |
492 | - | throw(toString(bV)) | |
472 | + | @Callable(bs) | |
473 | + | func ackRewards () = { | |
474 | + | let bM = invoke(G(), "claimProfit", [toBase58String(F())], nil) | |
475 | + | if ((bM == bM)) | |
476 | + | then { | |
477 | + | let bN = { | |
478 | + | let bO = bM | |
479 | + | if ($isInstanceOf(bO, "Int")) | |
480 | + | then { | |
481 | + | let bP = bO | |
482 | + | N(bP) | |
483 | + | } | |
484 | + | else throw("Invalid claimProfit response") | |
485 | + | } | |
486 | + | let bQ = if ((bN > 0)) | |
487 | + | then { | |
488 | + | let aD = aB(bN) | |
489 | + | let bB = invoke(G(), "deposit", nil, [AttachedPayment(F(), L(bN))]) | |
490 | + | if ((bB == bB)) | |
491 | + | then (aY(bN) ++ bc(aD)) | |
492 | + | else throw("Strict value is not equal to itself.") | |
493 | + | } | |
494 | + | else nil | |
495 | + | if ((bQ == bQ)) | |
496 | + | then bQ | |
497 | + | else throw("Strict value is not equal to itself.") | |
498 | + | } | |
499 | + | else throw("Strict value is not equal to itself.") | |
493 | 500 | } | |
494 | 501 | ||
495 | 502 | ||
496 | 503 | ||
497 | - | @Callable(bu) | |
498 | - | func view_stakingReward (af) = { | |
499 | - | let aR = aN(af, 0)._3 | |
500 | - | throw(toString(N(aR))) | |
504 | + | @Callable(bs) | |
505 | + | func view_reward (ad) = { | |
506 | + | let aZ = ac(ad) | |
507 | + | let bR = R(ae(ad), aZ) | |
508 | + | let bS = R(ab(), aZ) | |
509 | + | let bT = (bS - bR) | |
510 | + | throw(toString(bT)) | |
501 | 511 | } | |
502 | 512 | ||
503 | 513 | ||
504 | 514 | ||
505 | - | @Callable(bu) | |
506 | - | func view_withdrawLimit (af) = { | |
507 | - | let aB = aw(af)._2 | |
508 | - | let bW = N(T(aB, ad())) | |
509 | - | throw(toString(bW)) | |
515 | + | @Callable(bs) | |
516 | + | func view_stakingReward (ad) = { | |
517 | + | let aQ = aM(ad, 0)._3 | |
518 | + | throw(toString(L(aQ))) | |
510 | 519 | } | |
511 | 520 | ||
512 | 521 | ||
513 | - | @Verifier(bX) | |
514 | - | func bY () = sigVerify(bX.bodyBytes, bX.proofs[0], E()) | |
522 | + | ||
523 | + | @Callable(bs) | |
524 | + | func view_withdrawLimit (ad) = { | |
525 | + | let az = au(ad)._2 | |
526 | + | let bU = L(R(az, ab())) | |
527 | + | throw(toString(bU)) | |
528 | + | } | |
529 | + | ||
530 | + | ||
531 | + | @Verifier(bV) | |
532 | + | func bW () = { | |
533 | + | let bX = getString(this, r) | |
534 | + | if (isDefined(bX)) | |
535 | + | then { | |
536 | + | let bY = getString(addressFromStringValue(value(bX)), v) | |
537 | + | if (isDefined(bY)) | |
538 | + | then valueOrElse(getBoolean(addressFromStringValue(value(bY)), ((("status_" + toString(this)) + "_") + toBase58String(bV.id))), false) | |
539 | + | else throw("unable to verify: admin not set in coordinator") | |
540 | + | } | |
541 | + | else sigVerify(bV.bodyBytes, bV.proofs[0], bV.senderPublicKey) | |
542 | + | } | |
515 | 543 |
github/deemru/w8io/169f3d6 206.44 ms ◑