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