60 | | - | |
---|
61 | | - | @Callable(n) |
---|
62 | | - | func surf (s) = if (if ((n.caller != c)) |
---|
63 | | - | then (n.caller != this) |
---|
64 | | - | else false) |
---|
65 | | - | then throw("only admin can do") |
---|
66 | | - | else { |
---|
67 | | - | let t = g(invoke(addressFromStringValue("3P77iUusNwMMzWFdC8f7bftwpHyG1PBs1gq"), "calcNeutinoMetricsREADONLY", nil, nil)) |
---|
68 | | - | let u = k(t[8]) |
---|
69 | | - | if ((s > u)) |
---|
70 | | - | then { |
---|
71 | | - | let q = invoke(Address(base58'3PCbvPVQfSvVu88ip8Fm5YjwJhjEYk1Txhk'), "withdrawVestedAllSURF", [false, true], nil) |
---|
72 | | - | if ((q == q)) |
---|
73 | | - | then { |
---|
74 | | - | let v = assetBalance(this, b) |
---|
75 | | - | [ScriptTransfer(d, v, b)] |
---|
76 | | - | } |
---|
77 | | - | else throw("Strict value is not equal to itself.") |
---|
78 | | - | } |
---|
79 | | - | else throw(("br is bad. " + toString(u))) |
---|
80 | | - | } |
---|
81 | | - | |
---|
82 | | - | |
---|
83 | | - | |
---|
84 | | - | @Callable(n) |
---|
85 | | - | func toVesting (w) = if (if (if ((n.originCaller != c)) |
---|
86 | | - | then (n.originCaller != this) |
---|
87 | | - | else false) |
---|
88 | | - | then (n.originCaller != d) |
---|
89 | | - | else false) |
---|
90 | | - | then throw("only admin can do") |
---|
91 | | - | else if ((size(n.payments) != 1)) |
---|
92 | | - | then throw("bad payment") |
---|
93 | | - | else { |
---|
94 | | - | let x = n.payments[0].amount |
---|
95 | | - | let y = n.payments[0].assetId |
---|
96 | | - | let z = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "repay", [w], [AttachedPayment(y, x)]) |
---|
97 | | - | if ((z == z)) |
---|
98 | | - | then { |
---|
99 | | - | let A = invoke(Address(base58'3PCbvPVQfSvVu88ip8Fm5YjwJhjEYk1Txhk'), "convertToUSDN", nil, nil) |
---|
100 | | - | if ((A == A)) |
---|
101 | | - | then { |
---|
102 | | - | let B = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "withdraw", ["DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p", -1], nil) |
---|
103 | | - | if ((B == B)) |
---|
104 | | - | then { |
---|
105 | | - | let C = assetBalance(this, value(y)) |
---|
106 | | - | if ((C == C)) |
---|
107 | | - | then [ScriptTransfer(d, C, y), ScriptTransfer(e, assetBalance(this, a), a)] |
---|
108 | | - | else throw("Strict value is not equal to itself.") |
---|
109 | | - | } |
---|
110 | | - | else throw("Strict value is not equal to itself.") |
---|
111 | | - | } |
---|
112 | | - | else throw("Strict value is not equal to itself.") |
---|
113 | | - | } |
---|
114 | | - | else throw("Strict value is not equal to itself.") |
---|
115 | | - | } |
---|
116 | | - | |
---|
117 | | - | |
---|
118 | | - | |
---|
119 | | - | @Callable(n) |
---|
120 | | - | func rewards_vesting (D) = if (if ((n.originCaller != c)) |
---|
121 | | - | then (n.originCaller != this) |
---|
122 | | - | else false) |
---|
123 | | - | then throw("only admin can do") |
---|
124 | | - | else { |
---|
125 | | - | let E = if ((D == "3PC51qgNQz4xx7m1DhLdCDYESaeNKT6zeFt")) |
---|
126 | | - | then f |
---|
127 | | - | else e |
---|
128 | | - | let p = assetBalance(this, a) |
---|
129 | | - | if ((p == p)) |
---|
130 | | - | then { |
---|
131 | | - | let q = invoke(addressFromStringValue("3PKZk5TdPCLP2GZviipLFfK46ExTnwkRCBd"), "claimRewards", nil, nil) |
---|
132 | | - | if ((q == q)) |
---|
133 | | - | then { |
---|
134 | | - | let r = assetBalance(this, a) |
---|
135 | | - | if ((r == r)) |
---|
136 | | - | then [ScriptTransfer(E, (r - p), a)] |
---|
137 | | - | else throw("Strict value is not equal to itself.") |
---|
138 | | - | } |
---|
139 | | - | else throw("Strict value is not equal to itself.") |
---|
140 | | - | } |
---|
141 | | - | else throw("Strict value is not equal to itself.") |
---|
142 | | - | } |
---|
143 | | - | |
---|
144 | | - | |
---|
145 | | - | |
---|
146 | | - | @Callable(n) |
---|
147 | | - | func import_lp () = if (if (if (if ((n.originCaller != c)) |
---|
148 | | - | then (n.originCaller != this) |
---|
149 | | - | else false) |
---|
150 | | - | then (n.originCaller != d) |
---|
151 | | - | else false) |
---|
152 | | - | then (n.originCaller != e) |
---|
153 | | - | else false) |
---|
154 | | - | then throw("only admin can do") |
---|
155 | | - | else if ((size(n.payments) != 1)) |
---|
156 | | - | then throw("bad payment") |
---|
157 | | - | else { |
---|
158 | | - | let x = n.payments[0].amount |
---|
159 | | - | let y = n.payments[0].assetId |
---|
160 | | - | let q = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "replenishWithAtoken", nil, n.payments) |
---|
161 | | - | if ((q == q)) |
---|
162 | | - | then nil |
---|
163 | | - | else throw("Strict value is not equal to itself.") |
---|
164 | | - | } |
---|
165 | | - | |
---|
166 | | - | |
---|
167 | | - | |
---|
168 | | - | @Callable(n) |
---|
169 | | - | func itsmine (F,G,h,H,s,I) = if (if (if ((n.originCaller != c)) |
---|
170 | | - | then (n.originCaller != this) |
---|
171 | | - | else false) |
---|
172 | | - | then (n.originCaller != d) |
---|
173 | | - | else false) |
---|
174 | | - | then throw("only admin can do") |
---|
175 | | - | else if ((size(n.payments) != 1)) |
---|
176 | | - | then throw("bad payment") |
---|
177 | | - | else { |
---|
178 | | - | let J = n.payments[0].amount |
---|
179 | | - | let K = n.payments[0].assetId |
---|
180 | | - | if ((K != a)) |
---|
181 | | - | then throw("bad deposit asset") |
---|
182 | | - | else { |
---|
183 | | - | let z = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "deposit", ["3PCwFXSq8vj8iKitA5zrrLRbuqehfmimpce", true], [AttachedPayment(K, J)]) |
---|
184 | | - | if ((z == z)) |
---|
185 | | - | then { |
---|
186 | | - | let A = invoke(Address(base58'3PJ6iR5X1PT2rZcNmbqByKuh7k8mtj5wVGw'), "transferDebt", [F, G, h, H], nil) |
---|
187 | | - | if ((A == A)) |
---|
188 | | - | then { |
---|
189 | | - | let L = assetBalance(this, fromBase58String(s)) |
---|
190 | | - | if ((L == L)) |
---|
191 | | - | then { |
---|
192 | | - | let B = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "withdraw", [s, -1], nil) |
---|
193 | | - | if ((B == B)) |
---|
194 | | - | then { |
---|
195 | | - | let C = assetBalance(this, fromBase58String(s)) |
---|
196 | | - | if ((C == C)) |
---|
197 | | - | then if ((I == 0)) |
---|
198 | | - | then throw(toString((C - L))) |
---|
199 | | - | else if ((I > (C - L))) |
---|
200 | | - | then throw("low") |
---|
201 | | - | else [ScriptTransfer(n.caller, (C - L), fromBase58String(s))] |
---|
202 | | - | else throw("Strict value is not equal to itself.") |
---|
203 | | - | } |
---|
204 | | - | else throw("Strict value is not equal to itself.") |
---|
205 | | - | } |
---|
206 | | - | else throw("Strict value is not equal to itself.") |
---|
207 | | - | } |
---|
208 | | - | else throw("Strict value is not equal to itself.") |
---|
209 | | - | } |
---|
210 | | - | else throw("Strict value is not equal to itself.") |
---|
211 | | - | } |
---|
212 | | - | } |
---|
213 | | - | |
---|
214 | | - | |
---|
215 | | - | |
---|
216 | | - | @Callable(n) |
---|
217 | | - | func itsminewi (F,G,h,H,s,I) = if (if (if (if ((n.originCaller != c)) |
---|
218 | | - | then (n.originCaller != this) |
---|
219 | | - | else false) |
---|
220 | | - | then (n.originCaller != d) |
---|
221 | | - | else false) |
---|
222 | | - | then (n.originCaller != e) |
---|
223 | | - | else false) |
---|
224 | | - | then throw("only admin can do") |
---|
225 | | - | else if ((size(n.payments) != 1)) |
---|
226 | | - | then throw("bad payment") |
---|
227 | | - | else { |
---|
228 | | - | let x = n.payments[0].amount |
---|
229 | | - | let y = n.payments[0].assetId |
---|
230 | | - | let z = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "replenishWithAtoken", nil, n.payments) |
---|
231 | | - | if ((z == z)) |
---|
232 | | - | then { |
---|
233 | | - | let A = invoke(Address(base58'3PJ6iR5X1PT2rZcNmbqByKuh7k8mtj5wVGw'), "transferDebt", [F, G, h, H], nil) |
---|
234 | | - | if ((A == A)) |
---|
235 | | - | then { |
---|
236 | | - | let L = assetBalance(this, fromBase58String(s)) |
---|
237 | | - | if ((L == L)) |
---|
238 | | - | then { |
---|
239 | | - | let B = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "withdraw", [s, -1], nil) |
---|
240 | | - | if ((B == B)) |
---|
241 | | - | then { |
---|
242 | | - | let C = assetBalance(this, fromBase58String(s)) |
---|
243 | | - | if ((C == C)) |
---|
244 | | - | then if ((I == 0)) |
---|
245 | | - | then throw(toString((C - L))) |
---|
246 | | - | else if ((I > (C - L))) |
---|
247 | | - | then throw("low") |
---|
248 | | - | else [ScriptTransfer(n.caller, (C - L), fromBase58String(s))] |
---|
249 | | - | else throw("Strict value is not equal to itself.") |
---|
250 | | - | } |
---|
251 | | - | else throw("Strict value is not equal to itself.") |
---|
252 | | - | } |
---|
253 | | - | else throw("Strict value is not equal to itself.") |
---|
254 | | - | } |
---|
255 | | - | else throw("Strict value is not equal to itself.") |
---|
256 | | - | } |
---|
257 | | - | else throw("Strict value is not equal to itself.") |
---|
258 | | - | } |
---|
259 | | - | |
---|
260 | | - | |
---|
261 | | - | |
---|
262 | | - | @Callable(n) |
---|
263 | | - | func itsminewod (F,G,h,H,s,I) = if (if (if ((n.originCaller != c)) |
---|
264 | | - | then (n.originCaller != this) |
---|
265 | | - | else false) |
---|
266 | | - | then (n.originCaller != d) |
---|
267 | | - | else false) |
---|
268 | | - | then throw("only admin can do") |
---|
269 | | - | else if ((1 != 1)) |
---|
270 | | - | then throw("bad payment") |
---|
271 | | - | else if ((1 != 1)) |
---|
272 | | - | then throw("bad deposit asset") |
---|
273 | | - | else { |
---|
274 | | - | let A = invoke(Address(base58'3PJ6iR5X1PT2rZcNmbqByKuh7k8mtj5wVGw'), "transferDebt", [F, G, h, H], nil) |
---|
275 | | - | if ((A == A)) |
---|
276 | | - | then { |
---|
277 | | - | let L = assetBalance(this, fromBase58String(s)) |
---|
278 | | - | if ((L == L)) |
---|
279 | | - | then { |
---|
280 | | - | let B = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "withdraw", [s, -1], nil) |
---|
281 | | - | if ((B == B)) |
---|
282 | | - | then { |
---|
283 | | - | let C = assetBalance(this, fromBase58String(s)) |
---|
284 | | - | if ((C == C)) |
---|
285 | | - | then if ((I == 0)) |
---|
286 | | - | then throw(toString((C - L))) |
---|
287 | | - | else if ((I > (C - L))) |
---|
288 | | - | then throw("low") |
---|
289 | | - | else [ScriptTransfer(n.caller, (C - L), fromBase58String(s))] |
---|
290 | | - | else throw("Strict value is not equal to itself.") |
---|
291 | | - | } |
---|
292 | | - | else throw("Strict value is not equal to itself.") |
---|
293 | | - | } |
---|
294 | | - | else throw("Strict value is not equal to itself.") |
---|
295 | | - | } |
---|
296 | | - | else throw("Strict value is not equal to itself.") |
---|
297 | | - | } |
---|
298 | | - | |
---|
299 | | - | |
---|
300 | | - | |
---|
301 | | - | @Callable(n) |
---|
302 | | - | func liq (F,G,h,H) = if (if (if ((n.originCaller != c)) |
---|
303 | | - | then (n.originCaller != this) |
---|
304 | | - | else false) |
---|
305 | | - | then (n.originCaller != d) |
---|
306 | | - | else false) |
---|
307 | | - | then throw("only admin can do") |
---|
308 | | - | else if ((size(n.payments) != 1)) |
---|
309 | | - | then throw("bad payment") |
---|
310 | | - | else { |
---|
311 | | - | let J = n.payments[0].amount |
---|
312 | | - | let K = n.payments[0].assetId |
---|
313 | | - | if ((K != a)) |
---|
314 | | - | then throw("bad deposit asset") |
---|
315 | | - | else { |
---|
316 | | - | let z = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "deposit", ["3PCwFXSq8vj8iKitA5zrrLRbuqehfmimpce", true], [AttachedPayment(K, J)]) |
---|
317 | | - | if ((z == z)) |
---|
318 | | - | then { |
---|
319 | | - | let A = invoke(Address(base58'3PJ6iR5X1PT2rZcNmbqByKuh7k8mtj5wVGw'), "transferDebt", [F, G, h, H], nil) |
---|
320 | | - | if ((A == A)) |
---|
321 | | - | then nil |
---|
322 | | - | else throw("Strict value is not equal to itself.") |
---|
323 | | - | } |
---|
324 | | - | else throw("Strict value is not equal to itself.") |
---|
325 | | - | } |
---|
326 | | - | } |
---|
327 | | - | |
---|
328 | | - | |
---|
329 | | - | |
---|
330 | | - | @Callable(n) |
---|
331 | | - | func repay () = if (if (if ((n.originCaller != c)) |
---|
332 | | - | then (n.originCaller != this) |
---|
333 | | - | else false) |
---|
334 | | - | then (n.originCaller != d) |
---|
335 | | - | else false) |
---|
336 | | - | then throw("only admin can do") |
---|
337 | | - | else if ((size(n.payments) != 1)) |
---|
338 | | - | then throw("bad payment") |
---|
339 | | - | else { |
---|
340 | | - | let x = n.payments[0].amount |
---|
341 | | - | let y = n.payments[0].assetId |
---|
342 | | - | let z = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "repay", ["3PPdeWwrzaxqgr6BuReoF3sWfxW8SYv743D"], [AttachedPayment(y, x)]) |
---|
343 | | - | if ((z == z)) |
---|
344 | | - | then { |
---|
345 | | - | let A = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "withdraw2", ["3PN1LXdwuFWH3paF3fpMNCWk7oWRzXCeMSC", -1], nil) |
---|
346 | | - | if ((A == A)) |
---|
347 | | - | then { |
---|
348 | | - | let B = invoke(Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'), "withdraw2", ["3PCwFXSq8vj8iKitA5zrrLRbuqehfmimpce", -1], nil) |
---|
349 | | - | if ((B == B)) |
---|
350 | | - | then [ScriptTransfer(n.caller, assetBalance(this, value(y)), y), ScriptTransfer(n.caller, assetBalance(this, fromBase58String("6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ")), fromBase58String("6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ")), ScriptTransfer(n.caller, assetBalance(this, fromBase58String("DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p")), fromBase58String("DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p"))] |
---|
351 | | - | else throw("Strict value is not equal to itself.") |
---|
352 | | - | } |
---|
353 | | - | else throw("Strict value is not equal to itself.") |
---|
354 | | - | } |
---|
355 | | - | else throw("Strict value is not equal to itself.") |
---|
356 | | - | } |
---|
357 | | - | |
---|
358 | | - | |
---|