1 | | - | {-# STDLIB_VERSION 5 #-} |
---|
2 | | - | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | | - | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let a = base58'97zHFp1C3cB7qfvx8Xv5f2rWp9nUSG5UnAamfPcW6txf' |
---|
5 | | - | |
---|
6 | | - | let b = base58'Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on' |
---|
7 | | - | |
---|
8 | | - | let c = base58'BbP9tmd5Zxk345y9zipXkYaqDfxDG1suTj64eJmy1BAT' |
---|
9 | | - | |
---|
10 | | - | let d = Address(base58'3PC9xNkxwtsRA9ep91EV67Mdpv1NT64r3Mg') |
---|
11 | | - | |
---|
12 | | - | let e = 120 |
---|
13 | | - | |
---|
14 | | - | let f = 2990340 |
---|
15 | | - | |
---|
16 | | - | let g = 100000000000 |
---|
17 | | - | |
---|
18 | | - | @Callable(h) |
---|
19 | | - | func deposit () = { |
---|
20 | | - | let i = valueOrElse(getBoolean("deposit_locked"), false) |
---|
21 | | - | let j = valueOrElse(getInteger("total_balance"), 0) |
---|
22 | | - | let k = (f > height) |
---|
23 | | - | let l = valueOrElse(getBoolean("initialized"), false) |
---|
24 | | - | let m = (height >= valueOrElse(getInteger("first_block"), 0)) |
---|
25 | | - | if (if (if (if (if (if (if (if (!(i)) |
---|
26 | | - | then l |
---|
27 | | - | else false) |
---|
28 | | - | then m |
---|
29 | | - | else false) |
---|
30 | | - | then (size(h.payments) == 1) |
---|
31 | | - | else false) |
---|
32 | | - | then (h.payments[0].amount > 0) |
---|
33 | | - | else false) |
---|
34 | | - | then (h.payments[0].assetId == a) |
---|
35 | | - | else false) |
---|
36 | | - | then k |
---|
37 | | - | else false) |
---|
38 | | - | then (g >= (j + h.payments[0].amount)) |
---|
39 | | - | else false) |
---|
40 | | - | then { |
---|
41 | | - | let n = getIntegerValue("start_block") |
---|
42 | | - | func o () = { |
---|
43 | | - | let p = valueOrElse(getInteger((toString(h.caller) + "_last_deposit_block")), 0) |
---|
44 | | - | let q = valueOrElse(getInteger((toString(h.caller) + "_last_withdraw_block")), 0) |
---|
45 | | - | let r = if (if (if ((p != 0)) |
---|
46 | | - | then (n > p) |
---|
47 | | - | else false) |
---|
48 | | - | then (n > q) |
---|
49 | | - | else false) |
---|
50 | | - | then { |
---|
51 | | - | let s = valueOrElse(getInteger((toString(h.caller) + "_balance")), 0) |
---|
52 | | - | (toBigInt(s) * toBigInt(e)) |
---|
53 | | - | } |
---|
54 | | - | else parseBigIntValue(valueOrElse(getString((((toString(h.caller) + "_") + toString(n)) + "_share")), "0")) |
---|
55 | | - | r |
---|
56 | | - | } |
---|
57 | | - | |
---|
58 | | - | func t () = { |
---|
59 | | - | let p = valueOrElse(getInteger("last_deposit_block"), 0) |
---|
60 | | - | let q = valueOrElse(getInteger("last_withdraw_block"), 0) |
---|
61 | | - | let r = if (if (if ((p != 0)) |
---|
62 | | - | then (n > p) |
---|
63 | | - | else false) |
---|
64 | | - | then (n > q) |
---|
65 | | - | else false) |
---|
66 | | - | then { |
---|
67 | | - | let u = valueOrElse(getInteger("total_balance"), 0) |
---|
68 | | - | (toBigInt(u) * toBigInt(e)) |
---|
69 | | - | } |
---|
70 | | - | else parseBigIntValue(valueOrElse(getString((toString(n) + "_total_share")), "0")) |
---|
71 | | - | r |
---|
72 | | - | } |
---|
73 | | - | |
---|
74 | | - | let v = o() |
---|
75 | | - | let w = if ((height > (n + e))) |
---|
76 | | - | then toBigInt(0) |
---|
77 | | - | else (toBigInt(h.payments[0].amount) * toBigInt(((n + e) - height))) |
---|
78 | | - | let x = (v + w) |
---|
79 | | - | let y = valueOrElse(getInteger((toString(h.caller) + "_balance")), 0) |
---|
80 | | - | let s = (y + h.payments[0].amount) |
---|
81 | | - | let z = t() |
---|
82 | | - | let A = (z + w) |
---|
83 | | - | let B = valueOrElse(getInteger("total_balance"), 0) |
---|
84 | | - | let u = (B + h.payments[0].amount) |
---|
85 | | - | let C = invoke(d, "stakeLP", nil, [AttachedPayment(h.payments[0].assetId, h.payments[0].amount)]) |
---|
86 | | - | if ((C == C)) |
---|
87 | | - | then { |
---|
88 | | - | let D = { |
---|
89 | | - | let E = getString((toString(h.caller) + "_activity")) |
---|
90 | | - | if ($isInstanceOf(E, "String")) |
---|
91 | | - | then { |
---|
92 | | - | let F = E |
---|
93 | | - | true |
---|
94 | | - | } |
---|
95 | | - | else if ($isInstanceOf(E, "Unit")) |
---|
96 | | - | then { |
---|
97 | | - | let G = E |
---|
98 | | - | false |
---|
99 | | - | } |
---|
100 | | - | else throw("Match error") |
---|
101 | | - | } |
---|
102 | | - | let H = if (D) |
---|
103 | | - | then if (!(contains(getStringValue((toString(h.caller) + "_activity")), toString(n)))) |
---|
104 | | - | then ((getStringValue((toString(h.caller) + "_activity")) + "_") + toString(n)) |
---|
105 | | - | else getStringValue((toString(h.caller) + "_activity")) |
---|
106 | | - | else toString(n) |
---|
107 | | - | let I = { |
---|
108 | | - | let E = getInteger((toString(h.caller) + "_first_deposit")) |
---|
109 | | - | if ($isInstanceOf(E, "Int")) |
---|
110 | | - | then { |
---|
111 | | - | let F = E |
---|
112 | | - | F |
---|
113 | | - | } |
---|
114 | | - | else if ($isInstanceOf(E, "Unit")) |
---|
115 | | - | then { |
---|
116 | | - | let G = E |
---|
117 | | - | n |
---|
118 | | - | } |
---|
119 | | - | else throw("Match error") |
---|
120 | | - | } |
---|
121 | | - | $Tuple2([IntegerEntry((toString(h.caller) + "_balance"), s), StringEntry((((toString(h.caller) + "_") + toString(n)) + "_share"), toString(x)), IntegerEntry((((toString(h.caller) + "_") + toString(n)) + "_balance"), s), StringEntry((toString(h.caller) + "_activity"), H), IntegerEntry((toString(h.caller) + "_last_deposit_block"), n), IntegerEntry((toString(h.caller) + "_first_deposit"), I), IntegerEntry("total_balance", u), StringEntry((toString(n) + "_total_share"), toString(A)), IntegerEntry("last_deposit_block", n)], unit) |
---|
122 | | - | } |
---|
123 | | - | else throw("Strict value is not equal to itself.") |
---|
124 | | - | } |
---|
125 | | - | else throw("") |
---|
126 | | - | } |
---|
127 | | - | |
---|
128 | | - | |
---|
129 | | - | |
---|
130 | | - | @Callable(h) |
---|
131 | | - | func withdraw (J) = { |
---|
132 | | - | let K = valueOrElse(getBoolean("withdraw_locked"), false) |
---|
133 | | - | let y = valueOrElse(getInteger((toString(h.caller) + "_balance")), 0) |
---|
134 | | - | if (if (if (if (!(K)) |
---|
135 | | - | then (J > 0) |
---|
136 | | - | else false) |
---|
137 | | - | then (y > 0) |
---|
138 | | - | else false) |
---|
139 | | - | then (y >= J) |
---|
140 | | - | else false) |
---|
141 | | - | then { |
---|
142 | | - | let n = getIntegerValue("start_block") |
---|
143 | | - | func o () = { |
---|
144 | | - | let p = valueOrElse(getInteger((toString(h.caller) + "_last_deposit_block")), 0) |
---|
145 | | - | let q = valueOrElse(getInteger((toString(h.caller) + "_last_withdraw_block")), 0) |
---|
146 | | - | let r = if (if ((n > p)) |
---|
147 | | - | then (n > q) |
---|
148 | | - | else false) |
---|
149 | | - | then { |
---|
150 | | - | let s = valueOrElse(getInteger((toString(h.caller) + "_balance")), 0) |
---|
151 | | - | (toBigInt(s) * toBigInt(e)) |
---|
152 | | - | } |
---|
153 | | - | else parseBigIntValue(valueOrElse(getString((((toString(h.caller) + "_") + toString(n)) + "_share")), "0")) |
---|
154 | | - | r |
---|
155 | | - | } |
---|
156 | | - | |
---|
157 | | - | func t () = { |
---|
158 | | - | let p = valueOrElse(getInteger("last_deposit_block"), 0) |
---|
159 | | - | let q = valueOrElse(getInteger("last_withdraw_block"), 0) |
---|
160 | | - | let r = if (if ((n > p)) |
---|
161 | | - | then (n > q) |
---|
162 | | - | else false) |
---|
163 | | - | then { |
---|
164 | | - | let u = valueOrElse(getInteger("total_balance"), 0) |
---|
165 | | - | (toBigInt(u) * toBigInt(e)) |
---|
166 | | - | } |
---|
167 | | - | else parseBigIntValue(valueOrElse(getString((toString(n) + "_total_share")), "0")) |
---|
168 | | - | r |
---|
169 | | - | } |
---|
170 | | - | |
---|
171 | | - | let s = (y - J) |
---|
172 | | - | let L = if ((height > (n + e))) |
---|
173 | | - | then toBigInt(0) |
---|
174 | | - | else (toBigInt(J) * toBigInt(((n + e) - height))) |
---|
175 | | - | let x = (o() - L) |
---|
176 | | - | let u = (valueOrElse(getInteger("total_balance"), 0) - J) |
---|
177 | | - | let A = (t() - L) |
---|
178 | | - | let D = { |
---|
179 | | - | let E = getString((toString(h.caller) + "_activity")) |
---|
180 | | - | if ($isInstanceOf(E, "String")) |
---|
181 | | - | then { |
---|
182 | | - | let F = E |
---|
183 | | - | true |
---|
184 | | - | } |
---|
185 | | - | else if ($isInstanceOf(E, "Unit")) |
---|
186 | | - | then { |
---|
187 | | - | let G = E |
---|
188 | | - | false |
---|
189 | | - | } |
---|
190 | | - | else throw("Match error") |
---|
191 | | - | } |
---|
192 | | - | let H = if (D) |
---|
193 | | - | then if (!(contains(getStringValue((toString(h.caller) + "_activity")), toString(n)))) |
---|
194 | | - | then ((getStringValue((toString(h.caller) + "_activity")) + "_") + toString(n)) |
---|
195 | | - | else getStringValue((toString(h.caller) + "_activity")) |
---|
196 | | - | else toString(n) |
---|
197 | | - | let M = valueOrElse(getBoolean("ended"), false) |
---|
198 | | - | if (!(M)) |
---|
199 | | - | then { |
---|
200 | | - | let N = invoke(d, "unstakeLP", [J], nil) |
---|
201 | | - | if ((N == N)) |
---|
202 | | - | then $Tuple2([ScriptTransfer(h.caller, J, a), IntegerEntry((toString(h.caller) + "_balance"), s), StringEntry((((toString(h.caller) + "_") + toString(n)) + "_share"), toString(x)), IntegerEntry((((toString(h.caller) + "_") + toString(n)) + "_balance"), s), StringEntry((toString(h.caller) + "_activity"), H), IntegerEntry((toString(h.caller) + "_last_withdraw_block"), n), IntegerEntry("total_balance", u), StringEntry((toString(n) + "_total_share"), toString(A)), IntegerEntry("last_withdraw_block", n)], unit) |
---|
203 | | - | else throw("Strict value is not equal to itself.") |
---|
204 | | - | } |
---|
205 | | - | else { |
---|
206 | | - | let O = getIntegerValue("end_block") |
---|
207 | | - | $Tuple2([ScriptTransfer(h.caller, J, a), IntegerEntry((toString(h.caller) + "_balance"), s), IntegerEntry((toString(h.caller) + "_last_withdraw_block"), O), IntegerEntry("total_balance", u), IntegerEntry("last_withdraw_block", O)], unit) |
---|
208 | | - | } |
---|
209 | | - | } |
---|
210 | | - | else throw("") |
---|
211 | | - | } |
---|
212 | | - | |
---|
213 | | - | |
---|
214 | | - | |
---|
215 | | - | @Callable(h) |
---|
216 | | - | func end () = { |
---|
217 | | - | let P = valueOrElse(getBoolean("end_locked"), false) |
---|
218 | | - | let n = getIntegerValue("start_block") |
---|
219 | | - | let M = valueOrElse(getBoolean((("start_block_" + toString(n)) + "_ended")), false) |
---|
220 | | - | let k = (height >= (n + e)) |
---|
221 | | - | if (if (if (if (!(P)) |
---|
222 | | - | then !(M) |
---|
223 | | - | else false) |
---|
224 | | - | then k |
---|
225 | | - | else false) |
---|
226 | | - | then (f > n) |
---|
227 | | - | else false) |
---|
228 | | - | then { |
---|
229 | | - | let Q = assetBalance(this, b) |
---|
230 | | - | if ((Q == Q)) |
---|
231 | | - | then { |
---|
232 | | - | let R = assetBalance(this, c) |
---|
233 | | - | if ((R == R)) |
---|
234 | | - | then { |
---|
235 | | - | let S = invoke(d, "claim", nil, nil) |
---|
236 | | - | if ((S == S)) |
---|
237 | | - | then { |
---|
238 | | - | let T = (assetBalance(this, b) - Q) |
---|
239 | | - | if ((T == T)) |
---|
240 | | - | then { |
---|
241 | | - | let U = (assetBalance(this, c) - R) |
---|
242 | | - | if ((U == U)) |
---|
243 | | - | then { |
---|
244 | | - | let V = (valueOrElse(getInteger(this, "total_wx_reward_amount"), 0) + T) |
---|
245 | | - | let W = (valueOrElse(getInteger(this, "total_wxb_reward_amount"), 0) + U) |
---|
246 | | - | let X = { |
---|
247 | | - | let E = getString((toString(n) + "_total_share")) |
---|
248 | | - | if ($isInstanceOf(E, "String")) |
---|
249 | | - | then { |
---|
250 | | - | let F = E |
---|
251 | | - | F |
---|
252 | | - | } |
---|
253 | | - | else if ($isInstanceOf(E, "Unit")) |
---|
254 | | - | then { |
---|
255 | | - | let G = E |
---|
256 | | - | toString((toBigInt(valueOrElse(getInteger("total_balance"), 0)) * toBigInt(e))) |
---|
257 | | - | } |
---|
258 | | - | else throw("Match error") |
---|
259 | | - | } |
---|
260 | | - | let Y = { |
---|
261 | | - | let E = getString("round_activity") |
---|
262 | | - | if ($isInstanceOf(E, "String")) |
---|
263 | | - | then { |
---|
264 | | - | let F = E |
---|
265 | | - | ((F + "_") + toString(n)) |
---|
266 | | - | } |
---|
267 | | - | else if ($isInstanceOf(E, "Unit")) |
---|
268 | | - | then { |
---|
269 | | - | let G = E |
---|
270 | | - | toString(n) |
---|
271 | | - | } |
---|
272 | | - | else throw("Match error") |
---|
273 | | - | } |
---|
274 | | - | let Z = getIntegerValue("reward_amount") |
---|
275 | | - | if ((height >= f)) |
---|
276 | | - | then { |
---|
277 | | - | let u = valueOrElse(getInteger("total_balance"), 0) |
---|
278 | | - | let aa = invoke(d, "unstakeLP", [u], nil) |
---|
279 | | - | if ((aa == aa)) |
---|
280 | | - | then $Tuple2([ScriptTransfer(h.caller, Z, c), IntegerEntry((("start_block_" + toString(n)) + "_end_block"), height), BooleanEntry((("start_block_" + toString(n)) + "_ended"), true), IntegerEntry((("start_block_" + toString(n)) + "_wx_reward_amount"), T), IntegerEntry((("start_block_" + toString(n)) + "_wxb_reward_amount"), U), IntegerEntry("total_wx_reward_amount", V), IntegerEntry("total_wxb_reward_amount", W), StringEntry((toString(n) + "_total_share"), X), StringEntry("round_activity", Y), BooleanEntry("ended", true), IntegerEntry("end_block", height)], unit) |
---|
281 | | - | else throw("Strict value is not equal to itself.") |
---|
282 | | - | } |
---|
283 | | - | else $Tuple2([ScriptTransfer(h.caller, Z, c), IntegerEntry((("start_block_" + toString(n)) + "_end_block"), height), BooleanEntry((("start_block_" + toString(n)) + "_ended"), true), IntegerEntry((("start_block_" + toString(n)) + "_wx_reward_amount"), T), IntegerEntry((("start_block_" + toString(n)) + "_wxb_reward_amount"), U), IntegerEntry("total_wx_reward_amount", V), IntegerEntry("total_wxb_reward_amount", W), StringEntry((toString(n) + "_total_share"), X), StringEntry("round_activity", Y), IntegerEntry("start_block", height)], unit) |
---|
284 | | - | } |
---|
285 | | - | else throw("Strict value is not equal to itself.") |
---|
286 | | - | } |
---|
287 | | - | else throw("Strict value is not equal to itself.") |
---|
288 | | - | } |
---|
289 | | - | else throw("Strict value is not equal to itself.") |
---|
290 | | - | } |
---|
291 | | - | else throw("Strict value is not equal to itself.") |
---|
292 | | - | } |
---|
293 | | - | else throw("Strict value is not equal to itself.") |
---|
294 | | - | } |
---|
295 | | - | else throw("") |
---|
296 | | - | } |
---|
297 | | - | |
---|
298 | | - | |
---|
299 | | - | |
---|
300 | | - | @Callable(h) |
---|
301 | | - | func claim (n) = { |
---|
302 | | - | let ab = valueOrElse(getBoolean("claim_locked"), false) |
---|
303 | | - | let M = valueOrElse(getBoolean((("start_block_" + toString(n)) + "_ended")), false) |
---|
304 | | - | let ac = valueOrElse(getBoolean((((toString(h.caller) + "_") + toString(n)) + "_claimed")), false) |
---|
305 | | - | let ad = getIntegerValue("first_block") |
---|
306 | | - | if (if (if (if (if (!(ab)) |
---|
307 | | - | then M |
---|
308 | | - | else false) |
---|
309 | | - | then !(ac) |
---|
310 | | - | else false) |
---|
311 | | - | then (f > n) |
---|
312 | | - | else false) |
---|
313 | | - | then (n >= ad) |
---|
314 | | - | else false) |
---|
315 | | - | then { |
---|
316 | | - | func ae () = { |
---|
317 | | - | let p = valueOrElse(getInteger((toString(h.caller) + "_last_deposit_block")), 0) |
---|
318 | | - | let q = valueOrElse(getInteger((toString(h.caller) + "_last_withdraw_block")), 0) |
---|
319 | | - | let x = if ((p == 0)) |
---|
320 | | - | then throw("") |
---|
321 | | - | else if ((valueOrElse(getString((((toString(h.caller) + "_") + toString(n)) + "_share")), "0") != "0")) |
---|
322 | | - | then parseBigIntValue(getStringValue((((toString(h.caller) + "_") + toString(n)) + "_share"))) |
---|
323 | | - | else if ((valueOrElse(getString((((toString(h.caller) + "_") + toString(n)) + "_share")), "-1") == "0")) |
---|
324 | | - | then toBigInt(0) |
---|
325 | | - | else if (if ((n > p)) |
---|
326 | | - | then (n > q) |
---|
327 | | - | else false) |
---|
328 | | - | then { |
---|
329 | | - | let s = valueOrElse(getInteger((toString(h.caller) + "_balance")), 0) |
---|
330 | | - | (toBigInt(s) * toBigInt(e)) |
---|
331 | | - | } |
---|
332 | | - | else { |
---|
333 | | - | let I = getIntegerValue((toString(h.caller) + "_first_deposit")) |
---|
334 | | - | if (!((n > I))) |
---|
335 | | - | then throw("") |
---|
336 | | - | else { |
---|
337 | | - | let af = getStringValue("round_activity") |
---|
338 | | - | let ag = dropRight(af, ((size(af) + 1) - value(indexOf(af, toString(n))))) |
---|
339 | | - | let ah = if ((valueOrElse(lastIndexOf(ag, "_"), 0) != 0)) |
---|
340 | | - | then (value(lastIndexOf(ag, "_")) + 1) |
---|
341 | | - | else 0 |
---|
342 | | - | let ai = drop(ag, ah) |
---|
343 | | - | let aj = split(getStringValue((toString(h.caller) + "_activity")), "_") |
---|
344 | | - | func ak (al,am) = { |
---|
345 | | - | let an = if (if ((value(parseInt(ai)) > value(parseInt(am)))) |
---|
346 | | - | then (value(parseInt(am)) > value(parseInt(al))) |
---|
347 | | - | else false) |
---|
348 | | - | then am |
---|
349 | | - | else al |
---|
350 | | - | an |
---|
351 | | - | } |
---|
352 | | - | |
---|
353 | | - | let ao = if (containsElement(aj, ai)) |
---|
354 | | - | then ai |
---|
355 | | - | else { |
---|
356 | | - | let an = { |
---|
357 | | - | let ap = aj |
---|
358 | | - | let aq = size(ap) |
---|
359 | | - | let ar = "0" |
---|
360 | | - | func as (at,au) = if ((au >= aq)) |
---|
361 | | - | then at |
---|
362 | | - | else ak(at, ap[au]) |
---|
363 | | - | |
---|
364 | | - | func av (at,au) = if ((au >= aq)) |
---|
365 | | - | then at |
---|
366 | | - | else throw("List size exceeds 53") |
---|
367 | | - | |
---|
368 | | - | av(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(as(ar, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53) |
---|
369 | | - | } |
---|
370 | | - | an |
---|
371 | | - | } |
---|
372 | | - | let aw = (toBigInt(getIntegerValue((((toString(h.caller) + "_") + ao) + "_balance"))) * toBigInt(e)) |
---|
373 | | - | aw |
---|
374 | | - | } |
---|
375 | | - | } |
---|
376 | | - | x |
---|
377 | | - | } |
---|
378 | | - | |
---|
379 | | - | let x = ae() |
---|
380 | | - | if ((x > toBigInt(0))) |
---|
381 | | - | then { |
---|
382 | | - | let A = parseBigIntValue(getStringValue((toString(n) + "_total_share"))) |
---|
383 | | - | let ax = valueOrElse(getInteger((("start_block_" + toString(n)) + "_wx_reward_amount")), 0) |
---|
384 | | - | let ay = toInt(fraction(x, toBigInt(ax), A)) |
---|
385 | | - | let az = valueOrElse(getInteger((("start_block_" + toString(n)) + "_wxb_reward_amount")), 0) |
---|
386 | | - | let aA = toInt(fraction(x, toBigInt(az), A)) |
---|
387 | | - | let aB = (valueOrElse(getInteger((toString(n) + "_total_claimed_wx_reward_amount")), 0) + ay) |
---|
388 | | - | let aC = (valueOrElse(getInteger("total_claimed_wx_reward_amount"), 0) + ay) |
---|
389 | | - | let aD = (valueOrElse(getInteger((toString(n) + "_total_claimed_wxb_reward_amount")), 0) + aA) |
---|
390 | | - | let aE = (valueOrElse(getInteger("total_claimed_wxb_reward_amount"), 0) + aA) |
---|
391 | | - | let aF = (valueOrElse(getInteger((toString(h.caller) + "_total_claimed_wx_amount")), 0) + ay) |
---|
392 | | - | let aG = (valueOrElse(getInteger((toString(h.caller) + "_total_claimed_wxb_amount")), 0) + aA) |
---|
393 | | - | $Tuple2([ScriptTransfer(h.caller, ay, b), ScriptTransfer(h.caller, aA, c), BooleanEntry((((toString(h.caller) + "_") + toString(n)) + "_claimed"), true), IntegerEntry((toString(h.caller) + "_total_claimed_wx_amount"), aF), IntegerEntry((toString(n) + "_total_claimed_wx_reward_amount"), aB), IntegerEntry("total_claimed_wx_reward_amount", aC), IntegerEntry((toString(h.caller) + "_total_claimed_wxb_amount"), aG), IntegerEntry((toString(n) + "_total_claimed_wxb_reward_amount"), aD), IntegerEntry("total_claimed_wxb_reward_amount", aE)], unit) |
---|
394 | | - | } |
---|
395 | | - | else throw("") |
---|
396 | | - | } |
---|
397 | | - | else throw("") |
---|
398 | | - | } |
---|
399 | | - | |
---|
400 | | - | |
---|
401 | | - | |
---|
402 | | - | @Callable(h) |
---|
403 | | - | func init (n) = { |
---|
404 | | - | let l = valueOrElse(getBoolean("initialized"), false) |
---|
405 | | - | if (!(l)) |
---|
406 | | - | then $Tuple2([BooleanEntry("initialized", true), IntegerEntry("start_block", n), IntegerEntry("first_block", n), IntegerEntry("reward_amount", 10000000000)], unit) |
---|
407 | | - | else throw("") |
---|
408 | | - | } |
---|
409 | | - | |
---|
410 | | - | |
---|
411 | | - | |
---|
412 | | - | @Callable(h) |
---|
413 | | - | func changeRewardAmount (J) = if ((h.caller == this)) |
---|
414 | | - | then $Tuple2([IntegerEntry("reward_amount", J)], unit) |
---|
415 | | - | else throw("") |
---|
416 | | - | |
---|
417 | | - | |
---|
418 | | - | |
---|
419 | | - | @Callable(h) |
---|
420 | | - | func lock (aH,aI,aJ,aK) = if ((h.caller == this)) |
---|
421 | | - | then $Tuple2([BooleanEntry("deposit_locked", aH), BooleanEntry("withdraw_locked", aI), BooleanEntry("end_locked", aJ), BooleanEntry("claim_locked", aK)], unit) |
---|
422 | | - | else throw("") |
---|
423 | | - | |
---|
424 | | - | |
---|
| 1 | + | # no script |
---|