4 | | - | let a = "activate_height" |
---|
5 | | - | |
---|
6 | | - | let b = "finish_height" |
---|
7 | | - | |
---|
8 | | - | let c = getIntegerValue(this, a) |
---|
9 | | - | |
---|
10 | | - | let d = getIntegerValue(this, b) |
---|
11 | | - | |
---|
12 | | - | let e = 100000000000000 |
---|
13 | | - | |
---|
14 | | - | let f = base58'2Tqhz5PWbkijnzYpdLxLDFfVDw5ALQWm2rmxQ79ooMRZ' |
---|
15 | | - | |
---|
16 | | - | let g = "_ENNO_claimed_amount" |
---|
17 | | - | |
---|
18 | | - | let h = "_ENNO_last_claimed_amount" |
---|
19 | | - | |
---|
20 | | - | let i = base58'DkMBTSHqT9hKVK1joeyL9DWKdzMAiCYZtYVkMPUx4Zwq' |
---|
21 | | - | |
---|
22 | | - | let j = base58'DkMBTSHqT9hKVK1joeyL9DWKdzMAiCYZtYVkMPUx4Zwq' |
---|
23 | | - | |
---|
24 | | - | let k = base58'DkMBTSHqT9hKVK1joeyL9DWKdzMAiCYZtYVkMPUx4Zwq' |
---|
25 | | - | |
---|
26 | | - | func l (m) = { |
---|
27 | | - | let n = getInteger(this, ("share_" + toString(m))) |
---|
28 | | - | let o = { |
---|
29 | | - | let p = n |
---|
30 | | - | if ($isInstanceOf(p, "Int")) |
---|
31 | | - | then { |
---|
32 | | - | let q = p |
---|
33 | | - | q |
---|
34 | | - | } |
---|
35 | | - | else if ($isInstanceOf(p, "Unit")) |
---|
36 | | - | then { |
---|
37 | | - | let q = p |
---|
38 | | - | throw("Only early liquidity providers can call this function") |
---|
39 | | - | } |
---|
40 | | - | else throw("Match error") |
---|
41 | | - | } |
---|
42 | | - | o |
---|
43 | | - | } |
---|
46 | | - | func r (m) = { |
---|
47 | | - | let s = getInteger(this, (toString(m) + g)) |
---|
48 | | - | let t = { |
---|
49 | | - | let p = s |
---|
50 | | - | if ($isInstanceOf(p, "Int")) |
---|
51 | | - | then { |
---|
52 | | - | let q = p |
---|
53 | | - | q |
---|
54 | | - | } |
---|
55 | | - | else if ($isInstanceOf(p, "Unit")) |
---|
56 | | - | then { |
---|
57 | | - | let q = p |
---|
58 | | - | 0 |
---|
59 | | - | } |
---|
60 | | - | else throw("Match error") |
---|
61 | | - | } |
---|
62 | | - | t |
---|
63 | | - | } |
---|
64 | | - | |
---|
65 | | - | |
---|
66 | | - | @Callable(u) |
---|
67 | | - | func claimENNO () = { |
---|
68 | | - | let v = (d - c) |
---|
69 | | - | let w = if ((d > height)) |
---|
70 | | - | then height |
---|
71 | | - | else d |
---|
72 | | - | let x = l(u.caller) |
---|
73 | | - | let y = r(u.caller) |
---|
74 | | - | let z = (fraction((w - c), x, v) - y) |
---|
75 | | - | let A = (y + z) |
---|
76 | | - | [ScriptTransfer(u.caller, z, f), IntegerEntry((toString(u.caller) + g), A), IntegerEntry((toString(u.caller) + h), z)] |
---|
77 | | - | } |
---|
78 | | - | |
---|
79 | | - | |
---|
80 | | - | @Verifier(B) |
---|
81 | | - | func C () = { |
---|
82 | | - | let p = B |
---|
83 | | - | let D = if (sigVerify(B.bodyBytes, B.proofs[0], i)) |
---|
84 | | - | then 1 |
---|
85 | | - | else 0 |
---|
86 | | - | let E = if (sigVerify(B.bodyBytes, B.proofs[1], j)) |
---|
87 | | - | then 1 |
---|
88 | | - | else 0 |
---|
89 | | - | let F = if (sigVerify(B.bodyBytes, B.proofs[2], k)) |
---|
90 | | - | then 1 |
---|
91 | | - | else 0 |
---|
92 | | - | (((D + E) + F) >= 2) |
---|
93 | | - | } |
---|