tx · BRosojsJKoFNKPiYssrjPYHDcgvS1ykN9KP3HJKfmtD2 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy: -0.02600000 Waves 2023.09.07 12:25 [2744785] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves
{ "type": 13, "id": "BRosojsJKoFNKPiYssrjPYHDcgvS1ykN9KP3HJKfmtD2", "fee": 2600000, "feeAssetId": null, "timestamp": 1694078798319, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "2dp98mBG8QpETiXXK7EF7sHUQ25VmCo4TXs7PDLHbNdPFeJHXKYbGgPkFjyQzFvT4HsHfkCwuTxdV33vdcRc6BJB" ], "script": "base64:BgK2LQgCEgUKAwEIAhIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgSABIAEgUKAwgIBBIDCgEIEgMKAQgSBAoCCAgSBAoCCAgSAwoBBCIDU0VQIgZTQ0FMRTgiBU1VTFQ4Ig5QT09MV0VJR0hUTVVMVCIQY29udHJhY3RGaWxlbmFtZSIHU0NBTEUxOCIGTVVMVDE4IghNVUxUMThCSSIOREVDQVlfQ09OU1RBTlQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiD2dldFN0cmluZ09yRmFpbCIHYWRkcmVzcyIDa2V5IgxnZXRJbnRPclplcm8iD2dldEludE9yRGVmYXVsdCIKZGVmYXVsdFZhbCIMZ2V0SW50T3JGYWlsIgNhYnMiA3ZhbCIOZW5zdXJlUG9zaXRpdmUiAXYiAW0iG2tleVJlZmVycmFsc0NvbnRyYWN0QWRkcmVzcyIecmVmZXJyYWxzQ29udHJhY3RBZGRyZXNzT3JGYWlsIhZrZXlSZWZlcnJhbFByb2dyYW1OYW1lIhpyZWZlcnJhbFByb2dyYW1OYW1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UQUCYUoFAmFRAwkAAQIFAmFKAgRVbml0CAUCZVYPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmVWCWJvZHlCeXRlcwkAkQMCCAUCZVYGcHJvb2ZzAAAFAmVYVftOcw==", "height": 2744785, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ALkviD9fwAUxiJqz1Ny53Dun1JkugHS5rUb4nCH6Cttv Next: HAKq5ZPxuNdEToBdxVMkftzGhJnyUaW8BhJUy82p8QWi Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let d = c | |
11 | 11 | ||
12 | - | func e (f) = makeString(["boosting.ride:", f], " ") | |
12 | + | let e = "boosting.ride" | |
13 | + | ||
14 | + | let f = 18 | |
15 | + | ||
16 | + | let g = 1000000000000000000 | |
17 | + | ||
18 | + | let h = toBigInt(g) | |
19 | + | ||
20 | + | let i = 8 | |
21 | + | ||
22 | + | func j (k) = makeString([e, ": ", k], "") | |
13 | 23 | ||
14 | 24 | ||
15 | - | func | |
25 | + | func l (k) = throw(j(k)) | |
16 | 26 | ||
17 | 27 | ||
18 | - | func | |
28 | + | func m (n,o) = valueOrErrorMessage(getString(n, o), j((("mandatory this." + o) + " is not defined"))) | |
19 | 29 | ||
20 | 30 | ||
21 | - | func | |
31 | + | func p (n,o) = valueOrElse(getInteger(n, o), 0) | |
22 | 32 | ||
23 | 33 | ||
24 | - | func | |
34 | + | func q (n,o,r) = valueOrElse(getInteger(n, o), r) | |
25 | 35 | ||
26 | 36 | ||
27 | - | func | |
37 | + | func s (n,o) = valueOrErrorMessage(getInteger(n, o), j((("mandatory this." + o) + " is not defined"))) | |
28 | 38 | ||
29 | 39 | ||
30 | - | func | |
31 | - | then -( | |
32 | - | else | |
40 | + | func t (u) = if ((0 > u)) | |
41 | + | then -(u) | |
42 | + | else u | |
33 | 43 | ||
34 | 44 | ||
35 | - | func q (p) = { | |
36 | - | let r = p | |
37 | - | if ($isInstanceOf(r, "List[Any]")) | |
38 | - | then { | |
39 | - | let s = r | |
40 | - | s | |
41 | - | } | |
42 | - | else g("fail to cast into List[Any]") | |
43 | - | } | |
45 | + | func v (w,x) = if ((w >= 0)) | |
46 | + | then w | |
47 | + | else l((valueOrElse(x, "value") + " should be positive")) | |
44 | 48 | ||
45 | 49 | ||
46 | - | func t (p) = { | |
47 | - | let r = p | |
48 | - | if ($isInstanceOf(r, "Int")) | |
49 | - | then { | |
50 | - | let u = r | |
51 | - | u | |
52 | - | } | |
53 | - | else g("fail to cast into Int") | |
54 | - | } | |
50 | + | func y () = makeString(["%s%s", "config", "referralsContractAddress"], a) | |
55 | 51 | ||
56 | 52 | ||
57 | - | func v () = makeString(["%s%s", "config", "referralsContractAddress"], a) | |
53 | + | let z = addressFromStringValue(m(this, y())) | |
54 | + | ||
55 | + | let A = makeString(["%s%s", "referral", "programName"], a) | |
56 | + | ||
57 | + | let B = "wxlock" | |
58 | + | ||
59 | + | let C = valueOrElse(getString(this, A), B) | |
60 | + | ||
61 | + | func D () = "%s%s__config__factoryAddress" | |
58 | 62 | ||
59 | 63 | ||
60 | - | let | |
64 | + | let E = 1 | |
61 | 65 | ||
62 | - | let | |
66 | + | let F = 2 | |
63 | 67 | ||
64 | - | let | |
68 | + | let G = 3 | |
65 | 69 | ||
66 | - | let | |
70 | + | let H = 4 | |
67 | 71 | ||
68 | - | func A () = "%s%s__config__factoryAddress" | |
72 | + | let I = 5 | |
73 | + | ||
74 | + | let J = 6 | |
75 | + | ||
76 | + | let K = 7 | |
77 | + | ||
78 | + | let L = 8 | |
79 | + | ||
80 | + | let M = 9 | |
81 | + | ||
82 | + | let N = 10 | |
83 | + | ||
84 | + | let O = 11 | |
85 | + | ||
86 | + | func P () = "%s__factoryConfig" | |
69 | 87 | ||
70 | 88 | ||
71 | - | let B = 1 | |
72 | - | ||
73 | - | let C = 2 | |
74 | - | ||
75 | - | let D = 3 | |
76 | - | ||
77 | - | let E = 4 | |
78 | - | ||
79 | - | let F = 5 | |
80 | - | ||
81 | - | let G = 6 | |
82 | - | ||
83 | - | let H = 7 | |
84 | - | ||
85 | - | let I = 8 | |
86 | - | ||
87 | - | let J = 9 | |
88 | - | ||
89 | - | let K = 10 | |
90 | - | ||
91 | - | let L = 11 | |
92 | - | ||
93 | - | func M () = "%s__factoryConfig" | |
89 | + | func Q (R) = makeString(["%s%s%s", R, "mappings__lpAsset2PoolContract"], a) | |
94 | 90 | ||
95 | 91 | ||
96 | - | func | |
92 | + | func S (T) = makeString(["%s%s", "poolWeight", T], a) | |
97 | 93 | ||
98 | 94 | ||
99 | - | func | |
95 | + | func U (V,W) = ((("%s%s__poolWeight__" + V) + "__") + toString(W)) | |
100 | 96 | ||
101 | 97 | ||
102 | - | func | |
98 | + | func X () = addressFromStringValue(m(this, D())) | |
103 | 99 | ||
104 | 100 | ||
105 | - | func | |
101 | + | func Y (Z) = split(m(Z, P()), a) | |
106 | 102 | ||
107 | 103 | ||
108 | - | func | |
104 | + | func aa (ab) = addressFromStringValue(ab[F]) | |
109 | 105 | ||
110 | 106 | ||
111 | - | func | |
107 | + | func ac (ab) = addressFromStringValue(ab[I]) | |
112 | 108 | ||
113 | 109 | ||
114 | - | func | |
110 | + | func ad (ab) = addressFromStringValue(ab[E]) | |
115 | 111 | ||
116 | 112 | ||
117 | - | func | |
113 | + | func ae (ab) = addressFromStringValue(ab[N]) | |
118 | 114 | ||
119 | 115 | ||
120 | - | func | |
116 | + | func af () = "%s__managerPublicKey" | |
121 | 117 | ||
122 | 118 | ||
123 | - | func | |
119 | + | func ag () = "%s__managerVaultAddress" | |
124 | 120 | ||
125 | 121 | ||
126 | - | func | |
122 | + | func ah () = "%s%s__ratePerBlock__current" | |
127 | 123 | ||
128 | 124 | ||
129 | - | func | |
125 | + | func ai () = "%s%s__ratePerBlockMax__current" | |
130 | 126 | ||
131 | 127 | ||
132 | - | func | |
128 | + | func aj () = "%s%s__emission__startBlock" | |
133 | 129 | ||
134 | 130 | ||
135 | - | func | |
131 | + | func ak () = "%s%s__boostingV2__startBlock" | |
136 | 132 | ||
137 | 133 | ||
138 | - | func | |
134 | + | func al () = "%s%s__boostingV2__integral" | |
139 | 135 | ||
140 | 136 | ||
141 | - | func | |
137 | + | func am () = "%s%s__emission__duration" | |
142 | 138 | ||
143 | 139 | ||
144 | - | func | |
140 | + | func an () = "%s%s__emission__endBlock" | |
145 | 141 | ||
146 | 142 | ||
147 | - | func ak () = "%s%s__boostingV2__integral" | |
143 | + | let ao = 1 | |
144 | + | ||
145 | + | let ap = 2 | |
146 | + | ||
147 | + | let aq = 3 | |
148 | + | ||
149 | + | let ar = 4 | |
150 | + | ||
151 | + | let as = 5 | |
152 | + | ||
153 | + | let at = 6 | |
154 | + | ||
155 | + | let au = 7 | |
156 | + | ||
157 | + | func av () = "%s__config" | |
148 | 158 | ||
149 | 159 | ||
150 | - | func | |
160 | + | func aw () = split(m(this, av()), a) | |
151 | 161 | ||
152 | 162 | ||
153 | - | func am () = "%s%s__emission__endBlock" | |
163 | + | let ax = aw() | |
164 | + | ||
165 | + | let ay = fromBase58String(ax[ao]) | |
166 | + | ||
167 | + | let az = valueOrErrorMessage(parseInt(ax[ap]), j("invalid min lock amount")) | |
168 | + | ||
169 | + | let aA = valueOrErrorMessage(parseInt(ax[aq]), j("invalid min lock duration")) | |
170 | + | ||
171 | + | let aB = valueOrErrorMessage(parseInt(ax[ar]), j("invalid max lock duration")) | |
172 | + | ||
173 | + | let aC = valueOrErrorMessage(addressFromString(ax[as]), j("invalid math contract address")) | |
174 | + | ||
175 | + | let aD = valueOrErrorMessage(parseInt(ax[at]), j("invalid blocks in period")) | |
176 | + | ||
177 | + | let aE = valueOrErrorMessage(parseInt(ax[au]), j("invalid lock step blocks")) | |
178 | + | ||
179 | + | let aF = "%s__suspension" | |
180 | + | ||
181 | + | let aG = valueOrElse(getBoolean(this, aF), false) | |
182 | + | ||
183 | + | func aH () = if (!(aG)) | |
184 | + | then true | |
185 | + | else l("suspended") | |
154 | 186 | ||
155 | 187 | ||
156 | - | func an () = "%s__nextPeriod" | |
157 | - | ||
158 | - | ||
159 | - | func ao () = "%s%s__gwxRewardEmissionPart__startHeight" | |
160 | - | ||
161 | - | ||
162 | - | let ap = 1 | |
163 | - | ||
164 | - | let aq = 2 | |
165 | - | ||
166 | - | let ar = 3 | |
167 | - | ||
168 | - | let as = 4 | |
169 | - | ||
170 | - | let at = 5 | |
171 | - | ||
172 | - | func au () = "%s__config" | |
173 | - | ||
174 | - | ||
175 | - | func av () = split(h(this, au()), a) | |
176 | - | ||
177 | - | ||
178 | - | let aw = addressFromStringValue(av()[at]) | |
179 | - | ||
180 | - | func ax (ay,az,aA,aB,aw) = makeString(["%s%d%d%d", ay, az, aA, aB, aw], a) | |
181 | - | ||
182 | - | ||
183 | - | func aC (ay,az,aA,aB,aw) = ax(ay, toString(az), toString(aA), toString(aB), aw) | |
184 | - | ||
185 | - | ||
186 | - | func aD () = { | |
187 | - | let r = getString(af()) | |
188 | - | if ($isInstanceOf(r, "String")) | |
188 | + | func aI () = { | |
189 | + | let aJ = getString(ag()) | |
190 | + | if ($isInstanceOf(aJ, "String")) | |
189 | 191 | then { | |
190 | - | let | |
191 | - | addressFromStringValue( | |
192 | + | let aK = aJ | |
193 | + | addressFromStringValue(aK) | |
192 | 194 | } | |
193 | 195 | else this | |
194 | 196 | } | |
195 | 197 | ||
196 | 198 | ||
197 | - | func | |
198 | - | let | |
199 | - | let | |
200 | - | if ($isInstanceOf( | |
199 | + | func aL () = { | |
200 | + | let aM = aI() | |
201 | + | let aJ = getString(aM, af()) | |
202 | + | if ($isInstanceOf(aJ, "String")) | |
201 | 203 | then { | |
202 | - | let | |
203 | - | fromBase58String( | |
204 | + | let aK = aJ | |
205 | + | fromBase58String(aK) | |
204 | 206 | } | |
205 | - | else if ($isInstanceOf( | |
207 | + | else if ($isInstanceOf(aJ, "Unit")) | |
206 | 208 | then unit | |
207 | 209 | else throw("Match error") | |
208 | 210 | } | |
209 | 211 | ||
210 | 212 | ||
211 | - | func | |
212 | - | let | |
213 | - | let | |
214 | - | if ($isInstanceOf( | |
213 | + | func aN (aO) = { | |
214 | + | let aP = l("Permission denied") | |
215 | + | let aJ = aL() | |
216 | + | if ($isInstanceOf(aJ, "ByteVector")) | |
215 | 217 | then { | |
216 | - | let | |
217 | - | if (( | |
218 | + | let aQ = aJ | |
219 | + | if ((aO.callerPublicKey == aQ)) | |
218 | 220 | then true | |
219 | - | else | |
221 | + | else aP | |
220 | 222 | } | |
221 | - | else if ($isInstanceOf( | |
222 | - | then if (( | |
223 | + | else if ($isInstanceOf(aJ, "Unit")) | |
224 | + | then if ((aO.caller == this)) | |
223 | 225 | then true | |
224 | - | else | |
226 | + | else aP | |
225 | 227 | else throw("Match error") | |
226 | 228 | } | |
227 | 229 | ||
228 | 230 | ||
229 | - | let | |
231 | + | let aR = 1 | |
230 | 232 | ||
231 | - | let | |
233 | + | let aS = 2 | |
232 | 234 | ||
233 | - | let | |
235 | + | let aT = 3 | |
234 | 236 | ||
235 | - | let | |
237 | + | let aU = 4 | |
236 | 238 | ||
237 | - | let | |
239 | + | let aV = 5 | |
238 | 240 | ||
239 | - | let | |
241 | + | let aW = 6 | |
240 | 242 | ||
241 | - | func aR (aS) = makeString(["%s%s__lock", aS], a) | |
243 | + | func aX (aY,aZ) = makeString(["%s%s%s__lock", toString(aY), { | |
244 | + | let aJ = aZ | |
245 | + | if ($isInstanceOf(aJ, "ByteVector")) | |
246 | + | then { | |
247 | + | let ba = aJ | |
248 | + | toBase58String(ba) | |
249 | + | } | |
250 | + | else if ($isInstanceOf(aJ, "Unit")) | |
251 | + | then "legacy" | |
252 | + | else throw("Match error") | |
253 | + | }], a) | |
242 | 254 | ||
243 | 255 | ||
244 | - | func | |
256 | + | func bb (aY,aZ) = split(m(this, aX(aY, aZ)), a) | |
245 | 257 | ||
246 | 258 | ||
247 | - | func | |
259 | + | func bc (aY) = makeString(["%s%s__gwxAmountTotal", toString(aY)], a) | |
248 | 260 | ||
249 | 261 | ||
250 | - | func bd ( | |
262 | + | func bd (be,bf,bg,bh,bi) = makeString(["%d%d%d%d%d%d", toString(be), toString(bf), toString(bg), toString(lastBlock.timestamp), toString(bh), toString(bi)], a) | |
251 | 263 | ||
252 | 264 | ||
253 | - | func | |
265 | + | func bj () = "%s__nextUserNum" | |
254 | 266 | ||
255 | 267 | ||
256 | - | func | |
268 | + | func bk (aY) = makeString(["%s%s%s__mapping__user2num", aY], a) | |
257 | 269 | ||
258 | 270 | ||
259 | - | func | |
271 | + | func bl (W) = makeString(["%s%s%s__mapping__num2user", W], a) | |
260 | 272 | ||
261 | 273 | ||
262 | - | func | |
274 | + | func bm () = "%s%s__stats__activeTotalLocked" | |
263 | 275 | ||
264 | 276 | ||
265 | - | func | |
277 | + | func bn () = "%s%s__stats__locksDurationSumInBlocks" | |
266 | 278 | ||
267 | 279 | ||
268 | - | func | |
280 | + | func bo () = "%s%s__stats__locksCount" | |
269 | 281 | ||
270 | 282 | ||
271 | - | func | |
283 | + | func bp () = "%s%s__stats__activeUsersCount" | |
272 | 284 | ||
273 | 285 | ||
274 | - | func | |
286 | + | func bq (br) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(br)], a) | |
275 | 287 | ||
276 | 288 | ||
277 | - | func | |
289 | + | func bs (br,bt) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(br), bt], a) | |
278 | 290 | ||
279 | 291 | ||
280 | - | func | |
292 | + | func bu (br) = makeString(["%s%d__maxBoostInt", toString(br)], a) | |
281 | 293 | ||
282 | 294 | ||
283 | - | func | |
295 | + | func bv () = "%s%s__maxBoostInt__total" | |
284 | 296 | ||
285 | 297 | ||
286 | - | func | |
298 | + | func bw (br) = makeString(["%s%d__userBoostAvaliableToClaimTotal", toString(br)], a) | |
287 | 299 | ||
288 | 300 | ||
289 | - | func | |
301 | + | func bx (br) = makeString(["%s%d__userBoostClaimed", toString(br)], a) | |
290 | 302 | ||
291 | 303 | ||
292 | - | func | |
304 | + | func by () = "%s%s__gwx__total" | |
293 | 305 | ||
294 | 306 | ||
295 | - | func | |
307 | + | func bz (bA,bB,n,bC) = makeString(["%s%s%s%s%d", "vote", bA, bB, toString(n), toString(bC)], a) | |
296 | 308 | ||
297 | 309 | ||
298 | - | func | |
310 | + | func bD (bC) = makeString(["%s%d", "startHeight", toString(bC)], a) | |
299 | 311 | ||
300 | 312 | ||
301 | - | func | |
313 | + | func bE () = makeString(["%s", "currentEpochUi"], a) | |
302 | 314 | ||
303 | 315 | ||
304 | - | func | |
316 | + | func bF (bG,bC) = makeString(["%s%s%d", "votingResultStaked", bG, toString(bC)], a) | |
305 | 317 | ||
306 | 318 | ||
307 | - | func | |
319 | + | func bH (bG,bC) = makeString(["%s%s%d", "votingResultStakedIntegral", bG, toString(bC)], a) | |
308 | 320 | ||
309 | 321 | ||
310 | - | func | |
322 | + | func bI (bG,bC) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", bG, toString(bC)], a) | |
311 | 323 | ||
312 | 324 | ||
313 | - | func | |
325 | + | func bJ (bG,n,bC) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", bG, toString(n), toString(bC)], a) | |
314 | 326 | ||
315 | 327 | ||
316 | - | func | |
328 | + | func bK (bG,n,bC) = makeString(["%s%s%s%d", "voteStakedIntegral", bG, toString(n), toString(bC)], a) | |
317 | 329 | ||
318 | 330 | ||
319 | - | func | |
331 | + | func bL (bG,n,bC) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", bG, toString(n), toString(bC)], a) | |
320 | 332 | ||
321 | 333 | ||
322 | - | func | |
334 | + | func bM (bG,n,bC) = makeString(["%s%s%s%d", "voteStakedIntegralLast", bG, toString(n), toString(bC)], a) | |
323 | 335 | ||
324 | 336 | ||
325 | - | func | |
337 | + | func bN (bO,bG) = makeString(["%s%s%s", "staked", bO, bG], a) | |
326 | 338 | ||
327 | 339 | ||
328 | - | ||
340 | + | let bP = X() | |
329 | 341 | ||
342 | + | let ab = Y(bP) | |
330 | 343 | ||
331 | - | ||
344 | + | let bQ = ac(ab) | |
332 | 345 | ||
346 | + | let bR = ad(ab) | |
333 | 347 | ||
334 | - | ||
348 | + | let bS = ae(ab) | |
335 | 349 | ||
350 | + | let bT = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], a)), j("lp_staking_pools contract address is undefined"))), j("invalid lp_staking_pools contract address")) | |
336 | 351 | ||
337 | - | ||
352 | + | let bU = makeString(["%s", "votingEmissionContract"], a) | |
338 | 353 | ||
354 | + | let bV = addressFromStringValue(getStringValue(bP, bU)) | |
339 | 355 | ||
340 | - | ||
356 | + | let bW = makeString(["%s", "votingEmissionRateContract"], a) | |
341 | 357 | ||
342 | - | ||
343 | - | func bO (bJ,i,bF) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", bJ, toString(i), toString(bF)], a) | |
344 | - | ||
345 | - | ||
346 | - | func bP (bJ,i,bF) = makeString(["%s%s%s%d", "voteStakedIntegralLast", bJ, toString(i), toString(bF)], a) | |
347 | - | ||
348 | - | ||
349 | - | func bQ (bR,bJ) = makeString(["%s%s%s", "staked", bR, bJ], a) | |
350 | - | ||
351 | - | ||
352 | - | let bS = V() | |
353 | - | ||
354 | - | let aa = X(bS) | |
355 | - | ||
356 | - | let bT = ab(aa) | |
357 | - | ||
358 | - | let bU = ac(aa) | |
359 | - | ||
360 | - | let bV = ad(aa) | |
361 | - | ||
362 | - | let bW = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], a)), e("lp_staking_pools contract address is undefined"))), e("invalid lp_staking_pools contract address")) | |
363 | - | ||
364 | - | let bX = makeString(["%s", "votingEmissionContract"], a) | |
365 | - | ||
366 | - | let bY = addressFromStringValue(getStringValue(bS, bX)) | |
367 | - | ||
368 | - | let bZ = { | |
369 | - | let ca = invoke(bT, "getBoostCoeffREADONLY", nil, nil) | |
370 | - | if ($isInstanceOf(ca, "Int")) | |
371 | - | then ca | |
372 | - | else throw(($getType(ca) + " couldn't be cast to Int")) | |
358 | + | let bX = { | |
359 | + | let bY = invoke(bQ, "getBoostCoeffREADONLY", nil, nil) | |
360 | + | if ($isInstanceOf(bY, "Int")) | |
361 | + | then bY | |
362 | + | else throw(($getType(bY) + " couldn't be cast to Int")) | |
373 | 363 | } | |
374 | 364 | ||
375 | - | func cb (cc) = { | |
376 | - | let cd = getIntegerValue(bY, bH()) | |
377 | - | let ce = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], a) | |
378 | - | let cf = getInteger(this, ce) | |
379 | - | let cg = valueOrElse(getInteger(this, bA()), 0) | |
380 | - | let ch = if (isDefined(cf)) | |
381 | - | then (cd >= value(cf)) | |
382 | - | else false | |
383 | - | let ci = if (if (ch) | |
384 | - | then cc | |
385 | - | else false) | |
386 | - | then valueOrElse(getInteger(this, bB()), 0) | |
387 | - | else 0 | |
388 | - | max([0, (cg + ci)]) | |
365 | + | func bZ (aY) = { | |
366 | + | let aJ = getString(this, bk(toString(aY))) | |
367 | + | if ($isInstanceOf(aJ, "String")) | |
368 | + | then { | |
369 | + | let aK = aJ | |
370 | + | valueOrErrorMessage(parseInt(aK), j("invalid user number")) | |
371 | + | } | |
372 | + | else if ($isInstanceOf(aJ, "Unit")) | |
373 | + | then l("invalid user") | |
374 | + | else throw("Match error") | |
389 | 375 | } | |
390 | 376 | ||
391 | 377 | ||
392 | - | func cj (ck,cl,aW,cm,aY,cn,co,aI) = { | |
393 | - | let cp = makeString(["%s%s%s%s__history", ck, cl, toBase58String(aI.transactionId)], a) | |
394 | - | let cq = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(aW), toString(cm), toString(aY), toString(cn), toString(co)], a) | |
395 | - | StringEntry(cp, cq) | |
378 | + | func ca () = valueOrElse(getInteger(this, by()), 0) | |
379 | + | ||
380 | + | ||
381 | + | func cb (aY) = { | |
382 | + | let cc = "getLockedGwxAmount" | |
383 | + | let cd = valueOrErrorMessage({ | |
384 | + | let aJ = getString(bV, bW) | |
385 | + | if ($isInstanceOf(aJ, "Unit")) | |
386 | + | then unit | |
387 | + | else if ($isInstanceOf(aJ, "String")) | |
388 | + | then { | |
389 | + | let aK = aJ | |
390 | + | addressFromString(aK) | |
391 | + | } | |
392 | + | else throw("Match error") | |
393 | + | }, j("invalid voting emission rate address")) | |
394 | + | let ce = { | |
395 | + | let bY = invoke(bV, cc, [toString(aY)], nil) | |
396 | + | if ($isInstanceOf(bY, "Int")) | |
397 | + | then bY | |
398 | + | else throw(($getType(bY) + " couldn't be cast to Int")) | |
399 | + | } | |
400 | + | let cf = { | |
401 | + | let bY = invoke(cd, cc, [toString(aY)], nil) | |
402 | + | if ($isInstanceOf(bY, "Int")) | |
403 | + | then bY | |
404 | + | else throw(($getType(bY) + " couldn't be cast to Int")) | |
405 | + | } | |
406 | + | let cg = max([ce, cf]) | |
407 | + | cg | |
396 | 408 | } | |
397 | 409 | ||
398 | 410 | ||
399 | - | func cr (cs,ct,cu,cv) = { | |
400 | - | let cw = bq() | |
401 | - | let cx = br() | |
402 | - | let cy = bs() | |
403 | - | let cz = bp() | |
404 | - | let cA = k(this, cw) | |
405 | - | let cB = k(this, cx) | |
406 | - | let cC = k(this, cy) | |
407 | - | let cD = k(this, cz) | |
408 | - | [IntegerEntry(cw, (cA + ct)), IntegerEntry(cx, (cB + cu)), IntegerEntry(cy, (cC + cv)), IntegerEntry(cz, (cD + cs))] | |
411 | + | func ch (ci,cj,be,ck,bg,bh,aO) = { | |
412 | + | let cl = makeString(["%s%s%s%s__history", ci, cj, toBase58String(aO.transactionId)], a) | |
413 | + | let cm = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(be), toString(ck), toString(bg), toString(bh)], a) | |
414 | + | StringEntry(cl, cm) | |
409 | 415 | } | |
410 | 416 | ||
411 | 417 | ||
412 | - | func cE (cF,cG,cH) = { | |
413 | - | let cI = 1000 | |
414 | - | (((cF * cH) + cG) / cI) | |
418 | + | func cn (co,cp,cq,cr) = { | |
419 | + | let cs = bn() | |
420 | + | let ct = bo() | |
421 | + | let cu = bp() | |
422 | + | let cv = bm() | |
423 | + | let cw = p(this, cs) | |
424 | + | let cx = p(this, ct) | |
425 | + | let cy = p(this, cu) | |
426 | + | let cz = p(this, cv) | |
427 | + | [IntegerEntry(cs, (cw + cp)), IntegerEntry(ct, (cx + cq)), IntegerEntry(cu, (cy + cr)), IntegerEntry(cv, (cz + co))] | |
415 | 428 | } | |
416 | 429 | ||
417 | 430 | ||
418 | - | func cJ (aS,aV,aW,aX,aY,cn,co,bn) = { | |
419 | - | let cK = bh(aV) | |
420 | - | let cL = bi(aV) | |
421 | - | let cM = bj(aV) | |
422 | - | let cN = bk(aV) | |
423 | - | let cO = bl(aV) | |
424 | - | let cP = bm(aV, bn) | |
425 | - | let cQ = bo(aV, bn) | |
426 | - | let bc = cE(cn, co, height) | |
427 | - | [IntegerEntry(cK, aW), IntegerEntry(cL, aX), IntegerEntry(cM, aY), IntegerEntry(cN, cn), IntegerEntry(cO, co), IntegerEntry(cP, cn), IntegerEntry(cQ, co), StringEntry(aR(aS), bd(aV, aW, aX, aY, cn, co, bc))] | |
431 | + | func cA (aY,aZ,be,bf,bg,bh,bi) = [StringEntry(aX(aY, aZ), bd(be, bf, bg, bh, bi))] | |
432 | + | ||
433 | + | ||
434 | + | func cB (aO,cC) = if ((size(aO.payments) > 1)) | |
435 | + | then l("only one payment is allowed") | |
436 | + | else if ((size(aO.payments) == 0)) | |
437 | + | then 0 | |
438 | + | else { | |
439 | + | let cD = aO.payments[0] | |
440 | + | if ((value(cD.assetId) != cC)) | |
441 | + | then l("invalid asset id in payment") | |
442 | + | else cD.amount | |
443 | + | } | |
444 | + | ||
445 | + | ||
446 | + | func cE (aY) = valueOrElse(getInteger(this, bc(aY)), 0) | |
447 | + | ||
448 | + | ||
449 | + | func cF () = { | |
450 | + | let cG = { | |
451 | + | let cH = value(getInteger(bV, bE())) | |
452 | + | let cI = (cH - 1) | |
453 | + | if ((0 > cI)) | |
454 | + | then l("invalid epoch") | |
455 | + | else $Tuple2(cH, cI) | |
456 | + | } | |
457 | + | let cH = cG._1 | |
458 | + | let cI = cG._2 | |
459 | + | let cJ = value(getInteger(bV, bD(cH))) | |
460 | + | $Tuple2(cI, cJ) | |
428 | 461 | } | |
429 | 462 | ||
430 | 463 | ||
431 | - | func cR (aI,cS) = if ((size(aI.payments) > 1)) | |
432 | - | then g("only one payment is allowed") | |
433 | - | else if ((size(aI.payments) == 0)) | |
434 | - | then 0 | |
435 | - | else { | |
436 | - | let cT = aI.payments[0] | |
437 | - | if ((value(cT.assetId) != cS)) | |
438 | - | then g("invalid asset id in payment") | |
439 | - | else cT.amount | |
440 | - | } | |
441 | - | ||
442 | - | ||
443 | - | func cU (aS,cV) = { | |
444 | - | let cW = "empty" | |
445 | - | let cX = bf(aS) | |
446 | - | let aV = valueOrElse(getString(cX), cW) | |
447 | - | let cn = valueOrElse(getInteger(bk(aV)), 0) | |
448 | - | let co = valueOrElse(getInteger(bl(aV)), 0) | |
449 | - | let cY = cE(cn, co, cV) | |
450 | - | let bc = if ((0 > cY)) | |
451 | - | then 0 | |
452 | - | else cY | |
453 | - | bc | |
464 | + | func cK (bG) = { | |
465 | + | let cL = 4 | |
466 | + | let cM = 5 | |
467 | + | let cN = { | |
468 | + | let bY = invoke(bP, "getPoolConfigByLpAssetIdREADONLY", [bG], nil) | |
469 | + | if ($isInstanceOf(bY, "List[Any]")) | |
470 | + | then bY | |
471 | + | else throw(($getType(bY) + " couldn't be cast to List[Any]")) | |
472 | + | } | |
473 | + | let bA = { | |
474 | + | let bY = cN[cL] | |
475 | + | if ($isInstanceOf(bY, "String")) | |
476 | + | then bY | |
477 | + | else throw(($getType(bY) + " couldn't be cast to String")) | |
478 | + | } | |
479 | + | let bB = { | |
480 | + | let bY = cN[cM] | |
481 | + | if ($isInstanceOf(bY, "String")) | |
482 | + | then bY | |
483 | + | else throw(($getType(bY) + " couldn't be cast to String")) | |
484 | + | } | |
485 | + | $Tuple2(bA, bB) | |
454 | 486 | } | |
455 | 487 | ||
456 | 488 | ||
457 | - | func cZ (aS) = cU(aS, height) | |
458 | - | ||
459 | - | ||
460 | - | func da () = { | |
461 | - | let db = { | |
462 | - | let cd = value(getInteger(bY, bH())) | |
463 | - | let dc = (cd - 1) | |
464 | - | if ((0 > dc)) | |
465 | - | then g("invalid epoch") | |
466 | - | else $Tuple2(cd, dc) | |
467 | - | } | |
468 | - | let cd = db._1 | |
469 | - | let dc = db._2 | |
470 | - | let dd = value(getInteger(bY, bG(cd))) | |
471 | - | $Tuple2(dc, dd) | |
489 | + | func cO (bG,bO) = { | |
490 | + | let aY = addressFromStringValue(bO) | |
491 | + | let cP = cF() | |
492 | + | let cI = cP._1 | |
493 | + | let cJ = cP._2 | |
494 | + | let cQ = cK(bG) | |
495 | + | let bA = cQ._1 | |
496 | + | let bB = cQ._2 | |
497 | + | let cR = bz(bA, bB, aY, cI) | |
498 | + | let cS = valueOrElse(getInteger(bV, cR), 0) | |
499 | + | cS | |
472 | 500 | } | |
473 | 501 | ||
474 | 502 | ||
475 | - | func de (bJ) = { | |
476 | - | let df = 4 | |
477 | - | let dg = 5 | |
478 | - | let dh = { | |
479 | - | let ca = invoke(bS, "getPoolConfigByLpAssetIdREADONLY", [bJ], nil) | |
480 | - | if ($isInstanceOf(ca, "List[Any]")) | |
481 | - | then ca | |
482 | - | else throw(($getType(ca) + " couldn't be cast to List[Any]")) | |
483 | - | } | |
484 | - | let bD = { | |
485 | - | let ca = dh[df] | |
486 | - | if ($isInstanceOf(ca, "String")) | |
487 | - | then ca | |
488 | - | else throw(($getType(ca) + " couldn't be cast to String")) | |
489 | - | } | |
490 | - | let bE = { | |
491 | - | let ca = dh[dg] | |
492 | - | if ($isInstanceOf(ca, "String")) | |
493 | - | then ca | |
494 | - | else throw(($getType(ca) + " couldn't be cast to String")) | |
495 | - | } | |
496 | - | $Tuple2(bD, bE) | |
503 | + | func cT (bG,bO) = { | |
504 | + | let cU = valueOrElse(getInteger(bR, bN(bO, bG)), 0) | |
505 | + | let cS = cO(bG, bO) | |
506 | + | if ((cU == 0)) | |
507 | + | then 0 | |
508 | + | else cS | |
497 | 509 | } | |
498 | 510 | ||
499 | 511 | ||
500 | - | func di (bJ,bR) = { | |
501 | - | let aS = addressFromStringValue(bR) | |
502 | - | let dj = da() | |
503 | - | let dc = dj._1 | |
504 | - | let dd = dj._2 | |
505 | - | let dk = de(bJ) | |
506 | - | let bD = dk._1 | |
507 | - | let bE = dk._2 | |
508 | - | let dl = bC(bD, bE, aS, dc) | |
509 | - | let dm = valueOrElse(getInteger(bY, dl), 0) | |
510 | - | dm | |
512 | + | func cV (bG) = { | |
513 | + | let cW = cF() | |
514 | + | let cI = cW._1 | |
515 | + | let cJ = cW._2 | |
516 | + | let cX = valueOrElse(getInteger(bV, bF(bG, cI)), 0) | |
517 | + | let cY = valueOrElse(getInteger(this, bF(bG, cI)), cX) | |
518 | + | cY | |
511 | 519 | } | |
512 | 520 | ||
513 | 521 | ||
514 | - | func dn (bJ,bR) = { | |
515 | - | let do = valueOrElse(getInteger(bU, bQ(bR, bJ)), 0) | |
516 | - | let dm = di(bJ, bR) | |
517 | - | if ((do == 0)) | |
518 | - | then 0 | |
519 | - | else dm | |
522 | + | func cZ (bG) = { | |
523 | + | let da = cF() | |
524 | + | let cI = da._1 | |
525 | + | let cJ = da._2 | |
526 | + | let cY = cV(bG) | |
527 | + | let db = valueOrElse(getInteger(this, bH(bG, cI)), 0) | |
528 | + | let dc = valueOrElse(getInteger(this, bI(bG, cI)), cJ) | |
529 | + | let dd = (height - dc) | |
530 | + | let de = ((dd * cY) + db) | |
531 | + | de | |
520 | 532 | } | |
521 | 533 | ||
522 | 534 | ||
523 | - | func dp (bJ) = { | |
524 | - | let dq = da() | |
525 | - | let dc = dq._1 | |
526 | - | let dd = dq._2 | |
527 | - | let dr = valueOrElse(getInteger(bY, bI(bJ, dc)), 0) | |
528 | - | let ds = valueOrElse(getInteger(this, bI(bJ, dc)), dr) | |
529 | - | ds | |
535 | + | func df (bG,dg) = { | |
536 | + | let dh = cF() | |
537 | + | let cI = dh._1 | |
538 | + | let cJ = dh._2 | |
539 | + | let cY = cV(bG) | |
540 | + | let di = (cY + dg) | |
541 | + | let de = cZ(bG) | |
542 | + | [IntegerEntry(bF(bG, cI), di), IntegerEntry(bI(bG, cI), height), IntegerEntry(bH(bG, cI), de)] | |
530 | 543 | } | |
531 | 544 | ||
532 | 545 | ||
533 | - | func dt (bJ) = { | |
534 | - | let du = da() | |
535 | - | let dc = du._1 | |
536 | - | let dd = du._2 | |
537 | - | let ds = dp(bJ) | |
538 | - | let dv = valueOrElse(getInteger(this, bK(bJ, dc)), 0) | |
539 | - | let dw = valueOrElse(getInteger(this, bL(bJ, dc)), dd) | |
540 | - | let dx = (height - dw) | |
541 | - | let dy = ((dx * ds) + dv) | |
542 | - | dy | |
546 | + | func dj (bG,bO) = { | |
547 | + | let dk = cF() | |
548 | + | let cI = dk._1 | |
549 | + | let cJ = dk._2 | |
550 | + | let aY = addressFromStringValue(bO) | |
551 | + | let dl = cT(bG, bO) | |
552 | + | let dm = valueOrElse(getInteger(this, bK(bG, aY, cI)), 0) | |
553 | + | let dn = valueOrElse(getInteger(this, bL(bG, aY, cI)), cJ) | |
554 | + | let do = (height - dn) | |
555 | + | let dp = ((do * dl) + dm) | |
556 | + | dp | |
543 | 557 | } | |
544 | 558 | ||
545 | 559 | ||
546 | - | func dz (bJ,dA) = { | |
547 | - | let dB = da() | |
548 | - | let dc = dB._1 | |
549 | - | let dd = dB._2 | |
550 | - | let ds = dp(bJ) | |
551 | - | let dC = (ds + dA) | |
552 | - | let dy = dt(bJ) | |
553 | - | [IntegerEntry(bI(bJ, dc), dC), IntegerEntry(bL(bJ, dc), height), IntegerEntry(bK(bJ, dc), dy)] | |
560 | + | func dq (bG,bO,dr) = { | |
561 | + | let ds = cF() | |
562 | + | let cI = ds._1 | |
563 | + | let cJ = ds._2 | |
564 | + | let aY = addressFromStringValue(bO) | |
565 | + | let dt = cO(bG, bO) | |
566 | + | let du = if ((dt == 0)) | |
567 | + | then nil | |
568 | + | else { | |
569 | + | let dg = if (dr) | |
570 | + | then dt | |
571 | + | else -(dt) | |
572 | + | let dv = df(bG, dg) | |
573 | + | let dp = dj(bG, bO) | |
574 | + | let dw = [IntegerEntry(bL(bG, aY, cI), height), IntegerEntry(bK(bG, aY, cI), dp)] | |
575 | + | (dv ++ dw) | |
576 | + | } | |
577 | + | du | |
554 | 578 | } | |
555 | 579 | ||
556 | 580 | ||
557 | - | func dD (bJ,bR) = { | |
558 | - | let dE = da() | |
559 | - | let dc = dE._1 | |
560 | - | let dd = dE._2 | |
561 | - | let aS = addressFromStringValue(bR) | |
562 | - | let dF = dn(bJ, bR) | |
563 | - | let dG = valueOrElse(getInteger(this, bN(bJ, aS, dc)), 0) | |
564 | - | let dH = valueOrElse(getInteger(this, bO(bJ, aS, dc)), dd) | |
565 | - | let dI = (height - dH) | |
566 | - | let dJ = ((dI * dF) + dG) | |
567 | - | dJ | |
581 | + | func dx (bG,bO) = { | |
582 | + | let dy = cF() | |
583 | + | let cI = dy._1 | |
584 | + | let cJ = dy._2 | |
585 | + | let aY = addressFromStringValue(bO) | |
586 | + | let dz = bM(bG, aY, cI) | |
587 | + | let dA = valueOrElse(getInteger(this, dz), 0) | |
588 | + | let dB = bJ(bG, aY, cI) | |
589 | + | let dC = valueOrElse(getInteger(this, dB), 0) | |
590 | + | let dp = dj(bG, bO) | |
591 | + | let de = cZ(bG) | |
592 | + | let dD = (dp - dA) | |
593 | + | let dE = (de - dC) | |
594 | + | $Tuple3([IntegerEntry(dz, dp), IntegerEntry(dB, de)], dD, dE) | |
568 | 595 | } | |
569 | 596 | ||
570 | 597 | ||
571 | - | func dK (bJ,bR,dL) = { | |
572 | - | let dM = da() | |
573 | - | let dc = dM._1 | |
574 | - | let dd = dM._2 | |
575 | - | let aS = addressFromStringValue(bR) | |
576 | - | let dN = di(bJ, bR) | |
577 | - | let dO = if ((dN == 0)) | |
578 | - | then nil | |
579 | - | else { | |
580 | - | let dA = if (dL) | |
581 | - | then dN | |
582 | - | else -(dN) | |
583 | - | let dP = dz(bJ, dA) | |
584 | - | let dJ = dD(bJ, bR) | |
585 | - | let dQ = [IntegerEntry(bO(bJ, aS, dc), height), IntegerEntry(bN(bJ, aS, dc), dJ)] | |
586 | - | (dP ++ dQ) | |
587 | - | } | |
588 | - | dO | |
598 | + | func dF () = { | |
599 | + | let dG = s(bQ, ah()) | |
600 | + | let dH = getInteger(this, ak()) | |
601 | + | let dI = getInteger(this, al()) | |
602 | + | let dJ = s(bQ, an()) | |
603 | + | let dK = if ((height > dJ)) | |
604 | + | then dJ | |
605 | + | else height | |
606 | + | let dL = { | |
607 | + | let aJ = dH | |
608 | + | if ($isInstanceOf(aJ, "Int")) | |
609 | + | then { | |
610 | + | let dM = aJ | |
611 | + | max([(dK - dM), 0]) | |
612 | + | } | |
613 | + | else if ($isInstanceOf(aJ, "Unit")) | |
614 | + | then 0 | |
615 | + | else throw("Match error") | |
616 | + | } | |
617 | + | let dN = ((dG * (bX - 1)) / bX) | |
618 | + | let dO = valueOrElse(dI, 0) | |
619 | + | let dP = ((dN * dL) + dO) | |
620 | + | $Tuple2([IntegerEntry(al(), dP), IntegerEntry(ak(), height)], dP) | |
589 | 621 | } | |
590 | 622 | ||
591 | 623 | ||
592 | - | func dR (bJ,bR) = { | |
593 | - | let dS = da() | |
594 | - | let dc = dS._1 | |
595 | - | let dd = dS._2 | |
596 | - | let aS = addressFromStringValue(bR) | |
597 | - | let dT = bP(bJ, aS, dc) | |
598 | - | let dU = valueOrElse(getInteger(this, dT), 0) | |
599 | - | let dV = bM(bJ, aS, dc) | |
600 | - | let dW = valueOrElse(getInteger(this, dV), 0) | |
601 | - | let dJ = dD(bJ, bR) | |
602 | - | let dy = dt(bJ) | |
603 | - | let dX = (dJ - dU) | |
604 | - | let dY = (dy - dW) | |
605 | - | $Tuple3([IntegerEntry(dT, dJ), IntegerEntry(dV, dy)], dX, dY) | |
624 | + | func dQ (bG,bO,dR) = { | |
625 | + | let aY = valueOrErrorMessage(addressFromString(bO), j("invalid user address")) | |
626 | + | let br = bZ(aY) | |
627 | + | if ((br == br)) | |
628 | + | then { | |
629 | + | let dS = "empty" | |
630 | + | let dT = if ((bG != dS)) | |
631 | + | then { | |
632 | + | let dU = valueOrErrorMessage(getString(bP, Q(bG)), j(("unsupported lp asset " + bG))) | |
633 | + | getIntegerValue(bP, S(dU)) | |
634 | + | } | |
635 | + | else if (dR) | |
636 | + | then 0 | |
637 | + | else l(("not readonly mode: unsupported lp asset " + bG)) | |
638 | + | let dV = bs(br, bG) | |
639 | + | let dW = bq(br) | |
640 | + | let dX = valueOrElse(getInteger(this, dV), p(this, dW)) | |
641 | + | let dP = dF()._2 | |
642 | + | let dY = (dP - dX) | |
643 | + | if ((0 > dY)) | |
644 | + | then l("wrong calculations") | |
645 | + | else { | |
646 | + | let dZ = dx(bG, bO) | |
647 | + | let ea = dZ._1 | |
648 | + | let eb = dZ._2 | |
649 | + | let ec = dZ._3 | |
650 | + | let ed = fraction(dY, dT, d) | |
651 | + | let ee = if ((ec == 0)) | |
652 | + | then 0 | |
653 | + | else fraction(ed, eb, ec) | |
654 | + | let ef = ([IntegerEntry(dV, dP)] ++ ea) | |
655 | + | let eg = makeString([toString(dX), toString(dY), toString(dT), toString(eb), toString(ec)], ":") | |
656 | + | $Tuple3(ee, ef, eg) | |
657 | + | } | |
658 | + | } | |
659 | + | else throw("Strict value is not equal to itself.") | |
606 | 660 | } | |
607 | 661 | ||
608 | 662 | ||
609 | - | func dZ () = { | |
610 | - | let ea = n(bT, ag()) | |
611 | - | let eb = getInteger(this, aj()) | |
612 | - | let ec = getInteger(this, ak()) | |
613 | - | let ed = n(bT, am()) | |
614 | - | let cH = if ((height > ed)) | |
615 | - | then ed | |
616 | - | else height | |
617 | - | let ee = { | |
618 | - | let r = eb | |
619 | - | if ($isInstanceOf(r, "Int")) | |
620 | - | then { | |
621 | - | let ef = r | |
622 | - | max([(cH - ef), 0]) | |
623 | - | } | |
624 | - | else if ($isInstanceOf(r, "Unit")) | |
625 | - | then 0 | |
626 | - | else throw("Match error") | |
627 | - | } | |
628 | - | let eg = ((ea * (bZ - 1)) / bZ) | |
629 | - | let eh = valueOrElse(ec, 0) | |
630 | - | let ei = ((eg * ee) + eh) | |
631 | - | $Tuple2([IntegerEntry(ak(), ei), IntegerEntry(aj(), height)], ei) | |
632 | - | } | |
633 | - | ||
634 | - | ||
635 | - | func ej (bJ,bR,ek) = { | |
636 | - | let el = getString(this, aR(bR)) | |
637 | - | if ((el == unit)) | |
638 | - | then $Tuple3(0, nil, "userRecord::is::empty") | |
663 | + | func eh (aO,bg) = { | |
664 | + | let ei = toBase58String(ay) | |
665 | + | if ((size(aO.payments) != 1)) | |
666 | + | then l("invalid payment - exact one payment must be attached") | |
639 | 667 | else { | |
640 | - | let em = split(value(el), a) | |
641 | - | let en = em[aL] | |
642 | - | let eo = "empty" | |
643 | - | let ep = if ((bJ != eo)) | |
644 | - | then { | |
645 | - | let eq = valueOrErrorMessage(getString(bS, O(bJ)), e(("unsupported lp asset " + bJ))) | |
646 | - | getIntegerValue(bS, Q(eq)) | |
647 | - | } | |
648 | - | else if (ek) | |
649 | - | then 0 | |
650 | - | else g(("not readonly mode: unsupported lp asset " + bJ)) | |
651 | - | let er = bu(en, bJ) | |
652 | - | let es = bt(en) | |
653 | - | let et = valueOrElse(getInteger(this, er), k(this, es)) | |
654 | - | let ei = dZ()._2 | |
655 | - | let eu = (ei - et) | |
656 | - | if ((0 > eu)) | |
657 | - | then g("wrong calculations") | |
668 | + | let cD = aO.payments[0] | |
669 | + | let ej = cD.amount | |
670 | + | if ((ay != value(cD.assetId))) | |
671 | + | then l((("invalid asset is in payment - " + ei) + " is expected")) | |
658 | 672 | else { | |
659 | - | let ev = dR(bJ, bR) | |
660 | - | let ew = ev._1 | |
661 | - | let ex = ev._2 | |
662 | - | let ey = ev._3 | |
663 | - | let ez = fraction(eu, ep, d) | |
664 | - | let eA = if ((ey == 0)) | |
665 | - | then 0 | |
666 | - | else fraction(ez, ex, ey) | |
667 | - | let eB = ([IntegerEntry(er, ei)] ++ ew) | |
668 | - | let eC = makeString([toString(et), toString(eu), toString(ep), toString(ex), toString(ey)], ":") | |
669 | - | $Tuple3(eA, eB, eC) | |
673 | + | let ek = bj() | |
674 | + | let aY = aO.caller | |
675 | + | let bO = toString(aY) | |
676 | + | let el = isDefined(getString(bk(bO))) | |
677 | + | let em = if (el) | |
678 | + | then value(getString(bk(bO))) | |
679 | + | else toString(s(this, ek)) | |
680 | + | let br = parseIntValue(em) | |
681 | + | let ck = height | |
682 | + | if (if ((az > ej)) | |
683 | + | then (aY != bT) | |
684 | + | else false) | |
685 | + | then l(("amount is less then minLockAmount=" + toString(az))) | |
686 | + | else if ((aA > bg)) | |
687 | + | then l(("passed duration is less than minLockDuration=" + toString(aA))) | |
688 | + | else if ((bg > aB)) | |
689 | + | then l(("passed duration is greater than maxLockDuration=" + toString(aB))) | |
690 | + | else if (((bg % aE) != 0)) | |
691 | + | then l(("duration must be multiple of lockStepBlocks=" + toString(aE))) | |
692 | + | else { | |
693 | + | let en = fraction(ej, bg, aB) | |
694 | + | let eo = ca() | |
695 | + | let dW = bq(br) | |
696 | + | let dP = dF()._2 | |
697 | + | let ep = cE(aY) | |
698 | + | let eq = invoke(bS, "refreshUserReward", [aY.bytes, br], nil) | |
699 | + | if ((eq == eq)) | |
700 | + | then { | |
701 | + | let er = if (el) | |
702 | + | then nil | |
703 | + | else [IntegerEntry(ek, (br + 1)), StringEntry(bk(bO), em), StringEntry(bl(em), bO)] | |
704 | + | $Tuple2(((((er ++ cA(aY, aO.transactionId, ej, ck, bg, en, 0)) ++ cn(ej, bg, 1, if (el) | |
705 | + | then 0 | |
706 | + | else 1)) :+ ch("lock", bO, ej, ck, bg, en, aO)) ++ [IntegerEntry(dW, dP), IntegerEntry(by(), (eo + en)), IntegerEntry(bc(aY), (ep + en))]), en) | |
707 | + | } | |
708 | + | else throw("Strict value is not equal to itself.") | |
709 | + | } | |
670 | 710 | } | |
671 | 711 | } | |
672 | 712 | } | |
673 | 713 | ||
674 | 714 | ||
675 | - | func eD (aI,aY) = { | |
676 | - | let eE = av() | |
677 | - | let eF = eE[ap] | |
678 | - | let ay = fromBase58String(eF) | |
679 | - | let az = parseIntValue(eE[aq]) | |
680 | - | let aA = parseIntValue(eE[ar]) | |
681 | - | let aB = parseIntValue(eE[as]) | |
682 | - | if ((size(aI.payments) != 1)) | |
683 | - | then g("invalid payment - exact one payment must be attached") | |
684 | - | else { | |
685 | - | let cT = aI.payments[0] | |
686 | - | let eG = cT.amount | |
687 | - | if ((ay != value(cT.assetId))) | |
688 | - | then g((("invalid asset is in payment - " + eF) + " is expected")) | |
689 | - | else { | |
690 | - | let eH = be() | |
691 | - | let bR = toString(aI.caller) | |
692 | - | let eI = isDefined(getString(bf(bR))) | |
693 | - | let en = if (eI) | |
694 | - | then value(getString(bf(bR))) | |
695 | - | else toString(n(this, eH)) | |
696 | - | let aV = parseIntValue(en) | |
697 | - | let cm = height | |
698 | - | let cL = bi(en) | |
699 | - | let cM = bj(en) | |
700 | - | let cK = bh(en) | |
701 | - | if (if ((az > eG)) | |
702 | - | then (aI.caller != bW) | |
703 | - | else false) | |
704 | - | then g(("amount is less then minLockAmount=" + toString(az))) | |
705 | - | else if ((aA > aY)) | |
706 | - | then g(("passed duration is less then minLockDuration=" + toString(aA))) | |
707 | - | else if ((aY > aB)) | |
708 | - | then g(("passed duration is greater then maxLockDuration=" + toString(aB))) | |
709 | - | else if (if (eI) | |
710 | - | then ((n(this, cL) + n(this, cM)) >= cm) | |
711 | - | else false) | |
712 | - | then g("there is an active lock - consider to use increaseLock") | |
713 | - | else if ((k(this, cK) > 0)) | |
714 | - | then g(("there are locked WXs - consider to use increaseLock " + cK)) | |
715 | - | else { | |
716 | - | let eJ = fraction(aY, c, aB) | |
717 | - | let eK = fraction(eG, eJ, c) | |
718 | - | let eL = q(invoke(aw, "calcGwxParamsREADONLY", [eK, cm, aY], nil)) | |
719 | - | let cn = t(eL[0]) | |
720 | - | let co = t(eL[1]) | |
721 | - | let bn = toString(t(eL[2])) | |
722 | - | let cg = cb(false) | |
723 | - | let es = bt(en) | |
724 | - | let ei = dZ()._2 | |
725 | - | let eM = if (eI) | |
726 | - | then nil | |
727 | - | else [IntegerEntry(eH, (aV + 1)), StringEntry(bf(bR), en), StringEntry(bg(en), bR)] | |
728 | - | $Tuple2(((((eM ++ cJ(bR, en, eG, cm, aY, cn, co, bn)) ++ cr(eG, aY, 1, if (eI) | |
729 | - | then 0 | |
730 | - | else 1)) :+ cj("lock", bR, eG, cm, aY, cn, co, aI)) ++ [IntegerEntry(es, ei), IntegerEntry(bA(), (cg + eK))]), eK) | |
731 | - | } | |
732 | - | } | |
733 | - | } | |
715 | + | func es (aY,et) = { | |
716 | + | let eu = bb(aY, et) | |
717 | + | let ev = parseIntValue(eu[aR]) | |
718 | + | let ck = parseIntValue(eu[aS]) | |
719 | + | let ew = parseIntValue(eu[aT]) | |
720 | + | let ex = (ck + ew) | |
721 | + | let bi = parseIntValue(eu[aW]) | |
722 | + | let ey = ((height - ck) / aD) | |
723 | + | let ez = fraction(toBigInt(ey), (toBigInt((i * aD)) * h), toBigInt(ew)) | |
724 | + | let eA = if ((height > ex)) | |
725 | + | then ev | |
726 | + | else toInt(fraction(toBigInt(ev), (h - pow(toBigInt(5), 1, ez, f, f, DOWN)), h)) | |
727 | + | let eB = (eA - bi) | |
728 | + | eB | |
734 | 729 | } | |
735 | 730 | ||
736 | 731 | ||
737 | - | @Callable(aI) | |
738 | - | func constructor (eN,eO,az,eP,eQ,aw) = { | |
739 | - | let eR = aH(aI) | |
740 | - | if ((eR == eR)) | |
741 | - | then ([IntegerEntry(be(), 0), StringEntry(au(), aC(eO, az, eP, eQ, aw)), StringEntry(A(), eN)] ++ cr(0, 0, 0, 0)) | |
742 | - | else throw("Strict value is not equal to itself.") | |
743 | - | } | |
744 | - | ||
745 | - | ||
746 | - | ||
747 | - | @Callable(aI) | |
748 | - | func lockRef (aY,eS,eT) = { | |
749 | - | let eU = eD(aI, aY) | |
750 | - | let eV = eU._1 | |
751 | - | let eK = eU._2 | |
752 | - | let eW = toString(aI.caller) | |
753 | - | let eX = if (if ((eS == "")) | |
754 | - | then true | |
755 | - | else (eT == base58'')) | |
756 | - | then unit | |
757 | - | else invoke(w, "createPair", [z, eS, eW, eT], nil) | |
758 | - | if ((eX == eX)) | |
732 | + | @Callable(aO) | |
733 | + | func lockRef (bg,eC,eD) = { | |
734 | + | let eE = aH() | |
735 | + | if ((eE == eE)) | |
759 | 736 | then { | |
760 | - | let eY = invoke(aw, "updateReferralActivity", [toString(aI.caller), eK], nil) | |
761 | - | if ((eY == eY)) | |
762 | - | then $Tuple2(eV, unit) | |
737 | + | let eF = eh(aO, bg) | |
738 | + | let eG = eF._1 | |
739 | + | let en = eF._2 | |
740 | + | let eH = toString(aO.caller) | |
741 | + | let eI = if (if ((eC == "")) | |
742 | + | then true | |
743 | + | else (eD == base58'')) | |
744 | + | then unit | |
745 | + | else invoke(z, "createPair", [C, eC, eH, eD], nil) | |
746 | + | if ((eI == eI)) | |
747 | + | then { | |
748 | + | let eJ = invoke(aC, "updateReferralActivity", [toString(aO.caller), en], nil) | |
749 | + | if ((eJ == eJ)) | |
750 | + | then $Tuple2(eG, unit) | |
751 | + | else throw("Strict value is not equal to itself.") | |
752 | + | } | |
763 | 753 | else throw("Strict value is not equal to itself.") | |
764 | 754 | } | |
765 | 755 | else throw("Strict value is not equal to itself.") | |
767 | 757 | ||
768 | 758 | ||
769 | 759 | ||
770 | - | @Callable(aI) | |
771 | - | func lock (aY) = { | |
772 | - | let eZ = eD(aI, aY) | |
773 | - | let eV = eZ._1 | |
774 | - | let eK = eZ._2 | |
775 | - | let eY = invoke(aw, "updateReferralActivity", [toString(aI.caller), eK], nil) | |
776 | - | if ((eY == eY)) | |
777 | - | then $Tuple2(eV, unit) | |
778 | - | else throw("Strict value is not equal to itself.") | |
779 | - | } | |
780 | - | ||
781 | - | ||
782 | - | ||
783 | - | @Callable(aI) | |
784 | - | func increaseLock (fa) = { | |
785 | - | let eE = av() | |
786 | - | let eF = eE[ap] | |
787 | - | let ay = fromBase58String(eF) | |
788 | - | let aA = parseIntValue(eE[ar]) | |
789 | - | let aB = parseIntValue(eE[as]) | |
790 | - | let eG = cR(aI, ay) | |
791 | - | let bR = toString(aI.caller) | |
792 | - | let em = aT(bR) | |
793 | - | let en = em[aL] | |
794 | - | let fb = parseIntValue(em[aM]) | |
795 | - | let cm = parseIntValue(em[aN]) | |
796 | - | let fc = parseIntValue(em[aO]) | |
797 | - | let fd = (cm + fc) | |
798 | - | let fe = max([(fd - height), 0]) | |
799 | - | let ff = (fb + eG) | |
800 | - | let fg = (fe + fa) | |
801 | - | if ((0 > fa)) | |
802 | - | then g("duration is less then zero") | |
803 | - | else if ((aA > fg)) | |
804 | - | then g(("lockDurationNew is less then minLockDuration=" + toString(aA))) | |
805 | - | else if ((fg > aB)) | |
806 | - | then g(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(aB))) | |
807 | - | else { | |
808 | - | let eJ = fraction(fg, c, aB) | |
809 | - | let eK = fraction(ff, eJ, c) | |
810 | - | let eY = invoke(aw, "updateReferralActivity", [toString(aI.caller), eK], nil) | |
811 | - | if ((eY == eY)) | |
812 | - | then { | |
813 | - | let fh = height | |
814 | - | let eL = q(invoke(aw, "calcGwxParamsREADONLY", [eK, fh, fg], nil)) | |
815 | - | let cn = t(eL[0]) | |
816 | - | let co = t(eL[1]) | |
817 | - | let bn = toString(t(eL[2])) | |
818 | - | let fi = cZ(bR) | |
819 | - | let fj = (eK - fi) | |
820 | - | if ((0 > fj)) | |
821 | - | then g(("gwxDiff is less then 0: " + toString(fj))) | |
822 | - | else { | |
823 | - | let cg = cb(false) | |
824 | - | let fk = cb(true) | |
825 | - | (((cJ(bR, en, ff, fh, fg, cn, co, bn) ++ cr(eG, fa, 0, 0)) :+ cj("lock", bR, eG, cm, fg, cn, co, aI)) ++ [IntegerEntry(bA(), (cg + fj))]) | |
826 | - | } | |
827 | - | } | |
828 | - | else throw("Strict value is not equal to itself.") | |
829 | - | } | |
830 | - | } | |
831 | - | ||
832 | - | ||
833 | - | ||
834 | - | @Callable(aI) | |
835 | - | func claimWxBoost (bJ,bR) = if ((bU != aI.caller)) | |
836 | - | then g("permissions denied") | |
837 | - | else { | |
838 | - | let fl = ej(bJ, bR, false) | |
839 | - | let fm = fl._1 | |
840 | - | let eB = fl._2 | |
841 | - | let eC = fl._3 | |
842 | - | $Tuple2(eB, [fm]) | |
843 | - | } | |
844 | - | ||
845 | - | ||
846 | - | ||
847 | - | @Callable(aI) | |
848 | - | func claimWxBoostREADONLY (bJ,bR) = { | |
849 | - | let fn = ej(bJ, bR, true) | |
850 | - | let fm = fn._1 | |
851 | - | let eB = fn._2 | |
852 | - | let eC = fn._3 | |
853 | - | $Tuple2(nil, [fm, eC]) | |
854 | - | } | |
855 | - | ||
856 | - | ||
857 | - | ||
858 | - | @Callable(aI) | |
859 | - | func unlock (aS) = { | |
860 | - | let em = aT(aS) | |
861 | - | let en = em[aL] | |
862 | - | let fb = parseIntValue(em[aM]) | |
863 | - | let cm = parseIntValue(em[aN]) | |
864 | - | let fc = parseIntValue(em[aO]) | |
865 | - | let fd = (cm + fc) | |
866 | - | let eE = av() | |
867 | - | let ay = fromBase58String(eE[ap]) | |
868 | - | if ((fd >= height)) | |
869 | - | then g((("wait " + toString(fd)) + " to unlock")) | |
870 | - | else if ((0 >= fb)) | |
871 | - | then g("nothing to unlock") | |
872 | - | else { | |
873 | - | let bn = valueOrElse(getInteger(aw, an()), 0) | |
874 | - | (((cJ(aS, en, 0, cm, fc, 0, 0, toString(bn)) ++ cr(-(fb), 0, 0, -1)) :+ cj("unlock", aS, fb, cm, fc, 0, 0, aI)) :+ ScriptTransfer(addressFromStringValue(aS), fb, ay)) | |
875 | - | } | |
876 | - | } | |
877 | - | ||
878 | - | ||
879 | - | ||
880 | - | @Callable(aI) | |
881 | - | func gwxUserInfoREADONLY (aS) = { | |
882 | - | let bc = cZ(aS) | |
883 | - | $Tuple2(nil, [bc]) | |
884 | - | } | |
885 | - | ||
886 | - | ||
887 | - | ||
888 | - | @Callable(aI) | |
889 | - | func userMaxDurationREADONLY (bR) = { | |
890 | - | let eE = av() | |
891 | - | let aB = parseIntValue(eE[as]) | |
892 | - | let el = getString(this, aR(bR)) | |
893 | - | if ((el == unit)) | |
894 | - | then $Tuple2(nil, $Tuple2("lock", aB)) | |
895 | - | else { | |
896 | - | let em = split(value(el), a) | |
897 | - | let cm = parseIntValue(em[aN]) | |
898 | - | let fc = parseIntValue(em[aO]) | |
899 | - | let fd = (cm + fc) | |
900 | - | let fe = max([(fd - height), 0]) | |
901 | - | let fo = (aB - fe) | |
902 | - | $Tuple2(nil, $Tuple2("increaseLock", fo)) | |
903 | - | } | |
904 | - | } | |
905 | - | ||
906 | - | ||
907 | - | ||
908 | - | @Callable(aI) | |
909 | - | func getUserGwxAmountAtHeightREADONLY (aS,cV) = { | |
910 | - | let bc = cU(aS, cV) | |
911 | - | $Tuple2(nil, bc) | |
912 | - | } | |
913 | - | ||
914 | - | ||
915 | - | ||
916 | - | @Callable(aI) | |
917 | - | func getTotalCachedGwxREADONLY () = $Tuple2(nil, cb(true)) | |
918 | - | ||
919 | - | ||
920 | - | ||
921 | - | @Callable(aI) | |
922 | - | func onBoostEmissionUpdate () = { | |
923 | - | let eR = if ((aI.caller == bT)) | |
924 | - | then true | |
925 | - | else aH(aI) | |
926 | - | if ((eR == eR)) | |
927 | - | then dZ() | |
928 | - | else throw("Strict value is not equal to itself.") | |
929 | - | } | |
930 | - | ||
931 | - | ||
932 | - | ||
933 | - | @Callable(aI) | |
934 | - | func onStakedVoteUpdate (bJ,bR,dL) = { | |
935 | - | let eR = if ((aI.caller == bU)) | |
936 | - | then true | |
937 | - | else aH(aI) | |
938 | - | if ((eR == eR)) | |
760 | + | @Callable(aO) | |
761 | + | func lock (bg) = { | |
762 | + | let eE = aH() | |
763 | + | if ((eE == eE)) | |
939 | 764 | then { | |
940 | - | let dO = dK(bJ, bR, dL) | |
941 | - | $Tuple2(dO, unit) | |
765 | + | let eK = eh(aO, bg) | |
766 | + | let eG = eK._1 | |
767 | + | let en = eK._2 | |
768 | + | let eJ = invoke(aC, "updateReferralActivity", [toString(aO.caller), en], nil) | |
769 | + | if ((eJ == eJ)) | |
770 | + | then $Tuple2(eG, unit) | |
771 | + | else throw("Strict value is not equal to itself.") | |
942 | 772 | } | |
943 | 773 | else throw("Strict value is not equal to itself.") | |
944 | 774 | } | |
945 | 775 | ||
946 | 776 | ||
947 | 777 | ||
948 | - | @Callable(aI) | |
949 | - | func getVotingResultStakedREADONLY (bJ) = $Tuple2(nil, dp(bJ)) | |
778 | + | @Callable(aO) | |
779 | + | func claimWxBoost (bG,bO) = { | |
780 | + | let eE = aH() | |
781 | + | if ((eE == eE)) | |
782 | + | then if ((bR != aO.caller)) | |
783 | + | then l("permissions denied") | |
784 | + | else { | |
785 | + | let eL = dQ(bG, bO, false) | |
786 | + | let eM = eL._1 | |
787 | + | let ef = eL._2 | |
788 | + | let eg = eL._3 | |
789 | + | $Tuple2(ef, [eM]) | |
790 | + | } | |
791 | + | else throw("Strict value is not equal to itself.") | |
792 | + | } | |
950 | 793 | ||
951 | 794 | ||
952 | 795 | ||
953 | - | @Callable(aI) | |
954 | - | func getVotingResultStakedIntegralREADONLY (bJ) = $Tuple2(nil, dt(bJ)) | |
796 | + | @Callable(aO) | |
797 | + | func claimWxBoostREADONLY (bG,bO) = { | |
798 | + | let eN = dQ(bG, bO, true) | |
799 | + | let eM = eN._1 | |
800 | + | let ef = eN._2 | |
801 | + | let eg = eN._3 | |
802 | + | $Tuple2(nil, [eM, eg]) | |
803 | + | } | |
955 | 804 | ||
956 | 805 | ||
957 | 806 | ||
958 | - | @Callable(aI) | |
959 | - | func getUserVoteFinalizedREADONLY (bJ,bR) = $Tuple2(nil, di(bJ, bR)) | |
807 | + | @Callable(aO) | |
808 | + | func unlock (eO) = { | |
809 | + | let eE = aH() | |
810 | + | if ((eE == eE)) | |
811 | + | then { | |
812 | + | let aY = aO.caller | |
813 | + | let bO = toString(aY) | |
814 | + | let et = if ((eO == "")) | |
815 | + | then unit | |
816 | + | else fromBase58String(eO) | |
817 | + | let eu = bb(aY, et) | |
818 | + | let ev = parseIntValue(eu[aR]) | |
819 | + | let ck = parseIntValue(eu[aS]) | |
820 | + | let ew = parseIntValue(eu[aT]) | |
821 | + | let bi = parseIntValue(eu[aW]) | |
822 | + | let bh = parseIntValue(eu[aV]) | |
823 | + | let ey = ((height - ck) / aD) | |
824 | + | let eB = es(aY, et) | |
825 | + | let eP = min([fraction(eB, ew, aB), bh]) | |
826 | + | let eQ = v((bh - eP), "gwxRemaining") | |
827 | + | let eR = cb(aY) | |
828 | + | if ((0 >= eB)) | |
829 | + | then l("nothing to unlock") | |
830 | + | else { | |
831 | + | let eo = ca() | |
832 | + | let ep = cE(aY) | |
833 | + | let eS = v((ep - eP), "userGwxAmountTotalNew") | |
834 | + | if ((eR > eS)) | |
835 | + | then l(("locked gwx amount: " + toString(eR))) | |
836 | + | else { | |
837 | + | let br = parseIntValue(valueOrErrorMessage(getString(bk(bO)), j("invalid user number"))) | |
838 | + | let eq = invoke(bS, "refreshUserReward", [aY.bytes, br], nil) | |
839 | + | if ((eq == eq)) | |
840 | + | then ((((cA(aY, et, ev, ck, ew, eQ, (bi + eB)) ++ cn(-(eB), 0, 0, 0)) :+ ch("unlock", bO, eB, ck, ew, eP, aO)) :+ ScriptTransfer(aY, eB, ay)) ++ [IntegerEntry(by(), v((eo - eP), "gwxTotal")), IntegerEntry(bc(aY), eS)]) | |
841 | + | else throw("Strict value is not equal to itself.") | |
842 | + | } | |
843 | + | } | |
844 | + | } | |
845 | + | else throw("Strict value is not equal to itself.") | |
846 | + | } | |
960 | 847 | ||
961 | 848 | ||
962 | 849 | ||
963 | - | @Callable(aI) | |
964 | - | func getUserVoteStakedIntegralREADONLY (bJ,bR) = $Tuple2(nil, dD(bJ, bR)) | |
850 | + | @Callable(aO) | |
851 | + | func gwxUserInfoREADONLY (bO) = { | |
852 | + | let aY = valueOrErrorMessage(addressFromString(bO), j("invalid user address")) | |
853 | + | let bh = cE(aY) | |
854 | + | $Tuple2(nil, [bh]) | |
855 | + | } | |
965 | 856 | ||
966 | 857 | ||
967 | - | @Verifier(fp) | |
968 | - | func fq () = { | |
969 | - | let fr = { | |
970 | - | let r = aF() | |
971 | - | if ($isInstanceOf(r, "ByteVector")) | |
858 | + | ||
859 | + | @Callable(aO) | |
860 | + | func userMaxDurationREADONLY (bO) = $Tuple2(nil, $Tuple2("lock", aB)) | |
861 | + | ||
862 | + | ||
863 | + | ||
864 | + | @Callable(aO) | |
865 | + | func getUserGwxAmountAtHeightREADONLY (bO,eT) = { | |
866 | + | let aY = valueOrErrorMessage(addressFromString(bO), j("invalid user address")) | |
867 | + | let bh = cE(aY) | |
868 | + | $Tuple2(nil, bh) | |
869 | + | } | |
870 | + | ||
871 | + | ||
872 | + | ||
873 | + | @Callable(aO) | |
874 | + | func getUserGwxAmount (bO) = { | |
875 | + | let aY = valueOrErrorMessage(addressFromString(bO), j("invalid user address")) | |
876 | + | let bh = cE(aY) | |
877 | + | $Tuple2(nil, bh) | |
878 | + | } | |
879 | + | ||
880 | + | ||
881 | + | ||
882 | + | @Callable(aO) | |
883 | + | func getGwxTotalREADONLY () = $Tuple2(nil, ca()) | |
884 | + | ||
885 | + | ||
886 | + | ||
887 | + | @Callable(aO) | |
888 | + | func onBoostEmissionUpdate () = { | |
889 | + | let eE = aH() | |
890 | + | if ((eE == eE)) | |
891 | + | then { | |
892 | + | let eU = if ((aO.caller == bQ)) | |
893 | + | then true | |
894 | + | else aN(aO) | |
895 | + | if ((eU == eU)) | |
896 | + | then dF() | |
897 | + | else throw("Strict value is not equal to itself.") | |
898 | + | } | |
899 | + | else throw("Strict value is not equal to itself.") | |
900 | + | } | |
901 | + | ||
902 | + | ||
903 | + | ||
904 | + | @Callable(aO) | |
905 | + | func onStakedVoteUpdate (bG,bO,dr) = { | |
906 | + | let eE = aH() | |
907 | + | if ((eE == eE)) | |
908 | + | then { | |
909 | + | let eU = if ((aO.caller == bR)) | |
910 | + | then true | |
911 | + | else aN(aO) | |
912 | + | if ((eU == eU)) | |
913 | + | then { | |
914 | + | let du = dq(bG, bO, dr) | |
915 | + | $Tuple2(du, unit) | |
916 | + | } | |
917 | + | else throw("Strict value is not equal to itself.") | |
918 | + | } | |
919 | + | else throw("Strict value is not equal to itself.") | |
920 | + | } | |
921 | + | ||
922 | + | ||
923 | + | ||
924 | + | @Callable(aO) | |
925 | + | func getVotingResultStakedREADONLY (bG) = $Tuple2(nil, cV(bG)) | |
926 | + | ||
927 | + | ||
928 | + | ||
929 | + | @Callable(aO) | |
930 | + | func getVotingResultStakedIntegralREADONLY (bG) = $Tuple2(nil, cZ(bG)) | |
931 | + | ||
932 | + | ||
933 | + | ||
934 | + | @Callable(aO) | |
935 | + | func getUserVoteFinalizedREADONLY (bG,bO) = $Tuple2(nil, cO(bG, bO)) | |
936 | + | ||
937 | + | ||
938 | + | ||
939 | + | @Callable(aO) | |
940 | + | func getUserVoteStakedIntegralREADONLY (bG,bO) = $Tuple2(nil, dj(bG, bO)) | |
941 | + | ||
942 | + | ||
943 | + | ||
944 | + | @Callable(aO) | |
945 | + | func suspend (w) = { | |
946 | + | let eU = aN(aO) | |
947 | + | if ((eU == eU)) | |
948 | + | then $Tuple2([BooleanEntry(aF, w)], w) | |
949 | + | else throw("Strict value is not equal to itself.") | |
950 | + | } | |
951 | + | ||
952 | + | ||
953 | + | @Verifier(eV) | |
954 | + | func eW () = { | |
955 | + | let eX = { | |
956 | + | let aJ = aL() | |
957 | + | if ($isInstanceOf(aJ, "ByteVector")) | |
972 | 958 | then { | |
973 | - | let | |
974 | - | | |
959 | + | let aQ = aJ | |
960 | + | aQ | |
975 | 961 | } | |
976 | - | else if ($isInstanceOf( | |
977 | - | then | |
962 | + | else if ($isInstanceOf(aJ, "Unit")) | |
963 | + | then eV.senderPublicKey | |
978 | 964 | else throw("Match error") | |
979 | 965 | } | |
980 | - | sigVerify( | |
966 | + | sigVerify(eV.bodyBytes, eV.proofs[0], eX) | |
981 | 967 | } | |
982 | 968 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = 8 | |
7 | 7 | ||
8 | 8 | let c = 100000000 | |
9 | 9 | ||
10 | 10 | let d = c | |
11 | 11 | ||
12 | - | func e (f) = makeString(["boosting.ride:", f], " ") | |
12 | + | let e = "boosting.ride" | |
13 | + | ||
14 | + | let f = 18 | |
15 | + | ||
16 | + | let g = 1000000000000000000 | |
17 | + | ||
18 | + | let h = toBigInt(g) | |
19 | + | ||
20 | + | let i = 8 | |
21 | + | ||
22 | + | func j (k) = makeString([e, ": ", k], "") | |
13 | 23 | ||
14 | 24 | ||
15 | - | func | |
25 | + | func l (k) = throw(j(k)) | |
16 | 26 | ||
17 | 27 | ||
18 | - | func | |
28 | + | func m (n,o) = valueOrErrorMessage(getString(n, o), j((("mandatory this." + o) + " is not defined"))) | |
19 | 29 | ||
20 | 30 | ||
21 | - | func | |
31 | + | func p (n,o) = valueOrElse(getInteger(n, o), 0) | |
22 | 32 | ||
23 | 33 | ||
24 | - | func | |
34 | + | func q (n,o,r) = valueOrElse(getInteger(n, o), r) | |
25 | 35 | ||
26 | 36 | ||
27 | - | func | |
37 | + | func s (n,o) = valueOrErrorMessage(getInteger(n, o), j((("mandatory this." + o) + " is not defined"))) | |
28 | 38 | ||
29 | 39 | ||
30 | - | func | |
31 | - | then -( | |
32 | - | else | |
40 | + | func t (u) = if ((0 > u)) | |
41 | + | then -(u) | |
42 | + | else u | |
33 | 43 | ||
34 | 44 | ||
35 | - | func q (p) = { | |
36 | - | let r = p | |
37 | - | if ($isInstanceOf(r, "List[Any]")) | |
38 | - | then { | |
39 | - | let s = r | |
40 | - | s | |
41 | - | } | |
42 | - | else g("fail to cast into List[Any]") | |
43 | - | } | |
45 | + | func v (w,x) = if ((w >= 0)) | |
46 | + | then w | |
47 | + | else l((valueOrElse(x, "value") + " should be positive")) | |
44 | 48 | ||
45 | 49 | ||
46 | - | func t (p) = { | |
47 | - | let r = p | |
48 | - | if ($isInstanceOf(r, "Int")) | |
49 | - | then { | |
50 | - | let u = r | |
51 | - | u | |
52 | - | } | |
53 | - | else g("fail to cast into Int") | |
54 | - | } | |
50 | + | func y () = makeString(["%s%s", "config", "referralsContractAddress"], a) | |
55 | 51 | ||
56 | 52 | ||
57 | - | func v () = makeString(["%s%s", "config", "referralsContractAddress"], a) | |
53 | + | let z = addressFromStringValue(m(this, y())) | |
54 | + | ||
55 | + | let A = makeString(["%s%s", "referral", "programName"], a) | |
56 | + | ||
57 | + | let B = "wxlock" | |
58 | + | ||
59 | + | let C = valueOrElse(getString(this, A), B) | |
60 | + | ||
61 | + | func D () = "%s%s__config__factoryAddress" | |
58 | 62 | ||
59 | 63 | ||
60 | - | let | |
64 | + | let E = 1 | |
61 | 65 | ||
62 | - | let | |
66 | + | let F = 2 | |
63 | 67 | ||
64 | - | let | |
68 | + | let G = 3 | |
65 | 69 | ||
66 | - | let | |
70 | + | let H = 4 | |
67 | 71 | ||
68 | - | func A () = "%s%s__config__factoryAddress" | |
72 | + | let I = 5 | |
73 | + | ||
74 | + | let J = 6 | |
75 | + | ||
76 | + | let K = 7 | |
77 | + | ||
78 | + | let L = 8 | |
79 | + | ||
80 | + | let M = 9 | |
81 | + | ||
82 | + | let N = 10 | |
83 | + | ||
84 | + | let O = 11 | |
85 | + | ||
86 | + | func P () = "%s__factoryConfig" | |
69 | 87 | ||
70 | 88 | ||
71 | - | let B = 1 | |
72 | - | ||
73 | - | let C = 2 | |
74 | - | ||
75 | - | let D = 3 | |
76 | - | ||
77 | - | let E = 4 | |
78 | - | ||
79 | - | let F = 5 | |
80 | - | ||
81 | - | let G = 6 | |
82 | - | ||
83 | - | let H = 7 | |
84 | - | ||
85 | - | let I = 8 | |
86 | - | ||
87 | - | let J = 9 | |
88 | - | ||
89 | - | let K = 10 | |
90 | - | ||
91 | - | let L = 11 | |
92 | - | ||
93 | - | func M () = "%s__factoryConfig" | |
89 | + | func Q (R) = makeString(["%s%s%s", R, "mappings__lpAsset2PoolContract"], a) | |
94 | 90 | ||
95 | 91 | ||
96 | - | func | |
92 | + | func S (T) = makeString(["%s%s", "poolWeight", T], a) | |
97 | 93 | ||
98 | 94 | ||
99 | - | func | |
95 | + | func U (V,W) = ((("%s%s__poolWeight__" + V) + "__") + toString(W)) | |
100 | 96 | ||
101 | 97 | ||
102 | - | func | |
98 | + | func X () = addressFromStringValue(m(this, D())) | |
103 | 99 | ||
104 | 100 | ||
105 | - | func | |
101 | + | func Y (Z) = split(m(Z, P()), a) | |
106 | 102 | ||
107 | 103 | ||
108 | - | func | |
104 | + | func aa (ab) = addressFromStringValue(ab[F]) | |
109 | 105 | ||
110 | 106 | ||
111 | - | func | |
107 | + | func ac (ab) = addressFromStringValue(ab[I]) | |
112 | 108 | ||
113 | 109 | ||
114 | - | func | |
110 | + | func ad (ab) = addressFromStringValue(ab[E]) | |
115 | 111 | ||
116 | 112 | ||
117 | - | func | |
113 | + | func ae (ab) = addressFromStringValue(ab[N]) | |
118 | 114 | ||
119 | 115 | ||
120 | - | func | |
116 | + | func af () = "%s__managerPublicKey" | |
121 | 117 | ||
122 | 118 | ||
123 | - | func | |
119 | + | func ag () = "%s__managerVaultAddress" | |
124 | 120 | ||
125 | 121 | ||
126 | - | func | |
122 | + | func ah () = "%s%s__ratePerBlock__current" | |
127 | 123 | ||
128 | 124 | ||
129 | - | func | |
125 | + | func ai () = "%s%s__ratePerBlockMax__current" | |
130 | 126 | ||
131 | 127 | ||
132 | - | func | |
128 | + | func aj () = "%s%s__emission__startBlock" | |
133 | 129 | ||
134 | 130 | ||
135 | - | func | |
131 | + | func ak () = "%s%s__boostingV2__startBlock" | |
136 | 132 | ||
137 | 133 | ||
138 | - | func | |
134 | + | func al () = "%s%s__boostingV2__integral" | |
139 | 135 | ||
140 | 136 | ||
141 | - | func | |
137 | + | func am () = "%s%s__emission__duration" | |
142 | 138 | ||
143 | 139 | ||
144 | - | func | |
140 | + | func an () = "%s%s__emission__endBlock" | |
145 | 141 | ||
146 | 142 | ||
147 | - | func ak () = "%s%s__boostingV2__integral" | |
143 | + | let ao = 1 | |
144 | + | ||
145 | + | let ap = 2 | |
146 | + | ||
147 | + | let aq = 3 | |
148 | + | ||
149 | + | let ar = 4 | |
150 | + | ||
151 | + | let as = 5 | |
152 | + | ||
153 | + | let at = 6 | |
154 | + | ||
155 | + | let au = 7 | |
156 | + | ||
157 | + | func av () = "%s__config" | |
148 | 158 | ||
149 | 159 | ||
150 | - | func | |
160 | + | func aw () = split(m(this, av()), a) | |
151 | 161 | ||
152 | 162 | ||
153 | - | func am () = "%s%s__emission__endBlock" | |
163 | + | let ax = aw() | |
164 | + | ||
165 | + | let ay = fromBase58String(ax[ao]) | |
166 | + | ||
167 | + | let az = valueOrErrorMessage(parseInt(ax[ap]), j("invalid min lock amount")) | |
168 | + | ||
169 | + | let aA = valueOrErrorMessage(parseInt(ax[aq]), j("invalid min lock duration")) | |
170 | + | ||
171 | + | let aB = valueOrErrorMessage(parseInt(ax[ar]), j("invalid max lock duration")) | |
172 | + | ||
173 | + | let aC = valueOrErrorMessage(addressFromString(ax[as]), j("invalid math contract address")) | |
174 | + | ||
175 | + | let aD = valueOrErrorMessage(parseInt(ax[at]), j("invalid blocks in period")) | |
176 | + | ||
177 | + | let aE = valueOrErrorMessage(parseInt(ax[au]), j("invalid lock step blocks")) | |
178 | + | ||
179 | + | let aF = "%s__suspension" | |
180 | + | ||
181 | + | let aG = valueOrElse(getBoolean(this, aF), false) | |
182 | + | ||
183 | + | func aH () = if (!(aG)) | |
184 | + | then true | |
185 | + | else l("suspended") | |
154 | 186 | ||
155 | 187 | ||
156 | - | func an () = "%s__nextPeriod" | |
157 | - | ||
158 | - | ||
159 | - | func ao () = "%s%s__gwxRewardEmissionPart__startHeight" | |
160 | - | ||
161 | - | ||
162 | - | let ap = 1 | |
163 | - | ||
164 | - | let aq = 2 | |
165 | - | ||
166 | - | let ar = 3 | |
167 | - | ||
168 | - | let as = 4 | |
169 | - | ||
170 | - | let at = 5 | |
171 | - | ||
172 | - | func au () = "%s__config" | |
173 | - | ||
174 | - | ||
175 | - | func av () = split(h(this, au()), a) | |
176 | - | ||
177 | - | ||
178 | - | let aw = addressFromStringValue(av()[at]) | |
179 | - | ||
180 | - | func ax (ay,az,aA,aB,aw) = makeString(["%s%d%d%d", ay, az, aA, aB, aw], a) | |
181 | - | ||
182 | - | ||
183 | - | func aC (ay,az,aA,aB,aw) = ax(ay, toString(az), toString(aA), toString(aB), aw) | |
184 | - | ||
185 | - | ||
186 | - | func aD () = { | |
187 | - | let r = getString(af()) | |
188 | - | if ($isInstanceOf(r, "String")) | |
188 | + | func aI () = { | |
189 | + | let aJ = getString(ag()) | |
190 | + | if ($isInstanceOf(aJ, "String")) | |
189 | 191 | then { | |
190 | - | let | |
191 | - | addressFromStringValue( | |
192 | + | let aK = aJ | |
193 | + | addressFromStringValue(aK) | |
192 | 194 | } | |
193 | 195 | else this | |
194 | 196 | } | |
195 | 197 | ||
196 | 198 | ||
197 | - | func | |
198 | - | let | |
199 | - | let | |
200 | - | if ($isInstanceOf( | |
199 | + | func aL () = { | |
200 | + | let aM = aI() | |
201 | + | let aJ = getString(aM, af()) | |
202 | + | if ($isInstanceOf(aJ, "String")) | |
201 | 203 | then { | |
202 | - | let | |
203 | - | fromBase58String( | |
204 | + | let aK = aJ | |
205 | + | fromBase58String(aK) | |
204 | 206 | } | |
205 | - | else if ($isInstanceOf( | |
207 | + | else if ($isInstanceOf(aJ, "Unit")) | |
206 | 208 | then unit | |
207 | 209 | else throw("Match error") | |
208 | 210 | } | |
209 | 211 | ||
210 | 212 | ||
211 | - | func | |
212 | - | let | |
213 | - | let | |
214 | - | if ($isInstanceOf( | |
213 | + | func aN (aO) = { | |
214 | + | let aP = l("Permission denied") | |
215 | + | let aJ = aL() | |
216 | + | if ($isInstanceOf(aJ, "ByteVector")) | |
215 | 217 | then { | |
216 | - | let | |
217 | - | if (( | |
218 | + | let aQ = aJ | |
219 | + | if ((aO.callerPublicKey == aQ)) | |
218 | 220 | then true | |
219 | - | else | |
221 | + | else aP | |
220 | 222 | } | |
221 | - | else if ($isInstanceOf( | |
222 | - | then if (( | |
223 | + | else if ($isInstanceOf(aJ, "Unit")) | |
224 | + | then if ((aO.caller == this)) | |
223 | 225 | then true | |
224 | - | else | |
226 | + | else aP | |
225 | 227 | else throw("Match error") | |
226 | 228 | } | |
227 | 229 | ||
228 | 230 | ||
229 | - | let | |
231 | + | let aR = 1 | |
230 | 232 | ||
231 | - | let | |
233 | + | let aS = 2 | |
232 | 234 | ||
233 | - | let | |
235 | + | let aT = 3 | |
234 | 236 | ||
235 | - | let | |
237 | + | let aU = 4 | |
236 | 238 | ||
237 | - | let | |
239 | + | let aV = 5 | |
238 | 240 | ||
239 | - | let | |
241 | + | let aW = 6 | |
240 | 242 | ||
241 | - | func aR (aS) = makeString(["%s%s__lock", aS], a) | |
243 | + | func aX (aY,aZ) = makeString(["%s%s%s__lock", toString(aY), { | |
244 | + | let aJ = aZ | |
245 | + | if ($isInstanceOf(aJ, "ByteVector")) | |
246 | + | then { | |
247 | + | let ba = aJ | |
248 | + | toBase58String(ba) | |
249 | + | } | |
250 | + | else if ($isInstanceOf(aJ, "Unit")) | |
251 | + | then "legacy" | |
252 | + | else throw("Match error") | |
253 | + | }], a) | |
242 | 254 | ||
243 | 255 | ||
244 | - | func | |
256 | + | func bb (aY,aZ) = split(m(this, aX(aY, aZ)), a) | |
245 | 257 | ||
246 | 258 | ||
247 | - | func | |
259 | + | func bc (aY) = makeString(["%s%s__gwxAmountTotal", toString(aY)], a) | |
248 | 260 | ||
249 | 261 | ||
250 | - | func bd ( | |
262 | + | func bd (be,bf,bg,bh,bi) = makeString(["%d%d%d%d%d%d", toString(be), toString(bf), toString(bg), toString(lastBlock.timestamp), toString(bh), toString(bi)], a) | |
251 | 263 | ||
252 | 264 | ||
253 | - | func | |
265 | + | func bj () = "%s__nextUserNum" | |
254 | 266 | ||
255 | 267 | ||
256 | - | func | |
268 | + | func bk (aY) = makeString(["%s%s%s__mapping__user2num", aY], a) | |
257 | 269 | ||
258 | 270 | ||
259 | - | func | |
271 | + | func bl (W) = makeString(["%s%s%s__mapping__num2user", W], a) | |
260 | 272 | ||
261 | 273 | ||
262 | - | func | |
274 | + | func bm () = "%s%s__stats__activeTotalLocked" | |
263 | 275 | ||
264 | 276 | ||
265 | - | func | |
277 | + | func bn () = "%s%s__stats__locksDurationSumInBlocks" | |
266 | 278 | ||
267 | 279 | ||
268 | - | func | |
280 | + | func bo () = "%s%s__stats__locksCount" | |
269 | 281 | ||
270 | 282 | ||
271 | - | func | |
283 | + | func bp () = "%s%s__stats__activeUsersCount" | |
272 | 284 | ||
273 | 285 | ||
274 | - | func | |
286 | + | func bq (br) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(br)], a) | |
275 | 287 | ||
276 | 288 | ||
277 | - | func | |
289 | + | func bs (br,bt) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(br), bt], a) | |
278 | 290 | ||
279 | 291 | ||
280 | - | func | |
292 | + | func bu (br) = makeString(["%s%d__maxBoostInt", toString(br)], a) | |
281 | 293 | ||
282 | 294 | ||
283 | - | func | |
295 | + | func bv () = "%s%s__maxBoostInt__total" | |
284 | 296 | ||
285 | 297 | ||
286 | - | func | |
298 | + | func bw (br) = makeString(["%s%d__userBoostAvaliableToClaimTotal", toString(br)], a) | |
287 | 299 | ||
288 | 300 | ||
289 | - | func | |
301 | + | func bx (br) = makeString(["%s%d__userBoostClaimed", toString(br)], a) | |
290 | 302 | ||
291 | 303 | ||
292 | - | func | |
304 | + | func by () = "%s%s__gwx__total" | |
293 | 305 | ||
294 | 306 | ||
295 | - | func | |
307 | + | func bz (bA,bB,n,bC) = makeString(["%s%s%s%s%d", "vote", bA, bB, toString(n), toString(bC)], a) | |
296 | 308 | ||
297 | 309 | ||
298 | - | func | |
310 | + | func bD (bC) = makeString(["%s%d", "startHeight", toString(bC)], a) | |
299 | 311 | ||
300 | 312 | ||
301 | - | func | |
313 | + | func bE () = makeString(["%s", "currentEpochUi"], a) | |
302 | 314 | ||
303 | 315 | ||
304 | - | func | |
316 | + | func bF (bG,bC) = makeString(["%s%s%d", "votingResultStaked", bG, toString(bC)], a) | |
305 | 317 | ||
306 | 318 | ||
307 | - | func | |
319 | + | func bH (bG,bC) = makeString(["%s%s%d", "votingResultStakedIntegral", bG, toString(bC)], a) | |
308 | 320 | ||
309 | 321 | ||
310 | - | func | |
322 | + | func bI (bG,bC) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", bG, toString(bC)], a) | |
311 | 323 | ||
312 | 324 | ||
313 | - | func | |
325 | + | func bJ (bG,n,bC) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", bG, toString(n), toString(bC)], a) | |
314 | 326 | ||
315 | 327 | ||
316 | - | func | |
328 | + | func bK (bG,n,bC) = makeString(["%s%s%s%d", "voteStakedIntegral", bG, toString(n), toString(bC)], a) | |
317 | 329 | ||
318 | 330 | ||
319 | - | func | |
331 | + | func bL (bG,n,bC) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", bG, toString(n), toString(bC)], a) | |
320 | 332 | ||
321 | 333 | ||
322 | - | func | |
334 | + | func bM (bG,n,bC) = makeString(["%s%s%s%d", "voteStakedIntegralLast", bG, toString(n), toString(bC)], a) | |
323 | 335 | ||
324 | 336 | ||
325 | - | func | |
337 | + | func bN (bO,bG) = makeString(["%s%s%s", "staked", bO, bG], a) | |
326 | 338 | ||
327 | 339 | ||
328 | - | ||
340 | + | let bP = X() | |
329 | 341 | ||
342 | + | let ab = Y(bP) | |
330 | 343 | ||
331 | - | ||
344 | + | let bQ = ac(ab) | |
332 | 345 | ||
346 | + | let bR = ad(ab) | |
333 | 347 | ||
334 | - | ||
348 | + | let bS = ae(ab) | |
335 | 349 | ||
350 | + | let bT = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], a)), j("lp_staking_pools contract address is undefined"))), j("invalid lp_staking_pools contract address")) | |
336 | 351 | ||
337 | - | ||
352 | + | let bU = makeString(["%s", "votingEmissionContract"], a) | |
338 | 353 | ||
354 | + | let bV = addressFromStringValue(getStringValue(bP, bU)) | |
339 | 355 | ||
340 | - | ||
356 | + | let bW = makeString(["%s", "votingEmissionRateContract"], a) | |
341 | 357 | ||
342 | - | ||
343 | - | func bO (bJ,i,bF) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", bJ, toString(i), toString(bF)], a) | |
344 | - | ||
345 | - | ||
346 | - | func bP (bJ,i,bF) = makeString(["%s%s%s%d", "voteStakedIntegralLast", bJ, toString(i), toString(bF)], a) | |
347 | - | ||
348 | - | ||
349 | - | func bQ (bR,bJ) = makeString(["%s%s%s", "staked", bR, bJ], a) | |
350 | - | ||
351 | - | ||
352 | - | let bS = V() | |
353 | - | ||
354 | - | let aa = X(bS) | |
355 | - | ||
356 | - | let bT = ab(aa) | |
357 | - | ||
358 | - | let bU = ac(aa) | |
359 | - | ||
360 | - | let bV = ad(aa) | |
361 | - | ||
362 | - | let bW = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], a)), e("lp_staking_pools contract address is undefined"))), e("invalid lp_staking_pools contract address")) | |
363 | - | ||
364 | - | let bX = makeString(["%s", "votingEmissionContract"], a) | |
365 | - | ||
366 | - | let bY = addressFromStringValue(getStringValue(bS, bX)) | |
367 | - | ||
368 | - | let bZ = { | |
369 | - | let ca = invoke(bT, "getBoostCoeffREADONLY", nil, nil) | |
370 | - | if ($isInstanceOf(ca, "Int")) | |
371 | - | then ca | |
372 | - | else throw(($getType(ca) + " couldn't be cast to Int")) | |
358 | + | let bX = { | |
359 | + | let bY = invoke(bQ, "getBoostCoeffREADONLY", nil, nil) | |
360 | + | if ($isInstanceOf(bY, "Int")) | |
361 | + | then bY | |
362 | + | else throw(($getType(bY) + " couldn't be cast to Int")) | |
373 | 363 | } | |
374 | 364 | ||
375 | - | func cb (cc) = { | |
376 | - | let cd = getIntegerValue(bY, bH()) | |
377 | - | let ce = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], a) | |
378 | - | let cf = getInteger(this, ce) | |
379 | - | let cg = valueOrElse(getInteger(this, bA()), 0) | |
380 | - | let ch = if (isDefined(cf)) | |
381 | - | then (cd >= value(cf)) | |
382 | - | else false | |
383 | - | let ci = if (if (ch) | |
384 | - | then cc | |
385 | - | else false) | |
386 | - | then valueOrElse(getInteger(this, bB()), 0) | |
387 | - | else 0 | |
388 | - | max([0, (cg + ci)]) | |
365 | + | func bZ (aY) = { | |
366 | + | let aJ = getString(this, bk(toString(aY))) | |
367 | + | if ($isInstanceOf(aJ, "String")) | |
368 | + | then { | |
369 | + | let aK = aJ | |
370 | + | valueOrErrorMessage(parseInt(aK), j("invalid user number")) | |
371 | + | } | |
372 | + | else if ($isInstanceOf(aJ, "Unit")) | |
373 | + | then l("invalid user") | |
374 | + | else throw("Match error") | |
389 | 375 | } | |
390 | 376 | ||
391 | 377 | ||
392 | - | func cj (ck,cl,aW,cm,aY,cn,co,aI) = { | |
393 | - | let cp = makeString(["%s%s%s%s__history", ck, cl, toBase58String(aI.transactionId)], a) | |
394 | - | let cq = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(aW), toString(cm), toString(aY), toString(cn), toString(co)], a) | |
395 | - | StringEntry(cp, cq) | |
378 | + | func ca () = valueOrElse(getInteger(this, by()), 0) | |
379 | + | ||
380 | + | ||
381 | + | func cb (aY) = { | |
382 | + | let cc = "getLockedGwxAmount" | |
383 | + | let cd = valueOrErrorMessage({ | |
384 | + | let aJ = getString(bV, bW) | |
385 | + | if ($isInstanceOf(aJ, "Unit")) | |
386 | + | then unit | |
387 | + | else if ($isInstanceOf(aJ, "String")) | |
388 | + | then { | |
389 | + | let aK = aJ | |
390 | + | addressFromString(aK) | |
391 | + | } | |
392 | + | else throw("Match error") | |
393 | + | }, j("invalid voting emission rate address")) | |
394 | + | let ce = { | |
395 | + | let bY = invoke(bV, cc, [toString(aY)], nil) | |
396 | + | if ($isInstanceOf(bY, "Int")) | |
397 | + | then bY | |
398 | + | else throw(($getType(bY) + " couldn't be cast to Int")) | |
399 | + | } | |
400 | + | let cf = { | |
401 | + | let bY = invoke(cd, cc, [toString(aY)], nil) | |
402 | + | if ($isInstanceOf(bY, "Int")) | |
403 | + | then bY | |
404 | + | else throw(($getType(bY) + " couldn't be cast to Int")) | |
405 | + | } | |
406 | + | let cg = max([ce, cf]) | |
407 | + | cg | |
396 | 408 | } | |
397 | 409 | ||
398 | 410 | ||
399 | - | func cr (cs,ct,cu,cv) = { | |
400 | - | let cw = bq() | |
401 | - | let cx = br() | |
402 | - | let cy = bs() | |
403 | - | let cz = bp() | |
404 | - | let cA = k(this, cw) | |
405 | - | let cB = k(this, cx) | |
406 | - | let cC = k(this, cy) | |
407 | - | let cD = k(this, cz) | |
408 | - | [IntegerEntry(cw, (cA + ct)), IntegerEntry(cx, (cB + cu)), IntegerEntry(cy, (cC + cv)), IntegerEntry(cz, (cD + cs))] | |
411 | + | func ch (ci,cj,be,ck,bg,bh,aO) = { | |
412 | + | let cl = makeString(["%s%s%s%s__history", ci, cj, toBase58String(aO.transactionId)], a) | |
413 | + | let cm = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(be), toString(ck), toString(bg), toString(bh)], a) | |
414 | + | StringEntry(cl, cm) | |
409 | 415 | } | |
410 | 416 | ||
411 | 417 | ||
412 | - | func cE (cF,cG,cH) = { | |
413 | - | let cI = 1000 | |
414 | - | (((cF * cH) + cG) / cI) | |
418 | + | func cn (co,cp,cq,cr) = { | |
419 | + | let cs = bn() | |
420 | + | let ct = bo() | |
421 | + | let cu = bp() | |
422 | + | let cv = bm() | |
423 | + | let cw = p(this, cs) | |
424 | + | let cx = p(this, ct) | |
425 | + | let cy = p(this, cu) | |
426 | + | let cz = p(this, cv) | |
427 | + | [IntegerEntry(cs, (cw + cp)), IntegerEntry(ct, (cx + cq)), IntegerEntry(cu, (cy + cr)), IntegerEntry(cv, (cz + co))] | |
415 | 428 | } | |
416 | 429 | ||
417 | 430 | ||
418 | - | func cJ (aS,aV,aW,aX,aY,cn,co,bn) = { | |
419 | - | let cK = bh(aV) | |
420 | - | let cL = bi(aV) | |
421 | - | let cM = bj(aV) | |
422 | - | let cN = bk(aV) | |
423 | - | let cO = bl(aV) | |
424 | - | let cP = bm(aV, bn) | |
425 | - | let cQ = bo(aV, bn) | |
426 | - | let bc = cE(cn, co, height) | |
427 | - | [IntegerEntry(cK, aW), IntegerEntry(cL, aX), IntegerEntry(cM, aY), IntegerEntry(cN, cn), IntegerEntry(cO, co), IntegerEntry(cP, cn), IntegerEntry(cQ, co), StringEntry(aR(aS), bd(aV, aW, aX, aY, cn, co, bc))] | |
431 | + | func cA (aY,aZ,be,bf,bg,bh,bi) = [StringEntry(aX(aY, aZ), bd(be, bf, bg, bh, bi))] | |
432 | + | ||
433 | + | ||
434 | + | func cB (aO,cC) = if ((size(aO.payments) > 1)) | |
435 | + | then l("only one payment is allowed") | |
436 | + | else if ((size(aO.payments) == 0)) | |
437 | + | then 0 | |
438 | + | else { | |
439 | + | let cD = aO.payments[0] | |
440 | + | if ((value(cD.assetId) != cC)) | |
441 | + | then l("invalid asset id in payment") | |
442 | + | else cD.amount | |
443 | + | } | |
444 | + | ||
445 | + | ||
446 | + | func cE (aY) = valueOrElse(getInteger(this, bc(aY)), 0) | |
447 | + | ||
448 | + | ||
449 | + | func cF () = { | |
450 | + | let cG = { | |
451 | + | let cH = value(getInteger(bV, bE())) | |
452 | + | let cI = (cH - 1) | |
453 | + | if ((0 > cI)) | |
454 | + | then l("invalid epoch") | |
455 | + | else $Tuple2(cH, cI) | |
456 | + | } | |
457 | + | let cH = cG._1 | |
458 | + | let cI = cG._2 | |
459 | + | let cJ = value(getInteger(bV, bD(cH))) | |
460 | + | $Tuple2(cI, cJ) | |
428 | 461 | } | |
429 | 462 | ||
430 | 463 | ||
431 | - | func cR (aI,cS) = if ((size(aI.payments) > 1)) | |
432 | - | then g("only one payment is allowed") | |
433 | - | else if ((size(aI.payments) == 0)) | |
434 | - | then 0 | |
435 | - | else { | |
436 | - | let cT = aI.payments[0] | |
437 | - | if ((value(cT.assetId) != cS)) | |
438 | - | then g("invalid asset id in payment") | |
439 | - | else cT.amount | |
440 | - | } | |
441 | - | ||
442 | - | ||
443 | - | func cU (aS,cV) = { | |
444 | - | let cW = "empty" | |
445 | - | let cX = bf(aS) | |
446 | - | let aV = valueOrElse(getString(cX), cW) | |
447 | - | let cn = valueOrElse(getInteger(bk(aV)), 0) | |
448 | - | let co = valueOrElse(getInteger(bl(aV)), 0) | |
449 | - | let cY = cE(cn, co, cV) | |
450 | - | let bc = if ((0 > cY)) | |
451 | - | then 0 | |
452 | - | else cY | |
453 | - | bc | |
464 | + | func cK (bG) = { | |
465 | + | let cL = 4 | |
466 | + | let cM = 5 | |
467 | + | let cN = { | |
468 | + | let bY = invoke(bP, "getPoolConfigByLpAssetIdREADONLY", [bG], nil) | |
469 | + | if ($isInstanceOf(bY, "List[Any]")) | |
470 | + | then bY | |
471 | + | else throw(($getType(bY) + " couldn't be cast to List[Any]")) | |
472 | + | } | |
473 | + | let bA = { | |
474 | + | let bY = cN[cL] | |
475 | + | if ($isInstanceOf(bY, "String")) | |
476 | + | then bY | |
477 | + | else throw(($getType(bY) + " couldn't be cast to String")) | |
478 | + | } | |
479 | + | let bB = { | |
480 | + | let bY = cN[cM] | |
481 | + | if ($isInstanceOf(bY, "String")) | |
482 | + | then bY | |
483 | + | else throw(($getType(bY) + " couldn't be cast to String")) | |
484 | + | } | |
485 | + | $Tuple2(bA, bB) | |
454 | 486 | } | |
455 | 487 | ||
456 | 488 | ||
457 | - | func cZ (aS) = cU(aS, height) | |
458 | - | ||
459 | - | ||
460 | - | func da () = { | |
461 | - | let db = { | |
462 | - | let cd = value(getInteger(bY, bH())) | |
463 | - | let dc = (cd - 1) | |
464 | - | if ((0 > dc)) | |
465 | - | then g("invalid epoch") | |
466 | - | else $Tuple2(cd, dc) | |
467 | - | } | |
468 | - | let cd = db._1 | |
469 | - | let dc = db._2 | |
470 | - | let dd = value(getInteger(bY, bG(cd))) | |
471 | - | $Tuple2(dc, dd) | |
489 | + | func cO (bG,bO) = { | |
490 | + | let aY = addressFromStringValue(bO) | |
491 | + | let cP = cF() | |
492 | + | let cI = cP._1 | |
493 | + | let cJ = cP._2 | |
494 | + | let cQ = cK(bG) | |
495 | + | let bA = cQ._1 | |
496 | + | let bB = cQ._2 | |
497 | + | let cR = bz(bA, bB, aY, cI) | |
498 | + | let cS = valueOrElse(getInteger(bV, cR), 0) | |
499 | + | cS | |
472 | 500 | } | |
473 | 501 | ||
474 | 502 | ||
475 | - | func de (bJ) = { | |
476 | - | let df = 4 | |
477 | - | let dg = 5 | |
478 | - | let dh = { | |
479 | - | let ca = invoke(bS, "getPoolConfigByLpAssetIdREADONLY", [bJ], nil) | |
480 | - | if ($isInstanceOf(ca, "List[Any]")) | |
481 | - | then ca | |
482 | - | else throw(($getType(ca) + " couldn't be cast to List[Any]")) | |
483 | - | } | |
484 | - | let bD = { | |
485 | - | let ca = dh[df] | |
486 | - | if ($isInstanceOf(ca, "String")) | |
487 | - | then ca | |
488 | - | else throw(($getType(ca) + " couldn't be cast to String")) | |
489 | - | } | |
490 | - | let bE = { | |
491 | - | let ca = dh[dg] | |
492 | - | if ($isInstanceOf(ca, "String")) | |
493 | - | then ca | |
494 | - | else throw(($getType(ca) + " couldn't be cast to String")) | |
495 | - | } | |
496 | - | $Tuple2(bD, bE) | |
503 | + | func cT (bG,bO) = { | |
504 | + | let cU = valueOrElse(getInteger(bR, bN(bO, bG)), 0) | |
505 | + | let cS = cO(bG, bO) | |
506 | + | if ((cU == 0)) | |
507 | + | then 0 | |
508 | + | else cS | |
497 | 509 | } | |
498 | 510 | ||
499 | 511 | ||
500 | - | func di (bJ,bR) = { | |
501 | - | let aS = addressFromStringValue(bR) | |
502 | - | let dj = da() | |
503 | - | let dc = dj._1 | |
504 | - | let dd = dj._2 | |
505 | - | let dk = de(bJ) | |
506 | - | let bD = dk._1 | |
507 | - | let bE = dk._2 | |
508 | - | let dl = bC(bD, bE, aS, dc) | |
509 | - | let dm = valueOrElse(getInteger(bY, dl), 0) | |
510 | - | dm | |
512 | + | func cV (bG) = { | |
513 | + | let cW = cF() | |
514 | + | let cI = cW._1 | |
515 | + | let cJ = cW._2 | |
516 | + | let cX = valueOrElse(getInteger(bV, bF(bG, cI)), 0) | |
517 | + | let cY = valueOrElse(getInteger(this, bF(bG, cI)), cX) | |
518 | + | cY | |
511 | 519 | } | |
512 | 520 | ||
513 | 521 | ||
514 | - | func dn (bJ,bR) = { | |
515 | - | let do = valueOrElse(getInteger(bU, bQ(bR, bJ)), 0) | |
516 | - | let dm = di(bJ, bR) | |
517 | - | if ((do == 0)) | |
518 | - | then 0 | |
519 | - | else dm | |
522 | + | func cZ (bG) = { | |
523 | + | let da = cF() | |
524 | + | let cI = da._1 | |
525 | + | let cJ = da._2 | |
526 | + | let cY = cV(bG) | |
527 | + | let db = valueOrElse(getInteger(this, bH(bG, cI)), 0) | |
528 | + | let dc = valueOrElse(getInteger(this, bI(bG, cI)), cJ) | |
529 | + | let dd = (height - dc) | |
530 | + | let de = ((dd * cY) + db) | |
531 | + | de | |
520 | 532 | } | |
521 | 533 | ||
522 | 534 | ||
523 | - | func dp (bJ) = { | |
524 | - | let dq = da() | |
525 | - | let dc = dq._1 | |
526 | - | let dd = dq._2 | |
527 | - | let dr = valueOrElse(getInteger(bY, bI(bJ, dc)), 0) | |
528 | - | let ds = valueOrElse(getInteger(this, bI(bJ, dc)), dr) | |
529 | - | ds | |
535 | + | func df (bG,dg) = { | |
536 | + | let dh = cF() | |
537 | + | let cI = dh._1 | |
538 | + | let cJ = dh._2 | |
539 | + | let cY = cV(bG) | |
540 | + | let di = (cY + dg) | |
541 | + | let de = cZ(bG) | |
542 | + | [IntegerEntry(bF(bG, cI), di), IntegerEntry(bI(bG, cI), height), IntegerEntry(bH(bG, cI), de)] | |
530 | 543 | } | |
531 | 544 | ||
532 | 545 | ||
533 | - | func dt (bJ) = { | |
534 | - | let du = da() | |
535 | - | let dc = du._1 | |
536 | - | let dd = du._2 | |
537 | - | let ds = dp(bJ) | |
538 | - | let dv = valueOrElse(getInteger(this, bK(bJ, dc)), 0) | |
539 | - | let dw = valueOrElse(getInteger(this, bL(bJ, dc)), dd) | |
540 | - | let dx = (height - dw) | |
541 | - | let dy = ((dx * ds) + dv) | |
542 | - | dy | |
546 | + | func dj (bG,bO) = { | |
547 | + | let dk = cF() | |
548 | + | let cI = dk._1 | |
549 | + | let cJ = dk._2 | |
550 | + | let aY = addressFromStringValue(bO) | |
551 | + | let dl = cT(bG, bO) | |
552 | + | let dm = valueOrElse(getInteger(this, bK(bG, aY, cI)), 0) | |
553 | + | let dn = valueOrElse(getInteger(this, bL(bG, aY, cI)), cJ) | |
554 | + | let do = (height - dn) | |
555 | + | let dp = ((do * dl) + dm) | |
556 | + | dp | |
543 | 557 | } | |
544 | 558 | ||
545 | 559 | ||
546 | - | func dz (bJ,dA) = { | |
547 | - | let dB = da() | |
548 | - | let dc = dB._1 | |
549 | - | let dd = dB._2 | |
550 | - | let ds = dp(bJ) | |
551 | - | let dC = (ds + dA) | |
552 | - | let dy = dt(bJ) | |
553 | - | [IntegerEntry(bI(bJ, dc), dC), IntegerEntry(bL(bJ, dc), height), IntegerEntry(bK(bJ, dc), dy)] | |
560 | + | func dq (bG,bO,dr) = { | |
561 | + | let ds = cF() | |
562 | + | let cI = ds._1 | |
563 | + | let cJ = ds._2 | |
564 | + | let aY = addressFromStringValue(bO) | |
565 | + | let dt = cO(bG, bO) | |
566 | + | let du = if ((dt == 0)) | |
567 | + | then nil | |
568 | + | else { | |
569 | + | let dg = if (dr) | |
570 | + | then dt | |
571 | + | else -(dt) | |
572 | + | let dv = df(bG, dg) | |
573 | + | let dp = dj(bG, bO) | |
574 | + | let dw = [IntegerEntry(bL(bG, aY, cI), height), IntegerEntry(bK(bG, aY, cI), dp)] | |
575 | + | (dv ++ dw) | |
576 | + | } | |
577 | + | du | |
554 | 578 | } | |
555 | 579 | ||
556 | 580 | ||
557 | - | func dD (bJ,bR) = { | |
558 | - | let dE = da() | |
559 | - | let dc = dE._1 | |
560 | - | let dd = dE._2 | |
561 | - | let aS = addressFromStringValue(bR) | |
562 | - | let dF = dn(bJ, bR) | |
563 | - | let dG = valueOrElse(getInteger(this, bN(bJ, aS, dc)), 0) | |
564 | - | let dH = valueOrElse(getInteger(this, bO(bJ, aS, dc)), dd) | |
565 | - | let dI = (height - dH) | |
566 | - | let dJ = ((dI * dF) + dG) | |
567 | - | dJ | |
581 | + | func dx (bG,bO) = { | |
582 | + | let dy = cF() | |
583 | + | let cI = dy._1 | |
584 | + | let cJ = dy._2 | |
585 | + | let aY = addressFromStringValue(bO) | |
586 | + | let dz = bM(bG, aY, cI) | |
587 | + | let dA = valueOrElse(getInteger(this, dz), 0) | |
588 | + | let dB = bJ(bG, aY, cI) | |
589 | + | let dC = valueOrElse(getInteger(this, dB), 0) | |
590 | + | let dp = dj(bG, bO) | |
591 | + | let de = cZ(bG) | |
592 | + | let dD = (dp - dA) | |
593 | + | let dE = (de - dC) | |
594 | + | $Tuple3([IntegerEntry(dz, dp), IntegerEntry(dB, de)], dD, dE) | |
568 | 595 | } | |
569 | 596 | ||
570 | 597 | ||
571 | - | func dK (bJ,bR,dL) = { | |
572 | - | let dM = da() | |
573 | - | let dc = dM._1 | |
574 | - | let dd = dM._2 | |
575 | - | let aS = addressFromStringValue(bR) | |
576 | - | let dN = di(bJ, bR) | |
577 | - | let dO = if ((dN == 0)) | |
578 | - | then nil | |
579 | - | else { | |
580 | - | let dA = if (dL) | |
581 | - | then dN | |
582 | - | else -(dN) | |
583 | - | let dP = dz(bJ, dA) | |
584 | - | let dJ = dD(bJ, bR) | |
585 | - | let dQ = [IntegerEntry(bO(bJ, aS, dc), height), IntegerEntry(bN(bJ, aS, dc), dJ)] | |
586 | - | (dP ++ dQ) | |
587 | - | } | |
588 | - | dO | |
598 | + | func dF () = { | |
599 | + | let dG = s(bQ, ah()) | |
600 | + | let dH = getInteger(this, ak()) | |
601 | + | let dI = getInteger(this, al()) | |
602 | + | let dJ = s(bQ, an()) | |
603 | + | let dK = if ((height > dJ)) | |
604 | + | then dJ | |
605 | + | else height | |
606 | + | let dL = { | |
607 | + | let aJ = dH | |
608 | + | if ($isInstanceOf(aJ, "Int")) | |
609 | + | then { | |
610 | + | let dM = aJ | |
611 | + | max([(dK - dM), 0]) | |
612 | + | } | |
613 | + | else if ($isInstanceOf(aJ, "Unit")) | |
614 | + | then 0 | |
615 | + | else throw("Match error") | |
616 | + | } | |
617 | + | let dN = ((dG * (bX - 1)) / bX) | |
618 | + | let dO = valueOrElse(dI, 0) | |
619 | + | let dP = ((dN * dL) + dO) | |
620 | + | $Tuple2([IntegerEntry(al(), dP), IntegerEntry(ak(), height)], dP) | |
589 | 621 | } | |
590 | 622 | ||
591 | 623 | ||
592 | - | func dR (bJ,bR) = { | |
593 | - | let dS = da() | |
594 | - | let dc = dS._1 | |
595 | - | let dd = dS._2 | |
596 | - | let aS = addressFromStringValue(bR) | |
597 | - | let dT = bP(bJ, aS, dc) | |
598 | - | let dU = valueOrElse(getInteger(this, dT), 0) | |
599 | - | let dV = bM(bJ, aS, dc) | |
600 | - | let dW = valueOrElse(getInteger(this, dV), 0) | |
601 | - | let dJ = dD(bJ, bR) | |
602 | - | let dy = dt(bJ) | |
603 | - | let dX = (dJ - dU) | |
604 | - | let dY = (dy - dW) | |
605 | - | $Tuple3([IntegerEntry(dT, dJ), IntegerEntry(dV, dy)], dX, dY) | |
624 | + | func dQ (bG,bO,dR) = { | |
625 | + | let aY = valueOrErrorMessage(addressFromString(bO), j("invalid user address")) | |
626 | + | let br = bZ(aY) | |
627 | + | if ((br == br)) | |
628 | + | then { | |
629 | + | let dS = "empty" | |
630 | + | let dT = if ((bG != dS)) | |
631 | + | then { | |
632 | + | let dU = valueOrErrorMessage(getString(bP, Q(bG)), j(("unsupported lp asset " + bG))) | |
633 | + | getIntegerValue(bP, S(dU)) | |
634 | + | } | |
635 | + | else if (dR) | |
636 | + | then 0 | |
637 | + | else l(("not readonly mode: unsupported lp asset " + bG)) | |
638 | + | let dV = bs(br, bG) | |
639 | + | let dW = bq(br) | |
640 | + | let dX = valueOrElse(getInteger(this, dV), p(this, dW)) | |
641 | + | let dP = dF()._2 | |
642 | + | let dY = (dP - dX) | |
643 | + | if ((0 > dY)) | |
644 | + | then l("wrong calculations") | |
645 | + | else { | |
646 | + | let dZ = dx(bG, bO) | |
647 | + | let ea = dZ._1 | |
648 | + | let eb = dZ._2 | |
649 | + | let ec = dZ._3 | |
650 | + | let ed = fraction(dY, dT, d) | |
651 | + | let ee = if ((ec == 0)) | |
652 | + | then 0 | |
653 | + | else fraction(ed, eb, ec) | |
654 | + | let ef = ([IntegerEntry(dV, dP)] ++ ea) | |
655 | + | let eg = makeString([toString(dX), toString(dY), toString(dT), toString(eb), toString(ec)], ":") | |
656 | + | $Tuple3(ee, ef, eg) | |
657 | + | } | |
658 | + | } | |
659 | + | else throw("Strict value is not equal to itself.") | |
606 | 660 | } | |
607 | 661 | ||
608 | 662 | ||
609 | - | func dZ () = { | |
610 | - | let ea = n(bT, ag()) | |
611 | - | let eb = getInteger(this, aj()) | |
612 | - | let ec = getInteger(this, ak()) | |
613 | - | let ed = n(bT, am()) | |
614 | - | let cH = if ((height > ed)) | |
615 | - | then ed | |
616 | - | else height | |
617 | - | let ee = { | |
618 | - | let r = eb | |
619 | - | if ($isInstanceOf(r, "Int")) | |
620 | - | then { | |
621 | - | let ef = r | |
622 | - | max([(cH - ef), 0]) | |
623 | - | } | |
624 | - | else if ($isInstanceOf(r, "Unit")) | |
625 | - | then 0 | |
626 | - | else throw("Match error") | |
627 | - | } | |
628 | - | let eg = ((ea * (bZ - 1)) / bZ) | |
629 | - | let eh = valueOrElse(ec, 0) | |
630 | - | let ei = ((eg * ee) + eh) | |
631 | - | $Tuple2([IntegerEntry(ak(), ei), IntegerEntry(aj(), height)], ei) | |
632 | - | } | |
633 | - | ||
634 | - | ||
635 | - | func ej (bJ,bR,ek) = { | |
636 | - | let el = getString(this, aR(bR)) | |
637 | - | if ((el == unit)) | |
638 | - | then $Tuple3(0, nil, "userRecord::is::empty") | |
663 | + | func eh (aO,bg) = { | |
664 | + | let ei = toBase58String(ay) | |
665 | + | if ((size(aO.payments) != 1)) | |
666 | + | then l("invalid payment - exact one payment must be attached") | |
639 | 667 | else { | |
640 | - | let em = split(value(el), a) | |
641 | - | let en = em[aL] | |
642 | - | let eo = "empty" | |
643 | - | let ep = if ((bJ != eo)) | |
644 | - | then { | |
645 | - | let eq = valueOrErrorMessage(getString(bS, O(bJ)), e(("unsupported lp asset " + bJ))) | |
646 | - | getIntegerValue(bS, Q(eq)) | |
647 | - | } | |
648 | - | else if (ek) | |
649 | - | then 0 | |
650 | - | else g(("not readonly mode: unsupported lp asset " + bJ)) | |
651 | - | let er = bu(en, bJ) | |
652 | - | let es = bt(en) | |
653 | - | let et = valueOrElse(getInteger(this, er), k(this, es)) | |
654 | - | let ei = dZ()._2 | |
655 | - | let eu = (ei - et) | |
656 | - | if ((0 > eu)) | |
657 | - | then g("wrong calculations") | |
668 | + | let cD = aO.payments[0] | |
669 | + | let ej = cD.amount | |
670 | + | if ((ay != value(cD.assetId))) | |
671 | + | then l((("invalid asset is in payment - " + ei) + " is expected")) | |
658 | 672 | else { | |
659 | - | let ev = dR(bJ, bR) | |
660 | - | let ew = ev._1 | |
661 | - | let ex = ev._2 | |
662 | - | let ey = ev._3 | |
663 | - | let ez = fraction(eu, ep, d) | |
664 | - | let eA = if ((ey == 0)) | |
665 | - | then 0 | |
666 | - | else fraction(ez, ex, ey) | |
667 | - | let eB = ([IntegerEntry(er, ei)] ++ ew) | |
668 | - | let eC = makeString([toString(et), toString(eu), toString(ep), toString(ex), toString(ey)], ":") | |
669 | - | $Tuple3(eA, eB, eC) | |
673 | + | let ek = bj() | |
674 | + | let aY = aO.caller | |
675 | + | let bO = toString(aY) | |
676 | + | let el = isDefined(getString(bk(bO))) | |
677 | + | let em = if (el) | |
678 | + | then value(getString(bk(bO))) | |
679 | + | else toString(s(this, ek)) | |
680 | + | let br = parseIntValue(em) | |
681 | + | let ck = height | |
682 | + | if (if ((az > ej)) | |
683 | + | then (aY != bT) | |
684 | + | else false) | |
685 | + | then l(("amount is less then minLockAmount=" + toString(az))) | |
686 | + | else if ((aA > bg)) | |
687 | + | then l(("passed duration is less than minLockDuration=" + toString(aA))) | |
688 | + | else if ((bg > aB)) | |
689 | + | then l(("passed duration is greater than maxLockDuration=" + toString(aB))) | |
690 | + | else if (((bg % aE) != 0)) | |
691 | + | then l(("duration must be multiple of lockStepBlocks=" + toString(aE))) | |
692 | + | else { | |
693 | + | let en = fraction(ej, bg, aB) | |
694 | + | let eo = ca() | |
695 | + | let dW = bq(br) | |
696 | + | let dP = dF()._2 | |
697 | + | let ep = cE(aY) | |
698 | + | let eq = invoke(bS, "refreshUserReward", [aY.bytes, br], nil) | |
699 | + | if ((eq == eq)) | |
700 | + | then { | |
701 | + | let er = if (el) | |
702 | + | then nil | |
703 | + | else [IntegerEntry(ek, (br + 1)), StringEntry(bk(bO), em), StringEntry(bl(em), bO)] | |
704 | + | $Tuple2(((((er ++ cA(aY, aO.transactionId, ej, ck, bg, en, 0)) ++ cn(ej, bg, 1, if (el) | |
705 | + | then 0 | |
706 | + | else 1)) :+ ch("lock", bO, ej, ck, bg, en, aO)) ++ [IntegerEntry(dW, dP), IntegerEntry(by(), (eo + en)), IntegerEntry(bc(aY), (ep + en))]), en) | |
707 | + | } | |
708 | + | else throw("Strict value is not equal to itself.") | |
709 | + | } | |
670 | 710 | } | |
671 | 711 | } | |
672 | 712 | } | |
673 | 713 | ||
674 | 714 | ||
675 | - | func eD (aI,aY) = { | |
676 | - | let eE = av() | |
677 | - | let eF = eE[ap] | |
678 | - | let ay = fromBase58String(eF) | |
679 | - | let az = parseIntValue(eE[aq]) | |
680 | - | let aA = parseIntValue(eE[ar]) | |
681 | - | let aB = parseIntValue(eE[as]) | |
682 | - | if ((size(aI.payments) != 1)) | |
683 | - | then g("invalid payment - exact one payment must be attached") | |
684 | - | else { | |
685 | - | let cT = aI.payments[0] | |
686 | - | let eG = cT.amount | |
687 | - | if ((ay != value(cT.assetId))) | |
688 | - | then g((("invalid asset is in payment - " + eF) + " is expected")) | |
689 | - | else { | |
690 | - | let eH = be() | |
691 | - | let bR = toString(aI.caller) | |
692 | - | let eI = isDefined(getString(bf(bR))) | |
693 | - | let en = if (eI) | |
694 | - | then value(getString(bf(bR))) | |
695 | - | else toString(n(this, eH)) | |
696 | - | let aV = parseIntValue(en) | |
697 | - | let cm = height | |
698 | - | let cL = bi(en) | |
699 | - | let cM = bj(en) | |
700 | - | let cK = bh(en) | |
701 | - | if (if ((az > eG)) | |
702 | - | then (aI.caller != bW) | |
703 | - | else false) | |
704 | - | then g(("amount is less then minLockAmount=" + toString(az))) | |
705 | - | else if ((aA > aY)) | |
706 | - | then g(("passed duration is less then minLockDuration=" + toString(aA))) | |
707 | - | else if ((aY > aB)) | |
708 | - | then g(("passed duration is greater then maxLockDuration=" + toString(aB))) | |
709 | - | else if (if (eI) | |
710 | - | then ((n(this, cL) + n(this, cM)) >= cm) | |
711 | - | else false) | |
712 | - | then g("there is an active lock - consider to use increaseLock") | |
713 | - | else if ((k(this, cK) > 0)) | |
714 | - | then g(("there are locked WXs - consider to use increaseLock " + cK)) | |
715 | - | else { | |
716 | - | let eJ = fraction(aY, c, aB) | |
717 | - | let eK = fraction(eG, eJ, c) | |
718 | - | let eL = q(invoke(aw, "calcGwxParamsREADONLY", [eK, cm, aY], nil)) | |
719 | - | let cn = t(eL[0]) | |
720 | - | let co = t(eL[1]) | |
721 | - | let bn = toString(t(eL[2])) | |
722 | - | let cg = cb(false) | |
723 | - | let es = bt(en) | |
724 | - | let ei = dZ()._2 | |
725 | - | let eM = if (eI) | |
726 | - | then nil | |
727 | - | else [IntegerEntry(eH, (aV + 1)), StringEntry(bf(bR), en), StringEntry(bg(en), bR)] | |
728 | - | $Tuple2(((((eM ++ cJ(bR, en, eG, cm, aY, cn, co, bn)) ++ cr(eG, aY, 1, if (eI) | |
729 | - | then 0 | |
730 | - | else 1)) :+ cj("lock", bR, eG, cm, aY, cn, co, aI)) ++ [IntegerEntry(es, ei), IntegerEntry(bA(), (cg + eK))]), eK) | |
731 | - | } | |
732 | - | } | |
733 | - | } | |
715 | + | func es (aY,et) = { | |
716 | + | let eu = bb(aY, et) | |
717 | + | let ev = parseIntValue(eu[aR]) | |
718 | + | let ck = parseIntValue(eu[aS]) | |
719 | + | let ew = parseIntValue(eu[aT]) | |
720 | + | let ex = (ck + ew) | |
721 | + | let bi = parseIntValue(eu[aW]) | |
722 | + | let ey = ((height - ck) / aD) | |
723 | + | let ez = fraction(toBigInt(ey), (toBigInt((i * aD)) * h), toBigInt(ew)) | |
724 | + | let eA = if ((height > ex)) | |
725 | + | then ev | |
726 | + | else toInt(fraction(toBigInt(ev), (h - pow(toBigInt(5), 1, ez, f, f, DOWN)), h)) | |
727 | + | let eB = (eA - bi) | |
728 | + | eB | |
734 | 729 | } | |
735 | 730 | ||
736 | 731 | ||
737 | - | @Callable(aI) | |
738 | - | func constructor (eN,eO,az,eP,eQ,aw) = { | |
739 | - | let eR = aH(aI) | |
740 | - | if ((eR == eR)) | |
741 | - | then ([IntegerEntry(be(), 0), StringEntry(au(), aC(eO, az, eP, eQ, aw)), StringEntry(A(), eN)] ++ cr(0, 0, 0, 0)) | |
742 | - | else throw("Strict value is not equal to itself.") | |
743 | - | } | |
744 | - | ||
745 | - | ||
746 | - | ||
747 | - | @Callable(aI) | |
748 | - | func lockRef (aY,eS,eT) = { | |
749 | - | let eU = eD(aI, aY) | |
750 | - | let eV = eU._1 | |
751 | - | let eK = eU._2 | |
752 | - | let eW = toString(aI.caller) | |
753 | - | let eX = if (if ((eS == "")) | |
754 | - | then true | |
755 | - | else (eT == base58'')) | |
756 | - | then unit | |
757 | - | else invoke(w, "createPair", [z, eS, eW, eT], nil) | |
758 | - | if ((eX == eX)) | |
732 | + | @Callable(aO) | |
733 | + | func lockRef (bg,eC,eD) = { | |
734 | + | let eE = aH() | |
735 | + | if ((eE == eE)) | |
759 | 736 | then { | |
760 | - | let eY = invoke(aw, "updateReferralActivity", [toString(aI.caller), eK], nil) | |
761 | - | if ((eY == eY)) | |
762 | - | then $Tuple2(eV, unit) | |
737 | + | let eF = eh(aO, bg) | |
738 | + | let eG = eF._1 | |
739 | + | let en = eF._2 | |
740 | + | let eH = toString(aO.caller) | |
741 | + | let eI = if (if ((eC == "")) | |
742 | + | then true | |
743 | + | else (eD == base58'')) | |
744 | + | then unit | |
745 | + | else invoke(z, "createPair", [C, eC, eH, eD], nil) | |
746 | + | if ((eI == eI)) | |
747 | + | then { | |
748 | + | let eJ = invoke(aC, "updateReferralActivity", [toString(aO.caller), en], nil) | |
749 | + | if ((eJ == eJ)) | |
750 | + | then $Tuple2(eG, unit) | |
751 | + | else throw("Strict value is not equal to itself.") | |
752 | + | } | |
763 | 753 | else throw("Strict value is not equal to itself.") | |
764 | 754 | } | |
765 | 755 | else throw("Strict value is not equal to itself.") | |
766 | 756 | } | |
767 | 757 | ||
768 | 758 | ||
769 | 759 | ||
770 | - | @Callable(aI) | |
771 | - | func lock (aY) = { | |
772 | - | let eZ = eD(aI, aY) | |
773 | - | let eV = eZ._1 | |
774 | - | let eK = eZ._2 | |
775 | - | let eY = invoke(aw, "updateReferralActivity", [toString(aI.caller), eK], nil) | |
776 | - | if ((eY == eY)) | |
777 | - | then $Tuple2(eV, unit) | |
778 | - | else throw("Strict value is not equal to itself.") | |
779 | - | } | |
780 | - | ||
781 | - | ||
782 | - | ||
783 | - | @Callable(aI) | |
784 | - | func increaseLock (fa) = { | |
785 | - | let eE = av() | |
786 | - | let eF = eE[ap] | |
787 | - | let ay = fromBase58String(eF) | |
788 | - | let aA = parseIntValue(eE[ar]) | |
789 | - | let aB = parseIntValue(eE[as]) | |
790 | - | let eG = cR(aI, ay) | |
791 | - | let bR = toString(aI.caller) | |
792 | - | let em = aT(bR) | |
793 | - | let en = em[aL] | |
794 | - | let fb = parseIntValue(em[aM]) | |
795 | - | let cm = parseIntValue(em[aN]) | |
796 | - | let fc = parseIntValue(em[aO]) | |
797 | - | let fd = (cm + fc) | |
798 | - | let fe = max([(fd - height), 0]) | |
799 | - | let ff = (fb + eG) | |
800 | - | let fg = (fe + fa) | |
801 | - | if ((0 > fa)) | |
802 | - | then g("duration is less then zero") | |
803 | - | else if ((aA > fg)) | |
804 | - | then g(("lockDurationNew is less then minLockDuration=" + toString(aA))) | |
805 | - | else if ((fg > aB)) | |
806 | - | then g(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(aB))) | |
807 | - | else { | |
808 | - | let eJ = fraction(fg, c, aB) | |
809 | - | let eK = fraction(ff, eJ, c) | |
810 | - | let eY = invoke(aw, "updateReferralActivity", [toString(aI.caller), eK], nil) | |
811 | - | if ((eY == eY)) | |
812 | - | then { | |
813 | - | let fh = height | |
814 | - | let eL = q(invoke(aw, "calcGwxParamsREADONLY", [eK, fh, fg], nil)) | |
815 | - | let cn = t(eL[0]) | |
816 | - | let co = t(eL[1]) | |
817 | - | let bn = toString(t(eL[2])) | |
818 | - | let fi = cZ(bR) | |
819 | - | let fj = (eK - fi) | |
820 | - | if ((0 > fj)) | |
821 | - | then g(("gwxDiff is less then 0: " + toString(fj))) | |
822 | - | else { | |
823 | - | let cg = cb(false) | |
824 | - | let fk = cb(true) | |
825 | - | (((cJ(bR, en, ff, fh, fg, cn, co, bn) ++ cr(eG, fa, 0, 0)) :+ cj("lock", bR, eG, cm, fg, cn, co, aI)) ++ [IntegerEntry(bA(), (cg + fj))]) | |
826 | - | } | |
827 | - | } | |
828 | - | else throw("Strict value is not equal to itself.") | |
829 | - | } | |
830 | - | } | |
831 | - | ||
832 | - | ||
833 | - | ||
834 | - | @Callable(aI) | |
835 | - | func claimWxBoost (bJ,bR) = if ((bU != aI.caller)) | |
836 | - | then g("permissions denied") | |
837 | - | else { | |
838 | - | let fl = ej(bJ, bR, false) | |
839 | - | let fm = fl._1 | |
840 | - | let eB = fl._2 | |
841 | - | let eC = fl._3 | |
842 | - | $Tuple2(eB, [fm]) | |
843 | - | } | |
844 | - | ||
845 | - | ||
846 | - | ||
847 | - | @Callable(aI) | |
848 | - | func claimWxBoostREADONLY (bJ,bR) = { | |
849 | - | let fn = ej(bJ, bR, true) | |
850 | - | let fm = fn._1 | |
851 | - | let eB = fn._2 | |
852 | - | let eC = fn._3 | |
853 | - | $Tuple2(nil, [fm, eC]) | |
854 | - | } | |
855 | - | ||
856 | - | ||
857 | - | ||
858 | - | @Callable(aI) | |
859 | - | func unlock (aS) = { | |
860 | - | let em = aT(aS) | |
861 | - | let en = em[aL] | |
862 | - | let fb = parseIntValue(em[aM]) | |
863 | - | let cm = parseIntValue(em[aN]) | |
864 | - | let fc = parseIntValue(em[aO]) | |
865 | - | let fd = (cm + fc) | |
866 | - | let eE = av() | |
867 | - | let ay = fromBase58String(eE[ap]) | |
868 | - | if ((fd >= height)) | |
869 | - | then g((("wait " + toString(fd)) + " to unlock")) | |
870 | - | else if ((0 >= fb)) | |
871 | - | then g("nothing to unlock") | |
872 | - | else { | |
873 | - | let bn = valueOrElse(getInteger(aw, an()), 0) | |
874 | - | (((cJ(aS, en, 0, cm, fc, 0, 0, toString(bn)) ++ cr(-(fb), 0, 0, -1)) :+ cj("unlock", aS, fb, cm, fc, 0, 0, aI)) :+ ScriptTransfer(addressFromStringValue(aS), fb, ay)) | |
875 | - | } | |
876 | - | } | |
877 | - | ||
878 | - | ||
879 | - | ||
880 | - | @Callable(aI) | |
881 | - | func gwxUserInfoREADONLY (aS) = { | |
882 | - | let bc = cZ(aS) | |
883 | - | $Tuple2(nil, [bc]) | |
884 | - | } | |
885 | - | ||
886 | - | ||
887 | - | ||
888 | - | @Callable(aI) | |
889 | - | func userMaxDurationREADONLY (bR) = { | |
890 | - | let eE = av() | |
891 | - | let aB = parseIntValue(eE[as]) | |
892 | - | let el = getString(this, aR(bR)) | |
893 | - | if ((el == unit)) | |
894 | - | then $Tuple2(nil, $Tuple2("lock", aB)) | |
895 | - | else { | |
896 | - | let em = split(value(el), a) | |
897 | - | let cm = parseIntValue(em[aN]) | |
898 | - | let fc = parseIntValue(em[aO]) | |
899 | - | let fd = (cm + fc) | |
900 | - | let fe = max([(fd - height), 0]) | |
901 | - | let fo = (aB - fe) | |
902 | - | $Tuple2(nil, $Tuple2("increaseLock", fo)) | |
903 | - | } | |
904 | - | } | |
905 | - | ||
906 | - | ||
907 | - | ||
908 | - | @Callable(aI) | |
909 | - | func getUserGwxAmountAtHeightREADONLY (aS,cV) = { | |
910 | - | let bc = cU(aS, cV) | |
911 | - | $Tuple2(nil, bc) | |
912 | - | } | |
913 | - | ||
914 | - | ||
915 | - | ||
916 | - | @Callable(aI) | |
917 | - | func getTotalCachedGwxREADONLY () = $Tuple2(nil, cb(true)) | |
918 | - | ||
919 | - | ||
920 | - | ||
921 | - | @Callable(aI) | |
922 | - | func onBoostEmissionUpdate () = { | |
923 | - | let eR = if ((aI.caller == bT)) | |
924 | - | then true | |
925 | - | else aH(aI) | |
926 | - | if ((eR == eR)) | |
927 | - | then dZ() | |
928 | - | else throw("Strict value is not equal to itself.") | |
929 | - | } | |
930 | - | ||
931 | - | ||
932 | - | ||
933 | - | @Callable(aI) | |
934 | - | func onStakedVoteUpdate (bJ,bR,dL) = { | |
935 | - | let eR = if ((aI.caller == bU)) | |
936 | - | then true | |
937 | - | else aH(aI) | |
938 | - | if ((eR == eR)) | |
760 | + | @Callable(aO) | |
761 | + | func lock (bg) = { | |
762 | + | let eE = aH() | |
763 | + | if ((eE == eE)) | |
939 | 764 | then { | |
940 | - | let dO = dK(bJ, bR, dL) | |
941 | - | $Tuple2(dO, unit) | |
765 | + | let eK = eh(aO, bg) | |
766 | + | let eG = eK._1 | |
767 | + | let en = eK._2 | |
768 | + | let eJ = invoke(aC, "updateReferralActivity", [toString(aO.caller), en], nil) | |
769 | + | if ((eJ == eJ)) | |
770 | + | then $Tuple2(eG, unit) | |
771 | + | else throw("Strict value is not equal to itself.") | |
942 | 772 | } | |
943 | 773 | else throw("Strict value is not equal to itself.") | |
944 | 774 | } | |
945 | 775 | ||
946 | 776 | ||
947 | 777 | ||
948 | - | @Callable(aI) | |
949 | - | func getVotingResultStakedREADONLY (bJ) = $Tuple2(nil, dp(bJ)) | |
778 | + | @Callable(aO) | |
779 | + | func claimWxBoost (bG,bO) = { | |
780 | + | let eE = aH() | |
781 | + | if ((eE == eE)) | |
782 | + | then if ((bR != aO.caller)) | |
783 | + | then l("permissions denied") | |
784 | + | else { | |
785 | + | let eL = dQ(bG, bO, false) | |
786 | + | let eM = eL._1 | |
787 | + | let ef = eL._2 | |
788 | + | let eg = eL._3 | |
789 | + | $Tuple2(ef, [eM]) | |
790 | + | } | |
791 | + | else throw("Strict value is not equal to itself.") | |
792 | + | } | |
950 | 793 | ||
951 | 794 | ||
952 | 795 | ||
953 | - | @Callable(aI) | |
954 | - | func getVotingResultStakedIntegralREADONLY (bJ) = $Tuple2(nil, dt(bJ)) | |
796 | + | @Callable(aO) | |
797 | + | func claimWxBoostREADONLY (bG,bO) = { | |
798 | + | let eN = dQ(bG, bO, true) | |
799 | + | let eM = eN._1 | |
800 | + | let ef = eN._2 | |
801 | + | let eg = eN._3 | |
802 | + | $Tuple2(nil, [eM, eg]) | |
803 | + | } | |
955 | 804 | ||
956 | 805 | ||
957 | 806 | ||
958 | - | @Callable(aI) | |
959 | - | func getUserVoteFinalizedREADONLY (bJ,bR) = $Tuple2(nil, di(bJ, bR)) | |
807 | + | @Callable(aO) | |
808 | + | func unlock (eO) = { | |
809 | + | let eE = aH() | |
810 | + | if ((eE == eE)) | |
811 | + | then { | |
812 | + | let aY = aO.caller | |
813 | + | let bO = toString(aY) | |
814 | + | let et = if ((eO == "")) | |
815 | + | then unit | |
816 | + | else fromBase58String(eO) | |
817 | + | let eu = bb(aY, et) | |
818 | + | let ev = parseIntValue(eu[aR]) | |
819 | + | let ck = parseIntValue(eu[aS]) | |
820 | + | let ew = parseIntValue(eu[aT]) | |
821 | + | let bi = parseIntValue(eu[aW]) | |
822 | + | let bh = parseIntValue(eu[aV]) | |
823 | + | let ey = ((height - ck) / aD) | |
824 | + | let eB = es(aY, et) | |
825 | + | let eP = min([fraction(eB, ew, aB), bh]) | |
826 | + | let eQ = v((bh - eP), "gwxRemaining") | |
827 | + | let eR = cb(aY) | |
828 | + | if ((0 >= eB)) | |
829 | + | then l("nothing to unlock") | |
830 | + | else { | |
831 | + | let eo = ca() | |
832 | + | let ep = cE(aY) | |
833 | + | let eS = v((ep - eP), "userGwxAmountTotalNew") | |
834 | + | if ((eR > eS)) | |
835 | + | then l(("locked gwx amount: " + toString(eR))) | |
836 | + | else { | |
837 | + | let br = parseIntValue(valueOrErrorMessage(getString(bk(bO)), j("invalid user number"))) | |
838 | + | let eq = invoke(bS, "refreshUserReward", [aY.bytes, br], nil) | |
839 | + | if ((eq == eq)) | |
840 | + | then ((((cA(aY, et, ev, ck, ew, eQ, (bi + eB)) ++ cn(-(eB), 0, 0, 0)) :+ ch("unlock", bO, eB, ck, ew, eP, aO)) :+ ScriptTransfer(aY, eB, ay)) ++ [IntegerEntry(by(), v((eo - eP), "gwxTotal")), IntegerEntry(bc(aY), eS)]) | |
841 | + | else throw("Strict value is not equal to itself.") | |
842 | + | } | |
843 | + | } | |
844 | + | } | |
845 | + | else throw("Strict value is not equal to itself.") | |
846 | + | } | |
960 | 847 | ||
961 | 848 | ||
962 | 849 | ||
963 | - | @Callable(aI) | |
964 | - | func getUserVoteStakedIntegralREADONLY (bJ,bR) = $Tuple2(nil, dD(bJ, bR)) | |
850 | + | @Callable(aO) | |
851 | + | func gwxUserInfoREADONLY (bO) = { | |
852 | + | let aY = valueOrErrorMessage(addressFromString(bO), j("invalid user address")) | |
853 | + | let bh = cE(aY) | |
854 | + | $Tuple2(nil, [bh]) | |
855 | + | } | |
965 | 856 | ||
966 | 857 | ||
967 | - | @Verifier(fp) | |
968 | - | func fq () = { | |
969 | - | let fr = { | |
970 | - | let r = aF() | |
971 | - | if ($isInstanceOf(r, "ByteVector")) | |
858 | + | ||
859 | + | @Callable(aO) | |
860 | + | func userMaxDurationREADONLY (bO) = $Tuple2(nil, $Tuple2("lock", aB)) | |
861 | + | ||
862 | + | ||
863 | + | ||
864 | + | @Callable(aO) | |
865 | + | func getUserGwxAmountAtHeightREADONLY (bO,eT) = { | |
866 | + | let aY = valueOrErrorMessage(addressFromString(bO), j("invalid user address")) | |
867 | + | let bh = cE(aY) | |
868 | + | $Tuple2(nil, bh) | |
869 | + | } | |
870 | + | ||
871 | + | ||
872 | + | ||
873 | + | @Callable(aO) | |
874 | + | func getUserGwxAmount (bO) = { | |
875 | + | let aY = valueOrErrorMessage(addressFromString(bO), j("invalid user address")) | |
876 | + | let bh = cE(aY) | |
877 | + | $Tuple2(nil, bh) | |
878 | + | } | |
879 | + | ||
880 | + | ||
881 | + | ||
882 | + | @Callable(aO) | |
883 | + | func getGwxTotalREADONLY () = $Tuple2(nil, ca()) | |
884 | + | ||
885 | + | ||
886 | + | ||
887 | + | @Callable(aO) | |
888 | + | func onBoostEmissionUpdate () = { | |
889 | + | let eE = aH() | |
890 | + | if ((eE == eE)) | |
891 | + | then { | |
892 | + | let eU = if ((aO.caller == bQ)) | |
893 | + | then true | |
894 | + | else aN(aO) | |
895 | + | if ((eU == eU)) | |
896 | + | then dF() | |
897 | + | else throw("Strict value is not equal to itself.") | |
898 | + | } | |
899 | + | else throw("Strict value is not equal to itself.") | |
900 | + | } | |
901 | + | ||
902 | + | ||
903 | + | ||
904 | + | @Callable(aO) | |
905 | + | func onStakedVoteUpdate (bG,bO,dr) = { | |
906 | + | let eE = aH() | |
907 | + | if ((eE == eE)) | |
908 | + | then { | |
909 | + | let eU = if ((aO.caller == bR)) | |
910 | + | then true | |
911 | + | else aN(aO) | |
912 | + | if ((eU == eU)) | |
913 | + | then { | |
914 | + | let du = dq(bG, bO, dr) | |
915 | + | $Tuple2(du, unit) | |
916 | + | } | |
917 | + | else throw("Strict value is not equal to itself.") | |
918 | + | } | |
919 | + | else throw("Strict value is not equal to itself.") | |
920 | + | } | |
921 | + | ||
922 | + | ||
923 | + | ||
924 | + | @Callable(aO) | |
925 | + | func getVotingResultStakedREADONLY (bG) = $Tuple2(nil, cV(bG)) | |
926 | + | ||
927 | + | ||
928 | + | ||
929 | + | @Callable(aO) | |
930 | + | func getVotingResultStakedIntegralREADONLY (bG) = $Tuple2(nil, cZ(bG)) | |
931 | + | ||
932 | + | ||
933 | + | ||
934 | + | @Callable(aO) | |
935 | + | func getUserVoteFinalizedREADONLY (bG,bO) = $Tuple2(nil, cO(bG, bO)) | |
936 | + | ||
937 | + | ||
938 | + | ||
939 | + | @Callable(aO) | |
940 | + | func getUserVoteStakedIntegralREADONLY (bG,bO) = $Tuple2(nil, dj(bG, bO)) | |
941 | + | ||
942 | + | ||
943 | + | ||
944 | + | @Callable(aO) | |
945 | + | func suspend (w) = { | |
946 | + | let eU = aN(aO) | |
947 | + | if ((eU == eU)) | |
948 | + | then $Tuple2([BooleanEntry(aF, w)], w) | |
949 | + | else throw("Strict value is not equal to itself.") | |
950 | + | } | |
951 | + | ||
952 | + | ||
953 | + | @Verifier(eV) | |
954 | + | func eW () = { | |
955 | + | let eX = { | |
956 | + | let aJ = aL() | |
957 | + | if ($isInstanceOf(aJ, "ByteVector")) | |
972 | 958 | then { | |
973 | - | let | |
974 | - | | |
959 | + | let aQ = aJ | |
960 | + | aQ | |
975 | 961 | } | |
976 | - | else if ($isInstanceOf( | |
977 | - | then | |
962 | + | else if ($isInstanceOf(aJ, "Unit")) | |
963 | + | then eV.senderPublicKey | |
978 | 964 | else throw("Match error") | |
979 | 965 | } | |
980 | - | sigVerify( | |
966 | + | sigVerify(eV.bodyBytes, eV.proofs[0], eX) | |
981 | 967 | } | |
982 | 968 |
github/deemru/w8io/169f3d6 252.74 ms ◑