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