tx · 6hFUb23ozNADNPXnkBa7yHVUErQHMvUYSyCvxMB2AZP3
3MrrZRV6F9ywSejcyd9foJV5ZWXRhiDD6yo: -0.03700000 Waves
2023.03.04 14:23 [2475242] smart account 3MrrZRV6F9ywSejcyd9foJV5ZWXRhiDD6yo > SELF 0.00000000 Waves
{
"type": 13,
"id": "6hFUb23ozNADNPXnkBa7yHVUErQHMvUYSyCvxMB2AZP3",
"fee": 3700000,
"feeAssetId": null,
"timestamp": 1677929014946,
"version": 2,
"chainId": 84,
"sender": "3MrrZRV6F9ywSejcyd9foJV5ZWXRhiDD6yo",
"senderPublicKey": "AzkmMXb1TBA8jfijtZ5hFHMEC6p5hm3e5prwCk1cTVCh",
"proofs": [
"CN1PmrTqagZEDHQBi95oGxo9GqJZSBHkjBMvEgy4eFG37ypzZP5MVWZLjUnSmoQycup4qFm1ZYEKRh9zU6YaaVQ"
],
"script": "base64:BgIXCAISAwoBCBIAEgMKAQESABIAEgMKAQg2AA1rX3RvdGFsU3VwcGx5Ag1rX3RvdGFsU3VwcGx5AA9rX3Jld2FyZEJhbGFuY2UCD2tfcmV3YXJkQmFsYW5jZQAOa19zd2FwX2FkZHJlc3MCDmtfc3dhcF9hZGRyZXNzABBrX2xhc3RVcGRhdGVUaW1lAhBrX2xhc3RVcGRhdGVUaW1lABZrX3Jld2FyZFBlclRva2VuU3RvcmVkAhZrX3Jld2FyZFBlclRva2VuU3RvcmVkAAxrX3Jld2FyZFJhdGUCDGtfcmV3YXJkUmF0ZQAOa19wZXJpb2RGaW5pc2gCDmtfcGVyaW9kRmluaXNoAAlrX2JhbGFuY2UCCWtfYmFsYW5jZQAUa191c2VyUmV3YXJkUGVyVG9rZW4CFGtfdXNlclJld2FyZFBlclRva2VuAAxrX3VzZXJSZXdhcmQCDGtfdXNlclJld2FyZAANa19pbml0aWFsaXplZAINa19pbml0aWFsaXplZAAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzABFrX3N0Y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YWx1ZQEFBWFkbWluCQCsAgIJAKwCAgkArAICAgdzdGF0dXNfCQClCAEFBHRoaXMCAV8JANgEAQgFAnR4AmlkBwkAAgECLnVuYWJsZSB0byB2ZXJpZnk6IGFkbWluIG5vdCBzZXQgaW4gY29vcmRpbmF0b3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXnydWbP",
"height": 2475242,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: FARS8CStsiJ5UHkhXxGtM5poXeby4YJHo2K5aAVahN9Y
Next: none
Diff:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "k_rewardBalance" |
---|
7 | 7 | | |
---|
8 | | - | let c = "k_swapAddress" |
---|
| 8 | + | let c = "k_swap_address" |
---|
9 | 9 | | |
---|
10 | 10 | | let d = "k_lastUpdateTime" |
---|
11 | 11 | | |
---|
|
29 | 29 | | |
---|
30 | 30 | | let n = "k_gov_asset" |
---|
31 | 31 | | |
---|
32 | | - | let o = "k_quote_asset" |
---|
| 32 | + | let o = "k_reward_asset" |
---|
33 | 33 | | |
---|
34 | | - | let p = "k_admin_public_key" |
---|
| 34 | + | let p = "k_admin_address" |
---|
35 | 35 | | |
---|
36 | | - | let q = "k_admin_address" |
---|
37 | | - | |
---|
38 | | - | func r () = valueOrErrorMessage(addressFromString(getStringValue(this, l)), "Coordinator not set") |
---|
| 36 | + | func q () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, l), "Coordinator not set Farming")), "Coordinator address invalid") |
---|
39 | 37 | | |
---|
40 | 38 | | |
---|
41 | | - | func s () = addressFromString(getStringValue(r(), q)) |
---|
| 39 | + | func r () = addressFromString(valueOrErrorMessage(getString(q(), p), "Admin address not set")) |
---|
42 | 40 | | |
---|
43 | 41 | | |
---|
44 | | - | func t () = fromBase58String(getStringValue(r(), p)) |
---|
| 42 | + | func s () = fromBase58String(valueOrErrorMessage(getString(q(), n), "Governance asset not set")) |
---|
45 | 43 | | |
---|
46 | 44 | | |
---|
47 | | - | func u () = fromBase58String(getStringValue(r(), n)) |
---|
| 45 | + | func t () = fromBase58String(valueOrErrorMessage(getString(q(), o), "Reward asset not set")) |
---|
48 | 46 | | |
---|
49 | 47 | | |
---|
50 | | - | func v () = fromBase58String(getStringValue(r(), o)) |
---|
| 48 | + | func u () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(q(), m), "Staking address not set")), "Staking address invalid") |
---|
51 | 49 | | |
---|
52 | 50 | | |
---|
53 | | - | func w () = valueOrErrorMessage(addressFromString(getStringValue(r(), m)), "Staking not set") |
---|
| 51 | + | func v () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(q(), c), "Swap address not set")), "Swap address invalid") |
---|
54 | 52 | | |
---|
55 | 53 | | |
---|
56 | | - | let x = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) |
---|
| 54 | + | let w = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) |
---|
57 | 55 | | |
---|
58 | | - | let y = ((60 * 60) * 24) |
---|
| 56 | + | let x = ((60 * 60) * 24) |
---|
59 | 57 | | |
---|
60 | | - | let z = "" |
---|
| 58 | + | let y = "" |
---|
61 | 59 | | |
---|
62 | | - | let A = 0 |
---|
| 60 | + | let z = 0 |
---|
63 | 61 | | |
---|
64 | | - | func B (C,D) = fraction(C, x, D, HALFEVEN) |
---|
| 62 | + | func A (B,C) = fraction(B, w, C, HALFEVEN) |
---|
65 | 63 | | |
---|
66 | 64 | | |
---|
67 | | - | func E (C,D) = fraction(C, D, x, HALFEVEN) |
---|
| 65 | + | func D (B,C) = fraction(B, C, w, HALFEVEN) |
---|
68 | 66 | | |
---|
69 | 67 | | |
---|
70 | | - | func F (C) = if ((C > 0)) |
---|
71 | | - | then C |
---|
72 | | - | else -(C) |
---|
| 68 | + | func E (B) = if ((B > 0)) |
---|
| 69 | + | then B |
---|
| 70 | + | else -(B) |
---|
73 | 71 | | |
---|
74 | 72 | | |
---|
75 | | - | func G (C,D) = if ((C > D)) |
---|
76 | | - | then D |
---|
77 | | - | else C |
---|
| 73 | + | func F (B,C) = if ((B > C)) |
---|
| 74 | + | then C |
---|
| 75 | + | else B |
---|
78 | 76 | | |
---|
79 | 77 | | |
---|
80 | | - | func H (I,J) = ((I + "_") + J) |
---|
| 78 | + | func G (H,I) = ((H + "_") + I) |
---|
81 | 79 | | |
---|
82 | 80 | | |
---|
83 | | - | func K (L) = valueOrErrorMessage(getInteger(this, L), ("no value for " + L)) |
---|
| 81 | + | func J (K) = valueOrErrorMessage(getInteger(this, K), ("no value for " + K)) |
---|
84 | 82 | | |
---|
85 | 83 | | |
---|
86 | | - | func M (L) = valueOrElse(getInteger(this, L), 0) |
---|
| 84 | + | func L (K) = valueOrElse(getInteger(this, K), 0) |
---|
87 | 85 | | |
---|
88 | 86 | | |
---|
89 | | - | func N () = M(a) |
---|
| 87 | + | func M () = L(a) |
---|
90 | 88 | | |
---|
91 | 89 | | |
---|
92 | | - | func O () = M(e) |
---|
| 90 | + | func N () = L(e) |
---|
93 | 91 | | |
---|
94 | 92 | | |
---|
95 | | - | func P () = M(d) |
---|
| 93 | + | func O () = L(d) |
---|
96 | 94 | | |
---|
97 | 95 | | |
---|
98 | | - | func Q () = M(f) |
---|
| 96 | + | func P () = L(f) |
---|
99 | 97 | | |
---|
100 | 98 | | |
---|
101 | | - | func R () = M(g) |
---|
| 99 | + | func Q () = L(g) |
---|
102 | 100 | | |
---|
103 | 101 | | |
---|
104 | | - | func S () = M(b) |
---|
| 102 | + | func R () = L(b) |
---|
105 | 103 | | |
---|
106 | 104 | | |
---|
107 | | - | func T () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, c), "Now swap address")), "Invalid swap address") |
---|
| 105 | + | func S (T) = L(G(j, T)) |
---|
108 | 106 | | |
---|
109 | 107 | | |
---|
110 | | - | func U (V) = M(H(j, V)) |
---|
| 108 | + | func U (T) = L(G(i, T)) |
---|
111 | 109 | | |
---|
112 | 110 | | |
---|
113 | | - | func W (V) = M(H(i, V)) |
---|
| 111 | + | func V (T) = L(G(h, T)) |
---|
114 | 112 | | |
---|
115 | 113 | | |
---|
116 | | - | func X (V) = M(H(h, V)) |
---|
| 114 | + | func W () = valueOrElse(getBoolean(this, k), false) |
---|
117 | 115 | | |
---|
118 | 116 | | |
---|
119 | | - | func Y () = valueOrElse(getBoolean(this, k), false) |
---|
| 117 | + | func X (Y) = [IntegerEntry(b, (R() + Y))] |
---|
120 | 118 | | |
---|
121 | 119 | | |
---|
122 | | - | func Z (aa) = [IntegerEntry(b, (S() + aa))] |
---|
| 120 | + | func Z (aa) = [IntegerEntry(f, aa)] |
---|
123 | 121 | | |
---|
124 | 122 | | |
---|
125 | | - | func ab (ac) = [IntegerEntry(f, ac)] |
---|
| 123 | + | func ab (ac,ad) = [IntegerEntry(d, ac), IntegerEntry(g, ad)] |
---|
126 | 124 | | |
---|
127 | 125 | | |
---|
128 | | - | func ad (ae,af) = [IntegerEntry(d, ae), IntegerEntry(g, af)] |
---|
| 126 | + | func ae (af) = [IntegerEntry(e, af)] |
---|
129 | 127 | | |
---|
130 | 128 | | |
---|
131 | | - | func ag (ah) = [IntegerEntry(e, ah)] |
---|
| 129 | + | func ag (T,ah,ai) = [IntegerEntry(G(j, T), ah), IntegerEntry(G(i, T), ai)] |
---|
132 | 130 | | |
---|
133 | 131 | | |
---|
134 | | - | func ai (V,aj,ak) = [IntegerEntry(H(j, V), aj), IntegerEntry(H(i, V), ak)] |
---|
| 132 | + | func aj (T,Y) = [IntegerEntry(G(h, T), (V(T) + Y)), IntegerEntry(a, (M() + Y))] |
---|
135 | 133 | | |
---|
136 | 134 | | |
---|
137 | | - | func al (V,aa) = [IntegerEntry(H(h, V), (X(V) + aa)), IntegerEntry(a, (N() + aa))] |
---|
| 135 | + | func ak () = (lastBlock.timestamp / 1000) |
---|
138 | 136 | | |
---|
139 | 137 | | |
---|
140 | | - | func am () = (lastBlock.timestamp / 1000) |
---|
| 138 | + | func al () = F(ak(), Q()) |
---|
141 | 139 | | |
---|
142 | 140 | | |
---|
143 | | - | func an () = G(am(), R()) |
---|
144 | | - | |
---|
145 | | - | |
---|
146 | | - | func ao (ap) = if (((N() + ap) == 0)) |
---|
147 | | - | then O() |
---|
| 141 | + | func am (an) = if (((M() + an) == 0)) |
---|
| 142 | + | then N() |
---|
148 | 143 | | else { |
---|
149 | | - | let aq = (an() - P()) |
---|
150 | | - | let ar = if ((0 > aq)) |
---|
| 144 | + | let ao = (al() - O()) |
---|
| 145 | + | let ap = if ((0 > ao)) |
---|
151 | 146 | | then 0 |
---|
152 | | - | else aq |
---|
153 | | - | let as = B((Q() * ar), (N() + ap)) |
---|
154 | | - | (O() + as) |
---|
| 147 | + | else ao |
---|
| 148 | + | let aq = A((P() * ap), (M() + an)) |
---|
| 149 | + | (N() + aq) |
---|
155 | 150 | | } |
---|
156 | 151 | | |
---|
157 | 152 | | |
---|
158 | | - | func at (V,ap) = { |
---|
159 | | - | let au = (ao(ap) - W(V)) |
---|
160 | | - | (E((X(V) + ap), au) + U(V)) |
---|
| 153 | + | func ar (T,an) = { |
---|
| 154 | + | let as = (am(an) - U(T)) |
---|
| 155 | + | (D((V(T) + an), as) + S(T)) |
---|
161 | 156 | | } |
---|
162 | 157 | | |
---|
163 | 158 | | |
---|
164 | | - | func av (V,ap) = { |
---|
165 | | - | let aw = ao(ap) |
---|
166 | | - | let ax = am() |
---|
167 | | - | let ay = if ((V != "")) |
---|
168 | | - | then $Tuple2(at(V, ap), aw) |
---|
| 159 | + | func at (T,an) = { |
---|
| 160 | + | let au = am(an) |
---|
| 161 | + | let av = ak() |
---|
| 162 | + | let aw = if ((T != "")) |
---|
| 163 | + | then $Tuple2(ar(T, an), au) |
---|
169 | 164 | | else $Tuple2(0, 0) |
---|
170 | | - | let az = ay._1 |
---|
171 | | - | let aA = ay._2 |
---|
172 | | - | $Tuple4(aw, ax, az, aA) |
---|
| 165 | + | let ax = aw._1 |
---|
| 166 | + | let ay = aw._2 |
---|
| 167 | + | $Tuple4(au, av, ax, ay) |
---|
173 | 168 | | } |
---|
174 | 169 | | |
---|
175 | 170 | | |
---|
176 | | - | @Callable(aB) |
---|
177 | | - | func initialize (aC,aD) = if (Y()) |
---|
178 | | - | then throw("Already initialized") |
---|
179 | | - | else [StringEntry(l, aC), StringEntry(c, aD), BooleanEntry(k, true)] |
---|
| 171 | + | @Callable(az) |
---|
| 172 | + | func initialize (aA) = if (if (W()) |
---|
| 173 | + | then true |
---|
| 174 | + | else (az.caller != this)) |
---|
| 175 | + | then throw("Unable to initialize") |
---|
| 176 | + | else [StringEntry(l, toString(addressFromStringValue(aA))), BooleanEntry(k, true)] |
---|
180 | 177 | | |
---|
181 | 178 | | |
---|
182 | 179 | | |
---|
183 | | - | @Callable(aB) |
---|
184 | | - | func setSwap (aD) = if ((aB.caller != s())) |
---|
185 | | - | then throw("Invalid setSwap params") |
---|
186 | | - | else [StringEntry(c, aD)] |
---|
187 | | - | |
---|
188 | | - | |
---|
189 | | - | |
---|
190 | | - | @Callable(aB) |
---|
| 180 | + | @Callable(az) |
---|
191 | 181 | | func stake () = { |
---|
192 | | - | let V = toString(aB.caller) |
---|
193 | | - | let aE = aB.payments[0].amount |
---|
194 | | - | if (if ((aB.payments[0].assetId != u())) |
---|
| 182 | + | let T = toString(az.caller) |
---|
| 183 | + | let aB = az.payments[0].amount |
---|
| 184 | + | if (if ((az.payments[0].assetId != s())) |
---|
195 | 185 | | then true |
---|
196 | | - | else !(Y())) |
---|
| 186 | + | else !(W())) |
---|
197 | 187 | | then throw("Invalid call to stake") |
---|
198 | 188 | | else { |
---|
199 | | - | let aF = av(V, 0) |
---|
200 | | - | let aw = aF._1 |
---|
201 | | - | let ax = aF._2 |
---|
202 | | - | let az = aF._3 |
---|
203 | | - | let aA = aF._4 |
---|
204 | | - | let aG = invoke(w(), "stake", nil, [AttachedPayment(u(), aE)]) |
---|
205 | | - | if ((aG == aG)) |
---|
206 | | - | then (((ai(V, az, aA) ++ ag(aw)) ++ ad(ax, R())) ++ al(V, aE)) |
---|
| 189 | + | let aC = at(T, 0) |
---|
| 190 | + | let au = aC._1 |
---|
| 191 | + | let av = aC._2 |
---|
| 192 | + | let ax = aC._3 |
---|
| 193 | + | let ay = aC._4 |
---|
| 194 | + | let aD = invoke(u(), "stake", nil, [AttachedPayment(s(), aB)]) |
---|
| 195 | + | if ((aD == aD)) |
---|
| 196 | + | then (((ag(T, ax, ay) ++ ae(au)) ++ ab(av, Q())) ++ aj(T, aB)) |
---|
207 | 197 | | else throw("Strict value is not equal to itself.") |
---|
208 | 198 | | } |
---|
209 | 199 | | } |
---|
210 | 200 | | |
---|
211 | 201 | | |
---|
212 | 202 | | |
---|
213 | | - | @Callable(aB) |
---|
214 | | - | func unStake (aE) = { |
---|
215 | | - | let aH = invoke(this, "ackRewards", nil, nil) |
---|
216 | | - | if ((aH == aH)) |
---|
| 203 | + | @Callable(az) |
---|
| 204 | + | func unStake (aB) = { |
---|
| 205 | + | let aE = invoke(this, "ackRewards", nil, nil) |
---|
| 206 | + | if ((aE == aE)) |
---|
217 | 207 | | then { |
---|
218 | | - | let V = toString(aB.caller) |
---|
219 | | - | if (if ((aB.payments != nil)) |
---|
| 208 | + | let T = toString(az.caller) |
---|
| 209 | + | if (if ((az.payments != nil)) |
---|
220 | 210 | | then true |
---|
221 | | - | else !(Y())) |
---|
| 211 | + | else !(W())) |
---|
222 | 212 | | then throw("Invalid unStake parameters") |
---|
223 | 213 | | else { |
---|
224 | | - | let aI = av(V, 0) |
---|
225 | | - | let aw = aI._1 |
---|
226 | | - | let ax = aI._2 |
---|
227 | | - | let az = aI._3 |
---|
228 | | - | let aA = aI._4 |
---|
229 | | - | if ((aE > (X(V) + az))) |
---|
| 214 | + | let aF = at(T, 0) |
---|
| 215 | + | let au = aF._1 |
---|
| 216 | + | let av = aF._2 |
---|
| 217 | + | let ax = aF._3 |
---|
| 218 | + | let ay = aF._4 |
---|
| 219 | + | if ((aB > (V(T) + ax))) |
---|
230 | 220 | | then throw("Invalid unStake parameters") |
---|
231 | 221 | | else { |
---|
232 | | - | let aJ = invoke(w(), "unStake", [aE], nil) |
---|
233 | | - | if ((aJ == aJ)) |
---|
| 222 | + | let aG = invoke(u(), "unStake", [aB], nil) |
---|
| 223 | + | if ((aG == aG)) |
---|
234 | 224 | | then { |
---|
235 | | - | let aK = if ((X(V) >= aE)) |
---|
| 225 | + | let aH = if ((V(T) >= aB)) |
---|
236 | 226 | | then 0 |
---|
237 | | - | else (aE - X(V)) |
---|
238 | | - | let aL = if ((X(V) >= aE)) |
---|
239 | | - | then aE |
---|
240 | | - | else X(V) |
---|
241 | | - | (((((ai(V, (az - aK), aA) ++ ag(aw)) ++ ad(ax, R())) ++ al(V, -(aL))) ++ Z(-(aK))) ++ [ScriptTransfer(aB.caller, aE, u())]) |
---|
| 227 | + | else (aB - V(T)) |
---|
| 228 | + | let aI = if ((V(T) >= aB)) |
---|
| 229 | + | then aB |
---|
| 230 | + | else V(T) |
---|
| 231 | + | (((((ag(T, (ax - aH), ay) ++ ae(au)) ++ ab(av, Q())) ++ aj(T, -(aI))) ++ X(-(aH))) ++ [ScriptTransfer(az.caller, aB, s())]) |
---|
242 | 232 | | } |
---|
243 | 233 | | else throw("Strict value is not equal to itself.") |
---|
244 | 234 | | } |
---|
|
249 | 239 | | |
---|
250 | 240 | | |
---|
251 | 241 | | |
---|
252 | | - | @Callable(aB) |
---|
| 242 | + | @Callable(az) |
---|
253 | 243 | | func withdrawRewards () = { |
---|
254 | | - | let aH = invoke(this, "ackRewards", nil, nil) |
---|
255 | | - | if ((aH == aH)) |
---|
| 244 | + | let aE = invoke(this, "ackRewards", nil, nil) |
---|
| 245 | + | if ((aE == aE)) |
---|
256 | 246 | | then { |
---|
257 | | - | let V = toString(aB.caller) |
---|
258 | | - | let aM = av(V, 0) |
---|
259 | | - | let aw = aM._1 |
---|
260 | | - | let ax = aM._2 |
---|
261 | | - | let az = aM._3 |
---|
262 | | - | let aA = aM._4 |
---|
263 | | - | if (if ((0 >= az)) |
---|
| 247 | + | let T = toString(az.caller) |
---|
| 248 | + | let aJ = at(T, 0) |
---|
| 249 | + | let au = aJ._1 |
---|
| 250 | + | let av = aJ._2 |
---|
| 251 | + | let ax = aJ._3 |
---|
| 252 | + | let ay = aJ._4 |
---|
| 253 | + | if (if ((0 >= ax)) |
---|
264 | 254 | | then true |
---|
265 | | - | else !(Y())) |
---|
| 255 | + | else !(W())) |
---|
266 | 256 | | then throw("No farming reward") |
---|
267 | 257 | | else { |
---|
268 | | - | let aJ = invoke(w(), "unStake", [az], nil) |
---|
269 | | - | if ((aJ == aJ)) |
---|
270 | | - | then ((((ai(V, 0, aA) ++ ag(aw)) ++ ad(ax, R())) ++ Z(-(az))) ++ [ScriptTransfer(aB.caller, az, u())]) |
---|
| 258 | + | let aG = invoke(u(), "unStake", [ax], nil) |
---|
| 259 | + | if ((aG == aG)) |
---|
| 260 | + | then ((((ag(T, 0, ay) ++ ae(au)) ++ ab(av, Q())) ++ X(-(ax))) ++ [ScriptTransfer(az.caller, ax, s())]) |
---|
271 | 261 | | else throw("Strict value is not equal to itself.") |
---|
272 | 262 | | } |
---|
273 | 263 | | } |
---|
|
276 | 266 | | |
---|
277 | 267 | | |
---|
278 | 268 | | |
---|
279 | | - | @Callable(aB) |
---|
| 269 | + | @Callable(az) |
---|
280 | 270 | | func ackRewards () = { |
---|
281 | | - | let aN = invoke(w(), "computeReward", [toString(this)], nil) |
---|
282 | | - | if ((aN == aN)) |
---|
| 271 | + | let aK = invoke(u(), "computeReward", [toString(this)], nil) |
---|
| 272 | + | if ((aK == aK)) |
---|
283 | 273 | | then { |
---|
284 | | - | let aO = { |
---|
285 | | - | let aP = aN |
---|
286 | | - | if ($isInstanceOf(aP, "Int")) |
---|
| 274 | + | let aL = { |
---|
| 275 | + | let aM = aK |
---|
| 276 | + | if ($isInstanceOf(aM, "Int")) |
---|
287 | 277 | | then { |
---|
288 | | - | let aQ = aP |
---|
289 | | - | aQ |
---|
| 278 | + | let aN = aM |
---|
| 279 | + | aN |
---|
290 | 280 | | } |
---|
291 | 281 | | else throw("Reward amount not a number") |
---|
292 | 282 | | } |
---|
293 | | - | if (((1 * x) > aO)) |
---|
| 283 | + | if (((1 * w) > aL)) |
---|
294 | 284 | | then nil |
---|
295 | 285 | | else { |
---|
296 | | - | let aR = invoke(w(), "withdrawRewards", nil, nil) |
---|
297 | | - | if ((aR == aR)) |
---|
| 286 | + | let aO = invoke(u(), "withdrawRewards", nil, nil) |
---|
| 287 | + | if ((aO == aO)) |
---|
298 | 288 | | then { |
---|
299 | | - | let aS = assetBalance(this, v()) |
---|
300 | | - | let aT = invoke(T(), "swap", [toBase58String(u()), 0], [AttachedPayment(v(), aS)]) |
---|
301 | | - | if ((aT == aT)) |
---|
| 289 | + | let aP = assetBalance(this, t()) |
---|
| 290 | + | let aQ = invoke(v(), "swap", [toBase58String(s()), 0], [AttachedPayment(t(), aP)]) |
---|
| 291 | + | if ((aQ == aQ)) |
---|
302 | 292 | | then { |
---|
303 | | - | let au = assetBalance(this, u()) |
---|
304 | | - | if ((au == au)) |
---|
305 | | - | then if ((0 >= au)) |
---|
| 293 | + | let as = assetBalance(this, s()) |
---|
| 294 | + | if ((as == as)) |
---|
| 295 | + | then if ((0 >= as)) |
---|
306 | 296 | | then throw("Invalid ackRewards params") |
---|
307 | 297 | | else { |
---|
308 | | - | let aj = au |
---|
309 | | - | let aw = av(z, A)._1 |
---|
310 | | - | let aU = am() |
---|
311 | | - | let aV = if ((aU > R())) |
---|
312 | | - | then (aj / y) |
---|
| 298 | + | let ah = as |
---|
| 299 | + | let au = at(y, z)._1 |
---|
| 300 | + | let aR = ak() |
---|
| 301 | + | let aS = if ((aR > Q())) |
---|
| 302 | + | then (ah / x) |
---|
313 | 303 | | else { |
---|
314 | | - | let aW = (R() - aU) |
---|
315 | | - | let aX = (Q() * aW) |
---|
316 | | - | ((aj + aX) / y) |
---|
| 304 | + | let aT = (Q() - aR) |
---|
| 305 | + | let aU = (P() * aT) |
---|
| 306 | + | ((ah + aU) / x) |
---|
317 | 307 | | } |
---|
318 | | - | let aG = invoke(w(), "stake", nil, [AttachedPayment(u(), au)]) |
---|
319 | | - | if ((aG == aG)) |
---|
320 | | - | then (((ab(aV) ++ ag(aw)) ++ Z(aj)) ++ ad(aU, (aU + y))) |
---|
| 308 | + | let aD = invoke(u(), "stake", nil, [AttachedPayment(s(), as)]) |
---|
| 309 | + | if ((aD == aD)) |
---|
| 310 | + | then (((Z(aS) ++ ae(au)) ++ X(ah)) ++ ab(aR, (aR + x))) |
---|
321 | 311 | | else throw("Strict value is not equal to itself.") |
---|
322 | 312 | | } |
---|
323 | 313 | | else throw("Strict value is not equal to itself.") |
---|
|
332 | 322 | | |
---|
333 | 323 | | |
---|
334 | 324 | | |
---|
335 | | - | @Callable(aB) |
---|
336 | | - | func view_reward (V) = { |
---|
337 | | - | let az = av(V, 0)._3 |
---|
338 | | - | throw(toString(az)) |
---|
| 325 | + | @Callable(az) |
---|
| 326 | + | func view_reward (T) = { |
---|
| 327 | + | let ax = at(T, 0)._3 |
---|
| 328 | + | throw(toString(ax)) |
---|
339 | 329 | | } |
---|
340 | 330 | | |
---|
341 | 331 | | |
---|
342 | | - | @Verifier(aY) |
---|
343 | | - | func aZ () = sigVerify(aY.bodyBytes, aY.proofs[0], t()) |
---|
| 332 | + | @Verifier(aV) |
---|
| 333 | + | func aW () = { |
---|
| 334 | + | let aX = getString(this, l) |
---|
| 335 | + | if (isDefined(aX)) |
---|
| 336 | + | then { |
---|
| 337 | + | let aY = getString(addressFromStringValue(value(aX)), p) |
---|
| 338 | + | if (isDefined(aY)) |
---|
| 339 | + | then valueOrElse(getBoolean(addressFromStringValue(value(aY)), ((("status_" + toString(this)) + "_") + toBase58String(aV.id))), false) |
---|
| 340 | + | else throw("unable to verify: admin not set in coordinator") |
---|
| 341 | + | } |
---|
| 342 | + | else sigVerify(aV.bodyBytes, aV.proofs[0], aV.senderPublicKey) |
---|
| 343 | + | } |
---|
344 | 344 | | |
---|
Full:
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 | | - | let c = "k_swapAddress" |
---|
| 8 | + | let c = "k_swap_address" |
---|
9 | 9 | | |
---|
10 | 10 | | let d = "k_lastUpdateTime" |
---|
11 | 11 | | |
---|
12 | 12 | | let e = "k_rewardPerTokenStored" |
---|
13 | 13 | | |
---|
14 | 14 | | let f = "k_rewardRate" |
---|
15 | 15 | | |
---|
16 | 16 | | let g = "k_periodFinish" |
---|
17 | 17 | | |
---|
18 | 18 | | let h = "k_balance" |
---|
19 | 19 | | |
---|
20 | 20 | | let i = "k_userRewardPerToken" |
---|
21 | 21 | | |
---|
22 | 22 | | let j = "k_userReward" |
---|
23 | 23 | | |
---|
24 | 24 | | let k = "k_initialized" |
---|
25 | 25 | | |
---|
26 | 26 | | let l = "k_coordinatorAddress" |
---|
27 | 27 | | |
---|
28 | 28 | | let m = "k_staking_address" |
---|
29 | 29 | | |
---|
30 | 30 | | let n = "k_gov_asset" |
---|
31 | 31 | | |
---|
32 | | - | let o = "k_quote_asset" |
---|
| 32 | + | let o = "k_reward_asset" |
---|
33 | 33 | | |
---|
34 | | - | let p = "k_admin_public_key" |
---|
| 34 | + | let p = "k_admin_address" |
---|
35 | 35 | | |
---|
36 | | - | let q = "k_admin_address" |
---|
37 | | - | |
---|
38 | | - | func r () = valueOrErrorMessage(addressFromString(getStringValue(this, l)), "Coordinator not set") |
---|
| 36 | + | func q () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, l), "Coordinator not set Farming")), "Coordinator address invalid") |
---|
39 | 37 | | |
---|
40 | 38 | | |
---|
41 | | - | func s () = addressFromString(getStringValue(r(), q)) |
---|
| 39 | + | func r () = addressFromString(valueOrErrorMessage(getString(q(), p), "Admin address not set")) |
---|
42 | 40 | | |
---|
43 | 41 | | |
---|
44 | | - | func t () = fromBase58String(getStringValue(r(), p)) |
---|
| 42 | + | func s () = fromBase58String(valueOrErrorMessage(getString(q(), n), "Governance asset not set")) |
---|
45 | 43 | | |
---|
46 | 44 | | |
---|
47 | | - | func u () = fromBase58String(getStringValue(r(), n)) |
---|
| 45 | + | func t () = fromBase58String(valueOrErrorMessage(getString(q(), o), "Reward asset not set")) |
---|
48 | 46 | | |
---|
49 | 47 | | |
---|
50 | | - | func v () = fromBase58String(getStringValue(r(), o)) |
---|
| 48 | + | func u () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(q(), m), "Staking address not set")), "Staking address invalid") |
---|
51 | 49 | | |
---|
52 | 50 | | |
---|
53 | | - | func w () = valueOrErrorMessage(addressFromString(getStringValue(r(), m)), "Staking not set") |
---|
| 51 | + | func v () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(q(), c), "Swap address not set")), "Swap address invalid") |
---|
54 | 52 | | |
---|
55 | 53 | | |
---|
56 | | - | let x = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) |
---|
| 54 | + | let w = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) |
---|
57 | 55 | | |
---|
58 | | - | let y = ((60 * 60) * 24) |
---|
| 56 | + | let x = ((60 * 60) * 24) |
---|
59 | 57 | | |
---|
60 | | - | let z = "" |
---|
| 58 | + | let y = "" |
---|
61 | 59 | | |
---|
62 | | - | let A = 0 |
---|
| 60 | + | let z = 0 |
---|
63 | 61 | | |
---|
64 | | - | func B (C,D) = fraction(C, x, D, HALFEVEN) |
---|
| 62 | + | func A (B,C) = fraction(B, w, C, HALFEVEN) |
---|
65 | 63 | | |
---|
66 | 64 | | |
---|
67 | | - | func E (C,D) = fraction(C, D, x, HALFEVEN) |
---|
| 65 | + | func D (B,C) = fraction(B, C, w, HALFEVEN) |
---|
68 | 66 | | |
---|
69 | 67 | | |
---|
70 | | - | func F (C) = if ((C > 0)) |
---|
71 | | - | then C |
---|
72 | | - | else -(C) |
---|
| 68 | + | func E (B) = if ((B > 0)) |
---|
| 69 | + | then B |
---|
| 70 | + | else -(B) |
---|
73 | 71 | | |
---|
74 | 72 | | |
---|
75 | | - | func G (C,D) = if ((C > D)) |
---|
76 | | - | then D |
---|
77 | | - | else C |
---|
| 73 | + | func F (B,C) = if ((B > C)) |
---|
| 74 | + | then C |
---|
| 75 | + | else B |
---|
78 | 76 | | |
---|
79 | 77 | | |
---|
80 | | - | func H (I,J) = ((I + "_") + J) |
---|
| 78 | + | func G (H,I) = ((H + "_") + I) |
---|
81 | 79 | | |
---|
82 | 80 | | |
---|
83 | | - | func K (L) = valueOrErrorMessage(getInteger(this, L), ("no value for " + L)) |
---|
| 81 | + | func J (K) = valueOrErrorMessage(getInteger(this, K), ("no value for " + K)) |
---|
84 | 82 | | |
---|
85 | 83 | | |
---|
86 | | - | func M (L) = valueOrElse(getInteger(this, L), 0) |
---|
| 84 | + | func L (K) = valueOrElse(getInteger(this, K), 0) |
---|
87 | 85 | | |
---|
88 | 86 | | |
---|
89 | | - | func N () = M(a) |
---|
| 87 | + | func M () = L(a) |
---|
90 | 88 | | |
---|
91 | 89 | | |
---|
92 | | - | func O () = M(e) |
---|
| 90 | + | func N () = L(e) |
---|
93 | 91 | | |
---|
94 | 92 | | |
---|
95 | | - | func P () = M(d) |
---|
| 93 | + | func O () = L(d) |
---|
96 | 94 | | |
---|
97 | 95 | | |
---|
98 | | - | func Q () = M(f) |
---|
| 96 | + | func P () = L(f) |
---|
99 | 97 | | |
---|
100 | 98 | | |
---|
101 | | - | func R () = M(g) |
---|
| 99 | + | func Q () = L(g) |
---|
102 | 100 | | |
---|
103 | 101 | | |
---|
104 | | - | func S () = M(b) |
---|
| 102 | + | func R () = L(b) |
---|
105 | 103 | | |
---|
106 | 104 | | |
---|
107 | | - | func T () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, c), "Now swap address")), "Invalid swap address") |
---|
| 105 | + | func S (T) = L(G(j, T)) |
---|
108 | 106 | | |
---|
109 | 107 | | |
---|
110 | | - | func U (V) = M(H(j, V)) |
---|
| 108 | + | func U (T) = L(G(i, T)) |
---|
111 | 109 | | |
---|
112 | 110 | | |
---|
113 | | - | func W (V) = M(H(i, V)) |
---|
| 111 | + | func V (T) = L(G(h, T)) |
---|
114 | 112 | | |
---|
115 | 113 | | |
---|
116 | | - | func X (V) = M(H(h, V)) |
---|
| 114 | + | func W () = valueOrElse(getBoolean(this, k), false) |
---|
117 | 115 | | |
---|
118 | 116 | | |
---|
119 | | - | func Y () = valueOrElse(getBoolean(this, k), false) |
---|
| 117 | + | func X (Y) = [IntegerEntry(b, (R() + Y))] |
---|
120 | 118 | | |
---|
121 | 119 | | |
---|
122 | | - | func Z (aa) = [IntegerEntry(b, (S() + aa))] |
---|
| 120 | + | func Z (aa) = [IntegerEntry(f, aa)] |
---|
123 | 121 | | |
---|
124 | 122 | | |
---|
125 | | - | func ab (ac) = [IntegerEntry(f, ac)] |
---|
| 123 | + | func ab (ac,ad) = [IntegerEntry(d, ac), IntegerEntry(g, ad)] |
---|
126 | 124 | | |
---|
127 | 125 | | |
---|
128 | | - | func ad (ae,af) = [IntegerEntry(d, ae), IntegerEntry(g, af)] |
---|
| 126 | + | func ae (af) = [IntegerEntry(e, af)] |
---|
129 | 127 | | |
---|
130 | 128 | | |
---|
131 | | - | func ag (ah) = [IntegerEntry(e, ah)] |
---|
| 129 | + | func ag (T,ah,ai) = [IntegerEntry(G(j, T), ah), IntegerEntry(G(i, T), ai)] |
---|
132 | 130 | | |
---|
133 | 131 | | |
---|
134 | | - | func ai (V,aj,ak) = [IntegerEntry(H(j, V), aj), IntegerEntry(H(i, V), ak)] |
---|
| 132 | + | func aj (T,Y) = [IntegerEntry(G(h, T), (V(T) + Y)), IntegerEntry(a, (M() + Y))] |
---|
135 | 133 | | |
---|
136 | 134 | | |
---|
137 | | - | func al (V,aa) = [IntegerEntry(H(h, V), (X(V) + aa)), IntegerEntry(a, (N() + aa))] |
---|
| 135 | + | func ak () = (lastBlock.timestamp / 1000) |
---|
138 | 136 | | |
---|
139 | 137 | | |
---|
140 | | - | func am () = (lastBlock.timestamp / 1000) |
---|
| 138 | + | func al () = F(ak(), Q()) |
---|
141 | 139 | | |
---|
142 | 140 | | |
---|
143 | | - | func an () = G(am(), R()) |
---|
144 | | - | |
---|
145 | | - | |
---|
146 | | - | func ao (ap) = if (((N() + ap) == 0)) |
---|
147 | | - | then O() |
---|
| 141 | + | func am (an) = if (((M() + an) == 0)) |
---|
| 142 | + | then N() |
---|
148 | 143 | | else { |
---|
149 | | - | let aq = (an() - P()) |
---|
150 | | - | let ar = if ((0 > aq)) |
---|
| 144 | + | let ao = (al() - O()) |
---|
| 145 | + | let ap = if ((0 > ao)) |
---|
151 | 146 | | then 0 |
---|
152 | | - | else aq |
---|
153 | | - | let as = B((Q() * ar), (N() + ap)) |
---|
154 | | - | (O() + as) |
---|
| 147 | + | else ao |
---|
| 148 | + | let aq = A((P() * ap), (M() + an)) |
---|
| 149 | + | (N() + aq) |
---|
155 | 150 | | } |
---|
156 | 151 | | |
---|
157 | 152 | | |
---|
158 | | - | func at (V,ap) = { |
---|
159 | | - | let au = (ao(ap) - W(V)) |
---|
160 | | - | (E((X(V) + ap), au) + U(V)) |
---|
| 153 | + | func ar (T,an) = { |
---|
| 154 | + | let as = (am(an) - U(T)) |
---|
| 155 | + | (D((V(T) + an), as) + S(T)) |
---|
161 | 156 | | } |
---|
162 | 157 | | |
---|
163 | 158 | | |
---|
164 | | - | func av (V,ap) = { |
---|
165 | | - | let aw = ao(ap) |
---|
166 | | - | let ax = am() |
---|
167 | | - | let ay = if ((V != "")) |
---|
168 | | - | then $Tuple2(at(V, ap), aw) |
---|
| 159 | + | func at (T,an) = { |
---|
| 160 | + | let au = am(an) |
---|
| 161 | + | let av = ak() |
---|
| 162 | + | let aw = if ((T != "")) |
---|
| 163 | + | then $Tuple2(ar(T, an), au) |
---|
169 | 164 | | else $Tuple2(0, 0) |
---|
170 | | - | let az = ay._1 |
---|
171 | | - | let aA = ay._2 |
---|
172 | | - | $Tuple4(aw, ax, az, aA) |
---|
| 165 | + | let ax = aw._1 |
---|
| 166 | + | let ay = aw._2 |
---|
| 167 | + | $Tuple4(au, av, ax, ay) |
---|
173 | 168 | | } |
---|
174 | 169 | | |
---|
175 | 170 | | |
---|
176 | | - | @Callable(aB) |
---|
177 | | - | func initialize (aC,aD) = if (Y()) |
---|
178 | | - | then throw("Already initialized") |
---|
179 | | - | else [StringEntry(l, aC), StringEntry(c, aD), BooleanEntry(k, true)] |
---|
| 171 | + | @Callable(az) |
---|
| 172 | + | func initialize (aA) = if (if (W()) |
---|
| 173 | + | then true |
---|
| 174 | + | else (az.caller != this)) |
---|
| 175 | + | then throw("Unable to initialize") |
---|
| 176 | + | else [StringEntry(l, toString(addressFromStringValue(aA))), BooleanEntry(k, true)] |
---|
180 | 177 | | |
---|
181 | 178 | | |
---|
182 | 179 | | |
---|
183 | | - | @Callable(aB) |
---|
184 | | - | func setSwap (aD) = if ((aB.caller != s())) |
---|
185 | | - | then throw("Invalid setSwap params") |
---|
186 | | - | else [StringEntry(c, aD)] |
---|
187 | | - | |
---|
188 | | - | |
---|
189 | | - | |
---|
190 | | - | @Callable(aB) |
---|
| 180 | + | @Callable(az) |
---|
191 | 181 | | func stake () = { |
---|
192 | | - | let V = toString(aB.caller) |
---|
193 | | - | let aE = aB.payments[0].amount |
---|
194 | | - | if (if ((aB.payments[0].assetId != u())) |
---|
| 182 | + | let T = toString(az.caller) |
---|
| 183 | + | let aB = az.payments[0].amount |
---|
| 184 | + | if (if ((az.payments[0].assetId != s())) |
---|
195 | 185 | | then true |
---|
196 | | - | else !(Y())) |
---|
| 186 | + | else !(W())) |
---|
197 | 187 | | then throw("Invalid call to stake") |
---|
198 | 188 | | else { |
---|
199 | | - | let aF = av(V, 0) |
---|
200 | | - | let aw = aF._1 |
---|
201 | | - | let ax = aF._2 |
---|
202 | | - | let az = aF._3 |
---|
203 | | - | let aA = aF._4 |
---|
204 | | - | let aG = invoke(w(), "stake", nil, [AttachedPayment(u(), aE)]) |
---|
205 | | - | if ((aG == aG)) |
---|
206 | | - | then (((ai(V, az, aA) ++ ag(aw)) ++ ad(ax, R())) ++ al(V, aE)) |
---|
| 189 | + | let aC = at(T, 0) |
---|
| 190 | + | let au = aC._1 |
---|
| 191 | + | let av = aC._2 |
---|
| 192 | + | let ax = aC._3 |
---|
| 193 | + | let ay = aC._4 |
---|
| 194 | + | let aD = invoke(u(), "stake", nil, [AttachedPayment(s(), aB)]) |
---|
| 195 | + | if ((aD == aD)) |
---|
| 196 | + | then (((ag(T, ax, ay) ++ ae(au)) ++ ab(av, Q())) ++ aj(T, aB)) |
---|
207 | 197 | | else throw("Strict value is not equal to itself.") |
---|
208 | 198 | | } |
---|
209 | 199 | | } |
---|
210 | 200 | | |
---|
211 | 201 | | |
---|
212 | 202 | | |
---|
213 | | - | @Callable(aB) |
---|
214 | | - | func unStake (aE) = { |
---|
215 | | - | let aH = invoke(this, "ackRewards", nil, nil) |
---|
216 | | - | if ((aH == aH)) |
---|
| 203 | + | @Callable(az) |
---|
| 204 | + | func unStake (aB) = { |
---|
| 205 | + | let aE = invoke(this, "ackRewards", nil, nil) |
---|
| 206 | + | if ((aE == aE)) |
---|
217 | 207 | | then { |
---|
218 | | - | let V = toString(aB.caller) |
---|
219 | | - | if (if ((aB.payments != nil)) |
---|
| 208 | + | let T = toString(az.caller) |
---|
| 209 | + | if (if ((az.payments != nil)) |
---|
220 | 210 | | then true |
---|
221 | | - | else !(Y())) |
---|
| 211 | + | else !(W())) |
---|
222 | 212 | | then throw("Invalid unStake parameters") |
---|
223 | 213 | | else { |
---|
224 | | - | let aI = av(V, 0) |
---|
225 | | - | let aw = aI._1 |
---|
226 | | - | let ax = aI._2 |
---|
227 | | - | let az = aI._3 |
---|
228 | | - | let aA = aI._4 |
---|
229 | | - | if ((aE > (X(V) + az))) |
---|
| 214 | + | let aF = at(T, 0) |
---|
| 215 | + | let au = aF._1 |
---|
| 216 | + | let av = aF._2 |
---|
| 217 | + | let ax = aF._3 |
---|
| 218 | + | let ay = aF._4 |
---|
| 219 | + | if ((aB > (V(T) + ax))) |
---|
230 | 220 | | then throw("Invalid unStake parameters") |
---|
231 | 221 | | else { |
---|
232 | | - | let aJ = invoke(w(), "unStake", [aE], nil) |
---|
233 | | - | if ((aJ == aJ)) |
---|
| 222 | + | let aG = invoke(u(), "unStake", [aB], nil) |
---|
| 223 | + | if ((aG == aG)) |
---|
234 | 224 | | then { |
---|
235 | | - | let aK = if ((X(V) >= aE)) |
---|
| 225 | + | let aH = if ((V(T) >= aB)) |
---|
236 | 226 | | then 0 |
---|
237 | | - | else (aE - X(V)) |
---|
238 | | - | let aL = if ((X(V) >= aE)) |
---|
239 | | - | then aE |
---|
240 | | - | else X(V) |
---|
241 | | - | (((((ai(V, (az - aK), aA) ++ ag(aw)) ++ ad(ax, R())) ++ al(V, -(aL))) ++ Z(-(aK))) ++ [ScriptTransfer(aB.caller, aE, u())]) |
---|
| 227 | + | else (aB - V(T)) |
---|
| 228 | + | let aI = if ((V(T) >= aB)) |
---|
| 229 | + | then aB |
---|
| 230 | + | else V(T) |
---|
| 231 | + | (((((ag(T, (ax - aH), ay) ++ ae(au)) ++ ab(av, Q())) ++ aj(T, -(aI))) ++ X(-(aH))) ++ [ScriptTransfer(az.caller, aB, s())]) |
---|
242 | 232 | | } |
---|
243 | 233 | | else throw("Strict value is not equal to itself.") |
---|
244 | 234 | | } |
---|
245 | 235 | | } |
---|
246 | 236 | | } |
---|
247 | 237 | | else throw("Strict value is not equal to itself.") |
---|
248 | 238 | | } |
---|
249 | 239 | | |
---|
250 | 240 | | |
---|
251 | 241 | | |
---|
252 | | - | @Callable(aB) |
---|
| 242 | + | @Callable(az) |
---|
253 | 243 | | func withdrawRewards () = { |
---|
254 | | - | let aH = invoke(this, "ackRewards", nil, nil) |
---|
255 | | - | if ((aH == aH)) |
---|
| 244 | + | let aE = invoke(this, "ackRewards", nil, nil) |
---|
| 245 | + | if ((aE == aE)) |
---|
256 | 246 | | then { |
---|
257 | | - | let V = toString(aB.caller) |
---|
258 | | - | let aM = av(V, 0) |
---|
259 | | - | let aw = aM._1 |
---|
260 | | - | let ax = aM._2 |
---|
261 | | - | let az = aM._3 |
---|
262 | | - | let aA = aM._4 |
---|
263 | | - | if (if ((0 >= az)) |
---|
| 247 | + | let T = toString(az.caller) |
---|
| 248 | + | let aJ = at(T, 0) |
---|
| 249 | + | let au = aJ._1 |
---|
| 250 | + | let av = aJ._2 |
---|
| 251 | + | let ax = aJ._3 |
---|
| 252 | + | let ay = aJ._4 |
---|
| 253 | + | if (if ((0 >= ax)) |
---|
264 | 254 | | then true |
---|
265 | | - | else !(Y())) |
---|
| 255 | + | else !(W())) |
---|
266 | 256 | | then throw("No farming reward") |
---|
267 | 257 | | else { |
---|
268 | | - | let aJ = invoke(w(), "unStake", [az], nil) |
---|
269 | | - | if ((aJ == aJ)) |
---|
270 | | - | then ((((ai(V, 0, aA) ++ ag(aw)) ++ ad(ax, R())) ++ Z(-(az))) ++ [ScriptTransfer(aB.caller, az, u())]) |
---|
| 258 | + | let aG = invoke(u(), "unStake", [ax], nil) |
---|
| 259 | + | if ((aG == aG)) |
---|
| 260 | + | then ((((ag(T, 0, ay) ++ ae(au)) ++ ab(av, Q())) ++ X(-(ax))) ++ [ScriptTransfer(az.caller, ax, s())]) |
---|
271 | 261 | | else throw("Strict value is not equal to itself.") |
---|
272 | 262 | | } |
---|
273 | 263 | | } |
---|
274 | 264 | | else throw("Strict value is not equal to itself.") |
---|
275 | 265 | | } |
---|
276 | 266 | | |
---|
277 | 267 | | |
---|
278 | 268 | | |
---|
279 | | - | @Callable(aB) |
---|
| 269 | + | @Callable(az) |
---|
280 | 270 | | func ackRewards () = { |
---|
281 | | - | let aN = invoke(w(), "computeReward", [toString(this)], nil) |
---|
282 | | - | if ((aN == aN)) |
---|
| 271 | + | let aK = invoke(u(), "computeReward", [toString(this)], nil) |
---|
| 272 | + | if ((aK == aK)) |
---|
283 | 273 | | then { |
---|
284 | | - | let aO = { |
---|
285 | | - | let aP = aN |
---|
286 | | - | if ($isInstanceOf(aP, "Int")) |
---|
| 274 | + | let aL = { |
---|
| 275 | + | let aM = aK |
---|
| 276 | + | if ($isInstanceOf(aM, "Int")) |
---|
287 | 277 | | then { |
---|
288 | | - | let aQ = aP |
---|
289 | | - | aQ |
---|
| 278 | + | let aN = aM |
---|
| 279 | + | aN |
---|
290 | 280 | | } |
---|
291 | 281 | | else throw("Reward amount not a number") |
---|
292 | 282 | | } |
---|
293 | | - | if (((1 * x) > aO)) |
---|
| 283 | + | if (((1 * w) > aL)) |
---|
294 | 284 | | then nil |
---|
295 | 285 | | else { |
---|
296 | | - | let aR = invoke(w(), "withdrawRewards", nil, nil) |
---|
297 | | - | if ((aR == aR)) |
---|
| 286 | + | let aO = invoke(u(), "withdrawRewards", nil, nil) |
---|
| 287 | + | if ((aO == aO)) |
---|
298 | 288 | | then { |
---|
299 | | - | let aS = assetBalance(this, v()) |
---|
300 | | - | let aT = invoke(T(), "swap", [toBase58String(u()), 0], [AttachedPayment(v(), aS)]) |
---|
301 | | - | if ((aT == aT)) |
---|
| 289 | + | let aP = assetBalance(this, t()) |
---|
| 290 | + | let aQ = invoke(v(), "swap", [toBase58String(s()), 0], [AttachedPayment(t(), aP)]) |
---|
| 291 | + | if ((aQ == aQ)) |
---|
302 | 292 | | then { |
---|
303 | | - | let au = assetBalance(this, u()) |
---|
304 | | - | if ((au == au)) |
---|
305 | | - | then if ((0 >= au)) |
---|
| 293 | + | let as = assetBalance(this, s()) |
---|
| 294 | + | if ((as == as)) |
---|
| 295 | + | then if ((0 >= as)) |
---|
306 | 296 | | then throw("Invalid ackRewards params") |
---|
307 | 297 | | else { |
---|
308 | | - | let aj = au |
---|
309 | | - | let aw = av(z, A)._1 |
---|
310 | | - | let aU = am() |
---|
311 | | - | let aV = if ((aU > R())) |
---|
312 | | - | then (aj / y) |
---|
| 298 | + | let ah = as |
---|
| 299 | + | let au = at(y, z)._1 |
---|
| 300 | + | let aR = ak() |
---|
| 301 | + | let aS = if ((aR > Q())) |
---|
| 302 | + | then (ah / x) |
---|
313 | 303 | | else { |
---|
314 | | - | let aW = (R() - aU) |
---|
315 | | - | let aX = (Q() * aW) |
---|
316 | | - | ((aj + aX) / y) |
---|
| 304 | + | let aT = (Q() - aR) |
---|
| 305 | + | let aU = (P() * aT) |
---|
| 306 | + | ((ah + aU) / x) |
---|
317 | 307 | | } |
---|
318 | | - | let aG = invoke(w(), "stake", nil, [AttachedPayment(u(), au)]) |
---|
319 | | - | if ((aG == aG)) |
---|
320 | | - | then (((ab(aV) ++ ag(aw)) ++ Z(aj)) ++ ad(aU, (aU + y))) |
---|
| 308 | + | let aD = invoke(u(), "stake", nil, [AttachedPayment(s(), as)]) |
---|
| 309 | + | if ((aD == aD)) |
---|
| 310 | + | then (((Z(aS) ++ ae(au)) ++ X(ah)) ++ ab(aR, (aR + x))) |
---|
321 | 311 | | else throw("Strict value is not equal to itself.") |
---|
322 | 312 | | } |
---|
323 | 313 | | else throw("Strict value is not equal to itself.") |
---|
324 | 314 | | } |
---|
325 | 315 | | else throw("Strict value is not equal to itself.") |
---|
326 | 316 | | } |
---|
327 | 317 | | else throw("Strict value is not equal to itself.") |
---|
328 | 318 | | } |
---|
329 | 319 | | } |
---|
330 | 320 | | else throw("Strict value is not equal to itself.") |
---|
331 | 321 | | } |
---|
332 | 322 | | |
---|
333 | 323 | | |
---|
334 | 324 | | |
---|
335 | | - | @Callable(aB) |
---|
336 | | - | func view_reward (V) = { |
---|
337 | | - | let az = av(V, 0)._3 |
---|
338 | | - | throw(toString(az)) |
---|
| 325 | + | @Callable(az) |
---|
| 326 | + | func view_reward (T) = { |
---|
| 327 | + | let ax = at(T, 0)._3 |
---|
| 328 | + | throw(toString(ax)) |
---|
339 | 329 | | } |
---|
340 | 330 | | |
---|
341 | 331 | | |
---|
342 | | - | @Verifier(aY) |
---|
343 | | - | func aZ () = sigVerify(aY.bodyBytes, aY.proofs[0], t()) |
---|
| 332 | + | @Verifier(aV) |
---|
| 333 | + | func aW () = { |
---|
| 334 | + | let aX = getString(this, l) |
---|
| 335 | + | if (isDefined(aX)) |
---|
| 336 | + | then { |
---|
| 337 | + | let aY = getString(addressFromStringValue(value(aX)), p) |
---|
| 338 | + | if (isDefined(aY)) |
---|
| 339 | + | then valueOrElse(getBoolean(addressFromStringValue(value(aY)), ((("status_" + toString(this)) + "_") + toBase58String(aV.id))), false) |
---|
| 340 | + | else throw("unable to verify: admin not set in coordinator") |
---|
| 341 | + | } |
---|
| 342 | + | else sigVerify(aV.bodyBytes, aV.proofs[0], aV.senderPublicKey) |
---|
| 343 | + | } |
---|
344 | 344 | | |
---|