1 | | - | {-# STDLIB_VERSION 5 #-} |
---|
2 | | - | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | | - | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let d = addressFromStringValue("3P2ipa5bg2WU6UGCxymmZg1daPyn53fKfkA") |
---|
5 | | - | |
---|
6 | | - | let e = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") |
---|
7 | | - | |
---|
8 | | - | let f = base58'6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ' |
---|
9 | | - | |
---|
10 | | - | let g = base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ' |
---|
11 | | - | |
---|
12 | | - | let h = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' |
---|
13 | | - | |
---|
14 | | - | let i = ["6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ", "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ", "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p"] |
---|
15 | | - | |
---|
16 | | - | let j = base58'2tVLdi5fQXk2JcuDAojhctnDp5B5PZhNMyj5GUpeC3tZ' |
---|
17 | | - | |
---|
18 | | - | let k = base58'FSRHtSyXRXQjzQLRtmaqFpBDDCNjY8PU8KNtwoGXVBmr' |
---|
19 | | - | |
---|
20 | | - | let l = addressFromStringValue("3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S") |
---|
21 | | - | |
---|
22 | | - | let m = addressFromStringValue("3PEiD1zJWTMZNWSCyzhvBw9pxxAWeEwaghR") |
---|
23 | | - | |
---|
24 | | - | let n = addressFromStringValue("3PCwFXSq8vj8iKitA5zrrLRbuqehfmimpce") |
---|
25 | | - | |
---|
26 | | - | let o = [addressFromStringValue("3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S"), addressFromStringValue("3PEiD1zJWTMZNWSCyzhvBw9pxxAWeEwaghR"), addressFromStringValue("3PCwFXSq8vj8iKitA5zrrLRbuqehfmimpce")] |
---|
27 | | - | |
---|
28 | | - | func p (q,r) = { |
---|
29 | | - | let s = q |
---|
30 | | - | if ($isInstanceOf(s, "Int")) |
---|
31 | | - | then { |
---|
32 | | - | let t = s |
---|
33 | | - | t |
---|
34 | | - | } |
---|
35 | | - | else throw(("wrong type, expected: Int for " + r)) |
---|
36 | | - | } |
---|
37 | | - | |
---|
38 | | - | |
---|
39 | | - | func u (q) = { |
---|
40 | | - | let s = q |
---|
41 | | - | if ($isInstanceOf(s, "(Int, Int, Int, Int, Int, Boolean)")) |
---|
42 | | - | then { |
---|
43 | | - | let q = s |
---|
44 | | - | q |
---|
45 | | - | } |
---|
46 | | - | else { |
---|
47 | | - | let v = s |
---|
48 | | - | throw("expected int5&boolean") |
---|
49 | | - | } |
---|
50 | | - | } |
---|
51 | | - | |
---|
52 | | - | |
---|
53 | | - | @Callable(x) |
---|
54 | | - | func b (y,z) = if ((x.caller != d)) |
---|
55 | | - | then throw("!") |
---|
56 | | - | else { |
---|
57 | | - | let A = assetBalance(m, base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ') |
---|
58 | | - | if ((A == A)) |
---|
59 | | - | then if ((z > A)) |
---|
60 | | - | then throw("!") |
---|
61 | | - | else { |
---|
62 | | - | let B = assetBalance(this, base58'2tVLdi5fQXk2JcuDAojhctnDp5B5PZhNMyj5GUpeC3tZ') |
---|
63 | | - | if ((B == B)) |
---|
64 | | - | then { |
---|
65 | | - | let C = invoke(e, "redeemAtokens", nil, [AttachedPayment(j, y)]) |
---|
66 | | - | if ((C == C)) |
---|
67 | | - | then nil |
---|
68 | | - | else throw("Strict value is not equal to itself.") |
---|
69 | | - | } |
---|
70 | | - | else throw("Strict value is not equal to itself.") |
---|
71 | | - | } |
---|
72 | | - | else throw("Strict value is not equal to itself.") |
---|
73 | | - | } |
---|
74 | | - | |
---|
75 | | - | |
---|
76 | | - | |
---|
77 | | - | @Callable(x) |
---|
78 | | - | func c (y,z) = if ((x.caller != d)) |
---|
79 | | - | then throw("!") |
---|
80 | | - | else { |
---|
81 | | - | let A = assetBalance(m, f) |
---|
82 | | - | if ((A == A)) |
---|
83 | | - | then if ((z > A)) |
---|
84 | | - | then throw("!") |
---|
85 | | - | else { |
---|
86 | | - | let B = assetBalance(this, k) |
---|
87 | | - | if ((B == B)) |
---|
88 | | - | then { |
---|
89 | | - | let C = invoke(e, "redeemAtokens", nil, [AttachedPayment(k, y)]) |
---|
90 | | - | if ((C == C)) |
---|
91 | | - | then nil |
---|
92 | | - | else throw("Strict value is not equal to itself.") |
---|
93 | | - | } |
---|
94 | | - | else throw("Strict value is not equal to itself.") |
---|
95 | | - | } |
---|
96 | | - | else throw("Strict value is not equal to itself.") |
---|
97 | | - | } |
---|
98 | | - | |
---|
99 | | - | |
---|
100 | | - | |
---|
101 | | - | @Callable(x) |
---|
102 | | - | func a () = if ((x.caller != d)) |
---|
103 | | - | then throw("!") |
---|
104 | | - | else { |
---|
105 | | - | let A = assetBalance(m, base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ') |
---|
106 | | - | if ((A == A)) |
---|
107 | | - | then if ((100000000 > A)) |
---|
108 | | - | then throw("!") |
---|
109 | | - | else { |
---|
110 | | - | let B = assetBalance(this, base58'2tVLdi5fQXk2JcuDAojhctnDp5B5PZhNMyj5GUpeC3tZ') |
---|
111 | | - | if ((B == B)) |
---|
112 | | - | then { |
---|
113 | | - | let C = invoke(e, "redeemAtokens", nil, [AttachedPayment(j, min([fraction(A, 100, 119), B]))]) |
---|
114 | | - | if ((C == C)) |
---|
115 | | - | then nil |
---|
116 | | - | else throw("Strict value is not equal to itself.") |
---|
117 | | - | } |
---|
118 | | - | else throw("Strict value is not equal to itself.") |
---|
119 | | - | } |
---|
120 | | - | else throw("Strict value is not equal to itself.") |
---|
121 | | - | } |
---|
122 | | - | |
---|
123 | | - | |
---|
124 | | - | |
---|
125 | | - | @Callable(x) |
---|
126 | | - | func aa () = if ((x.caller != d)) |
---|
127 | | - | then throw("!") |
---|
128 | | - | else { |
---|
129 | | - | let A = assetBalance(l, base58'6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ') |
---|
130 | | - | if ((A == A)) |
---|
131 | | - | then if ((100000000 > A)) |
---|
132 | | - | then throw("!") |
---|
133 | | - | else { |
---|
134 | | - | let B = assetBalance(this, k) |
---|
135 | | - | if ((B == B)) |
---|
136 | | - | then { |
---|
137 | | - | let C = invoke(e, "redeemAtokens", nil, [AttachedPayment(k, min([fraction(A, 100, 121), B]))]) |
---|
138 | | - | if ((C == C)) |
---|
139 | | - | then nil |
---|
140 | | - | else throw("Strict value is not equal to itself.") |
---|
141 | | - | } |
---|
142 | | - | else throw("Strict value is not equal to itself.") |
---|
143 | | - | } |
---|
144 | | - | else throw("Strict value is not equal to itself.") |
---|
145 | | - | } |
---|
146 | | - | |
---|
147 | | - | |
---|
148 | | - | |
---|
149 | | - | @Callable(x) |
---|
150 | | - | func w (D,E,F) = if ((x.caller != d)) |
---|
151 | | - | then throw("!") |
---|
152 | | - | else { |
---|
153 | | - | let G = i[D] |
---|
154 | | - | let H = fromBase58String(G) |
---|
155 | | - | let I = o[D] |
---|
156 | | - | let J = assetBalance(I, H) |
---|
157 | | - | let K = u(invoke(I, "userBalance", [toString(x.caller)], nil)) |
---|
158 | | - | let L = K._1 |
---|
159 | | - | let M = K._2 |
---|
160 | | - | let N = K._3 |
---|
161 | | - | let O = K._4 |
---|
162 | | - | let P = K._5 |
---|
163 | | - | let Q = K._6 |
---|
164 | | - | let R = if ((J > M)) |
---|
165 | | - | then -1 |
---|
166 | | - | else if ((2 > D)) |
---|
167 | | - | then J |
---|
168 | | - | else -1 |
---|
169 | | - | let S = p(invoke(e, "withdraw", [G, R], nil), "result of Vires invoke") |
---|
170 | | - | if (if ((S > F)) |
---|
171 | | - | then true |
---|
172 | | - | else E) |
---|
173 | | - | then nil |
---|
174 | | - | else throw((((((" onPool: " + toString(J)) + ", myBalance:") + toString(M)) + " vf_resp: ") + toString(S))) |
---|
175 | | - | } |
---|
176 | | - | |
---|
177 | | - | |
---|
178 | | - | @Verifier(T) |
---|
179 | | - | func U () = sigVerify_128Kb(T.bodyBytes, T.proofs[0], T.senderPublicKey) |
---|
180 | | - | |
---|
| 1 | + | # no script |
---|