tx · FCgGzRvw6fdH5SmPd5M5JNpfGPqa99GziSpQ8X6sGo1A 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT: -0.03200000 Waves 2023.02.27 12:42 [2467950] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves
{ "type": 13, "id": "FCgGzRvw6fdH5SmPd5M5JNpfGPqa99GziSpQ8X6sGo1A", "fee": 3200000, "feeAssetId": null, "timestamp": 1677490954751, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "4VXRnbE8FJ1A6mb4pn6CtHagCGPFt3uXZgjcr1K8R1pHYRsm8fivvx5UHyK5EHGsvNFMvZfKivi9nqQxRe7V7TCt" ], "script": "base64:BgK/IggCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIECgIIARIECgIIARIECgIBARIDCgEBEgUKAwEBARIFCgMBCAESBAoCAQgSBAoCAQgSBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCCIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiCnNsaXBwYWdlNEQiC3dhdmVzU3RyaW5nIgVBbXVsdCIFRGNvbnYiA1NFUCIFRU1QVFkiClBvb2xBY3RpdmUiClBvb2xQdXREaXMiDlBvb2xNYXRjaGVyRGlzIgxQb29sU2h1dGRvd24iDmlkeFBvb2xBZGRyZXNzIglpZHhQb29sU3QiCWlkeExQQXNJZCIJaWR4QW1Bc0lkIglpZHhQckFzSWQiC2lkeEFtdEFzRGNtIg1pZHhQcmljZUFzRGNtIgtpZHhJQW10QXNJZCINaWR4SVByaWNlQXNJZCIPaWR4RmFjdFN0YWtDbnRyIhJpZ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saWNLZXkJAAIBAgtNYXRjaCBlcnJvcgQCYXYFAmdPAwkAAQIFAmF2AgVPcmRlcgQCZHoFAmF2BAJnUgkBAmFKAAQCZ1MJAQJkeQEFAmR6BAJnVAkA9AMDCAUCZHoJYm9keUJ5dGVzCQCRAwIIBQJkegZwcm9vZnMAAAgFAmR6D3NlbmRlclB1YmxpY0tleQQCZ1UJAPQDAwgFAmR6CWJvZHlCeXRlcwkAkQMCCAUCZHoGcHJvb2ZzAAEFAmdSAwMDBQJnUwUCZ1QHBQJnVQcGCQECYXEDBQJnUwUCZ1QFAmdVAwkAAQIFAmF2AhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZFoFAmF2BAJnVgkA9gMBCQEFdmFsdWUBCAUCZFoGc2NyaXB0BAJnVwkA2wQBCQEFdmFsdWUBCQCdCAIFAmFECQECYW8ABAJnWAkA8QcBBQR0aGlzAwMJAAACBQJnVwUCZ1YJAQIhPQIFAmdYBQJnVgcGCQD0AwMIBQJnTwlib2R5Qnl0ZXMJAJEDAggFAmdPBnByb29mcwAABQJnUQkA9AMDCAUCZ08JYm9keUJ5dGVzCQCRAwIIBQJnTwZwcm9vZnMAAAUCZ1GEykE/", "chainId": 84, "height": 2467950, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2vZHFhDbkCCjV4QTWnhMjjpBiGJjeB1Sqb7A2VcJShT1 Next: Gm59MEY78Hw4gwPA5rhY7dMdDAVeZw3BX9kVG1962tmP Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | ||
16 | 16 | let g = toBigInt(2) | |
17 | 17 | ||
18 | - | let h = toBigInt( | |
18 | + | let h = toBigInt((a - ((a * 1) / a))) | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = "WAVES" | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = "100" | |
23 | 23 | ||
24 | - | let k = " | |
24 | + | let k = "1" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "__" | |
27 | 27 | ||
28 | - | let m = " | |
28 | + | let m = "" | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = 1 | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 2 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 3 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 4 | |
37 | 37 | ||
38 | - | let r = | |
38 | + | let r = 1 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 2 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = 3 | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = 4 | |
45 | 45 | ||
46 | - | let v = | |
46 | + | let v = 5 | |
47 | 47 | ||
48 | - | let w = | |
48 | + | let w = 6 | |
49 | 49 | ||
50 | - | let x = | |
50 | + | let x = 7 | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = 8 | |
53 | 53 | ||
54 | - | let z = | |
54 | + | let z = 9 | |
55 | 55 | ||
56 | - | let A = | |
56 | + | let A = 1 | |
57 | 57 | ||
58 | - | let B = | |
58 | + | let B = 6 | |
59 | 59 | ||
60 | - | let C = | |
60 | + | let C = 7 | |
61 | 61 | ||
62 | - | let D = | |
62 | + | let D = 10 | |
63 | 63 | ||
64 | - | let E = | |
64 | + | let E = fraction(10, a, 10000) | |
65 | 65 | ||
66 | - | let F = 10 | |
67 | - | ||
68 | - | let G = fraction(10, a, 10000) | |
69 | - | ||
70 | - | func H (I,J) = fraction(toBigInt(I), c, toBigInt(J)) | |
66 | + | func F (G,H) = fraction(toBigInt(G), c, toBigInt(H)) | |
71 | 67 | ||
72 | 68 | ||
73 | - | func | |
69 | + | func I (J,K) = toInt(fraction(J, toBigInt(K), c)) | |
74 | 70 | ||
75 | 71 | ||
76 | - | func L (M,N) = | |
72 | + | func L (M,N,O) = fraction(M, N, O) | |
77 | 73 | ||
78 | 74 | ||
79 | - | func O (M,N,P) = toInt(fraction(M, toBigInt(N), c, P)) | |
75 | + | func P (J) = if ((d > J)) | |
76 | + | then -(J) | |
77 | + | else J | |
80 | 78 | ||
81 | 79 | ||
82 | - | func Q (I,J) = fraction(I, c, toBigInt(J)) | |
80 | + | func Q (J) = if ((d > J)) | |
81 | + | then -(J) | |
82 | + | else J | |
83 | 83 | ||
84 | 84 | ||
85 | - | func R ( | |
85 | + | func R () = "%s__factoryContract" | |
86 | 86 | ||
87 | 87 | ||
88 | - | func S ( | |
88 | + | func S () = "%s__managerPublicKey" | |
89 | 89 | ||
90 | 90 | ||
91 | - | func W (M) = if ((d > M)) | |
92 | - | then -(M) | |
93 | - | else M | |
91 | + | func T () = "%s__pendingManagerPublicKey" | |
94 | 92 | ||
95 | 93 | ||
96 | - | func X (M) = if ((d > M)) | |
97 | - | then -(M) | |
98 | - | else M | |
94 | + | func U () = "%s%s__price__last" | |
99 | 95 | ||
100 | 96 | ||
101 | - | func | |
97 | + | func V (W,X) = makeString(["%s%s%d%d__price__history", toString(W), toString(X)], l) | |
102 | 98 | ||
103 | 99 | ||
104 | - | func | |
100 | + | func Y (Z,aa) = ((("%s%s%s__P__" + Z) + "__") + aa) | |
105 | 101 | ||
106 | 102 | ||
107 | - | func | |
103 | + | func ab (Z,aa) = ((("%s%s%s__G__" + Z) + "__") + aa) | |
108 | 104 | ||
109 | 105 | ||
110 | - | func | |
106 | + | func ac () = "%s__amountAsset" | |
111 | 107 | ||
112 | 108 | ||
113 | - | func | |
109 | + | func ad () = "%s__priceAsset" | |
114 | 110 | ||
115 | 111 | ||
116 | - | func | |
112 | + | func ae () = "%s__amp" | |
117 | 113 | ||
118 | 114 | ||
119 | - | func | |
115 | + | func af () = "%s__addonAddr" | |
120 | 116 | ||
121 | 117 | ||
122 | - | func | |
118 | + | func ag () = "%s__factoryConfig" | |
123 | 119 | ||
124 | 120 | ||
125 | - | func | |
121 | + | func ah () = "%s%s__matcher__publicKey" | |
126 | 122 | ||
127 | 123 | ||
128 | - | func | |
124 | + | func ai (aj,ak) = (((("%d%d%s__" + aj) + "__") + ak) + "__config") | |
129 | 125 | ||
130 | 126 | ||
131 | - | func | |
127 | + | func al (am) = ("%s%s%s__mappings__baseAsset2internalId__" + am) | |
132 | 128 | ||
133 | 129 | ||
134 | - | let an = "%s__fee" | |
135 | - | ||
136 | - | let ao = valueOrElse(getInteger(this, an), G) | |
137 | - | ||
138 | - | let ap = makeString(["%s", "dLp"], n) | |
139 | - | ||
140 | - | let aq = makeString(["%s", "dLpRefreshedHeight"], n) | |
141 | - | ||
142 | - | let ar = makeString(["%s", "refreshDLpDelay"], n) | |
143 | - | ||
144 | - | let as = 30 | |
145 | - | ||
146 | - | let at = valueOrElse(getInteger(this, ar), as) | |
147 | - | ||
148 | - | func au () = "%s__factoryConfig" | |
130 | + | func an () = "%s__shutdown" | |
149 | 131 | ||
150 | 132 | ||
151 | - | func | |
133 | + | func ao () = "%s__allowedLpStableScriptHash" | |
152 | 134 | ||
153 | 135 | ||
154 | - | func | |
136 | + | func ap () = "%s__feeCollectorAddress" | |
155 | 137 | ||
156 | 138 | ||
157 | - | func | |
139 | + | func aq (ar,as,at) = throw(((((("Failed: ordValid=" + toString(ar)) + " sndrValid=") + toString(as)) + " mtchrValid=") + toString(at))) | |
158 | 140 | ||
159 | 141 | ||
160 | - | func aB () = "%s__shutdown" | |
161 | - | ||
162 | - | ||
163 | - | func aC () = "%s__allowedLpStableScriptHash" | |
164 | - | ||
165 | - | ||
166 | - | func aD () = "%s__feeCollectorAddress" | |
167 | - | ||
168 | - | ||
169 | - | func aE (aF,aG,aH,aI) = throw((((((((("order validation failed: orderValid=" + toString(aF)) + " (") + aG) + ")") + " senderValid=") + toString(aH)) + " matcherValid=") + toString(aI))) | |
170 | - | ||
171 | - | ||
172 | - | func aJ (aK,aL) = valueOrErrorMessage(getString(aK, aL), makeString(["mandatory ", toString(aK), ".", aL, " not defined"], "")) | |
173 | - | ||
174 | - | ||
175 | - | func aM (aK,aL) = valueOrErrorMessage(getInteger(aK, aL), makeString(["mandatory ", toString(aK), ".", aL, " not defined"], "")) | |
176 | - | ||
177 | - | ||
178 | - | func aN (aO) = throw(makeString(["lp_stable.ride:", aO], " ")) | |
179 | - | ||
180 | - | ||
181 | - | func aP (aO) = makeString(["lp_stable.ride:", aO], " ") | |
182 | - | ||
183 | - | ||
184 | - | let aQ = addressFromStringValue(aJ(this, Y())) | |
185 | - | ||
186 | - | let aR = { | |
187 | - | let aS = invoke(aQ, "getInFeeREADONLY", [toString(this)], nil) | |
188 | - | if ($isInstanceOf(aS, "Int")) | |
189 | - | then aS | |
190 | - | else throw(($getType(aS) + " couldn't be cast to Int")) | |
191 | - | } | |
192 | - | ||
193 | - | let aT = { | |
194 | - | let aS = invoke(aQ, "getOutFeeREADONLY", [toString(this)], nil) | |
195 | - | if ($isInstanceOf(aS, "Int")) | |
196 | - | then aS | |
197 | - | else throw(($getType(aS) + " couldn't be cast to Int")) | |
198 | - | } | |
199 | - | ||
200 | - | let aU = aJ(this, al()) | |
201 | - | ||
202 | - | func aV () = valueOrElse(getBoolean(aQ, aB()), false) | |
203 | - | ||
204 | - | ||
205 | - | func aW () = fromBase58String(aJ(aQ, av())) | |
206 | - | ||
207 | - | ||
208 | - | let aX = addressFromStringValue(aJ(aQ, aD())) | |
209 | - | ||
210 | - | func aY () = { | |
211 | - | let aZ = aJ(this, aj()) | |
212 | - | let ba = aJ(this, ak()) | |
213 | - | let bb = aM(aQ, az(ba)) | |
214 | - | let ax = aM(aQ, az(aZ)) | |
215 | - | split(aJ(aQ, aw(toString(ax), toString(bb))), n) | |
142 | + | func au (J) = { | |
143 | + | let av = J | |
144 | + | if ($isInstanceOf(av, "String")) | |
145 | + | then { | |
146 | + | let aw = av | |
147 | + | aw | |
148 | + | } | |
149 | + | else throw("fail cast to String") | |
216 | 150 | } | |
217 | 151 | ||
218 | 152 | ||
219 | - | func bc (bd) = if ((bd == k)) | |
220 | - | then unit | |
221 | - | else fromBase58String(bd) | |
153 | + | func ax (ay,az) = valueOrErrorMessage(getString(ay, az), makeString(["mandatory ", toString(ay), ".", az, " not defined"], "")) | |
222 | 154 | ||
223 | 155 | ||
224 | - | func be (bd) = if ((bd == unit)) | |
225 | - | then k | |
226 | - | else toBase58String(value(bd)) | |
156 | + | func aA (ay,az) = valueOrErrorMessage(getInteger(ay, az), makeString(["mandatory ", toString(ay), ".", az, " not defined"], "")) | |
227 | 157 | ||
228 | 158 | ||
229 | - | func | |
159 | + | func aB (aC) = throw(makeString(["lp_stable.ride:", aC], " ")) | |
230 | 160 | ||
231 | 161 | ||
232 | - | let | |
162 | + | let aD = addressFromStringValue(ax(this, R())) | |
233 | 163 | ||
234 | - | let bi = bh | |
164 | + | let aE = { | |
165 | + | let aF = invoke(aD, "getInFeeREADONLY", [toString(this)], nil) | |
166 | + | if ($isInstanceOf(aF, "Int")) | |
167 | + | then aF | |
168 | + | else throw(($getType(aF) + " couldn't be cast to Int")) | |
169 | + | } | |
235 | 170 | ||
236 | - | let bj = bi._1 | |
171 | + | let aG = { | |
172 | + | let aF = invoke(aD, "getOutFeeREADONLY", [toString(this)], nil) | |
173 | + | if ($isInstanceOf(aF, "Int")) | |
174 | + | then aF | |
175 | + | else throw(($getType(aF) + " couldn't be cast to Int")) | |
176 | + | } | |
237 | 177 | ||
238 | - | let | |
178 | + | let aH = ax(this, ae()) | |
239 | 179 | ||
240 | - | let bl = bi._3 | |
241 | - | ||
242 | - | let bm = bi._4 | |
243 | - | ||
244 | - | let bn = bi._5 | |
245 | - | ||
246 | - | let bo = bi._6 | |
247 | - | ||
248 | - | let bp = bi._7 | |
249 | - | ||
250 | - | let bq = bi._8 | |
251 | - | ||
252 | - | let br = bi._9 | |
253 | - | ||
254 | - | func bs () = split(aJ(aQ, au()), n) | |
180 | + | func aI () = valueOrElse(getBoolean(aD, an()), false) | |
255 | 181 | ||
256 | 182 | ||
257 | - | let bt = bs() | |
258 | - | ||
259 | - | let bu = valueOrErrorMessage(addressFromString(bt[C]), "Invalid staking contract address") | |
260 | - | ||
261 | - | let bv = valueOrErrorMessage(addressFromString(bt[E]), "Invalid slipage contract address") | |
262 | - | ||
263 | - | let bw = valueOrErrorMessage(addressFromString(bt[F]), "Invalid gwx contract address") | |
264 | - | ||
265 | - | let bx = valueOrErrorMessage(addressFromString(bt[D]), "Invalid gwx contract address") | |
266 | - | ||
267 | - | func by (bz,bA,bB,bC,bD,bE,bF,bG,bH,bI) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bz), toString(bA), toString(bB), toString(bC), toString(bD), toString(bE), toString(bF), toString(bG), toString(bH), toString(bI)], n) | |
183 | + | func aJ () = fromBase58String(ax(aD, ah())) | |
268 | 184 | ||
269 | 185 | ||
270 | - | ||
186 | + | let aK = addressFromStringValue(ax(aD, ap())) | |
271 | 187 | ||
272 | - | ||
273 | - | func bN (bO) = if ((bO == "WAVES")) | |
274 | - | then wavesBalance(this).available | |
275 | - | else assetBalance(this, fromBase58String(bO)) | |
276 | - | ||
277 | - | ||
278 | - | func bP (bQ,bR) = fraction(bQ, c, bR) | |
279 | - | ||
280 | - | ||
281 | - | func bS (bQ,bR,P) = fraction(bQ, c, bR, P) | |
282 | - | ||
283 | - | ||
284 | - | func bT (bU,bV,bW) = { | |
285 | - | let bX = fraction((bU - bV), b, bV) | |
286 | - | let bY = ((bW - W(bX)) > d) | |
287 | - | if (!(bY)) | |
288 | - | then throw(("Big slpg: " + toString(bX))) | |
289 | - | else $Tuple2(bY, min([bU, bV])) | |
188 | + | func aL () = { | |
189 | + | let aM = ax(this, ac()) | |
190 | + | let aN = ax(this, ad()) | |
191 | + | let aO = aA(aD, al(aN)) | |
192 | + | let aj = aA(aD, al(aM)) | |
193 | + | split(ax(aD, ai(toString(aj), toString(aO))), l) | |
290 | 194 | } | |
291 | 195 | ||
292 | 196 | ||
293 | - | func bZ (ca,cb,cc) = { | |
294 | - | let bX = fraction(cb, b, ca) | |
295 | - | let cd = (cc > bX) | |
296 | - | if (if (cd) | |
297 | - | then true | |
298 | - | else (cb > ca)) | |
299 | - | then throw(((((((toString(cb) + " ") + toString(ca)) + " ") + toString(bX)) + " ") + toString(cc))) | |
300 | - | else cd | |
197 | + | func aP (aQ) = if ((aQ == i)) | |
198 | + | then unit | |
199 | + | else fromBase58String(aQ) | |
200 | + | ||
201 | + | ||
202 | + | func aR (aQ) = if ((aQ == unit)) | |
203 | + | then i | |
204 | + | else toBase58String(value(aQ)) | |
205 | + | ||
206 | + | ||
207 | + | func aS (aT) = $Tuple7(addressFromStringValue(aT[r]), parseIntValue(aT[s]), fromBase58String(aT[t]), aP(aT[u]), aP(aT[v]), parseIntValue(aT[w]), parseIntValue(aT[x])) | |
208 | + | ||
209 | + | ||
210 | + | let aU = aS(aL()) | |
211 | + | ||
212 | + | let aV = aU | |
213 | + | ||
214 | + | let aW = aV._1 | |
215 | + | ||
216 | + | let aX = aV._2 | |
217 | + | ||
218 | + | let aY = aV._3 | |
219 | + | ||
220 | + | let aZ = aV._4 | |
221 | + | ||
222 | + | let ba = aV._5 | |
223 | + | ||
224 | + | let bb = aV._6 | |
225 | + | ||
226 | + | let bc = aV._7 | |
227 | + | ||
228 | + | func bd () = split(ax(aD, ag()), l) | |
229 | + | ||
230 | + | ||
231 | + | let be = bd() | |
232 | + | ||
233 | + | let bf = valueOrErrorMessage(addressFromString(be[A]), "Invalid staking contract address") | |
234 | + | ||
235 | + | let bg = valueOrErrorMessage(addressFromString(be[C]), "Invalid slipage contract address") | |
236 | + | ||
237 | + | let bh = valueOrErrorMessage(addressFromString(be[D]), "Invalid gwx contract address") | |
238 | + | ||
239 | + | let bi = valueOrErrorMessage(addressFromString(be[B]), "Invalid gwx contract address") | |
240 | + | ||
241 | + | func bj (bk,bl,bm,bn,bo,bp,bq,br,bs,bt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bk), toString(bl), toString(bm), toString(bn), toString(bo), toString(bp), toString(bq), toString(br), toString(bs), toString(bt)], l) | |
242 | + | ||
243 | + | ||
244 | + | func bu (bv,bw,bx,bn,bq,br) = makeString(["%d%d%d%d%d%d", toString(bv), toString(bw), toString(bx), toString(bn), toString(bq), toString(br)], l) | |
245 | + | ||
246 | + | ||
247 | + | func by (bz) = if ((bz == "WAVES")) | |
248 | + | then wavesBalance(this).available | |
249 | + | else assetBalance(this, fromBase58String(bz)) | |
250 | + | ||
251 | + | ||
252 | + | func bA (bB,bC) = fraction(bB, c, bC) | |
253 | + | ||
254 | + | ||
255 | + | func bD (bE,bF,bG) = { | |
256 | + | let bH = fraction((bE - bF), b, bF) | |
257 | + | let bI = ((bG - P(bH)) > d) | |
258 | + | if (!(bI)) | |
259 | + | then throw(("Big slpg: " + toString(bH))) | |
260 | + | else $Tuple2(bI, min([bE, bF])) | |
301 | 261 | } | |
302 | 262 | ||
303 | 263 | ||
304 | - | func ce (cf,cg,ch,ci) = { | |
305 | - | let cj = H(ch, cf) | |
306 | - | let ck = H(ci, cg) | |
307 | - | bP(ck, cj) | |
264 | + | func bJ (bK,bL,bM) = { | |
265 | + | let bH = fraction(bL, b, bK) | |
266 | + | let bN = (bM > bH) | |
267 | + | if (if (bN) | |
268 | + | then true | |
269 | + | else (bL > bK)) | |
270 | + | then throw(((((((toString(bL) + " ") + toString(bK)) + " ") + toString(bH)) + " ") + toString(bM))) | |
271 | + | else bN | |
308 | 272 | } | |
309 | 273 | ||
310 | 274 | ||
311 | - | func cl (ch,ci,cm) = { | |
312 | - | let cn = bo | |
313 | - | let co = bp | |
314 | - | let cp = ce(cn, co, ch, ci) | |
315 | - | let bR = H(ch, cn) | |
316 | - | let bQ = H(ci, co) | |
317 | - | let cq = H(cm, a) | |
318 | - | let cr = bP(bR, cq) | |
319 | - | let cs = bP(bQ, cq) | |
320 | - | [cp, cr, cs] | |
275 | + | func bO (bP,bQ,bR,bS) = { | |
276 | + | let bT = F(bR, bP) | |
277 | + | let bU = F(bS, bQ) | |
278 | + | bA(bU, bT) | |
321 | 279 | } | |
322 | 280 | ||
323 | 281 | ||
324 | - | func ct (ch,ci,cm) = { | |
325 | - | let cu = cl(ch, ci, cm) | |
326 | - | [L(cu[0], a), L(cu[1], a), L(cu[2], a)] | |
282 | + | func bV (bR,bS,bW) = { | |
283 | + | let bX = aL() | |
284 | + | let bY = parseIntValue(bX[w]) | |
285 | + | let bZ = parseIntValue(bX[x]) | |
286 | + | let ca = bO(bY, bZ, bR, bS) | |
287 | + | let bC = F(bR, bY) | |
288 | + | let bB = F(bS, bZ) | |
289 | + | let cb = F(bW, a) | |
290 | + | let cc = bA(bC, cb) | |
291 | + | let cd = bA(bB, cb) | |
292 | + | [ca, cc, cd] | |
327 | 293 | } | |
328 | 294 | ||
329 | 295 | ||
330 | - | func cv (cw,ao) = { | |
331 | - | let cx = if ((ao == 0)) | |
332 | - | then 0 | |
333 | - | else fraction(cw, ao, a) | |
334 | - | $Tuple2((cw - cx), cx) | |
296 | + | func ce (bR,bS,bW) = { | |
297 | + | let cf = bV(bR, bS, bW) | |
298 | + | [I(cf[0], a), I(cf[1], a), I(cf[2], a)] | |
335 | 299 | } | |
336 | 300 | ||
337 | 301 | ||
338 | - | func cy (cz) = { | |
339 | - | let cA = cz[0] | |
340 | - | let cB = cz[1] | |
341 | - | let cC = (cA + cB) | |
342 | - | if ((cC == e)) | |
343 | - | then e | |
302 | + | func cg (ch,ci) = { | |
303 | + | let cj = if ((ci == 0)) | |
304 | + | then 0 | |
305 | + | else fraction(ch, ci, a) | |
306 | + | $Tuple2((ch - cj), cj) | |
307 | + | } | |
308 | + | ||
309 | + | ||
310 | + | func ck (cl,cm,cn,co) = { | |
311 | + | let bX = aL() | |
312 | + | let cp = bX[t] | |
313 | + | let cq = bX[u] | |
314 | + | let cr = bX[v] | |
315 | + | let cs = parseIntValue(bX[w]) | |
316 | + | let ct = parseIntValue(bX[x]) | |
317 | + | let cu = bX[s] | |
318 | + | let cv = valueOrErrorMessage(assetInfo(fromBase58String(cp)), "Wrong LP id").quantity | |
319 | + | if ((cp != cm)) | |
320 | + | then throw("Wrong pmt asset") | |
344 | 321 | else { | |
345 | - | let cD = parseIntValue(aU) | |
346 | - | let cE = (cD * 2) | |
347 | - | let cu = fraction(cA, cB, f) | |
348 | - | let cF = fraction(cu, i, f) | |
349 | - | let cG = fraction(toBigInt(cE), cC, f) | |
350 | - | let cH = toBigInt((cE - 1)) | |
351 | - | func cI (cJ) = { | |
352 | - | let cK = fraction(cJ, cJ, f) | |
353 | - | let cL = fraction(cK, cJ, f) | |
354 | - | let cM = fraction(cL, f, cF) | |
355 | - | fraction((cG + fraction(cM, g, f)), cJ, (fraction(cH, cJ, f) + fraction(h, cM, f))) | |
356 | - | } | |
357 | - | ||
358 | - | func cN (cO,cP) = if (cO._2) | |
359 | - | then cO | |
360 | - | else { | |
361 | - | let cJ = cO._1 | |
362 | - | let cQ = cI(cJ) | |
363 | - | let cR = (cQ - value(cJ)) | |
364 | - | let cS = if ((e > cR)) | |
365 | - | then -(cR) | |
366 | - | else cR | |
367 | - | if ((f >= cS)) | |
368 | - | then $Tuple2(cQ, true) | |
369 | - | else $Tuple2(cQ, false) | |
370 | - | } | |
371 | - | ||
372 | - | let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] | |
373 | - | let cU = { | |
374 | - | let cV = cT | |
375 | - | let cW = size(cV) | |
376 | - | let cX = $Tuple2(cC, false) | |
377 | - | func cY (cZ,da) = if ((da >= cW)) | |
378 | - | then cZ | |
379 | - | else cN(cZ, cV[da]) | |
380 | - | ||
381 | - | func db (cZ,da) = if ((da >= cW)) | |
382 | - | then cZ | |
383 | - | else throw("List size exceeds 18") | |
384 | - | ||
385 | - | db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18) | |
386 | - | } | |
387 | - | let cJ = cU._1 | |
388 | - | let dc = cU._2 | |
389 | - | if (dc) | |
390 | - | then cJ | |
391 | - | else throw(("D calculation error, D = " + toString(cJ))) | |
322 | + | let cw = by(cq) | |
323 | + | let cx = F(cw, cs) | |
324 | + | let cy = by(cr) | |
325 | + | let cz = F(cy, ct) | |
326 | + | let cA = bA(cz, cx) | |
327 | + | let cB = I(cA, a) | |
328 | + | let cC = F(cn, a) | |
329 | + | let cD = F(cv, a) | |
330 | + | let cE = fraction(cx, cC, cD) | |
331 | + | let cF = fraction(cz, cC, cD) | |
332 | + | let cG = I(cE, cs) | |
333 | + | let cH = I(cF, ct) | |
334 | + | let cI = if ((cl == "")) | |
335 | + | then nil | |
336 | + | else [ScriptTransfer(co, cG, if ((cq == "WAVES")) | |
337 | + | then unit | |
338 | + | else fromBase58String(cq)), ScriptTransfer(co, cH, if ((cr == "WAVES")) | |
339 | + | then unit | |
340 | + | else fromBase58String(cr)), StringEntry(ab(toString(co), cl), bu(cG, cH, cn, cB, height, lastBlock.timestamp)), IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB)] | |
341 | + | $Tuple10(cG, cH, cq, cr, cw, cy, cv, cA, cu, cI) | |
392 | 342 | } | |
393 | 343 | } | |
394 | 344 | ||
395 | 345 | ||
396 | - | func dd (de,df,dg,dh) = { | |
397 | - | let di = bl | |
398 | - | let dj = toBase58String(value(bm)) | |
399 | - | let dk = toBase58String(value(bn)) | |
400 | - | let dl = bo | |
401 | - | let dm = bp | |
402 | - | let dn = toString(bk) | |
403 | - | let do = valueOrErrorMessage(assetInfo(di), "Wrong LP id").quantity | |
404 | - | if ((toBase58String(di) != df)) | |
405 | - | then throw("Wrong pmt asset") | |
346 | + | func cJ (cl,bG,cK,cL,cM,cN,co,cO,cP,cQ,cR,cS,cT) = { | |
347 | + | let bX = aL() | |
348 | + | let cp = fromBase58String(bX[t]) | |
349 | + | let cU = bX[u] | |
350 | + | let cV = bX[v] | |
351 | + | let cW = bX[y] | |
352 | + | let cX = bX[z] | |
353 | + | let cY = parseIntValue(bX[w]) | |
354 | + | let cZ = parseIntValue(bX[x]) | |
355 | + | let cu = bX[s] | |
356 | + | let da = valueOrErrorMessage(assetInfo(cp), "Wr lp as").quantity | |
357 | + | let cw = if (cO) | |
358 | + | then by(cU) | |
359 | + | else if (if (cQ) | |
360 | + | then (cT == cU) | |
361 | + | else false) | |
362 | + | then (by(cU) - cS) | |
363 | + | else if (cQ) | |
364 | + | then by(cU) | |
365 | + | else (by(cU) - cK) | |
366 | + | let cy = if (cO) | |
367 | + | then by(cV) | |
368 | + | else if (if (cQ) | |
369 | + | then (cT == cV) | |
370 | + | else false) | |
371 | + | then (by(cV) - cS) | |
372 | + | else if (cQ) | |
373 | + | then by(cV) | |
374 | + | else (by(cV) - cM) | |
375 | + | let db = F(cK, cY) | |
376 | + | let dc = F(cM, cZ) | |
377 | + | let dd = bA(dc, db) | |
378 | + | let cx = F(cw, cY) | |
379 | + | let cz = F(cy, cZ) | |
380 | + | let de = if ((da == 0)) | |
381 | + | then { | |
382 | + | let cA = d | |
383 | + | let df = d | |
384 | + | let cb = pow((db * dc), 0, toBigInt(5), 1, 0, DOWN) | |
385 | + | $Tuple5(I(cb, a), I(db, cY), I(dc, cZ), bA((cz + dc), (cx + db)), df) | |
386 | + | } | |
406 | 387 | else { | |
407 | - | let dp = bN(dj) | |
408 | - | let dq = H(dp, dl) | |
409 | - | let dr = bN(dk) | |
410 | - | let ds = H(dr, dm) | |
411 | - | let dt = bP(ds, dq) | |
412 | - | let du = L(dt, a) | |
413 | - | let dv = H(dg, a) | |
414 | - | let dw = H(do, a) | |
415 | - | let dx = fraction(dq, dv, dw) | |
416 | - | let dy = fraction(ds, dv, dw) | |
417 | - | let dz = O(dx, dl, FLOOR) | |
418 | - | let dA = O(dy, dm, FLOOR) | |
419 | - | let dB = if ((de == "")) | |
420 | - | then nil | |
421 | - | else [ScriptTransfer(dh, dz, if ((dj == "WAVES")) | |
422 | - | then unit | |
423 | - | else fromBase58String(dj)), ScriptTransfer(dh, dA, if ((dk == "WAVES")) | |
424 | - | then unit | |
425 | - | else fromBase58String(dk)), StringEntry(ai(toString(dh), de), bJ(dz, dA, dg, du, height, lastBlock.timestamp)), IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du)] | |
426 | - | $Tuple10(dz, dA, dj, dk, dp, dr, do, dt, dn, dB) | |
388 | + | let cA = bA(cz, cx) | |
389 | + | let dg = fraction(P((cA - dd)), c, cA) | |
390 | + | let df = F(bG, a) | |
391 | + | if (if (if (cR) | |
392 | + | then (cA != d) | |
393 | + | else false) | |
394 | + | then (dg > df) | |
395 | + | else false) | |
396 | + | then throw(((("Price slippage " + toString(dg)) + " > ") + toString(df))) | |
397 | + | else { | |
398 | + | let dh = F(da, a) | |
399 | + | let di = fraction(db, cA, c) | |
400 | + | let dj = fraction(dc, c, cA) | |
401 | + | let dk = if ((di > dc)) | |
402 | + | then $Tuple2(dj, dc) | |
403 | + | else $Tuple2(db, di) | |
404 | + | let dl = dk._1 | |
405 | + | let dm = dk._2 | |
406 | + | let cb = fraction(dh, dm, cz) | |
407 | + | $Tuple5(I(cb, a), I(dl, cY), I(dm, cZ), cA, df) | |
408 | + | } | |
409 | + | } | |
410 | + | let dn = de._1 | |
411 | + | let do = de._2 | |
412 | + | let dp = de._3 | |
413 | + | let cB = I(de._4, a) | |
414 | + | let dq = I(de._5, a) | |
415 | + | if ((0 >= dn)) | |
416 | + | then throw("LP <= 0") | |
417 | + | else { | |
418 | + | let dr = if (!(cP)) | |
419 | + | then 0 | |
420 | + | else dn | |
421 | + | let ds = (cK - do) | |
422 | + | let dt = (cM - dp) | |
423 | + | let du = if (if (cQ) | |
424 | + | then (cT == cU) | |
425 | + | else false) | |
426 | + | then $Tuple2(cS, 0) | |
427 | + | else if (if (cQ) | |
428 | + | then (cT == cV) | |
429 | + | else false) | |
430 | + | then $Tuple2(0, cS) | |
431 | + | else $Tuple2(do, dp) | |
432 | + | let dv = du._1 | |
433 | + | let dw = du._2 | |
434 | + | let dx = [IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB), StringEntry(Y(co, cl), bj(dv, dw, dr, cB, bG, dq, height, lastBlock.timestamp, ds, dt))] | |
435 | + | $Tuple13(dn, dr, cB, cw, cy, da, cp, cu, dx, ds, dt, cL, cN) | |
427 | 436 | } | |
428 | 437 | } | |
429 | 438 | ||
430 | 439 | ||
431 | - | func dC (de,bW,dD,dE,dF,dG,dh,dH,dI,dJ,dK,dL,dM) = { | |
432 | - | let di = bl | |
433 | - | let dN = toBase58String(value(bm)) | |
434 | - | let dO = toBase58String(value(bn)) | |
435 | - | let dP = bq | |
436 | - | let dQ = br | |
437 | - | let dR = bo | |
438 | - | let dS = bp | |
439 | - | let dn = toString(bk) | |
440 | - | let dT = valueOrErrorMessage(assetInfo(di), "Wr lp as").quantity | |
441 | - | let dp = if (dH) | |
442 | - | then bN(dN) | |
443 | - | else if (if (dJ) | |
444 | - | then (dM == dN) | |
445 | - | else false) | |
446 | - | then (bN(dN) - dL) | |
447 | - | else if (dJ) | |
448 | - | then bN(dN) | |
449 | - | else (bN(dN) - dD) | |
450 | - | let dr = if (dH) | |
451 | - | then bN(dO) | |
452 | - | else if (if (dJ) | |
453 | - | then (dM == dO) | |
454 | - | else false) | |
455 | - | then (bN(dO) - dL) | |
456 | - | else if (dJ) | |
457 | - | then bN(dO) | |
458 | - | else (bN(dO) - dF) | |
459 | - | let dU = H(dD, dR) | |
460 | - | let dV = H(dF, dS) | |
461 | - | let dW = bP(dV, dU) | |
462 | - | let dq = H(dp, dR) | |
463 | - | let ds = H(dr, dS) | |
464 | - | let cb = cy([dq, ds]) | |
465 | - | let dX = if ((dT == 0)) | |
466 | - | then { | |
467 | - | let ca = cy([(dq + dU), (ds + dV)]) | |
468 | - | let dY = if ((ca > cb)) | |
440 | + | func dy (dz) = { | |
441 | + | let bX = aL() | |
442 | + | let dA = bX[u] | |
443 | + | let dB = bX[v] | |
444 | + | let cu = parseIntValue(bX[s]) | |
445 | + | let bY = parseIntValue(bX[w]) | |
446 | + | let bZ = parseIntValue(bX[x]) | |
447 | + | let dC = by(dA) | |
448 | + | let dD = by(dB) | |
449 | + | let cA = if ((dz.orderType == Buy)) | |
450 | + | then bO(bY, bZ, (dC + dz.amount), dD) | |
451 | + | else bO(bY, bZ, (dC - dz.amount), dD) | |
452 | + | let cB = I(cA, a) | |
453 | + | if (if (if (aI()) | |
454 | + | then true | |
455 | + | else (cu == p)) | |
456 | + | then true | |
457 | + | else (cu == q)) | |
458 | + | then throw("Admin blocked") | |
459 | + | else { | |
460 | + | let dE = dz.assetPair.amountAsset | |
461 | + | let dF = if ((dE == unit)) | |
462 | + | then "WAVES" | |
463 | + | else toBase58String(value(dE)) | |
464 | + | let dG = dz.assetPair.priceAsset | |
465 | + | let dH = if ((dG == unit)) | |
466 | + | then "WAVES" | |
467 | + | else toBase58String(value(dG)) | |
468 | + | if (if ((dF != dA)) | |
469 | 469 | then true | |
470 | - | else throw("D1 should be greater than D0") | |
471 | - | if ((dY == dY)) | |
472 | - | then { | |
473 | - | let dt = d | |
474 | - | let dZ = d | |
475 | - | let cq = ca | |
476 | - | $Tuple5(L(cq, a), L(dU, dR), L(dV, dS), bP((ds + dV), (dq + dU)), dZ) | |
470 | + | else (dH != dB)) | |
471 | + | then throw("Wr assets") | |
472 | + | else { | |
473 | + | let dI = dz.price | |
474 | + | let cZ = fraction(a, bZ, bY) | |
475 | + | let dJ = L(dI, a, cZ) | |
476 | + | let dK = if ((dz.orderType == Buy)) | |
477 | + | then (cB >= dJ) | |
478 | + | else (dJ >= cB) | |
479 | + | true | |
477 | 480 | } | |
478 | - | else throw("Strict value is not equal to itself.") | |
479 | - | } | |
480 | - | else { | |
481 | - | let dt = bP(ds, dq) | |
482 | - | let ea = fraction(W((dt - dW)), c, dt) | |
483 | - | let dZ = H(bW, a) | |
484 | - | if (if (if (dK) | |
485 | - | then (dt != d) | |
486 | - | else false) | |
487 | - | then (ea > dZ) | |
488 | - | else false) | |
489 | - | then throw(((("Price slippage " + toString(ea)) + " > ") + toString(dZ))) | |
490 | - | else { | |
491 | - | let eb = H(dT, a) | |
492 | - | let ec = fraction(dU, bS(ds, dq, CEILING), c, CEILING) | |
493 | - | let ed = fraction(dV, c, bS(ds, dq, FLOOR), CEILING) | |
494 | - | let ee = if ((ec > dV)) | |
495 | - | then $Tuple2(ed, dV) | |
496 | - | else $Tuple2(dU, ec) | |
497 | - | let ef = ee._1 | |
498 | - | let eg = ee._2 | |
499 | - | let ca = cy([(dq + ef), (ds + eg)]) | |
500 | - | let dY = if ((ca > cb)) | |
501 | - | then true | |
502 | - | else throw("D1 should be greater than D0") | |
503 | - | if ((dY == dY)) | |
504 | - | then { | |
505 | - | let cq = fraction(eb, (ca - cb), cb) | |
506 | - | $Tuple5(O(cq, a, FLOOR), O(ef, dR, CEILING), O(eg, dS, CEILING), dt, dZ) | |
507 | - | } | |
508 | - | else throw("Strict value is not equal to itself.") | |
509 | - | } | |
510 | - | } | |
511 | - | let eh = dX._1 | |
512 | - | let ei = dX._2 | |
513 | - | let ej = dX._3 | |
514 | - | let du = L(dX._4, a) | |
515 | - | let ek = L(dX._5, a) | |
516 | - | if ((0 >= eh)) | |
517 | - | then throw("LP <= 0") | |
518 | - | else { | |
519 | - | let el = if (!(dI)) | |
520 | - | then 0 | |
521 | - | else eh | |
522 | - | let em = (dD - ei) | |
523 | - | let en = (dF - ej) | |
524 | - | let eo = if (if (dJ) | |
525 | - | then (dM == dN) | |
526 | - | else false) | |
527 | - | then $Tuple2(dL, 0) | |
528 | - | else if (if (dJ) | |
529 | - | then (dM == dO) | |
530 | - | else false) | |
531 | - | then $Tuple2(0, dL) | |
532 | - | else $Tuple2(ei, ej) | |
533 | - | let ep = eo._1 | |
534 | - | let eq = eo._2 | |
535 | - | let er = [IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du), StringEntry(af(dh, de), by(ep, eq, el, du, bW, ek, height, lastBlock.timestamp, em, en))] | |
536 | - | $Tuple13(eh, el, du, dp, dr, dT, di, dn, er, em, en, dE, dG) | |
537 | 481 | } | |
538 | 482 | } | |
539 | 483 | ||
540 | 484 | ||
541 | - | func es (cz,cP,et) = { | |
542 | - | let eu = g | |
543 | - | let ev = cz[if ((cP == 0)) | |
485 | + | func dL (dM) = if ((size(dM.payments) != 1)) | |
486 | + | then throw("1 pmnt exp") | |
487 | + | else { | |
488 | + | let dN = value(dM.payments[0]) | |
489 | + | let cm = value(dN.assetId) | |
490 | + | let cS = dN.amount | |
491 | + | let de = ck(toBase58String(dM.transactionId), toBase58String(cm), cS, dM.caller) | |
492 | + | let cG = de._1 | |
493 | + | let cH = de._2 | |
494 | + | let cu = parseIntValue(de._9) | |
495 | + | let cI = de._10 | |
496 | + | if (if (aI()) | |
497 | + | then true | |
498 | + | else (cu == q)) | |
499 | + | then throw(("Admin blocked: " + toString(cu))) | |
500 | + | else $Tuple5(cG, cH, cS, cm, cI) | |
501 | + | } | |
502 | + | ||
503 | + | ||
504 | + | func dO (dP,aa,dQ,dR,bG,cP,cQ,cR,cS,cT) = { | |
505 | + | let de = cJ(aa, bG, value(dQ).amount, value(dQ).assetId, value(dR).amount, value(dR).assetId, dP, (aa == ""), cP, cQ, cR, cS, cT) | |
506 | + | let cu = parseIntValue(de._8) | |
507 | + | if (if (if (aI()) | |
508 | + | then true | |
509 | + | else (cu == o)) | |
510 | + | then true | |
511 | + | else (cu == q)) | |
512 | + | then throw(("Blocked:" + toString(cu))) | |
513 | + | else de | |
514 | + | } | |
515 | + | ||
516 | + | ||
517 | + | func dS (dT) = { | |
518 | + | let dU = g | |
519 | + | let dV = dT[0] | |
520 | + | let dW = dT[1] | |
521 | + | let dX = parseBigIntValue(j) | |
522 | + | let dY = (parseBigIntValue(aH) * dX) | |
523 | + | let dZ = (dV + dW) | |
524 | + | if ((dZ == e)) | |
525 | + | then e | |
526 | + | else { | |
527 | + | let ea = (dY * dU) | |
528 | + | let eb = (((dV * dW) * dU) * dU) | |
529 | + | let ec = ((ea * dZ) / dX) | |
530 | + | let ed = (ea - dX) | |
531 | + | let ee = (dU + f) | |
532 | + | func ef (eg,eh) = { | |
533 | + | let ei = eg | |
534 | + | let ej = ei._1 | |
535 | + | let ek = ei._2 | |
536 | + | if ((ek != unit)) | |
537 | + | then eg | |
538 | + | else { | |
539 | + | let el = (((ej * ej) * ej) / eb) | |
540 | + | let em = (((ec + (el * dU)) * ej) / (((ed * ej) / dX) + (ee * el))) | |
541 | + | let en = Q((em - value(ej))) | |
542 | + | if ((f >= en)) | |
543 | + | then $Tuple2(em, eh) | |
544 | + | else $Tuple2(em, unit) | |
545 | + | } | |
546 | + | } | |
547 | + | ||
548 | + | let eo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
549 | + | let ep = { | |
550 | + | let eq = eo | |
551 | + | let er = size(eq) | |
552 | + | let es = $Tuple2(dZ, unit) | |
553 | + | func et (eu,ev) = if ((ev >= er)) | |
554 | + | then eu | |
555 | + | else ef(eu, eq[ev]) | |
556 | + | ||
557 | + | func ew (eu,ev) = if ((ev >= er)) | |
558 | + | then eu | |
559 | + | else throw("List size exceeds 15") | |
560 | + | ||
561 | + | ew(et(et(et(et(et(et(et(et(et(et(et(et(et(et(et(es, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
562 | + | } | |
563 | + | let ej = ep._1 | |
564 | + | let ek = ep._2 | |
565 | + | if ((ek != unit)) | |
566 | + | then ej | |
567 | + | else throw(("D calculation error, D = " + toString(ej))) | |
568 | + | } | |
569 | + | } | |
570 | + | ||
571 | + | ||
572 | + | func ex (dT,dM,ey) = { | |
573 | + | let dU = g | |
574 | + | let ez = dT[if ((dM == 0)) | |
544 | 575 | then 1 | |
545 | 576 | else 0] | |
546 | - | let | |
547 | - | let | |
548 | - | let | |
549 | - | let | |
550 | - | let | |
551 | - | let | |
552 | - | func | |
553 | - | let | |
554 | - | let | |
555 | - | let | |
556 | - | if (( | |
557 | - | then | |
577 | + | let dX = parseBigIntValue(j) | |
578 | + | let dY = (parseBigIntValue(aH) * dX) | |
579 | + | let dZ = ez | |
580 | + | let ea = (dY * dU) | |
581 | + | let eA = (((((ey * ey) / (ez * dU)) * ey) * dX) / (ea * dU)) | |
582 | + | let eB = ((dZ + ((ey * dX) / ea)) - ey) | |
583 | + | func ef (eg,eh) = { | |
584 | + | let eC = eg | |
585 | + | let eD = eC._1 | |
586 | + | let ek = eC._2 | |
587 | + | if ((ek != unit)) | |
588 | + | then eg | |
558 | 589 | else { | |
559 | - | let | |
560 | - | let | |
561 | - | if ((f >= | |
562 | - | then $Tuple2( | |
563 | - | else $Tuple2( | |
590 | + | let eE = (((eD * eD) + eA) / ((g * eD) + eB)) | |
591 | + | let eF = Q((eE - value(eD))) | |
592 | + | if ((f >= eF)) | |
593 | + | then $Tuple2(eE, eh) | |
594 | + | else $Tuple2(eE, unit) | |
564 | 595 | } | |
565 | 596 | } | |
566 | 597 | ||
567 | - | let | |
568 | - | let | |
569 | - | let | |
570 | - | let | |
571 | - | let | |
572 | - | func | |
573 | - | then | |
574 | - | else | |
598 | + | let eo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
599 | + | let eG = { | |
600 | + | let eq = eo | |
601 | + | let er = size(eq) | |
602 | + | let es = $Tuple2(ey, unit) | |
603 | + | func et (eu,ev) = if ((ev >= er)) | |
604 | + | then eu | |
605 | + | else ef(eu, eq[ev]) | |
575 | 606 | ||
576 | - | func | |
577 | - | then | |
607 | + | func ew (eu,ev) = if ((ev >= er)) | |
608 | + | then eu | |
578 | 609 | else throw("List size exceeds 15") | |
579 | 610 | ||
580 | - | | |
611 | + | ew(et(et(et(et(et(et(et(et(et(et(et(et(et(et(et(es, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
581 | 612 | } | |
582 | - | let | |
583 | - | let | |
584 | - | if (( | |
585 | - | then | |
586 | - | else throw(("Y calculation error, Y = " + toString( | |
613 | + | let eD = eG._1 | |
614 | + | let ek = eG._2 | |
615 | + | if ((ek != unit)) | |
616 | + | then eD | |
617 | + | else throw(("Y calculation error, Y = " + toString(eD))) | |
587 | 618 | } | |
588 | 619 | ||
589 | 620 | ||
590 | - | func eF (eG,eH,eI) = { | |
591 | - | let eJ = fraction(cy([K(eG, toBigInt(bo)), K(eH, toBigInt(bp))]), c, eI) | |
592 | - | if ((eI == e)) | |
593 | - | then e | |
594 | - | else eJ | |
595 | - | } | |
596 | - | ||
597 | - | ||
598 | - | func eK (eL,eM,eN) = { | |
599 | - | let eO = (toBigInt(bN(be(bm))) - eL) | |
600 | - | let eP = (toBigInt(bN(be(bn))) - eM) | |
601 | - | let eQ = (toBigInt(value(assetInfo(bl)).quantity) - eN) | |
602 | - | let eR = eF(eO, eP, eQ) | |
603 | - | eR | |
604 | - | } | |
605 | - | ||
606 | - | ||
607 | - | func eS (eT,eU,eN) = { | |
608 | - | let eO = (bN(be(bm)) + eT) | |
609 | - | let eP = (bN(be(bn)) + eU) | |
610 | - | let eQ = (value(assetInfo(bl)).quantity + eN) | |
611 | - | let eJ = eF(toBigInt(eO), toBigInt(eP), toBigInt(eQ)) | |
612 | - | let eV = [IntegerEntry(aq, height), StringEntry(ap, toString(eJ))] | |
613 | - | $Tuple2(eV, eJ) | |
614 | - | } | |
615 | - | ||
616 | - | ||
617 | - | func eW (eX,eJ) = if ((eJ >= eX)) | |
618 | - | then true | |
619 | - | else aN("updated DLp lower than current DLp") | |
620 | - | ||
621 | - | ||
622 | - | func eY (eZ) = { | |
623 | - | let eO = bN(be(bm)) | |
624 | - | let eP = bN(be(bn)) | |
625 | - | let fa = eZ.amount | |
626 | - | let fb = fraction(eZ.amount, eZ.price, a, FLOOR) | |
627 | - | let fc = if ((eZ.orderType == Buy)) | |
628 | - | then $Tuple2(fa, -(fb)) | |
629 | - | else $Tuple2(-(fa), fb) | |
630 | - | let eT = fc._1 | |
631 | - | let eU = fc._2 | |
632 | - | if (if (if (aV()) | |
633 | - | then true | |
634 | - | else (bk == r)) | |
635 | - | then true | |
636 | - | else (bk == s)) | |
637 | - | then throw("Admin blocked") | |
638 | - | else if (if ((eZ.assetPair.amountAsset != bm)) | |
639 | - | then true | |
640 | - | else (eZ.assetPair.priceAsset != bn)) | |
641 | - | then throw("Wr assets") | |
642 | - | else { | |
643 | - | let fd = parseBigIntValue(valueOrElse(getString(this, ap), "0")) | |
644 | - | let fe = eS(eT, eU, 0) | |
645 | - | let ff = fe._1 | |
646 | - | let fg = fe._2 | |
647 | - | let fh = (fg >= fd) | |
648 | - | let fi = makeString(["dLp=", toString(fd), " dLpNew=", toString(fg), " amountAssetBalance=", toString(eO), " priceAssetBalance=", toString(eP), " amountAssetBalanceDelta=", toString(eT), " priceAssetBalanceDelta=", toString(eU), " height=", toString(height)], "") | |
649 | - | $Tuple2(fh, fi) | |
650 | - | } | |
651 | - | } | |
652 | - | ||
653 | - | ||
654 | - | func fj (cP) = if ((size(cP.payments) != 1)) | |
655 | - | then throw("1 pmnt exp") | |
656 | - | else { | |
657 | - | let fk = value(cP.payments[0]) | |
658 | - | let df = value(fk.assetId) | |
659 | - | let dL = fk.amount | |
660 | - | let dX = dd(toBase58String(cP.transactionId), toBase58String(df), dL, cP.caller) | |
661 | - | let dz = dX._1 | |
662 | - | let dA = dX._2 | |
663 | - | let dn = parseIntValue(dX._9) | |
664 | - | let dB = dX._10 | |
665 | - | if (if (aV()) | |
666 | - | then true | |
667 | - | else (dn == s)) | |
668 | - | then throw(("Admin blocked: " + toString(dn))) | |
669 | - | else $Tuple5(dz, dA, dL, df, dB) | |
670 | - | } | |
671 | - | ||
672 | - | ||
673 | - | func fl (fm,ah,fn,fo,bW,dI,dJ,dK,dL,dM) = { | |
674 | - | let dX = dC(ah, bW, value(fn).amount, value(fn).assetId, value(fo).amount, value(fo).assetId, fm, (ah == ""), dI, dJ, dK, dL, dM) | |
675 | - | let dn = parseIntValue(dX._8) | |
676 | - | if (if (if (aV()) | |
677 | - | then true | |
678 | - | else (dn == q)) | |
679 | - | then true | |
680 | - | else (dn == s)) | |
681 | - | then throw(("Blocked:" + toString(dn))) | |
682 | - | else dX | |
683 | - | } | |
684 | - | ||
685 | - | ||
686 | - | func fp (fq,df,dh,ah,fr) = { | |
687 | - | let dj = toBase58String(value(bm)) | |
688 | - | let dk = toBase58String(value(bn)) | |
689 | - | let di = bl | |
690 | - | let dR = bo | |
691 | - | let dS = bp | |
692 | - | let eQ = toBigInt(valueOrErrorMessage(assetInfo(di), "invalid lp asset").quantity) | |
693 | - | let fs = if ((eQ > e)) | |
621 | + | func eH (eI,cm,co,aa,eJ) = { | |
622 | + | let aT = aL() | |
623 | + | let cq = aT[u] | |
624 | + | let cr = aT[v] | |
625 | + | let cp = aT[t] | |
626 | + | let cY = parseIntValue(aT[w]) | |
627 | + | let cZ = parseIntValue(aT[x]) | |
628 | + | let eK = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cp)), "invalid lp asset").quantity) | |
629 | + | let eL = if ((eK > e)) | |
694 | 630 | then true | |
695 | 631 | else throw("initial deposit requires all coins") | |
696 | - | if (( | |
632 | + | if ((eL == eL)) | |
697 | 633 | then { | |
698 | - | let | |
699 | - | let | |
700 | - | let | |
701 | - | then $Tuple2( | |
702 | - | else if (( | |
703 | - | then if (( | |
634 | + | let cw = by(cq) | |
635 | + | let cy = by(cr) | |
636 | + | let eM = if ((aa == "")) | |
637 | + | then $Tuple2(cw, cy) | |
638 | + | else if ((cm == cq)) | |
639 | + | then if ((eI > cw)) | |
704 | 640 | then throw("invalid payment amount") | |
705 | - | else $Tuple2(( | |
706 | - | else if (( | |
707 | - | then if (( | |
641 | + | else $Tuple2((cw - eI), cy) | |
642 | + | else if ((cm == cr)) | |
643 | + | then if ((eI > cy)) | |
708 | 644 | then throw("invalid payment amount") | |
709 | - | else $Tuple2( | |
645 | + | else $Tuple2(cw, (cy - eI)) | |
710 | 646 | else throw("wrong pmtAssetId") | |
711 | - | let | |
712 | - | let | |
713 | - | let | |
714 | - | then $Tuple2( | |
715 | - | else if (( | |
716 | - | then $Tuple2(0, | |
647 | + | let eN = eM._1 | |
648 | + | let eO = eM._2 | |
649 | + | let eP = if ((cm == cq)) | |
650 | + | then $Tuple2(eI, 0) | |
651 | + | else if ((cm == cr)) | |
652 | + | then $Tuple2(0, eI) | |
717 | 653 | else throw("invalid payment") | |
718 | - | let | |
719 | - | let | |
720 | - | let | |
721 | - | then $Tuple3( | |
722 | - | else $Tuple3( | |
723 | - | let | |
724 | - | let | |
725 | - | let | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | let | |
730 | - | let | |
654 | + | let eQ = eP._1 | |
655 | + | let eR = eP._2 | |
656 | + | let eS = if (eJ) | |
657 | + | then $Tuple3(cg(eQ, aE)._1, cg(eR, aE)._1, cg(eI, aE)._2) | |
658 | + | else $Tuple3(eQ, eR, 0) | |
659 | + | let eT = eS._1 | |
660 | + | let eU = eS._2 | |
661 | + | let cj = eS._3 | |
662 | + | let eV = (eN + eT) | |
663 | + | let eW = (eO + eU) | |
664 | + | let bL = dS([toBigInt(eN), toBigInt(eO)]) | |
665 | + | let bK = dS([toBigInt(eV), toBigInt(eW)]) | |
666 | + | let eX = if ((bK > bL)) | |
731 | 667 | then true | |
732 | 668 | else throw() | |
733 | - | if (( | |
669 | + | if ((eX == eX)) | |
734 | 670 | then { | |
735 | - | let | |
736 | - | let | |
737 | - | let | |
738 | - | let | |
739 | - | let | |
740 | - | let | |
741 | - | let | |
742 | - | let | |
743 | - | $Tuple4(toInt( | |
671 | + | let eY = fraction(eK, (bK - bL), bL) | |
672 | + | let cB = I(bA(F(eW, cZ), F(eV, cY)), a) | |
673 | + | let dx = [IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB), StringEntry(Y(co, aa), bj(eQ, eR, toInt(eY), cB, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
674 | + | let eZ = fraction(eO, a, eN) | |
675 | + | let fa = fraction(eI, a, (eZ + a)) | |
676 | + | let fb = (eI - fa) | |
677 | + | let fc = fraction(eK, toBigInt(fb), toBigInt(eO)) | |
678 | + | let fd = toInt(fraction((eY - fc), b, fc)) | |
679 | + | $Tuple4(toInt(eY), dx, cj, fd) | |
744 | 680 | } | |
745 | 681 | else throw("Strict value is not equal to itself.") | |
746 | 682 | } | |
748 | 684 | } | |
749 | 685 | ||
750 | 686 | ||
751 | - | func fK (fL,fM,fN,fm,fO,fP) = { | |
752 | - | let di = toBase58String(value(bl)) | |
753 | - | let dj = toBase58String(value(bm)) | |
754 | - | let dk = toBase58String(value(bn)) | |
755 | - | let fQ = bo | |
756 | - | let fR = bp | |
757 | - | let fS = bk | |
758 | - | let dh = if ((fm == bx)) | |
759 | - | then fO | |
760 | - | else fm | |
761 | - | let fk = value(fN[0]) | |
762 | - | let df = value(fk.assetId) | |
763 | - | let dL = fk.amount | |
764 | - | let eR = eK(e, e, e) | |
765 | - | if ((eR == eR)) | |
766 | - | then { | |
767 | - | let de = toBase58String(fP) | |
768 | - | if ((di != toBase58String(df))) | |
769 | - | then throw("Wrong LP") | |
770 | - | else { | |
771 | - | let dp = bN(dj) | |
772 | - | let dr = bN(dk) | |
773 | - | let fT = { | |
774 | - | let aS = invoke(this, "getOneTknV2READONLY", [fL, dL], nil) | |
775 | - | if ($isInstanceOf(aS, "(Int, Int)")) | |
776 | - | then aS | |
777 | - | else throw(($getType(aS) + " couldn't be cast to (Int, Int)")) | |
778 | - | } | |
779 | - | if ((fT == fT)) | |
687 | + | func fe (ff,fg,fh,dP,fi,fj) = { | |
688 | + | let aT = aL() | |
689 | + | let cp = aT[t] | |
690 | + | let cq = aT[u] | |
691 | + | let cr = aT[v] | |
692 | + | let fk = parseIntValue(aT[w]) | |
693 | + | let fl = parseIntValue(aT[x]) | |
694 | + | let fm = aT[s] | |
695 | + | let co = if ((dP == bi)) | |
696 | + | then fi | |
697 | + | else dP | |
698 | + | let dN = value(fh[0]) | |
699 | + | let cm = value(dN.assetId) | |
700 | + | let cS = dN.amount | |
701 | + | let cl = toBase58String(fj) | |
702 | + | if ((cp != toBase58String(cm))) | |
703 | + | then throw("Wrong LP") | |
704 | + | else { | |
705 | + | let cw = by(cq) | |
706 | + | let cy = by(cr) | |
707 | + | let fn = { | |
708 | + | let aF = invoke(this, "getOneTknV2READONLY", [ff, cS], nil) | |
709 | + | if ($isInstanceOf(aF, "(Int, Int)")) | |
710 | + | then aF | |
711 | + | else throw(($getType(aF) + " couldn't be cast to (Int, Int)")) | |
712 | + | } | |
713 | + | if ((fn == fn)) | |
714 | + | then { | |
715 | + | let cj = fn._2 | |
716 | + | let fo = fn._1 | |
717 | + | let fp = if (if ((fg > 0)) | |
718 | + | then (fg > fo) | |
719 | + | else false) | |
720 | + | then aB(makeString(["amount to receive is less than ", toString(fg)], "")) | |
721 | + | else fo | |
722 | + | let fq = if ((ff == cq)) | |
723 | + | then $Tuple4(fp, 0, ((cw - fp) - cj), cy) | |
724 | + | else if ((ff == cr)) | |
725 | + | then $Tuple4(0, fp, cw, ((cy - fp) - cj)) | |
726 | + | else throw("invalid out asset id") | |
727 | + | let fr = fq._1 | |
728 | + | let fs = fq._2 | |
729 | + | let eV = fq._3 | |
730 | + | let eW = fq._4 | |
731 | + | let ft = bA(F(eW, fl), F(eV, fk)) | |
732 | + | let fu = I(ft, a) | |
733 | + | let fv = if ((ff == "WAVES")) | |
734 | + | then unit | |
735 | + | else fromBase58String(ff) | |
736 | + | let fw = if ((cj > 0)) | |
737 | + | then [ScriptTransfer(aK, cj, fv)] | |
738 | + | else nil | |
739 | + | let cI = ([ScriptTransfer(co, fp, fv), StringEntry(ab(toString(co), cl), bu(fr, fs, cS, fu, height, lastBlock.timestamp)), IntegerEntry(U(), fu), IntegerEntry(V(height, lastBlock.timestamp), fu)] ++ fw) | |
740 | + | if ((cI == cI)) | |
780 | 741 | then { | |
781 | - | let cx = fT._2 | |
782 | - | let fU = fT._1 | |
783 | - | let fV = if (if ((fM > 0)) | |
784 | - | then (fM > fU) | |
785 | - | else false) | |
786 | - | then aN(makeString(["amount to receive is less than ", toString(fM)], "")) | |
787 | - | else fU | |
788 | - | let fW = if ((fL == dj)) | |
789 | - | then $Tuple4(fV, 0, ((dp - fV) - cx), dr) | |
790 | - | else if ((fL == dk)) | |
791 | - | then $Tuple4(0, fV, dp, ((dr - fV) - cx)) | |
792 | - | else throw("invalid out asset id") | |
793 | - | let fX = fW._1 | |
794 | - | let fY = fW._2 | |
795 | - | let fC = fW._3 | |
796 | - | let fD = fW._4 | |
797 | - | let fZ = bP(H(fD, fR), H(fC, fQ)) | |
798 | - | let ga = L(fZ, a) | |
799 | - | let gb = if ((fL == "WAVES")) | |
800 | - | then unit | |
801 | - | else fromBase58String(fL) | |
802 | - | let gc = if ((cx > 0)) | |
803 | - | then [ScriptTransfer(aX, cx, gb)] | |
804 | - | else nil | |
805 | - | let dB = ([ScriptTransfer(dh, fV, gb), StringEntry(ai(toString(dh), de), bJ(fX, fY, dL, ga, height, lastBlock.timestamp)), IntegerEntry(ab(), ga), IntegerEntry(ac(height, lastBlock.timestamp), ga)] ++ gc) | |
806 | - | if ((dB == dB)) | |
807 | - | then { | |
808 | - | let gd = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)]) | |
809 | - | if ((gd == gd)) | |
810 | - | then { | |
811 | - | let ge = { | |
812 | - | let gf = if ((this == aX)) | |
813 | - | then 0 | |
814 | - | else cx | |
815 | - | let gg = if ((bc(fL) == bm)) | |
816 | - | then true | |
817 | - | else false | |
818 | - | if (gg) | |
819 | - | then $Tuple2(-((fU + gf)), 0) | |
820 | - | else $Tuple2(0, -((fU + gf))) | |
821 | - | } | |
822 | - | let eT = ge._1 | |
823 | - | let eU = ge._2 | |
824 | - | let gh = eS(eT, eU, 0) | |
825 | - | let gi = gh._1 | |
826 | - | let eJ = gh._2 | |
827 | - | let gj = eW(eR, eJ) | |
828 | - | if ((gj == gj)) | |
829 | - | then $Tuple2((dB ++ gi), fV) | |
830 | - | else throw("Strict value is not equal to itself.") | |
831 | - | } | |
832 | - | else throw("Strict value is not equal to itself.") | |
833 | - | } | |
742 | + | let fx = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)]) | |
743 | + | if ((fx == fx)) | |
744 | + | then $Tuple2(cI, fp) | |
834 | 745 | else throw("Strict value is not equal to itself.") | |
835 | 746 | } | |
836 | 747 | else throw("Strict value is not equal to itself.") | |
837 | 748 | } | |
749 | + | else throw("Strict value is not equal to itself.") | |
838 | 750 | } | |
839 | - | else throw("Strict value is not equal to itself.") | |
840 | 751 | } | |
841 | 752 | ||
842 | 753 | ||
843 | - | func | |
844 | - | let | |
845 | - | if ($isInstanceOf( | |
754 | + | func fy () = { | |
755 | + | let av = getString(S()) | |
756 | + | if ($isInstanceOf(av, "String")) | |
846 | 757 | then { | |
847 | - | let | |
848 | - | fromBase58String( | |
758 | + | let dZ = av | |
759 | + | fromBase58String(dZ) | |
849 | 760 | } | |
850 | - | else if ($isInstanceOf( | |
761 | + | else if ($isInstanceOf(av, "Unit")) | |
851 | 762 | then unit | |
852 | 763 | else throw("Match error") | |
853 | 764 | } | |
854 | 765 | ||
855 | 766 | ||
856 | - | func | |
857 | - | let | |
858 | - | if ($isInstanceOf( | |
767 | + | func fz () = { | |
768 | + | let av = getString(T()) | |
769 | + | if ($isInstanceOf(av, "String")) | |
859 | 770 | then { | |
860 | - | let | |
861 | - | fromBase58String( | |
771 | + | let dZ = av | |
772 | + | fromBase58String(dZ) | |
862 | 773 | } | |
863 | - | else if ($isInstanceOf( | |
774 | + | else if ($isInstanceOf(av, "Unit")) | |
864 | 775 | then unit | |
865 | 776 | else throw("Match error") | |
866 | 777 | } | |
867 | 778 | ||
868 | 779 | ||
869 | - | let | |
780 | + | let fA = throw("Permission denied") | |
870 | 781 | ||
871 | - | func | |
872 | - | let | |
873 | - | if ($isInstanceOf( | |
782 | + | func fB (dM) = { | |
783 | + | let av = fy() | |
784 | + | if ($isInstanceOf(av, "ByteVector")) | |
874 | 785 | then { | |
875 | - | let | |
876 | - | ( | |
786 | + | let fC = av | |
787 | + | (dM.callerPublicKey == fC) | |
877 | 788 | } | |
878 | - | else if ($isInstanceOf( | |
879 | - | then ( | |
789 | + | else if ($isInstanceOf(av, "Unit")) | |
790 | + | then (dM.caller == this) | |
880 | 791 | else throw("Match error") | |
881 | 792 | } | |
882 | 793 | ||
883 | 794 | ||
884 | - | func | |
885 | - | let | |
886 | - | if ($isInstanceOf( | |
795 | + | func fD (dM) = { | |
796 | + | let av = fy() | |
797 | + | if ($isInstanceOf(av, "ByteVector")) | |
887 | 798 | then { | |
888 | - | let | |
889 | - | if (( | |
799 | + | let fC = av | |
800 | + | if ((dM.callerPublicKey == fC)) | |
890 | 801 | then true | |
891 | - | else | |
802 | + | else fA | |
892 | 803 | } | |
893 | - | else if ($isInstanceOf( | |
894 | - | then if (( | |
804 | + | else if ($isInstanceOf(av, "Unit")) | |
805 | + | then if ((dM.caller == this)) | |
895 | 806 | then true | |
896 | - | else | |
807 | + | else fA | |
897 | 808 | else throw("Match error") | |
898 | 809 | } | |
899 | 810 | ||
900 | 811 | ||
901 | - | func gr (gs,et,gt) = { | |
902 | - | let bg = aY() | |
903 | - | let dj = bg[w] | |
904 | - | let dk = bg[x] | |
905 | - | let eu = g | |
906 | - | let ew = parseBigIntValue(l) | |
907 | - | let cD = (parseBigIntValue(aU) * ew) | |
908 | - | let cz = if ((gs == false)) | |
909 | - | then [(toBigInt(bN(dj)) + gt), toBigInt(bN(dk))] | |
910 | - | else [(toBigInt(bN(dk)) + gt), toBigInt(bN(dj))] | |
911 | - | let ev = cz[0] | |
912 | - | let cC = ev | |
913 | - | let cE = (cD * eu) | |
914 | - | let ex = (((((et * et) / (ev * eu)) * et) * ew) / (cE * eu)) | |
915 | - | let ey = ((cC + ((et * ew) / cE)) - et) | |
916 | - | func cN (cO,ez) = { | |
917 | - | let gu = cO | |
918 | - | let eB = gu._1 | |
919 | - | let dc = gu._2 | |
920 | - | if ((dc != unit)) | |
921 | - | then cO | |
922 | - | else { | |
923 | - | let eC = (((eB * eB) + ex) / ((g * eB) + ey)) | |
924 | - | let eD = X((eC - value(eB))) | |
925 | - | if ((f >= eD)) | |
926 | - | then $Tuple2(eC, ez) | |
927 | - | else $Tuple2(eC, unit) | |
928 | - | } | |
929 | - | } | |
930 | - | ||
931 | - | let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
932 | - | let gv = { | |
933 | - | let cV = cT | |
934 | - | let cW = size(cV) | |
935 | - | let cX = $Tuple2(et, unit) | |
936 | - | func cY (cZ,da) = if ((da >= cW)) | |
937 | - | then cZ | |
938 | - | else cN(cZ, cV[da]) | |
939 | - | ||
940 | - | func db (cZ,da) = if ((da >= cW)) | |
941 | - | then cZ | |
942 | - | else throw("List size exceeds 15") | |
943 | - | ||
944 | - | db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
945 | - | } | |
946 | - | let eB = gv._1 | |
947 | - | let dc = gv._2 | |
948 | - | if ((dc != unit)) | |
949 | - | then eB | |
950 | - | else throw(("Y calculation error, Y = " + toString(eB))) | |
951 | - | } | |
952 | - | ||
953 | - | ||
954 | - | @Callable(cP) | |
955 | - | func calculateAmountOutForSwapREADONLY (gw,gs,gx) = { | |
956 | - | let gy = if ((gs == false)) | |
957 | - | then { | |
958 | - | let gz = aJ(this, ak()) | |
959 | - | let gt = (toBigInt(bN(aJ(this, aj()))) + toBigInt(gw)) | |
960 | - | $Tuple2(gz, gt) | |
961 | - | } | |
962 | - | else { | |
963 | - | let gz = aJ(this, aj()) | |
964 | - | let gt = (toBigInt(bN(aJ(this, ak()))) + toBigInt(gw)) | |
965 | - | $Tuple2(gz, gt) | |
966 | - | } | |
967 | - | let gz = gy._1 | |
968 | - | let gt = gy._2 | |
969 | - | let bg = aY() | |
970 | - | let dj = bg[w] | |
971 | - | let dk = bg[x] | |
972 | - | let cz = [toBigInt(bN(dj)), toBigInt(bN(dk))] | |
973 | - | let et = cy(cz) | |
974 | - | let eB = gr(gs, et, toBigInt(gw)) | |
975 | - | let gA = ((toBigInt(bN(gz)) - eB) - toBigInt(1)) | |
976 | - | let gB = max([0, toInt(gA)]) | |
977 | - | let gC = if ((gs == false)) | |
978 | - | then [((toBigInt(bN(dj)) + toBigInt(gw)) + toBigInt(gx)), (toBigInt(bN(dk)) - gA)] | |
979 | - | else [(toBigInt(bN(dj)) - gA), ((toBigInt(bN(dk)) + toBigInt(gw)) + toBigInt(gx))] | |
980 | - | let gD = cy(gC) | |
981 | - | let dY = if ((gD >= et)) | |
982 | - | then true | |
983 | - | else throw(makeString(["new D is fewer error", toString(et), toString(gD)], "__")) | |
984 | - | if ((dY == dY)) | |
985 | - | then $Tuple2(nil, gB) | |
812 | + | @Callable(dM) | |
813 | + | func constructor (R) = { | |
814 | + | let eA = fD(dM) | |
815 | + | if ((eA == eA)) | |
816 | + | then [StringEntry(R(), R)] | |
986 | 817 | else throw("Strict value is not equal to itself.") | |
987 | 818 | } | |
988 | 819 | ||
989 | 820 | ||
990 | 821 | ||
991 | - | @Callable(cP) | |
992 | - | func calculateAmountOutForSwapAndSendTokens (gw,gs,gE,gF,gx) = { | |
993 | - | let gG = { | |
994 | - | let aS = invoke(aQ, "getSwapContractREADONLY", nil, nil) | |
995 | - | if ($isInstanceOf(aS, "String")) | |
996 | - | then aS | |
997 | - | else throw(($getType(aS) + " couldn't be cast to String")) | |
998 | - | } | |
999 | - | let gH = [if ((value(cP.payments[0]).amount >= gw)) | |
1000 | - | then true | |
1001 | - | else aN("Wrong amount"), if ((cP.caller == addressFromStringValue(gG))) | |
1002 | - | then true | |
1003 | - | else aN("Permission denied")] | |
1004 | - | if ((gH == gH)) | |
822 | + | @Callable(dM) | |
823 | + | func setManager (fE) = { | |
824 | + | let eA = fD(dM) | |
825 | + | if ((eA == eA)) | |
1005 | 826 | then { | |
1006 | - | let fk = value(cP.payments[0]) | |
1007 | - | let gI = be(fk.assetId) | |
1008 | - | let gJ = if ((gs == false)) | |
1009 | - | then { | |
1010 | - | let gz = aJ(this, ak()) | |
1011 | - | let gt = (bN(gI) - value(cP.payments[0]).amount) | |
1012 | - | $Tuple2(gz, gt) | |
1013 | - | } | |
1014 | - | else { | |
1015 | - | let gz = aJ(this, aj()) | |
1016 | - | let gt = (bN(gI) - value(cP.payments[0]).amount) | |
1017 | - | $Tuple2(gz, gt) | |
1018 | - | } | |
1019 | - | let gz = gJ._1 | |
1020 | - | let gt = gJ._2 | |
1021 | - | let bg = aY() | |
1022 | - | let dj = bg[w] | |
1023 | - | let dk = bg[x] | |
1024 | - | let cz = if ((gs == false)) | |
1025 | - | then [(toBigInt(bN(dj)) - toBigInt(value(cP.payments[0]).amount)), toBigInt(bN(dk))] | |
1026 | - | else [toBigInt(bN(dj)), (toBigInt(bN(dk)) - toBigInt(value(cP.payments[0]).amount))] | |
1027 | - | let et = cy(cz) | |
1028 | - | let eB = gr(gs, et, toBigInt(0)) | |
1029 | - | let gA = ((toBigInt(bN(gz)) - eB) - toBigInt(1)) | |
1030 | - | let gB = max([0, toInt(gA)]) | |
1031 | - | let gK = if ((gB >= gE)) | |
1032 | - | then true | |
1033 | - | else throw("Exchange result is fewer coins than expected") | |
1034 | - | if ((gK == gK)) | |
1035 | - | then { | |
1036 | - | let gC = if ((gs == false)) | |
1037 | - | then [(toBigInt(bN(dj)) + toBigInt(gx)), (toBigInt(bN(dk)) - gA)] | |
1038 | - | else [(toBigInt(bN(dj)) - gA), (toBigInt(bN(dk)) + toBigInt(gx))] | |
1039 | - | let gD = cy(gC) | |
1040 | - | let dY = if ((gD >= et)) | |
1041 | - | then true | |
1042 | - | else throw("new D is fewer error") | |
1043 | - | if ((dY == dY)) | |
1044 | - | then $Tuple2([ScriptTransfer(addressFromStringValue(gF), gB, bc(gz))], gB) | |
1045 | - | else throw("Strict value is not equal to itself.") | |
1046 | - | } | |
827 | + | let fF = fromBase58String(fE) | |
828 | + | if ((fF == fF)) | |
829 | + | then [StringEntry(T(), fE)] | |
1047 | 830 | else throw("Strict value is not equal to itself.") | |
1048 | 831 | } | |
1049 | 832 | else throw("Strict value is not equal to itself.") | |
1051 | 834 | ||
1052 | 835 | ||
1053 | 836 | ||
1054 | - | @Callable(cP) | |
1055 | - | func constructor (Y) = { | |
1056 | - | let ex = gq(cP) | |
1057 | - | if ((ex == ex)) | |
1058 | - | then [StringEntry(Y(), Y)] | |
1059 | - | else throw("Strict value is not equal to itself.") | |
1060 | - | } | |
1061 | - | ||
1062 | - | ||
1063 | - | ||
1064 | - | @Callable(cP) | |
1065 | - | func setManager (gL) = { | |
1066 | - | let ex = gq(cP) | |
1067 | - | if ((ex == ex)) | |
837 | + | @Callable(dM) | |
838 | + | func confirmManager () = { | |
839 | + | let cf = fz() | |
840 | + | let fG = if (isDefined(cf)) | |
841 | + | then true | |
842 | + | else throw("No pending manager") | |
843 | + | if ((fG == fG)) | |
1068 | 844 | then { | |
1069 | - | let gM = fromBase58String(gL) | |
1070 | - | if ((gM == gM)) | |
1071 | - | then [StringEntry(aa(), gL)] | |
845 | + | let fH = if ((dM.callerPublicKey == value(cf))) | |
846 | + | then true | |
847 | + | else throw("You are not pending manager") | |
848 | + | if ((fH == fH)) | |
849 | + | then [StringEntry(S(), toBase58String(value(cf))), DeleteEntry(T())] | |
1072 | 850 | else throw("Strict value is not equal to itself.") | |
1073 | 851 | } | |
1074 | 852 | else throw("Strict value is not equal to itself.") | |
1076 | 854 | ||
1077 | 855 | ||
1078 | 856 | ||
1079 | - | @Callable(cP) | |
1080 | - | func confirmManager () = { | |
1081 | - | let cu = gm() | |
1082 | - | let gN = if (isDefined(cu)) | |
1083 | - | then true | |
1084 | - | else throw("No pending manager") | |
1085 | - | if ((gN == gN)) | |
1086 | - | then { | |
1087 | - | let gO = if ((cP.callerPublicKey == value(cu))) | |
1088 | - | then true | |
1089 | - | else throw("You are not pending manager") | |
1090 | - | if ((gO == gO)) | |
1091 | - | then [StringEntry(Z(), toBase58String(value(cu))), DeleteEntry(aa())] | |
1092 | - | else throw("Strict value is not equal to itself.") | |
1093 | - | } | |
1094 | - | else throw("Strict value is not equal to itself.") | |
1095 | - | } | |
1096 | - | ||
1097 | - | ||
1098 | - | ||
1099 | - | @Callable(cP) | |
1100 | - | func put (gP,gQ) = { | |
1101 | - | let gR = bs() | |
1102 | - | let gS = valueOrErrorMessage(addressFromString(gR[C]), "Wr st addr") | |
1103 | - | let gT = valueOrErrorMessage(addressFromString(gR[E]), "Wr sl addr") | |
1104 | - | if ((0 > gP)) | |
857 | + | @Callable(dM) | |
858 | + | func put (fI,fJ) = { | |
859 | + | let fK = bd() | |
860 | + | let fL = valueOrErrorMessage(addressFromString(fK[A]), "Wr st addr") | |
861 | + | let fM = valueOrErrorMessage(addressFromString(fK[C]), "Wr sl addr") | |
862 | + | if ((0 > fI)) | |
1105 | 863 | then throw("Wrong slippage") | |
1106 | - | else if ((size( | |
864 | + | else if ((size(dM.payments) != 2)) | |
1107 | 865 | then throw("2 pmnts expd") | |
1108 | 866 | else { | |
1109 | - | let gU = toBigInt(value(cP.payments[0]).amount) | |
1110 | - | let gV = toBigInt(value(cP.payments[1]).amount) | |
1111 | - | let eO = (toBigInt(bN(be(bm))) - gU) | |
1112 | - | if ((eO == eO)) | |
867 | + | let fN = dO(toString(dM.caller), toBase58String(dM.transactionId), AttachedPayment(value(dM.payments[0]).assetId, value(dM.payments[0]).amount), dM.payments[1], fI, true, false, true, 0, "") | |
868 | + | let dr = fN._2 | |
869 | + | let fO = fN._7 | |
870 | + | let cI = fN._9 | |
871 | + | let ds = fN._10 | |
872 | + | let dt = fN._11 | |
873 | + | let cq = fN._12 | |
874 | + | let cr = fN._13 | |
875 | + | let de = invoke(aD, "emit", [dr], nil) | |
876 | + | if ((de == de)) | |
1113 | 877 | then { | |
1114 | - | let eP = (toBigInt(bN(be(bn))) - gV) | |
1115 | - | if ((eP == eP)) | |
878 | + | let fP = { | |
879 | + | let av = de | |
880 | + | if ($isInstanceOf(av, "Address")) | |
881 | + | then { | |
882 | + | let fQ = av | |
883 | + | invoke(fQ, "emit", [dr], nil) | |
884 | + | } | |
885 | + | else unit | |
886 | + | } | |
887 | + | if ((fP == fP)) | |
1116 | 888 | then { | |
1117 | - | let eQ = toBigInt(value(assetInfo(bl)).quantity) | |
1118 | - | if ((eQ == eQ)) | |
889 | + | let fR = if ((ds > 0)) | |
890 | + | then invoke(fM, "put", nil, [AttachedPayment(cq, ds)]) | |
891 | + | else nil | |
892 | + | if ((fR == fR)) | |
1119 | 893 | then { | |
1120 | - | let eR = eK(gU, gV, toBigInt(0)) | |
1121 | - | if ((eR == eR)) | |
894 | + | let fS = if ((dt > 0)) | |
895 | + | then invoke(fM, "put", nil, [AttachedPayment(cr, dt)]) | |
896 | + | else nil | |
897 | + | if ((fS == fS)) | |
1122 | 898 | then { | |
1123 | - | let gW = fl(toString(cP.caller), toBase58String(cP.transactionId), AttachedPayment(value(cP.payments[0]).assetId, value(cP.payments[0]).amount), cP.payments[1], gP, true, false, true, 0, "") | |
1124 | - | let el = gW._2 | |
1125 | - | let gX = gW._7 | |
1126 | - | let dB = gW._9 | |
1127 | - | let em = gW._10 | |
1128 | - | let en = gW._11 | |
1129 | - | let dj = gW._12 | |
1130 | - | let dk = gW._13 | |
1131 | - | let dX = invoke(aQ, "emit", [el], nil) | |
1132 | - | if ((dX == dX)) | |
899 | + | let fT = if (fJ) | |
1133 | 900 | then { | |
1134 | - | let gY = { | |
1135 | - | let gl = dX | |
1136 | - | if ($isInstanceOf(gl, "Address")) | |
1137 | - | then { | |
1138 | - | let gZ = gl | |
1139 | - | invoke(gZ, "emit", [el], nil) | |
1140 | - | } | |
1141 | - | else unit | |
1142 | - | } | |
1143 | - | if ((gY == gY)) | |
1144 | - | then { | |
1145 | - | let ha = if ((em > 0)) | |
1146 | - | then invoke(gT, "put", nil, [AttachedPayment(dj, em)]) | |
1147 | - | else nil | |
1148 | - | if ((ha == ha)) | |
1149 | - | then { | |
1150 | - | let hb = if ((en > 0)) | |
1151 | - | then invoke(gT, "put", nil, [AttachedPayment(dk, en)]) | |
1152 | - | else nil | |
1153 | - | if ((hb == hb)) | |
1154 | - | then { | |
1155 | - | let hc = if (gQ) | |
1156 | - | then { | |
1157 | - | let hd = invoke(gS, "stake", nil, [AttachedPayment(gX, el)]) | |
1158 | - | if ((hd == hd)) | |
1159 | - | then nil | |
1160 | - | else throw("Strict value is not equal to itself.") | |
1161 | - | } | |
1162 | - | else [ScriptTransfer(cP.caller, el, gX)] | |
1163 | - | let he = eS(0, 0, 0) | |
1164 | - | let gi = he._1 | |
1165 | - | let eJ = he._2 | |
1166 | - | let hf = if ((eJ >= eR)) | |
1167 | - | then true | |
1168 | - | else aN(makeString(["updated DLp lower than current DLp", toString(eO), toString(eP), toString(eQ), toString(eR), toString(eJ), toString(em), toString(en)], " ")) | |
1169 | - | if ((hf == hf)) | |
1170 | - | then { | |
1171 | - | let hg = value(assetInfo(bl)).quantity | |
1172 | - | if ((hg == hg)) | |
1173 | - | then ((dB ++ hc) ++ gi) | |
1174 | - | else throw("Strict value is not equal to itself.") | |
1175 | - | } | |
1176 | - | else throw("Strict value is not equal to itself.") | |
1177 | - | } | |
1178 | - | else throw("Strict value is not equal to itself.") | |
1179 | - | } | |
1180 | - | else throw("Strict value is not equal to itself.") | |
1181 | - | } | |
901 | + | let fU = invoke(fL, "stake", nil, [AttachedPayment(fO, dr)]) | |
902 | + | if ((fU == fU)) | |
903 | + | then nil | |
1182 | 904 | else throw("Strict value is not equal to itself.") | |
1183 | 905 | } | |
1184 | - | else throw("Strict value is not equal to itself.") | |
906 | + | else [ScriptTransfer(dM.caller, dr, fO)] | |
907 | + | (cI ++ fT) | |
1185 | 908 | } | |
1186 | 909 | else throw("Strict value is not equal to itself.") | |
1187 | 910 | } | |
1195 | 918 | ||
1196 | 919 | ||
1197 | 920 | ||
1198 | - | @Callable( | |
1199 | - | func putOneTknV2 ( | |
1200 | - | let | |
1201 | - | let | |
1202 | - | if ($isInstanceOf( | |
1203 | - | then | |
1204 | - | else throw(($getType( | |
921 | + | @Callable(dM) | |
922 | + | func putOneTknV2 (fg,fJ) = { | |
923 | + | let fV = { | |
924 | + | let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
925 | + | if ($isInstanceOf(aF, "Boolean")) | |
926 | + | then aF | |
927 | + | else throw(($getType(aF) + " couldn't be cast to Boolean")) | |
1205 | 928 | } | |
1206 | - | let | |
929 | + | let fW = if (if (if (aI()) | |
1207 | 930 | then true | |
1208 | - | else ( | |
931 | + | else (aX == o)) | |
1209 | 932 | then true | |
1210 | - | else ( | |
933 | + | else (aX == q)) | |
1211 | 934 | then true | |
1212 | - | else | |
1213 | - | let | |
935 | + | else fV | |
936 | + | let fX = [if (if (!(fW)) | |
1214 | 937 | then true | |
1215 | - | else | |
938 | + | else fB(dM)) | |
1216 | 939 | then true | |
1217 | - | else | |
940 | + | else aB("put operation is blocked by admin"), if ((size(dM.payments) == 1)) | |
1218 | 941 | then true | |
1219 | - | else | |
1220 | - | if (( | |
942 | + | else aB("exactly 1 payment are expected")] | |
943 | + | if ((fX == fX)) | |
1221 | 944 | then { | |
1222 | - | let dj = toBase58String(value(bm)) | |
1223 | - | let dk = toBase58String(value(bn)) | |
1224 | - | let di = bl | |
1225 | - | let fQ = bo | |
1226 | - | let fR = bp | |
1227 | - | let dh = if ((cP.caller == this)) | |
1228 | - | then cP.originCaller | |
1229 | - | else cP.caller | |
1230 | - | let fk = value(cP.payments[0]) | |
1231 | - | let df = toBase58String(value(fk.assetId)) | |
1232 | - | let dL = fk.amount | |
1233 | - | let eR = if ((fk.assetId == bm)) | |
1234 | - | then eK(toBigInt(dL), toBigInt(0), toBigInt(0)) | |
1235 | - | else eK(toBigInt(0), toBigInt(dL), toBigInt(0)) | |
1236 | - | if ((eR == eR)) | |
945 | + | let aT = aL() | |
946 | + | let cq = aT[u] | |
947 | + | let cr = aT[v] | |
948 | + | let cp = fromBase58String(aT[t]) | |
949 | + | let fk = parseIntValue(aT[w]) | |
950 | + | let fl = parseIntValue(aT[x]) | |
951 | + | let co = if ((dM.caller == this)) | |
952 | + | then dM.originCaller | |
953 | + | else dM.caller | |
954 | + | let dN = value(dM.payments[0]) | |
955 | + | let cm = toBase58String(value(dN.assetId)) | |
956 | + | let cS = dN.amount | |
957 | + | let fY = eH(cS, cm, toString(co), toBase58String(dM.transactionId), true) | |
958 | + | if ((fY == fY)) | |
1237 | 959 | then { | |
1238 | - | let hj = fp(dL, df, toString(dh), toBase58String(cP.transactionId), true) | |
1239 | - | if ((hj == hj)) | |
960 | + | let cj = fY._3 | |
961 | + | let cI = fY._2 | |
962 | + | let fZ = fY._1 | |
963 | + | let dr = if (if ((fg > 0)) | |
964 | + | then (fg > fZ) | |
965 | + | else false) | |
966 | + | then aB(makeString(["amount to receive is less than ", toString(fg)], "")) | |
967 | + | else fZ | |
968 | + | let fN = invoke(aD, "emit", [dr], nil) | |
969 | + | if ((fN == fN)) | |
1240 | 970 | then { | |
1241 | - | let | |
1242 | - | let | |
1243 | - | | |
1244 | - | | |
1245 | - | | |
1246 | - | | |
1247 | - | | |
1248 | - | else | |
1249 | - | | |
1250 | - | if (( | |
971 | + | let fP = { | |
972 | + | let av = fN | |
973 | + | if ($isInstanceOf(av, "Address")) | |
974 | + | then { | |
975 | + | let fQ = av | |
976 | + | invoke(fQ, "emit", [dr], nil) | |
977 | + | } | |
978 | + | else unit | |
979 | + | } | |
980 | + | if ((fP == fP)) | |
1251 | 981 | then { | |
1252 | - | let gY = { | |
1253 | - | let gl = gW | |
1254 | - | if ($isInstanceOf(gl, "Address")) | |
1255 | - | then { | |
1256 | - | let gZ = gl | |
1257 | - | invoke(gZ, "emit", [el], nil) | |
1258 | - | } | |
1259 | - | else unit | |
1260 | - | } | |
1261 | - | if ((gY == gY)) | |
982 | + | let fT = if (fJ) | |
1262 | 983 | then { | |
1263 | - | let hc = if (gQ) | |
1264 | - | then { | |
1265 | - | let hd = invoke(bu, "stake", nil, [AttachedPayment(di, el)]) | |
1266 | - | if ((hd == hd)) | |
1267 | - | then nil | |
1268 | - | else throw("Strict value is not equal to itself.") | |
1269 | - | } | |
1270 | - | else [ScriptTransfer(cP.caller, el, di)] | |
1271 | - | let gc = if ((cx > 0)) | |
1272 | - | then [ScriptTransfer(aX, cx, fromBase58String(df))] | |
1273 | - | else nil | |
1274 | - | let hl = if ((this == aX)) | |
1275 | - | then $Tuple2(0, 0) | |
1276 | - | else { | |
1277 | - | let hm = if ((fk.assetId == bm)) | |
1278 | - | then true | |
1279 | - | else false | |
1280 | - | if (hm) | |
1281 | - | then $Tuple2(-(cx), 0) | |
1282 | - | else $Tuple2(0, -(cx)) | |
1283 | - | } | |
1284 | - | let eT = hl._1 | |
1285 | - | let eU = hl._2 | |
1286 | - | let hn = eS(eT, eU, 0) | |
1287 | - | let gi = hn._1 | |
1288 | - | let eJ = hn._2 | |
1289 | - | let gj = eW(eR, eJ) | |
1290 | - | if ((gj == gj)) | |
1291 | - | then $Tuple2((((dB ++ hc) ++ gc) ++ gi), el) | |
984 | + | let fU = invoke(bf, "stake", nil, [AttachedPayment(cp, dr)]) | |
985 | + | if ((fU == fU)) | |
986 | + | then nil | |
1292 | 987 | else throw("Strict value is not equal to itself.") | |
1293 | 988 | } | |
1294 | - | else throw("Strict value is not equal to itself.") | |
989 | + | else [ScriptTransfer(dM.caller, dr, cp)] | |
990 | + | let fw = if ((cj > 0)) | |
991 | + | then [ScriptTransfer(aK, cj, fromBase58String(cm))] | |
992 | + | else nil | |
993 | + | $Tuple2(((cI ++ fT) ++ fw), dr) | |
1295 | 994 | } | |
1296 | 995 | else throw("Strict value is not equal to itself.") | |
1297 | 996 | } | |
1304 | 1003 | ||
1305 | 1004 | ||
1306 | 1005 | ||
1307 | - | @Callable( | |
1308 | - | func putForFree ( | |
1006 | + | @Callable(dM) | |
1007 | + | func putForFree (ga) = if ((0 > ga)) | |
1309 | 1008 | then throw("Wrong slpg") | |
1310 | - | else if ((size( | |
1009 | + | else if ((size(dM.payments) != 2)) | |
1311 | 1010 | then throw("2 pmnts expd") | |
1312 | 1011 | else { | |
1313 | - | let hp = fl(toString(cP.caller), toBase58String(cP.transactionId), AttachedPayment(value(cP.payments[0]).assetId, value(cP.payments[0]).amount), cP.payments[1], ho, false, false, true, 0, "") | |
1314 | - | let dB = hp._9 | |
1315 | - | let gU = toBigInt(value(cP.payments[0]).amount) | |
1316 | - | let gV = toBigInt(value(cP.payments[1]).amount) | |
1317 | - | let eR = eK(gU, gV, toBigInt(0)) | |
1318 | - | if ((eR == eR)) | |
1319 | - | then { | |
1320 | - | let hq = eS(0, 0, 0) | |
1321 | - | let gi = hq._1 | |
1322 | - | let eJ = hq._2 | |
1323 | - | let gj = eW(eR, eJ) | |
1324 | - | if ((gj == gj)) | |
1325 | - | then (dB ++ gi) | |
1326 | - | else throw("Strict value is not equal to itself.") | |
1327 | - | } | |
1328 | - | else throw("Strict value is not equal to itself.") | |
1012 | + | let gb = dO(toString(dM.caller), toBase58String(dM.transactionId), AttachedPayment(value(dM.payments[0]).assetId, value(dM.payments[0]).amount), dM.payments[1], ga, false, false, true, 0, "") | |
1013 | + | gb._9 | |
1329 | 1014 | } | |
1330 | 1015 | ||
1331 | 1016 | ||
1332 | 1017 | ||
1333 | - | @Callable( | |
1018 | + | @Callable(dM) | |
1334 | 1019 | func get () = { | |
1335 | - | let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1336 | - | if ((eR == eR)) | |
1020 | + | let de = dL(dM) | |
1021 | + | let gc = de._1 | |
1022 | + | let cH = de._2 | |
1023 | + | let cS = de._3 | |
1024 | + | let cm = de._4 | |
1025 | + | let cI = de._5 | |
1026 | + | let eB = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)]) | |
1027 | + | if ((eB == eB)) | |
1028 | + | then cI | |
1029 | + | else throw("Strict value is not equal to itself.") | |
1030 | + | } | |
1031 | + | ||
1032 | + | ||
1033 | + | ||
1034 | + | @Callable(dM) | |
1035 | + | func getOneTknV2 (ff,fg) = { | |
1036 | + | let fV = { | |
1037 | + | let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1038 | + | if ($isInstanceOf(aF, "Boolean")) | |
1039 | + | then aF | |
1040 | + | else throw(($getType(aF) + " couldn't be cast to Boolean")) | |
1041 | + | } | |
1042 | + | let gd = if (if (aI()) | |
1043 | + | then true | |
1044 | + | else (aX == q)) | |
1045 | + | then true | |
1046 | + | else fV | |
1047 | + | let fX = [if (if (!(gd)) | |
1048 | + | then true | |
1049 | + | else fB(dM)) | |
1050 | + | then true | |
1051 | + | else aB("get operation is blocked by admin"), if ((size(dM.payments) == 1)) | |
1052 | + | then true | |
1053 | + | else aB("exactly 1 payment are expected")] | |
1054 | + | if ((fX == fX)) | |
1337 | 1055 | then { | |
1338 | - | let dX = fj(cP) | |
1339 | - | let hr = dX._1 | |
1340 | - | let dA = dX._2 | |
1341 | - | let dL = dX._3 | |
1342 | - | let df = dX._4 | |
1343 | - | let dB = dX._5 | |
1344 | - | let ey = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)]) | |
1345 | - | if ((ey == ey)) | |
1346 | - | then { | |
1347 | - | let hs = eS(-(hr), -(dA), 0) | |
1348 | - | let gi = hs._1 | |
1349 | - | let eJ = hs._2 | |
1350 | - | let gj = eW(eR, eJ) | |
1351 | - | if ((gj == gj)) | |
1352 | - | then (dB ++ gi) | |
1353 | - | else throw("Strict value is not equal to itself.") | |
1354 | - | } | |
1355 | - | else throw("Strict value is not equal to itself.") | |
1056 | + | let ge = fe(ff, fg, dM.payments, dM.caller, dM.originCaller, dM.transactionId) | |
1057 | + | let cI = ge._1 | |
1058 | + | let fp = ge._2 | |
1059 | + | $Tuple2(cI, fp) | |
1356 | 1060 | } | |
1357 | 1061 | else throw("Strict value is not equal to itself.") | |
1358 | 1062 | } | |
1359 | 1063 | ||
1360 | 1064 | ||
1361 | 1065 | ||
1362 | - | @Callable(cP) | |
1363 | - | func getOneTknV2 (fL,fM) = { | |
1364 | - | let hh = { | |
1365 | - | let aS = invoke(aQ, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1366 | - | if ($isInstanceOf(aS, "Boolean")) | |
1367 | - | then aS | |
1368 | - | else throw(($getType(aS) + " couldn't be cast to Boolean")) | |
1369 | - | } | |
1370 | - | let ht = if (if (aV()) | |
1371 | - | then true | |
1372 | - | else (bk == s)) | |
1373 | - | then true | |
1374 | - | else hh | |
1375 | - | let gH = [if (if (!(ht)) | |
1376 | - | then true | |
1377 | - | else go(cP)) | |
1378 | - | then true | |
1379 | - | else aN("get operation is blocked by admin"), if ((size(cP.payments) == 1)) | |
1380 | - | then true | |
1381 | - | else aN("exactly 1 payment are expected")] | |
1382 | - | if ((gH == gH)) | |
1383 | - | then { | |
1384 | - | let hu = fK(fL, fM, cP.payments, cP.caller, cP.originCaller, cP.transactionId) | |
1385 | - | let dB = hu._1 | |
1386 | - | let fV = hu._2 | |
1387 | - | $Tuple2(dB, fV) | |
1388 | - | } | |
1389 | - | else throw("Strict value is not equal to itself.") | |
1066 | + | @Callable(dM) | |
1067 | + | func getOneTknV2READONLY (ff,gf) = { | |
1068 | + | let aT = aL() | |
1069 | + | let cq = aT[u] | |
1070 | + | let cr = aT[v] | |
1071 | + | let cp = aT[t] | |
1072 | + | let dT = [toBigInt(by(cq)), toBigInt(by(cr))] | |
1073 | + | let gg = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cp)), "invalid lp asset").quantity) | |
1074 | + | let bL = dS(dT) | |
1075 | + | let bK = (bL - fraction(toBigInt(gf), bL, gg)) | |
1076 | + | let gh = if ((ff == cq)) | |
1077 | + | then 0 | |
1078 | + | else if ((ff == cr)) | |
1079 | + | then 1 | |
1080 | + | else throw("invalid out asset id") | |
1081 | + | let gi = ex(dT, gh, bK) | |
1082 | + | let gj = (dT[gh] - gi) | |
1083 | + | let gk = max([0, toInt((gj - f))]) | |
1084 | + | let gl = cg(gk, aG) | |
1085 | + | let fo = gl._1 | |
1086 | + | let cj = gl._2 | |
1087 | + | $Tuple2(nil, $Tuple2(fo, cj)) | |
1390 | 1088 | } | |
1391 | 1089 | ||
1392 | 1090 | ||
1393 | 1091 | ||
1394 | - | @Callable(cP) | |
1395 | - | func refreshDLp () = { | |
1396 | - | let hv = valueOrElse(getInteger(aq), 0) | |
1397 | - | let hw = if (((height - hv) >= at)) | |
1398 | - | then unit | |
1399 | - | else aN(makeString([toString(at), " blocks have not passed since the previous call"], "")) | |
1400 | - | if ((hw == hw)) | |
1401 | - | then { | |
1402 | - | let fd = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, ap), "0")), aP("invalid dLp")) | |
1403 | - | let hx = eS(0, 0, 0) | |
1404 | - | let hy = hx._1 | |
1405 | - | let eJ = hx._2 | |
1406 | - | let eV = if ((fd != eJ)) | |
1407 | - | then hy | |
1408 | - | else aN("nothing to refresh") | |
1409 | - | $Tuple2(eV, toString(eJ)) | |
1410 | - | } | |
1411 | - | else throw("Strict value is not equal to itself.") | |
1092 | + | @Callable(dM) | |
1093 | + | func getOneTknV2WithBonusREADONLY (ff,gf) = { | |
1094 | + | let aT = aL() | |
1095 | + | let cq = aT[u] | |
1096 | + | let cr = aT[v] | |
1097 | + | let cp = aT[t] | |
1098 | + | let cw = by(cq) | |
1099 | + | let cy = by(cr) | |
1100 | + | let gm = { | |
1101 | + | let aF = invoke(this, "getOneTknV2READONLY", [ff, gf], nil) | |
1102 | + | if ($isInstanceOf(aF, "(Int, Int)")) | |
1103 | + | then aF | |
1104 | + | else throw(($getType(aF) + " couldn't be cast to (Int, Int)")) | |
1105 | + | } | |
1106 | + | let fo = gm._1 | |
1107 | + | let cj = gm._2 | |
1108 | + | let de = ck("", cp, gf, this) | |
1109 | + | let cG = de._1 | |
1110 | + | let cH = de._2 | |
1111 | + | let gn = (cG + cH) | |
1112 | + | let fd = if ((gn == 0)) | |
1113 | + | then if ((fo == 0)) | |
1114 | + | then 0 | |
1115 | + | else throw("bonus calculation error") | |
1116 | + | else fraction((fo - gn), a, gn) | |
1117 | + | $Tuple2(nil, $Tuple3(fo, cj, fd)) | |
1412 | 1118 | } | |
1413 | 1119 | ||
1414 | 1120 | ||
1415 | 1121 | ||
1416 | - | @Callable(cP) | |
1417 | - | func getOneTknV2READONLY (fL,hz) = { | |
1418 | - | let dj = toBase58String(value(bm)) | |
1419 | - | let dk = toBase58String(value(bn)) | |
1420 | - | let di = toBase58String(value(bl)) | |
1421 | - | let cz = [toBigInt(bN(dj)), toBigInt(bN(dk))] | |
1422 | - | let eI = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(di)), "invalid lp asset").quantity) | |
1423 | - | let cb = cy(cz) | |
1424 | - | let ca = (cb - fraction(toBigInt(hz), cb, eI)) | |
1425 | - | let hA = if ((fL == dj)) | |
1426 | - | then 0 | |
1427 | - | else if ((fL == dk)) | |
1428 | - | then 1 | |
1429 | - | else throw("invalid out asset id") | |
1430 | - | let hB = es(cz, hA, ca) | |
1431 | - | let gA = (cz[hA] - hB) | |
1432 | - | let gB = max([0, toInt((gA - f))]) | |
1433 | - | let hC = cv(gB, aT) | |
1434 | - | let fU = hC._1 | |
1435 | - | let cx = hC._2 | |
1436 | - | $Tuple2(nil, $Tuple2(fU, cx)) | |
1437 | - | } | |
1438 | - | ||
1439 | - | ||
1440 | - | ||
1441 | - | @Callable(cP) | |
1442 | - | func getOneTknV2WithBonusREADONLY (fL,hz) = { | |
1443 | - | let dj = toBase58String(value(bm)) | |
1444 | - | let dk = toBase58String(value(bn)) | |
1445 | - | let di = toBase58String(value(bl)) | |
1446 | - | let dp = bN(dj) | |
1447 | - | let dr = bN(dk) | |
1448 | - | let hD = { | |
1449 | - | let aS = invoke(this, "getOneTknV2READONLY", [fL, hz], nil) | |
1450 | - | if ($isInstanceOf(aS, "(Int, Int)")) | |
1451 | - | then aS | |
1452 | - | else throw(($getType(aS) + " couldn't be cast to (Int, Int)")) | |
1453 | - | } | |
1454 | - | let fU = hD._1 | |
1455 | - | let cx = hD._2 | |
1456 | - | let dX = dd("", di, hz, this) | |
1457 | - | let dz = dX._1 | |
1458 | - | let dA = dX._2 | |
1459 | - | let hE = (dz + dA) | |
1460 | - | let fJ = if ((hE == 0)) | |
1461 | - | then if ((fU == 0)) | |
1462 | - | then 0 | |
1463 | - | else throw("bonus calculation error") | |
1464 | - | else fraction((fU - hE), a, hE) | |
1465 | - | $Tuple2(nil, $Tuple3(fU, cx, fJ)) | |
1466 | - | } | |
1467 | - | ||
1468 | - | ||
1469 | - | ||
1470 | - | @Callable(cP) | |
1471 | - | func getNoLess (hF,hG) = { | |
1472 | - | let dX = fj(cP) | |
1473 | - | let dz = dX._1 | |
1474 | - | let dA = dX._2 | |
1475 | - | let dL = dX._3 | |
1476 | - | let df = dX._4 | |
1477 | - | let dB = dX._5 | |
1478 | - | if ((hF > dz)) | |
1479 | - | then throw(((("Failed: " + toString(dz)) + " < ") + toString(hF))) | |
1480 | - | else if ((hG > dA)) | |
1481 | - | then throw(((("Failed: " + toString(dA)) + " < ") + toString(hG))) | |
1122 | + | @Callable(dM) | |
1123 | + | func getNoLess (go,gp) = { | |
1124 | + | let de = dL(dM) | |
1125 | + | let cG = de._1 | |
1126 | + | let cH = de._2 | |
1127 | + | let cS = de._3 | |
1128 | + | let cm = de._4 | |
1129 | + | let cI = de._5 | |
1130 | + | if ((go > cG)) | |
1131 | + | then throw(((("Failed: " + toString(cG)) + " < ") + toString(go))) | |
1132 | + | else if ((gp > cH)) | |
1133 | + | then throw(((("Failed: " + toString(cH)) + " < ") + toString(gp))) | |
1482 | 1134 | else { | |
1483 | - | let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1484 | - | if ((eR == eR)) | |
1485 | - | then { | |
1486 | - | let hH = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)]) | |
1487 | - | if ((hH == hH)) | |
1488 | - | then { | |
1489 | - | let hI = eS(-(dz), -(dA), 0) | |
1490 | - | let gi = hI._1 | |
1491 | - | let eJ = hI._2 | |
1492 | - | let gj = eW(eR, eJ) | |
1493 | - | if ((gj == gj)) | |
1494 | - | then (dB ++ gi) | |
1495 | - | else throw("Strict value is not equal to itself.") | |
1496 | - | } | |
1497 | - | else throw("Strict value is not equal to itself.") | |
1498 | - | } | |
1135 | + | let gq = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)]) | |
1136 | + | if ((gq == gq)) | |
1137 | + | then cI | |
1499 | 1138 | else throw("Strict value is not equal to itself.") | |
1500 | 1139 | } | |
1501 | 1140 | } | |
1502 | 1141 | ||
1503 | 1142 | ||
1504 | 1143 | ||
1505 | - | @Callable( | |
1506 | - | func unstakeAndGet ( | |
1507 | - | let | |
1144 | + | @Callable(dM) | |
1145 | + | func unstakeAndGet (ch) = { | |
1146 | + | let gr = if ((size(dM.payments) != 0)) | |
1508 | 1147 | then throw("No pmnts expd") | |
1509 | 1148 | else true | |
1510 | - | if (( | |
1149 | + | if ((gr == gr)) | |
1511 | 1150 | then { | |
1512 | - | let hK = bs() | |
1513 | - | let gX = bl | |
1514 | - | let hL = valueOrErrorMessage(addressFromString(hK[C]), "Wr st addr") | |
1515 | - | let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1516 | - | if ((eR == eR)) | |
1151 | + | let bX = aL() | |
1152 | + | let gs = bd() | |
1153 | + | let fO = fromBase58String(bX[t]) | |
1154 | + | let gt = valueOrErrorMessage(addressFromString(gs[A]), "Wr st addr") | |
1155 | + | let gu = invoke(gt, "unstake", [toBase58String(fO), ch], nil) | |
1156 | + | if ((gu == gu)) | |
1517 | 1157 | then { | |
1518 | - | let hM = invoke(hL, "unstake", [toBase58String(gX), cw], nil) | |
1519 | - | if ((hM == hM)) | |
1158 | + | let de = ck(toBase58String(dM.transactionId), toBase58String(fO), ch, dM.caller) | |
1159 | + | let cu = parseIntValue(de._9) | |
1160 | + | let cI = de._10 | |
1161 | + | let gv = if (if (aI()) | |
1162 | + | then true | |
1163 | + | else (cu == q)) | |
1164 | + | then throw(("Blocked: " + toString(cu))) | |
1165 | + | else true | |
1166 | + | if ((gv == gv)) | |
1520 | 1167 | then { | |
1521 | - | let dX = dd(toBase58String(cP.transactionId), toBase58String(gX), cw, cP.caller) | |
1522 | - | let dz = dX._1 | |
1523 | - | let dA = dX._2 | |
1524 | - | let dn = parseIntValue(dX._9) | |
1525 | - | let dB = dX._10 | |
1526 | - | let hN = if (if (aV()) | |
1527 | - | then true | |
1528 | - | else (dn == s)) | |
1529 | - | then throw(("Blocked: " + toString(dn))) | |
1530 | - | else true | |
1531 | - | if ((hN == hN)) | |
1532 | - | then { | |
1533 | - | let hO = invoke(aQ, "burn", [cw], [AttachedPayment(gX, cw)]) | |
1534 | - | if ((hO == hO)) | |
1535 | - | then { | |
1536 | - | let hP = eS(-(dz), -(dA), 0) | |
1537 | - | let gi = hP._1 | |
1538 | - | let eJ = hP._2 | |
1539 | - | let gj = eW(eR, eJ) | |
1540 | - | if ((gj == gj)) | |
1541 | - | then (dB ++ gi) | |
1542 | - | else throw("Strict value is not equal to itself.") | |
1543 | - | } | |
1544 | - | else throw("Strict value is not equal to itself.") | |
1545 | - | } | |
1168 | + | let gw = invoke(aD, "burn", [ch], [AttachedPayment(fO, ch)]) | |
1169 | + | if ((gw == gw)) | |
1170 | + | then cI | |
1546 | 1171 | else throw("Strict value is not equal to itself.") | |
1547 | 1172 | } | |
1548 | 1173 | else throw("Strict value is not equal to itself.") | |
1554 | 1179 | ||
1555 | 1180 | ||
1556 | 1181 | ||
1557 | - | @Callable( | |
1558 | - | func unstakeAndGetNoLess ( | |
1559 | - | let | |
1182 | + | @Callable(dM) | |
1183 | + | func unstakeAndGetNoLess (gx,gy,gp) = { | |
1184 | + | let gd = if (aI()) | |
1560 | 1185 | then true | |
1561 | - | else ( | |
1562 | - | let | |
1186 | + | else (aX == q) | |
1187 | + | let fX = [if (!(gd)) | |
1563 | 1188 | then true | |
1564 | - | else throw("get operation is blocked by admin"), if ((size( | |
1189 | + | else throw("get operation is blocked by admin"), if ((size(dM.payments) == 0)) | |
1565 | 1190 | then true | |
1566 | 1191 | else throw("no payments are expected")] | |
1567 | - | if (( | |
1192 | + | if ((fX == fX)) | |
1568 | 1193 | then { | |
1569 | - | let | |
1570 | - | if (( | |
1194 | + | let gu = invoke(bf, "unstake", [toBase58String(aY), gx], nil) | |
1195 | + | if ((gu == gu)) | |
1571 | 1196 | then { | |
1572 | - | let hM = invoke(bu, "unstake", [toBase58String(bl), hQ], nil) | |
1573 | - | if ((hM == hM)) | |
1197 | + | let gz = ck(toBase58String(dM.transactionId), toBase58String(aY), gx, dM.caller) | |
1198 | + | let cG = gz._1 | |
1199 | + | let cH = gz._2 | |
1200 | + | let cI = gz._10 | |
1201 | + | let gA = [if ((cG >= gy)) | |
1202 | + | then true | |
1203 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(gy)], "")), if ((cH >= gp)) | |
1204 | + | then true | |
1205 | + | else throw(makeString(["price asset amount to receive is less than ", toString(gp)], ""))] | |
1206 | + | if ((gA == gA)) | |
1574 | 1207 | then { | |
1575 | - | let hS = dd(toBase58String(cP.transactionId), toBase58String(bl), hQ, cP.caller) | |
1576 | - | let dz = hS._1 | |
1577 | - | let dA = hS._2 | |
1578 | - | let dB = hS._10 | |
1579 | - | let hT = [if ((dz >= hR)) | |
1580 | - | then true | |
1581 | - | else throw(makeString(["amount asset amount to receive is less than ", toString(hR)], "")), if ((dA >= hG)) | |
1582 | - | then true | |
1583 | - | else throw(makeString(["price asset amount to receive is less than ", toString(hG)], ""))] | |
1584 | - | if ((hT == hT)) | |
1585 | - | then { | |
1586 | - | let hH = invoke(aQ, "burn", [hQ], [AttachedPayment(bl, hQ)]) | |
1587 | - | if ((hH == hH)) | |
1588 | - | then { | |
1589 | - | let hU = eS(-(dz), -(dA), 0) | |
1590 | - | let gi = hU._1 | |
1591 | - | let eJ = hU._2 | |
1592 | - | let gj = eW(eR, eJ) | |
1593 | - | if ((gj == gj)) | |
1594 | - | then (dB ++ gi) | |
1595 | - | else throw("Strict value is not equal to itself.") | |
1596 | - | } | |
1597 | - | else throw("Strict value is not equal to itself.") | |
1598 | - | } | |
1208 | + | let gq = invoke(aD, "burn", [gx], [AttachedPayment(aY, gx)]) | |
1209 | + | if ((gq == gq)) | |
1210 | + | then cI | |
1599 | 1211 | else throw("Strict value is not equal to itself.") | |
1600 | 1212 | } | |
1601 | 1213 | else throw("Strict value is not equal to itself.") | |
1607 | 1219 | ||
1608 | 1220 | ||
1609 | 1221 | ||
1610 | - | @Callable( | |
1611 | - | func unstakeAndGetOneTknV2 ( | |
1612 | - | let | |
1613 | - | let | |
1614 | - | if ($isInstanceOf( | |
1615 | - | then | |
1616 | - | else throw(($getType( | |
1222 | + | @Callable(dM) | |
1223 | + | func unstakeAndGetOneTknV2 (gx,ff,fg) = { | |
1224 | + | let fV = { | |
1225 | + | let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1226 | + | if ($isInstanceOf(aF, "Boolean")) | |
1227 | + | then aF | |
1228 | + | else throw(($getType(aF) + " couldn't be cast to Boolean")) | |
1617 | 1229 | } | |
1618 | - | let | |
1230 | + | let gd = if (if (aI()) | |
1619 | 1231 | then true | |
1620 | - | else ( | |
1232 | + | else (aX == q)) | |
1621 | 1233 | then true | |
1622 | - | else | |
1623 | - | let | |
1234 | + | else fV | |
1235 | + | let fX = [if (if (!(gd)) | |
1624 | 1236 | then true | |
1625 | - | else | |
1237 | + | else fB(dM)) | |
1626 | 1238 | then true | |
1627 | - | else | |
1239 | + | else aB("get operation is blocked by admin"), if ((size(dM.payments) == 0)) | |
1628 | 1240 | then true | |
1629 | - | else | |
1630 | - | if (( | |
1241 | + | else aB("no payments are expected")] | |
1242 | + | if ((fX == fX)) | |
1631 | 1243 | then { | |
1632 | - | let hK = bs() | |
1633 | - | let gX = bl | |
1634 | - | let hL = valueOrErrorMessage(addressFromString(hK[C]), "Wr st addr") | |
1635 | - | let hM = invoke(hL, "unstake", [toBase58String(gX), hQ], nil) | |
1636 | - | if ((hM == hM)) | |
1244 | + | let bX = aL() | |
1245 | + | let gs = bd() | |
1246 | + | let fO = fromBase58String(bX[t]) | |
1247 | + | let gt = valueOrErrorMessage(addressFromString(gs[A]), "Wr st addr") | |
1248 | + | let co = dM.caller | |
1249 | + | let gB = this | |
1250 | + | let gu = invoke(gt, "unstakeINTERNAL", [fO, gx, co.bytes, gB.bytes], nil) | |
1251 | + | if ((gu == gu)) | |
1637 | 1252 | then { | |
1638 | - | let | |
1639 | - | let | |
1640 | - | let | |
1641 | - | $Tuple2( | |
1253 | + | let gC = fe(ff, fg, [AttachedPayment(fO, gx)], dM.caller, dM.originCaller, dM.transactionId) | |
1254 | + | let cI = gC._1 | |
1255 | + | let fp = gC._2 | |
1256 | + | $Tuple2(cI, fp) | |
1642 | 1257 | } | |
1643 | 1258 | else throw("Strict value is not equal to itself.") | |
1644 | 1259 | } | |
1647 | 1262 | ||
1648 | 1263 | ||
1649 | 1264 | ||
1650 | - | @Callable(cP) | |
1651 | - | func putOneTknV2WithBonusREADONLY (hW,hX) = { | |
1652 | - | let hY = fp(hW, hX, "", "", true) | |
1653 | - | let fE = hY._1 | |
1654 | - | let dB = hY._2 | |
1655 | - | let cx = hY._3 | |
1656 | - | let fJ = hY._4 | |
1657 | - | $Tuple2(nil, $Tuple3(fE, cx, fJ)) | |
1265 | + | @Callable(dM) | |
1266 | + | func putOneTknV2WithBonusREADONLY (gD,gE) = { | |
1267 | + | let aT = aL() | |
1268 | + | let cq = aT[u] | |
1269 | + | let cr = aT[v] | |
1270 | + | let cp = aT[t] | |
1271 | + | let gF = eH(gD, gE, "", "", true) | |
1272 | + | let eY = gF._1 | |
1273 | + | let cI = gF._2 | |
1274 | + | let cj = gF._3 | |
1275 | + | let fd = gF._4 | |
1276 | + | $Tuple2(nil, $Tuple3(eY, cj, fd)) | |
1658 | 1277 | } | |
1659 | 1278 | ||
1660 | 1279 | ||
1661 | 1280 | ||
1662 | - | @Callable(cP) | |
1663 | - | func putOneTknV2WithoutTakeFeeREADONLY (hW,hX) = { | |
1664 | - | let hZ = fp(hW, hX, "", "", false) | |
1665 | - | let fE = hZ._1 | |
1666 | - | let dB = hZ._2 | |
1667 | - | let cx = hZ._3 | |
1668 | - | let fJ = hZ._4 | |
1669 | - | $Tuple2(nil, $Tuple3(fE, cx, fJ)) | |
1281 | + | @Callable(dM) | |
1282 | + | func putOneTknV2WithoutTakeFeeREADONLY (gD,gE) = { | |
1283 | + | let aT = aL() | |
1284 | + | let cq = aT[u] | |
1285 | + | let cr = aT[v] | |
1286 | + | let cp = aT[t] | |
1287 | + | let gG = eH(gD, gE, "", "", false) | |
1288 | + | let eY = gG._1 | |
1289 | + | let cI = gG._2 | |
1290 | + | let cj = gG._3 | |
1291 | + | let fd = gG._4 | |
1292 | + | $Tuple2(nil, $Tuple3(eY, cj, fd)) | |
1670 | 1293 | } | |
1671 | 1294 | ||
1672 | 1295 | ||
1673 | 1296 | ||
1674 | - | @Callable( | |
1675 | - | func activate ( | |
1297 | + | @Callable(dM) | |
1298 | + | func activate (gH,gI) = if ((toString(dM.caller) != toString(aD))) | |
1676 | 1299 | then throw("denied") | |
1677 | - | else $Tuple2([StringEntry( | |
1300 | + | else $Tuple2([StringEntry(ac(), gH), StringEntry(ad(), gI)], "success") | |
1678 | 1301 | ||
1679 | 1302 | ||
1680 | 1303 | ||
1681 | - | @Callable( | |
1682 | - | func setS ( | |
1683 | - | then | |
1684 | - | else [StringEntry( | |
1304 | + | @Callable(dM) | |
1305 | + | func setS (gJ,gv) = if ((toString(dM.caller) != ax(this, af()))) | |
1306 | + | then fA | |
1307 | + | else [StringEntry(gJ, gv)] | |
1685 | 1308 | ||
1686 | 1309 | ||
1687 | 1310 | ||
1688 | - | @Callable( | |
1689 | - | func setI ( | |
1690 | - | then | |
1691 | - | else [IntegerEntry( | |
1311 | + | @Callable(dM) | |
1312 | + | func setI (gJ,gv) = if ((toString(dM.caller) != ax(this, af()))) | |
1313 | + | then fA | |
1314 | + | else [IntegerEntry(gJ, gv)] | |
1692 | 1315 | ||
1693 | 1316 | ||
1694 | 1317 | ||
1695 | - | @Callable( | |
1696 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, | |
1318 | + | @Callable(dM) | |
1319 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aL()) | |
1697 | 1320 | ||
1698 | 1321 | ||
1699 | 1322 | ||
1700 | - | @Callable( | |
1701 | - | func getAccBalanceWrapperREADONLY ( | |
1323 | + | @Callable(dM) | |
1324 | + | func getAccBalanceWrapperREADONLY (bz) = $Tuple2(nil, by(bz)) | |
1702 | 1325 | ||
1703 | 1326 | ||
1704 | 1327 | ||
1705 | - | @Callable( | |
1706 | - | func calcPricesWrapperREADONLY ( | |
1707 | - | let | |
1708 | - | $Tuple2(nil, [toString( | |
1328 | + | @Callable(dM) | |
1329 | + | func calcPricesWrapperREADONLY (bR,bS,bW) = { | |
1330 | + | let gK = bV(bR, bS, bW) | |
1331 | + | $Tuple2(nil, [toString(gK[0]), toString(gK[1]), toString(gK[2])]) | |
1709 | 1332 | } | |
1710 | 1333 | ||
1711 | 1334 | ||
1712 | 1335 | ||
1713 | - | @Callable( | |
1714 | - | func fromX18WrapperREADONLY ( | |
1336 | + | @Callable(dM) | |
1337 | + | func fromX18WrapperREADONLY (J,gL) = $Tuple2(nil, I(parseBigIntValue(J), gL)) | |
1715 | 1338 | ||
1716 | 1339 | ||
1717 | 1340 | ||
1718 | - | @Callable( | |
1719 | - | func toX18WrapperREADONLY ( | |
1341 | + | @Callable(dM) | |
1342 | + | func toX18WrapperREADONLY (G,H) = $Tuple2(nil, toString(F(G, H))) | |
1720 | 1343 | ||
1721 | 1344 | ||
1722 | 1345 | ||
1723 | - | @Callable( | |
1724 | - | func calcPriceBigIntWrapperREADONLY ( | |
1346 | + | @Callable(dM) | |
1347 | + | func calcPriceBigIntWrapperREADONLY (bB,bC) = $Tuple2(nil, toString(bA(parseBigIntValue(bB), parseBigIntValue(bC)))) | |
1725 | 1348 | ||
1726 | 1349 | ||
1727 | 1350 | ||
1728 | - | @Callable( | |
1729 | - | func estimatePutOperationWrapperREADONLY ( | |
1351 | + | @Callable(dM) | |
1352 | + | func estimatePutOperationWrapperREADONLY (cl,bG,cK,cL,cM,cN,gM,cO,cP) = $Tuple2(nil, cJ(cl, bG, cK, cL, cM, cN, gM, cO, cP, true, false, 0, "")) | |
1730 | 1353 | ||
1731 | 1354 | ||
1732 | 1355 | ||
1733 | - | @Callable( | |
1734 | - | func estimateGetOperationWrapperREADONLY ( | |
1735 | - | let | |
1736 | - | $Tuple2(nil, $Tuple10( | |
1356 | + | @Callable(dM) | |
1357 | + | func estimateGetOperationWrapperREADONLY (cl,gN,cn,gM) = { | |
1358 | + | let de = ck(cl, gN, cn, addressFromStringValue(gM)) | |
1359 | + | $Tuple2(nil, $Tuple10(de._1, de._2, de._3, de._4, de._5, de._6, de._7, toString(de._8), de._9, de._10)) | |
1737 | 1360 | } | |
1738 | 1361 | ||
1739 | 1362 | ||
1740 | - | @Verifier( | |
1741 | - | func | |
1742 | - | let | |
1743 | - | let | |
1744 | - | if ($isInstanceOf( | |
1363 | + | @Verifier(gO) | |
1364 | + | func gP () = { | |
1365 | + | let gQ = { | |
1366 | + | let av = fy() | |
1367 | + | if ($isInstanceOf(av, "ByteVector")) | |
1745 | 1368 | then { | |
1746 | - | let | |
1747 | - | | |
1369 | + | let fC = av | |
1370 | + | fC | |
1748 | 1371 | } | |
1749 | - | else if ($isInstanceOf( | |
1750 | - | then | |
1372 | + | else if ($isInstanceOf(av, "Unit")) | |
1373 | + | then gO.senderPublicKey | |
1751 | 1374 | else throw("Match error") | |
1752 | 1375 | } | |
1753 | - | let | |
1754 | - | if ($isInstanceOf( | |
1376 | + | let av = gO | |
1377 | + | if ($isInstanceOf(av, "Order")) | |
1755 | 1378 | then { | |
1756 | - | let eZ = gl | |
1757 | - | let ik = aW() | |
1758 | - | let il = eY(eZ) | |
1759 | - | let aF = il._1 | |
1760 | - | let aG = il._2 | |
1761 | - | let aH = sigVerify(eZ.bodyBytes, eZ.proofs[0], eZ.senderPublicKey) | |
1762 | - | let aI = sigVerify(eZ.bodyBytes, eZ.proofs[1], ik) | |
1763 | - | if (if (if (aF) | |
1764 | - | then aH | |
1379 | + | let dz = av | |
1380 | + | let gR = aJ() | |
1381 | + | let gS = dy(dz) | |
1382 | + | let gT = sigVerify(dz.bodyBytes, dz.proofs[0], dz.senderPublicKey) | |
1383 | + | let gU = sigVerify(dz.bodyBytes, dz.proofs[1], gR) | |
1384 | + | if (if (if (gS) | |
1385 | + | then gT | |
1765 | 1386 | else false) | |
1766 | - | then | |
1387 | + | then gU | |
1767 | 1388 | else false) | |
1768 | 1389 | then true | |
1769 | - | else | |
1390 | + | else aq(gS, gT, gU) | |
1770 | 1391 | } | |
1771 | - | else if ($isInstanceOf( | |
1392 | + | else if ($isInstanceOf(av, "SetScriptTransaction")) | |
1772 | 1393 | then { | |
1773 | - | let cC = gl | |
1774 | - | if (sigVerify(ih.bodyBytes, ih.proofs[0], ij)) | |
1394 | + | let dZ = av | |
1395 | + | let gV = blake2b256(value(dZ.script)) | |
1396 | + | let gW = fromBase64String(value(getString(aD, ao()))) | |
1397 | + | let gX = scriptHash(this) | |
1398 | + | if (if ((gW == gV)) | |
1399 | + | then (gX != gV) | |
1400 | + | else false) | |
1775 | 1401 | then true | |
1776 | - | else { | |
1777 | - | let im = blake2b256(value(cC.script)) | |
1778 | - | let in = fromBase64String(value(getString(aQ, aC()))) | |
1779 | - | let io = scriptHash(this) | |
1780 | - | if ((in == im)) | |
1781 | - | then (io != im) | |
1782 | - | else false | |
1783 | - | } | |
1402 | + | else sigVerify(gO.bodyBytes, gO.proofs[0], gQ) | |
1784 | 1403 | } | |
1785 | - | else sigVerify( | |
1404 | + | else sigVerify(gO.bodyBytes, gO.proofs[0], gQ) | |
1786 | 1405 | } | |
1787 | 1406 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 100000000 | |
5 | 5 | ||
6 | 6 | let b = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | let c = toBigInt(1000000000000000000) | |
9 | 9 | ||
10 | 10 | let d = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let e = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let f = toBigInt(1) | |
15 | 15 | ||
16 | 16 | let g = toBigInt(2) | |
17 | 17 | ||
18 | - | let h = toBigInt( | |
18 | + | let h = toBigInt((a - ((a * 1) / a))) | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = "WAVES" | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = "100" | |
23 | 23 | ||
24 | - | let k = " | |
24 | + | let k = "1" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "__" | |
27 | 27 | ||
28 | - | let m = " | |
28 | + | let m = "" | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = 1 | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 2 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 3 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 4 | |
37 | 37 | ||
38 | - | let r = | |
38 | + | let r = 1 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 2 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = 3 | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = 4 | |
45 | 45 | ||
46 | - | let v = | |
46 | + | let v = 5 | |
47 | 47 | ||
48 | - | let w = | |
48 | + | let w = 6 | |
49 | 49 | ||
50 | - | let x = | |
50 | + | let x = 7 | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = 8 | |
53 | 53 | ||
54 | - | let z = | |
54 | + | let z = 9 | |
55 | 55 | ||
56 | - | let A = | |
56 | + | let A = 1 | |
57 | 57 | ||
58 | - | let B = | |
58 | + | let B = 6 | |
59 | 59 | ||
60 | - | let C = | |
60 | + | let C = 7 | |
61 | 61 | ||
62 | - | let D = | |
62 | + | let D = 10 | |
63 | 63 | ||
64 | - | let E = | |
64 | + | let E = fraction(10, a, 10000) | |
65 | 65 | ||
66 | - | let F = 10 | |
67 | - | ||
68 | - | let G = fraction(10, a, 10000) | |
69 | - | ||
70 | - | func H (I,J) = fraction(toBigInt(I), c, toBigInt(J)) | |
66 | + | func F (G,H) = fraction(toBigInt(G), c, toBigInt(H)) | |
71 | 67 | ||
72 | 68 | ||
73 | - | func | |
69 | + | func I (J,K) = toInt(fraction(J, toBigInt(K), c)) | |
74 | 70 | ||
75 | 71 | ||
76 | - | func L (M,N) = | |
72 | + | func L (M,N,O) = fraction(M, N, O) | |
77 | 73 | ||
78 | 74 | ||
79 | - | func O (M,N,P) = toInt(fraction(M, toBigInt(N), c, P)) | |
75 | + | func P (J) = if ((d > J)) | |
76 | + | then -(J) | |
77 | + | else J | |
80 | 78 | ||
81 | 79 | ||
82 | - | func Q (I,J) = fraction(I, c, toBigInt(J)) | |
80 | + | func Q (J) = if ((d > J)) | |
81 | + | then -(J) | |
82 | + | else J | |
83 | 83 | ||
84 | 84 | ||
85 | - | func R ( | |
85 | + | func R () = "%s__factoryContract" | |
86 | 86 | ||
87 | 87 | ||
88 | - | func S ( | |
88 | + | func S () = "%s__managerPublicKey" | |
89 | 89 | ||
90 | 90 | ||
91 | - | func W (M) = if ((d > M)) | |
92 | - | then -(M) | |
93 | - | else M | |
91 | + | func T () = "%s__pendingManagerPublicKey" | |
94 | 92 | ||
95 | 93 | ||
96 | - | func X (M) = if ((d > M)) | |
97 | - | then -(M) | |
98 | - | else M | |
94 | + | func U () = "%s%s__price__last" | |
99 | 95 | ||
100 | 96 | ||
101 | - | func | |
97 | + | func V (W,X) = makeString(["%s%s%d%d__price__history", toString(W), toString(X)], l) | |
102 | 98 | ||
103 | 99 | ||
104 | - | func | |
100 | + | func Y (Z,aa) = ((("%s%s%s__P__" + Z) + "__") + aa) | |
105 | 101 | ||
106 | 102 | ||
107 | - | func | |
103 | + | func ab (Z,aa) = ((("%s%s%s__G__" + Z) + "__") + aa) | |
108 | 104 | ||
109 | 105 | ||
110 | - | func | |
106 | + | func ac () = "%s__amountAsset" | |
111 | 107 | ||
112 | 108 | ||
113 | - | func | |
109 | + | func ad () = "%s__priceAsset" | |
114 | 110 | ||
115 | 111 | ||
116 | - | func | |
112 | + | func ae () = "%s__amp" | |
117 | 113 | ||
118 | 114 | ||
119 | - | func | |
115 | + | func af () = "%s__addonAddr" | |
120 | 116 | ||
121 | 117 | ||
122 | - | func | |
118 | + | func ag () = "%s__factoryConfig" | |
123 | 119 | ||
124 | 120 | ||
125 | - | func | |
121 | + | func ah () = "%s%s__matcher__publicKey" | |
126 | 122 | ||
127 | 123 | ||
128 | - | func | |
124 | + | func ai (aj,ak) = (((("%d%d%s__" + aj) + "__") + ak) + "__config") | |
129 | 125 | ||
130 | 126 | ||
131 | - | func | |
127 | + | func al (am) = ("%s%s%s__mappings__baseAsset2internalId__" + am) | |
132 | 128 | ||
133 | 129 | ||
134 | - | let an = "%s__fee" | |
135 | - | ||
136 | - | let ao = valueOrElse(getInteger(this, an), G) | |
137 | - | ||
138 | - | let ap = makeString(["%s", "dLp"], n) | |
139 | - | ||
140 | - | let aq = makeString(["%s", "dLpRefreshedHeight"], n) | |
141 | - | ||
142 | - | let ar = makeString(["%s", "refreshDLpDelay"], n) | |
143 | - | ||
144 | - | let as = 30 | |
145 | - | ||
146 | - | let at = valueOrElse(getInteger(this, ar), as) | |
147 | - | ||
148 | - | func au () = "%s__factoryConfig" | |
130 | + | func an () = "%s__shutdown" | |
149 | 131 | ||
150 | 132 | ||
151 | - | func | |
133 | + | func ao () = "%s__allowedLpStableScriptHash" | |
152 | 134 | ||
153 | 135 | ||
154 | - | func | |
136 | + | func ap () = "%s__feeCollectorAddress" | |
155 | 137 | ||
156 | 138 | ||
157 | - | func | |
139 | + | func aq (ar,as,at) = throw(((((("Failed: ordValid=" + toString(ar)) + " sndrValid=") + toString(as)) + " mtchrValid=") + toString(at))) | |
158 | 140 | ||
159 | 141 | ||
160 | - | func aB () = "%s__shutdown" | |
161 | - | ||
162 | - | ||
163 | - | func aC () = "%s__allowedLpStableScriptHash" | |
164 | - | ||
165 | - | ||
166 | - | func aD () = "%s__feeCollectorAddress" | |
167 | - | ||
168 | - | ||
169 | - | func aE (aF,aG,aH,aI) = throw((((((((("order validation failed: orderValid=" + toString(aF)) + " (") + aG) + ")") + " senderValid=") + toString(aH)) + " matcherValid=") + toString(aI))) | |
170 | - | ||
171 | - | ||
172 | - | func aJ (aK,aL) = valueOrErrorMessage(getString(aK, aL), makeString(["mandatory ", toString(aK), ".", aL, " not defined"], "")) | |
173 | - | ||
174 | - | ||
175 | - | func aM (aK,aL) = valueOrErrorMessage(getInteger(aK, aL), makeString(["mandatory ", toString(aK), ".", aL, " not defined"], "")) | |
176 | - | ||
177 | - | ||
178 | - | func aN (aO) = throw(makeString(["lp_stable.ride:", aO], " ")) | |
179 | - | ||
180 | - | ||
181 | - | func aP (aO) = makeString(["lp_stable.ride:", aO], " ") | |
182 | - | ||
183 | - | ||
184 | - | let aQ = addressFromStringValue(aJ(this, Y())) | |
185 | - | ||
186 | - | let aR = { | |
187 | - | let aS = invoke(aQ, "getInFeeREADONLY", [toString(this)], nil) | |
188 | - | if ($isInstanceOf(aS, "Int")) | |
189 | - | then aS | |
190 | - | else throw(($getType(aS) + " couldn't be cast to Int")) | |
191 | - | } | |
192 | - | ||
193 | - | let aT = { | |
194 | - | let aS = invoke(aQ, "getOutFeeREADONLY", [toString(this)], nil) | |
195 | - | if ($isInstanceOf(aS, "Int")) | |
196 | - | then aS | |
197 | - | else throw(($getType(aS) + " couldn't be cast to Int")) | |
198 | - | } | |
199 | - | ||
200 | - | let aU = aJ(this, al()) | |
201 | - | ||
202 | - | func aV () = valueOrElse(getBoolean(aQ, aB()), false) | |
203 | - | ||
204 | - | ||
205 | - | func aW () = fromBase58String(aJ(aQ, av())) | |
206 | - | ||
207 | - | ||
208 | - | let aX = addressFromStringValue(aJ(aQ, aD())) | |
209 | - | ||
210 | - | func aY () = { | |
211 | - | let aZ = aJ(this, aj()) | |
212 | - | let ba = aJ(this, ak()) | |
213 | - | let bb = aM(aQ, az(ba)) | |
214 | - | let ax = aM(aQ, az(aZ)) | |
215 | - | split(aJ(aQ, aw(toString(ax), toString(bb))), n) | |
142 | + | func au (J) = { | |
143 | + | let av = J | |
144 | + | if ($isInstanceOf(av, "String")) | |
145 | + | then { | |
146 | + | let aw = av | |
147 | + | aw | |
148 | + | } | |
149 | + | else throw("fail cast to String") | |
216 | 150 | } | |
217 | 151 | ||
218 | 152 | ||
219 | - | func bc (bd) = if ((bd == k)) | |
220 | - | then unit | |
221 | - | else fromBase58String(bd) | |
153 | + | func ax (ay,az) = valueOrErrorMessage(getString(ay, az), makeString(["mandatory ", toString(ay), ".", az, " not defined"], "")) | |
222 | 154 | ||
223 | 155 | ||
224 | - | func be (bd) = if ((bd == unit)) | |
225 | - | then k | |
226 | - | else toBase58String(value(bd)) | |
156 | + | func aA (ay,az) = valueOrErrorMessage(getInteger(ay, az), makeString(["mandatory ", toString(ay), ".", az, " not defined"], "")) | |
227 | 157 | ||
228 | 158 | ||
229 | - | func | |
159 | + | func aB (aC) = throw(makeString(["lp_stable.ride:", aC], " ")) | |
230 | 160 | ||
231 | 161 | ||
232 | - | let | |
162 | + | let aD = addressFromStringValue(ax(this, R())) | |
233 | 163 | ||
234 | - | let bi = bh | |
164 | + | let aE = { | |
165 | + | let aF = invoke(aD, "getInFeeREADONLY", [toString(this)], nil) | |
166 | + | if ($isInstanceOf(aF, "Int")) | |
167 | + | then aF | |
168 | + | else throw(($getType(aF) + " couldn't be cast to Int")) | |
169 | + | } | |
235 | 170 | ||
236 | - | let bj = bi._1 | |
171 | + | let aG = { | |
172 | + | let aF = invoke(aD, "getOutFeeREADONLY", [toString(this)], nil) | |
173 | + | if ($isInstanceOf(aF, "Int")) | |
174 | + | then aF | |
175 | + | else throw(($getType(aF) + " couldn't be cast to Int")) | |
176 | + | } | |
237 | 177 | ||
238 | - | let | |
178 | + | let aH = ax(this, ae()) | |
239 | 179 | ||
240 | - | let bl = bi._3 | |
241 | - | ||
242 | - | let bm = bi._4 | |
243 | - | ||
244 | - | let bn = bi._5 | |
245 | - | ||
246 | - | let bo = bi._6 | |
247 | - | ||
248 | - | let bp = bi._7 | |
249 | - | ||
250 | - | let bq = bi._8 | |
251 | - | ||
252 | - | let br = bi._9 | |
253 | - | ||
254 | - | func bs () = split(aJ(aQ, au()), n) | |
180 | + | func aI () = valueOrElse(getBoolean(aD, an()), false) | |
255 | 181 | ||
256 | 182 | ||
257 | - | let bt = bs() | |
258 | - | ||
259 | - | let bu = valueOrErrorMessage(addressFromString(bt[C]), "Invalid staking contract address") | |
260 | - | ||
261 | - | let bv = valueOrErrorMessage(addressFromString(bt[E]), "Invalid slipage contract address") | |
262 | - | ||
263 | - | let bw = valueOrErrorMessage(addressFromString(bt[F]), "Invalid gwx contract address") | |
264 | - | ||
265 | - | let bx = valueOrErrorMessage(addressFromString(bt[D]), "Invalid gwx contract address") | |
266 | - | ||
267 | - | func by (bz,bA,bB,bC,bD,bE,bF,bG,bH,bI) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bz), toString(bA), toString(bB), toString(bC), toString(bD), toString(bE), toString(bF), toString(bG), toString(bH), toString(bI)], n) | |
183 | + | func aJ () = fromBase58String(ax(aD, ah())) | |
268 | 184 | ||
269 | 185 | ||
270 | - | ||
186 | + | let aK = addressFromStringValue(ax(aD, ap())) | |
271 | 187 | ||
272 | - | ||
273 | - | func bN (bO) = if ((bO == "WAVES")) | |
274 | - | then wavesBalance(this).available | |
275 | - | else assetBalance(this, fromBase58String(bO)) | |
276 | - | ||
277 | - | ||
278 | - | func bP (bQ,bR) = fraction(bQ, c, bR) | |
279 | - | ||
280 | - | ||
281 | - | func bS (bQ,bR,P) = fraction(bQ, c, bR, P) | |
282 | - | ||
283 | - | ||
284 | - | func bT (bU,bV,bW) = { | |
285 | - | let bX = fraction((bU - bV), b, bV) | |
286 | - | let bY = ((bW - W(bX)) > d) | |
287 | - | if (!(bY)) | |
288 | - | then throw(("Big slpg: " + toString(bX))) | |
289 | - | else $Tuple2(bY, min([bU, bV])) | |
188 | + | func aL () = { | |
189 | + | let aM = ax(this, ac()) | |
190 | + | let aN = ax(this, ad()) | |
191 | + | let aO = aA(aD, al(aN)) | |
192 | + | let aj = aA(aD, al(aM)) | |
193 | + | split(ax(aD, ai(toString(aj), toString(aO))), l) | |
290 | 194 | } | |
291 | 195 | ||
292 | 196 | ||
293 | - | func bZ (ca,cb,cc) = { | |
294 | - | let bX = fraction(cb, b, ca) | |
295 | - | let cd = (cc > bX) | |
296 | - | if (if (cd) | |
297 | - | then true | |
298 | - | else (cb > ca)) | |
299 | - | then throw(((((((toString(cb) + " ") + toString(ca)) + " ") + toString(bX)) + " ") + toString(cc))) | |
300 | - | else cd | |
197 | + | func aP (aQ) = if ((aQ == i)) | |
198 | + | then unit | |
199 | + | else fromBase58String(aQ) | |
200 | + | ||
201 | + | ||
202 | + | func aR (aQ) = if ((aQ == unit)) | |
203 | + | then i | |
204 | + | else toBase58String(value(aQ)) | |
205 | + | ||
206 | + | ||
207 | + | func aS (aT) = $Tuple7(addressFromStringValue(aT[r]), parseIntValue(aT[s]), fromBase58String(aT[t]), aP(aT[u]), aP(aT[v]), parseIntValue(aT[w]), parseIntValue(aT[x])) | |
208 | + | ||
209 | + | ||
210 | + | let aU = aS(aL()) | |
211 | + | ||
212 | + | let aV = aU | |
213 | + | ||
214 | + | let aW = aV._1 | |
215 | + | ||
216 | + | let aX = aV._2 | |
217 | + | ||
218 | + | let aY = aV._3 | |
219 | + | ||
220 | + | let aZ = aV._4 | |
221 | + | ||
222 | + | let ba = aV._5 | |
223 | + | ||
224 | + | let bb = aV._6 | |
225 | + | ||
226 | + | let bc = aV._7 | |
227 | + | ||
228 | + | func bd () = split(ax(aD, ag()), l) | |
229 | + | ||
230 | + | ||
231 | + | let be = bd() | |
232 | + | ||
233 | + | let bf = valueOrErrorMessage(addressFromString(be[A]), "Invalid staking contract address") | |
234 | + | ||
235 | + | let bg = valueOrErrorMessage(addressFromString(be[C]), "Invalid slipage contract address") | |
236 | + | ||
237 | + | let bh = valueOrErrorMessage(addressFromString(be[D]), "Invalid gwx contract address") | |
238 | + | ||
239 | + | let bi = valueOrErrorMessage(addressFromString(be[B]), "Invalid gwx contract address") | |
240 | + | ||
241 | + | func bj (bk,bl,bm,bn,bo,bp,bq,br,bs,bt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bk), toString(bl), toString(bm), toString(bn), toString(bo), toString(bp), toString(bq), toString(br), toString(bs), toString(bt)], l) | |
242 | + | ||
243 | + | ||
244 | + | func bu (bv,bw,bx,bn,bq,br) = makeString(["%d%d%d%d%d%d", toString(bv), toString(bw), toString(bx), toString(bn), toString(bq), toString(br)], l) | |
245 | + | ||
246 | + | ||
247 | + | func by (bz) = if ((bz == "WAVES")) | |
248 | + | then wavesBalance(this).available | |
249 | + | else assetBalance(this, fromBase58String(bz)) | |
250 | + | ||
251 | + | ||
252 | + | func bA (bB,bC) = fraction(bB, c, bC) | |
253 | + | ||
254 | + | ||
255 | + | func bD (bE,bF,bG) = { | |
256 | + | let bH = fraction((bE - bF), b, bF) | |
257 | + | let bI = ((bG - P(bH)) > d) | |
258 | + | if (!(bI)) | |
259 | + | then throw(("Big slpg: " + toString(bH))) | |
260 | + | else $Tuple2(bI, min([bE, bF])) | |
301 | 261 | } | |
302 | 262 | ||
303 | 263 | ||
304 | - | func ce (cf,cg,ch,ci) = { | |
305 | - | let cj = H(ch, cf) | |
306 | - | let ck = H(ci, cg) | |
307 | - | bP(ck, cj) | |
264 | + | func bJ (bK,bL,bM) = { | |
265 | + | let bH = fraction(bL, b, bK) | |
266 | + | let bN = (bM > bH) | |
267 | + | if (if (bN) | |
268 | + | then true | |
269 | + | else (bL > bK)) | |
270 | + | then throw(((((((toString(bL) + " ") + toString(bK)) + " ") + toString(bH)) + " ") + toString(bM))) | |
271 | + | else bN | |
308 | 272 | } | |
309 | 273 | ||
310 | 274 | ||
311 | - | func cl (ch,ci,cm) = { | |
312 | - | let cn = bo | |
313 | - | let co = bp | |
314 | - | let cp = ce(cn, co, ch, ci) | |
315 | - | let bR = H(ch, cn) | |
316 | - | let bQ = H(ci, co) | |
317 | - | let cq = H(cm, a) | |
318 | - | let cr = bP(bR, cq) | |
319 | - | let cs = bP(bQ, cq) | |
320 | - | [cp, cr, cs] | |
275 | + | func bO (bP,bQ,bR,bS) = { | |
276 | + | let bT = F(bR, bP) | |
277 | + | let bU = F(bS, bQ) | |
278 | + | bA(bU, bT) | |
321 | 279 | } | |
322 | 280 | ||
323 | 281 | ||
324 | - | func ct (ch,ci,cm) = { | |
325 | - | let cu = cl(ch, ci, cm) | |
326 | - | [L(cu[0], a), L(cu[1], a), L(cu[2], a)] | |
282 | + | func bV (bR,bS,bW) = { | |
283 | + | let bX = aL() | |
284 | + | let bY = parseIntValue(bX[w]) | |
285 | + | let bZ = parseIntValue(bX[x]) | |
286 | + | let ca = bO(bY, bZ, bR, bS) | |
287 | + | let bC = F(bR, bY) | |
288 | + | let bB = F(bS, bZ) | |
289 | + | let cb = F(bW, a) | |
290 | + | let cc = bA(bC, cb) | |
291 | + | let cd = bA(bB, cb) | |
292 | + | [ca, cc, cd] | |
327 | 293 | } | |
328 | 294 | ||
329 | 295 | ||
330 | - | func cv (cw,ao) = { | |
331 | - | let cx = if ((ao == 0)) | |
332 | - | then 0 | |
333 | - | else fraction(cw, ao, a) | |
334 | - | $Tuple2((cw - cx), cx) | |
296 | + | func ce (bR,bS,bW) = { | |
297 | + | let cf = bV(bR, bS, bW) | |
298 | + | [I(cf[0], a), I(cf[1], a), I(cf[2], a)] | |
335 | 299 | } | |
336 | 300 | ||
337 | 301 | ||
338 | - | func cy (cz) = { | |
339 | - | let cA = cz[0] | |
340 | - | let cB = cz[1] | |
341 | - | let cC = (cA + cB) | |
342 | - | if ((cC == e)) | |
343 | - | then e | |
302 | + | func cg (ch,ci) = { | |
303 | + | let cj = if ((ci == 0)) | |
304 | + | then 0 | |
305 | + | else fraction(ch, ci, a) | |
306 | + | $Tuple2((ch - cj), cj) | |
307 | + | } | |
308 | + | ||
309 | + | ||
310 | + | func ck (cl,cm,cn,co) = { | |
311 | + | let bX = aL() | |
312 | + | let cp = bX[t] | |
313 | + | let cq = bX[u] | |
314 | + | let cr = bX[v] | |
315 | + | let cs = parseIntValue(bX[w]) | |
316 | + | let ct = parseIntValue(bX[x]) | |
317 | + | let cu = bX[s] | |
318 | + | let cv = valueOrErrorMessage(assetInfo(fromBase58String(cp)), "Wrong LP id").quantity | |
319 | + | if ((cp != cm)) | |
320 | + | then throw("Wrong pmt asset") | |
344 | 321 | else { | |
345 | - | let cD = parseIntValue(aU) | |
346 | - | let cE = (cD * 2) | |
347 | - | let cu = fraction(cA, cB, f) | |
348 | - | let cF = fraction(cu, i, f) | |
349 | - | let cG = fraction(toBigInt(cE), cC, f) | |
350 | - | let cH = toBigInt((cE - 1)) | |
351 | - | func cI (cJ) = { | |
352 | - | let cK = fraction(cJ, cJ, f) | |
353 | - | let cL = fraction(cK, cJ, f) | |
354 | - | let cM = fraction(cL, f, cF) | |
355 | - | fraction((cG + fraction(cM, g, f)), cJ, (fraction(cH, cJ, f) + fraction(h, cM, f))) | |
356 | - | } | |
357 | - | ||
358 | - | func cN (cO,cP) = if (cO._2) | |
359 | - | then cO | |
360 | - | else { | |
361 | - | let cJ = cO._1 | |
362 | - | let cQ = cI(cJ) | |
363 | - | let cR = (cQ - value(cJ)) | |
364 | - | let cS = if ((e > cR)) | |
365 | - | then -(cR) | |
366 | - | else cR | |
367 | - | if ((f >= cS)) | |
368 | - | then $Tuple2(cQ, true) | |
369 | - | else $Tuple2(cQ, false) | |
370 | - | } | |
371 | - | ||
372 | - | let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] | |
373 | - | let cU = { | |
374 | - | let cV = cT | |
375 | - | let cW = size(cV) | |
376 | - | let cX = $Tuple2(cC, false) | |
377 | - | func cY (cZ,da) = if ((da >= cW)) | |
378 | - | then cZ | |
379 | - | else cN(cZ, cV[da]) | |
380 | - | ||
381 | - | func db (cZ,da) = if ((da >= cW)) | |
382 | - | then cZ | |
383 | - | else throw("List size exceeds 18") | |
384 | - | ||
385 | - | db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18) | |
386 | - | } | |
387 | - | let cJ = cU._1 | |
388 | - | let dc = cU._2 | |
389 | - | if (dc) | |
390 | - | then cJ | |
391 | - | else throw(("D calculation error, D = " + toString(cJ))) | |
322 | + | let cw = by(cq) | |
323 | + | let cx = F(cw, cs) | |
324 | + | let cy = by(cr) | |
325 | + | let cz = F(cy, ct) | |
326 | + | let cA = bA(cz, cx) | |
327 | + | let cB = I(cA, a) | |
328 | + | let cC = F(cn, a) | |
329 | + | let cD = F(cv, a) | |
330 | + | let cE = fraction(cx, cC, cD) | |
331 | + | let cF = fraction(cz, cC, cD) | |
332 | + | let cG = I(cE, cs) | |
333 | + | let cH = I(cF, ct) | |
334 | + | let cI = if ((cl == "")) | |
335 | + | then nil | |
336 | + | else [ScriptTransfer(co, cG, if ((cq == "WAVES")) | |
337 | + | then unit | |
338 | + | else fromBase58String(cq)), ScriptTransfer(co, cH, if ((cr == "WAVES")) | |
339 | + | then unit | |
340 | + | else fromBase58String(cr)), StringEntry(ab(toString(co), cl), bu(cG, cH, cn, cB, height, lastBlock.timestamp)), IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB)] | |
341 | + | $Tuple10(cG, cH, cq, cr, cw, cy, cv, cA, cu, cI) | |
392 | 342 | } | |
393 | 343 | } | |
394 | 344 | ||
395 | 345 | ||
396 | - | func dd (de,df,dg,dh) = { | |
397 | - | let di = bl | |
398 | - | let dj = toBase58String(value(bm)) | |
399 | - | let dk = toBase58String(value(bn)) | |
400 | - | let dl = bo | |
401 | - | let dm = bp | |
402 | - | let dn = toString(bk) | |
403 | - | let do = valueOrErrorMessage(assetInfo(di), "Wrong LP id").quantity | |
404 | - | if ((toBase58String(di) != df)) | |
405 | - | then throw("Wrong pmt asset") | |
346 | + | func cJ (cl,bG,cK,cL,cM,cN,co,cO,cP,cQ,cR,cS,cT) = { | |
347 | + | let bX = aL() | |
348 | + | let cp = fromBase58String(bX[t]) | |
349 | + | let cU = bX[u] | |
350 | + | let cV = bX[v] | |
351 | + | let cW = bX[y] | |
352 | + | let cX = bX[z] | |
353 | + | let cY = parseIntValue(bX[w]) | |
354 | + | let cZ = parseIntValue(bX[x]) | |
355 | + | let cu = bX[s] | |
356 | + | let da = valueOrErrorMessage(assetInfo(cp), "Wr lp as").quantity | |
357 | + | let cw = if (cO) | |
358 | + | then by(cU) | |
359 | + | else if (if (cQ) | |
360 | + | then (cT == cU) | |
361 | + | else false) | |
362 | + | then (by(cU) - cS) | |
363 | + | else if (cQ) | |
364 | + | then by(cU) | |
365 | + | else (by(cU) - cK) | |
366 | + | let cy = if (cO) | |
367 | + | then by(cV) | |
368 | + | else if (if (cQ) | |
369 | + | then (cT == cV) | |
370 | + | else false) | |
371 | + | then (by(cV) - cS) | |
372 | + | else if (cQ) | |
373 | + | then by(cV) | |
374 | + | else (by(cV) - cM) | |
375 | + | let db = F(cK, cY) | |
376 | + | let dc = F(cM, cZ) | |
377 | + | let dd = bA(dc, db) | |
378 | + | let cx = F(cw, cY) | |
379 | + | let cz = F(cy, cZ) | |
380 | + | let de = if ((da == 0)) | |
381 | + | then { | |
382 | + | let cA = d | |
383 | + | let df = d | |
384 | + | let cb = pow((db * dc), 0, toBigInt(5), 1, 0, DOWN) | |
385 | + | $Tuple5(I(cb, a), I(db, cY), I(dc, cZ), bA((cz + dc), (cx + db)), df) | |
386 | + | } | |
406 | 387 | else { | |
407 | - | let dp = bN(dj) | |
408 | - | let dq = H(dp, dl) | |
409 | - | let dr = bN(dk) | |
410 | - | let ds = H(dr, dm) | |
411 | - | let dt = bP(ds, dq) | |
412 | - | let du = L(dt, a) | |
413 | - | let dv = H(dg, a) | |
414 | - | let dw = H(do, a) | |
415 | - | let dx = fraction(dq, dv, dw) | |
416 | - | let dy = fraction(ds, dv, dw) | |
417 | - | let dz = O(dx, dl, FLOOR) | |
418 | - | let dA = O(dy, dm, FLOOR) | |
419 | - | let dB = if ((de == "")) | |
420 | - | then nil | |
421 | - | else [ScriptTransfer(dh, dz, if ((dj == "WAVES")) | |
422 | - | then unit | |
423 | - | else fromBase58String(dj)), ScriptTransfer(dh, dA, if ((dk == "WAVES")) | |
424 | - | then unit | |
425 | - | else fromBase58String(dk)), StringEntry(ai(toString(dh), de), bJ(dz, dA, dg, du, height, lastBlock.timestamp)), IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du)] | |
426 | - | $Tuple10(dz, dA, dj, dk, dp, dr, do, dt, dn, dB) | |
388 | + | let cA = bA(cz, cx) | |
389 | + | let dg = fraction(P((cA - dd)), c, cA) | |
390 | + | let df = F(bG, a) | |
391 | + | if (if (if (cR) | |
392 | + | then (cA != d) | |
393 | + | else false) | |
394 | + | then (dg > df) | |
395 | + | else false) | |
396 | + | then throw(((("Price slippage " + toString(dg)) + " > ") + toString(df))) | |
397 | + | else { | |
398 | + | let dh = F(da, a) | |
399 | + | let di = fraction(db, cA, c) | |
400 | + | let dj = fraction(dc, c, cA) | |
401 | + | let dk = if ((di > dc)) | |
402 | + | then $Tuple2(dj, dc) | |
403 | + | else $Tuple2(db, di) | |
404 | + | let dl = dk._1 | |
405 | + | let dm = dk._2 | |
406 | + | let cb = fraction(dh, dm, cz) | |
407 | + | $Tuple5(I(cb, a), I(dl, cY), I(dm, cZ), cA, df) | |
408 | + | } | |
409 | + | } | |
410 | + | let dn = de._1 | |
411 | + | let do = de._2 | |
412 | + | let dp = de._3 | |
413 | + | let cB = I(de._4, a) | |
414 | + | let dq = I(de._5, a) | |
415 | + | if ((0 >= dn)) | |
416 | + | then throw("LP <= 0") | |
417 | + | else { | |
418 | + | let dr = if (!(cP)) | |
419 | + | then 0 | |
420 | + | else dn | |
421 | + | let ds = (cK - do) | |
422 | + | let dt = (cM - dp) | |
423 | + | let du = if (if (cQ) | |
424 | + | then (cT == cU) | |
425 | + | else false) | |
426 | + | then $Tuple2(cS, 0) | |
427 | + | else if (if (cQ) | |
428 | + | then (cT == cV) | |
429 | + | else false) | |
430 | + | then $Tuple2(0, cS) | |
431 | + | else $Tuple2(do, dp) | |
432 | + | let dv = du._1 | |
433 | + | let dw = du._2 | |
434 | + | let dx = [IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB), StringEntry(Y(co, cl), bj(dv, dw, dr, cB, bG, dq, height, lastBlock.timestamp, ds, dt))] | |
435 | + | $Tuple13(dn, dr, cB, cw, cy, da, cp, cu, dx, ds, dt, cL, cN) | |
427 | 436 | } | |
428 | 437 | } | |
429 | 438 | ||
430 | 439 | ||
431 | - | func dC (de,bW,dD,dE,dF,dG,dh,dH,dI,dJ,dK,dL,dM) = { | |
432 | - | let di = bl | |
433 | - | let dN = toBase58String(value(bm)) | |
434 | - | let dO = toBase58String(value(bn)) | |
435 | - | let dP = bq | |
436 | - | let dQ = br | |
437 | - | let dR = bo | |
438 | - | let dS = bp | |
439 | - | let dn = toString(bk) | |
440 | - | let dT = valueOrErrorMessage(assetInfo(di), "Wr lp as").quantity | |
441 | - | let dp = if (dH) | |
442 | - | then bN(dN) | |
443 | - | else if (if (dJ) | |
444 | - | then (dM == dN) | |
445 | - | else false) | |
446 | - | then (bN(dN) - dL) | |
447 | - | else if (dJ) | |
448 | - | then bN(dN) | |
449 | - | else (bN(dN) - dD) | |
450 | - | let dr = if (dH) | |
451 | - | then bN(dO) | |
452 | - | else if (if (dJ) | |
453 | - | then (dM == dO) | |
454 | - | else false) | |
455 | - | then (bN(dO) - dL) | |
456 | - | else if (dJ) | |
457 | - | then bN(dO) | |
458 | - | else (bN(dO) - dF) | |
459 | - | let dU = H(dD, dR) | |
460 | - | let dV = H(dF, dS) | |
461 | - | let dW = bP(dV, dU) | |
462 | - | let dq = H(dp, dR) | |
463 | - | let ds = H(dr, dS) | |
464 | - | let cb = cy([dq, ds]) | |
465 | - | let dX = if ((dT == 0)) | |
466 | - | then { | |
467 | - | let ca = cy([(dq + dU), (ds + dV)]) | |
468 | - | let dY = if ((ca > cb)) | |
440 | + | func dy (dz) = { | |
441 | + | let bX = aL() | |
442 | + | let dA = bX[u] | |
443 | + | let dB = bX[v] | |
444 | + | let cu = parseIntValue(bX[s]) | |
445 | + | let bY = parseIntValue(bX[w]) | |
446 | + | let bZ = parseIntValue(bX[x]) | |
447 | + | let dC = by(dA) | |
448 | + | let dD = by(dB) | |
449 | + | let cA = if ((dz.orderType == Buy)) | |
450 | + | then bO(bY, bZ, (dC + dz.amount), dD) | |
451 | + | else bO(bY, bZ, (dC - dz.amount), dD) | |
452 | + | let cB = I(cA, a) | |
453 | + | if (if (if (aI()) | |
454 | + | then true | |
455 | + | else (cu == p)) | |
456 | + | then true | |
457 | + | else (cu == q)) | |
458 | + | then throw("Admin blocked") | |
459 | + | else { | |
460 | + | let dE = dz.assetPair.amountAsset | |
461 | + | let dF = if ((dE == unit)) | |
462 | + | then "WAVES" | |
463 | + | else toBase58String(value(dE)) | |
464 | + | let dG = dz.assetPair.priceAsset | |
465 | + | let dH = if ((dG == unit)) | |
466 | + | then "WAVES" | |
467 | + | else toBase58String(value(dG)) | |
468 | + | if (if ((dF != dA)) | |
469 | 469 | then true | |
470 | - | else throw("D1 should be greater than D0") | |
471 | - | if ((dY == dY)) | |
472 | - | then { | |
473 | - | let dt = d | |
474 | - | let dZ = d | |
475 | - | let cq = ca | |
476 | - | $Tuple5(L(cq, a), L(dU, dR), L(dV, dS), bP((ds + dV), (dq + dU)), dZ) | |
470 | + | else (dH != dB)) | |
471 | + | then throw("Wr assets") | |
472 | + | else { | |
473 | + | let dI = dz.price | |
474 | + | let cZ = fraction(a, bZ, bY) | |
475 | + | let dJ = L(dI, a, cZ) | |
476 | + | let dK = if ((dz.orderType == Buy)) | |
477 | + | then (cB >= dJ) | |
478 | + | else (dJ >= cB) | |
479 | + | true | |
477 | 480 | } | |
478 | - | else throw("Strict value is not equal to itself.") | |
479 | - | } | |
480 | - | else { | |
481 | - | let dt = bP(ds, dq) | |
482 | - | let ea = fraction(W((dt - dW)), c, dt) | |
483 | - | let dZ = H(bW, a) | |
484 | - | if (if (if (dK) | |
485 | - | then (dt != d) | |
486 | - | else false) | |
487 | - | then (ea > dZ) | |
488 | - | else false) | |
489 | - | then throw(((("Price slippage " + toString(ea)) + " > ") + toString(dZ))) | |
490 | - | else { | |
491 | - | let eb = H(dT, a) | |
492 | - | let ec = fraction(dU, bS(ds, dq, CEILING), c, CEILING) | |
493 | - | let ed = fraction(dV, c, bS(ds, dq, FLOOR), CEILING) | |
494 | - | let ee = if ((ec > dV)) | |
495 | - | then $Tuple2(ed, dV) | |
496 | - | else $Tuple2(dU, ec) | |
497 | - | let ef = ee._1 | |
498 | - | let eg = ee._2 | |
499 | - | let ca = cy([(dq + ef), (ds + eg)]) | |
500 | - | let dY = if ((ca > cb)) | |
501 | - | then true | |
502 | - | else throw("D1 should be greater than D0") | |
503 | - | if ((dY == dY)) | |
504 | - | then { | |
505 | - | let cq = fraction(eb, (ca - cb), cb) | |
506 | - | $Tuple5(O(cq, a, FLOOR), O(ef, dR, CEILING), O(eg, dS, CEILING), dt, dZ) | |
507 | - | } | |
508 | - | else throw("Strict value is not equal to itself.") | |
509 | - | } | |
510 | - | } | |
511 | - | let eh = dX._1 | |
512 | - | let ei = dX._2 | |
513 | - | let ej = dX._3 | |
514 | - | let du = L(dX._4, a) | |
515 | - | let ek = L(dX._5, a) | |
516 | - | if ((0 >= eh)) | |
517 | - | then throw("LP <= 0") | |
518 | - | else { | |
519 | - | let el = if (!(dI)) | |
520 | - | then 0 | |
521 | - | else eh | |
522 | - | let em = (dD - ei) | |
523 | - | let en = (dF - ej) | |
524 | - | let eo = if (if (dJ) | |
525 | - | then (dM == dN) | |
526 | - | else false) | |
527 | - | then $Tuple2(dL, 0) | |
528 | - | else if (if (dJ) | |
529 | - | then (dM == dO) | |
530 | - | else false) | |
531 | - | then $Tuple2(0, dL) | |
532 | - | else $Tuple2(ei, ej) | |
533 | - | let ep = eo._1 | |
534 | - | let eq = eo._2 | |
535 | - | let er = [IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du), StringEntry(af(dh, de), by(ep, eq, el, du, bW, ek, height, lastBlock.timestamp, em, en))] | |
536 | - | $Tuple13(eh, el, du, dp, dr, dT, di, dn, er, em, en, dE, dG) | |
537 | 481 | } | |
538 | 482 | } | |
539 | 483 | ||
540 | 484 | ||
541 | - | func es (cz,cP,et) = { | |
542 | - | let eu = g | |
543 | - | let ev = cz[if ((cP == 0)) | |
485 | + | func dL (dM) = if ((size(dM.payments) != 1)) | |
486 | + | then throw("1 pmnt exp") | |
487 | + | else { | |
488 | + | let dN = value(dM.payments[0]) | |
489 | + | let cm = value(dN.assetId) | |
490 | + | let cS = dN.amount | |
491 | + | let de = ck(toBase58String(dM.transactionId), toBase58String(cm), cS, dM.caller) | |
492 | + | let cG = de._1 | |
493 | + | let cH = de._2 | |
494 | + | let cu = parseIntValue(de._9) | |
495 | + | let cI = de._10 | |
496 | + | if (if (aI()) | |
497 | + | then true | |
498 | + | else (cu == q)) | |
499 | + | then throw(("Admin blocked: " + toString(cu))) | |
500 | + | else $Tuple5(cG, cH, cS, cm, cI) | |
501 | + | } | |
502 | + | ||
503 | + | ||
504 | + | func dO (dP,aa,dQ,dR,bG,cP,cQ,cR,cS,cT) = { | |
505 | + | let de = cJ(aa, bG, value(dQ).amount, value(dQ).assetId, value(dR).amount, value(dR).assetId, dP, (aa == ""), cP, cQ, cR, cS, cT) | |
506 | + | let cu = parseIntValue(de._8) | |
507 | + | if (if (if (aI()) | |
508 | + | then true | |
509 | + | else (cu == o)) | |
510 | + | then true | |
511 | + | else (cu == q)) | |
512 | + | then throw(("Blocked:" + toString(cu))) | |
513 | + | else de | |
514 | + | } | |
515 | + | ||
516 | + | ||
517 | + | func dS (dT) = { | |
518 | + | let dU = g | |
519 | + | let dV = dT[0] | |
520 | + | let dW = dT[1] | |
521 | + | let dX = parseBigIntValue(j) | |
522 | + | let dY = (parseBigIntValue(aH) * dX) | |
523 | + | let dZ = (dV + dW) | |
524 | + | if ((dZ == e)) | |
525 | + | then e | |
526 | + | else { | |
527 | + | let ea = (dY * dU) | |
528 | + | let eb = (((dV * dW) * dU) * dU) | |
529 | + | let ec = ((ea * dZ) / dX) | |
530 | + | let ed = (ea - dX) | |
531 | + | let ee = (dU + f) | |
532 | + | func ef (eg,eh) = { | |
533 | + | let ei = eg | |
534 | + | let ej = ei._1 | |
535 | + | let ek = ei._2 | |
536 | + | if ((ek != unit)) | |
537 | + | then eg | |
538 | + | else { | |
539 | + | let el = (((ej * ej) * ej) / eb) | |
540 | + | let em = (((ec + (el * dU)) * ej) / (((ed * ej) / dX) + (ee * el))) | |
541 | + | let en = Q((em - value(ej))) | |
542 | + | if ((f >= en)) | |
543 | + | then $Tuple2(em, eh) | |
544 | + | else $Tuple2(em, unit) | |
545 | + | } | |
546 | + | } | |
547 | + | ||
548 | + | let eo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
549 | + | let ep = { | |
550 | + | let eq = eo | |
551 | + | let er = size(eq) | |
552 | + | let es = $Tuple2(dZ, unit) | |
553 | + | func et (eu,ev) = if ((ev >= er)) | |
554 | + | then eu | |
555 | + | else ef(eu, eq[ev]) | |
556 | + | ||
557 | + | func ew (eu,ev) = if ((ev >= er)) | |
558 | + | then eu | |
559 | + | else throw("List size exceeds 15") | |
560 | + | ||
561 | + | ew(et(et(et(et(et(et(et(et(et(et(et(et(et(et(et(es, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
562 | + | } | |
563 | + | let ej = ep._1 | |
564 | + | let ek = ep._2 | |
565 | + | if ((ek != unit)) | |
566 | + | then ej | |
567 | + | else throw(("D calculation error, D = " + toString(ej))) | |
568 | + | } | |
569 | + | } | |
570 | + | ||
571 | + | ||
572 | + | func ex (dT,dM,ey) = { | |
573 | + | let dU = g | |
574 | + | let ez = dT[if ((dM == 0)) | |
544 | 575 | then 1 | |
545 | 576 | else 0] | |
546 | - | let | |
547 | - | let | |
548 | - | let | |
549 | - | let | |
550 | - | let | |
551 | - | let | |
552 | - | func | |
553 | - | let | |
554 | - | let | |
555 | - | let | |
556 | - | if (( | |
557 | - | then | |
577 | + | let dX = parseBigIntValue(j) | |
578 | + | let dY = (parseBigIntValue(aH) * dX) | |
579 | + | let dZ = ez | |
580 | + | let ea = (dY * dU) | |
581 | + | let eA = (((((ey * ey) / (ez * dU)) * ey) * dX) / (ea * dU)) | |
582 | + | let eB = ((dZ + ((ey * dX) / ea)) - ey) | |
583 | + | func ef (eg,eh) = { | |
584 | + | let eC = eg | |
585 | + | let eD = eC._1 | |
586 | + | let ek = eC._2 | |
587 | + | if ((ek != unit)) | |
588 | + | then eg | |
558 | 589 | else { | |
559 | - | let | |
560 | - | let | |
561 | - | if ((f >= | |
562 | - | then $Tuple2( | |
563 | - | else $Tuple2( | |
590 | + | let eE = (((eD * eD) + eA) / ((g * eD) + eB)) | |
591 | + | let eF = Q((eE - value(eD))) | |
592 | + | if ((f >= eF)) | |
593 | + | then $Tuple2(eE, eh) | |
594 | + | else $Tuple2(eE, unit) | |
564 | 595 | } | |
565 | 596 | } | |
566 | 597 | ||
567 | - | let | |
568 | - | let | |
569 | - | let | |
570 | - | let | |
571 | - | let | |
572 | - | func | |
573 | - | then | |
574 | - | else | |
598 | + | let eo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
599 | + | let eG = { | |
600 | + | let eq = eo | |
601 | + | let er = size(eq) | |
602 | + | let es = $Tuple2(ey, unit) | |
603 | + | func et (eu,ev) = if ((ev >= er)) | |
604 | + | then eu | |
605 | + | else ef(eu, eq[ev]) | |
575 | 606 | ||
576 | - | func | |
577 | - | then | |
607 | + | func ew (eu,ev) = if ((ev >= er)) | |
608 | + | then eu | |
578 | 609 | else throw("List size exceeds 15") | |
579 | 610 | ||
580 | - | | |
611 | + | ew(et(et(et(et(et(et(et(et(et(et(et(et(et(et(et(es, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
581 | 612 | } | |
582 | - | let | |
583 | - | let | |
584 | - | if (( | |
585 | - | then | |
586 | - | else throw(("Y calculation error, Y = " + toString( | |
613 | + | let eD = eG._1 | |
614 | + | let ek = eG._2 | |
615 | + | if ((ek != unit)) | |
616 | + | then eD | |
617 | + | else throw(("Y calculation error, Y = " + toString(eD))) | |
587 | 618 | } | |
588 | 619 | ||
589 | 620 | ||
590 | - | func eF (eG,eH,eI) = { | |
591 | - | let eJ = fraction(cy([K(eG, toBigInt(bo)), K(eH, toBigInt(bp))]), c, eI) | |
592 | - | if ((eI == e)) | |
593 | - | then e | |
594 | - | else eJ | |
595 | - | } | |
596 | - | ||
597 | - | ||
598 | - | func eK (eL,eM,eN) = { | |
599 | - | let eO = (toBigInt(bN(be(bm))) - eL) | |
600 | - | let eP = (toBigInt(bN(be(bn))) - eM) | |
601 | - | let eQ = (toBigInt(value(assetInfo(bl)).quantity) - eN) | |
602 | - | let eR = eF(eO, eP, eQ) | |
603 | - | eR | |
604 | - | } | |
605 | - | ||
606 | - | ||
607 | - | func eS (eT,eU,eN) = { | |
608 | - | let eO = (bN(be(bm)) + eT) | |
609 | - | let eP = (bN(be(bn)) + eU) | |
610 | - | let eQ = (value(assetInfo(bl)).quantity + eN) | |
611 | - | let eJ = eF(toBigInt(eO), toBigInt(eP), toBigInt(eQ)) | |
612 | - | let eV = [IntegerEntry(aq, height), StringEntry(ap, toString(eJ))] | |
613 | - | $Tuple2(eV, eJ) | |
614 | - | } | |
615 | - | ||
616 | - | ||
617 | - | func eW (eX,eJ) = if ((eJ >= eX)) | |
618 | - | then true | |
619 | - | else aN("updated DLp lower than current DLp") | |
620 | - | ||
621 | - | ||
622 | - | func eY (eZ) = { | |
623 | - | let eO = bN(be(bm)) | |
624 | - | let eP = bN(be(bn)) | |
625 | - | let fa = eZ.amount | |
626 | - | let fb = fraction(eZ.amount, eZ.price, a, FLOOR) | |
627 | - | let fc = if ((eZ.orderType == Buy)) | |
628 | - | then $Tuple2(fa, -(fb)) | |
629 | - | else $Tuple2(-(fa), fb) | |
630 | - | let eT = fc._1 | |
631 | - | let eU = fc._2 | |
632 | - | if (if (if (aV()) | |
633 | - | then true | |
634 | - | else (bk == r)) | |
635 | - | then true | |
636 | - | else (bk == s)) | |
637 | - | then throw("Admin blocked") | |
638 | - | else if (if ((eZ.assetPair.amountAsset != bm)) | |
639 | - | then true | |
640 | - | else (eZ.assetPair.priceAsset != bn)) | |
641 | - | then throw("Wr assets") | |
642 | - | else { | |
643 | - | let fd = parseBigIntValue(valueOrElse(getString(this, ap), "0")) | |
644 | - | let fe = eS(eT, eU, 0) | |
645 | - | let ff = fe._1 | |
646 | - | let fg = fe._2 | |
647 | - | let fh = (fg >= fd) | |
648 | - | let fi = makeString(["dLp=", toString(fd), " dLpNew=", toString(fg), " amountAssetBalance=", toString(eO), " priceAssetBalance=", toString(eP), " amountAssetBalanceDelta=", toString(eT), " priceAssetBalanceDelta=", toString(eU), " height=", toString(height)], "") | |
649 | - | $Tuple2(fh, fi) | |
650 | - | } | |
651 | - | } | |
652 | - | ||
653 | - | ||
654 | - | func fj (cP) = if ((size(cP.payments) != 1)) | |
655 | - | then throw("1 pmnt exp") | |
656 | - | else { | |
657 | - | let fk = value(cP.payments[0]) | |
658 | - | let df = value(fk.assetId) | |
659 | - | let dL = fk.amount | |
660 | - | let dX = dd(toBase58String(cP.transactionId), toBase58String(df), dL, cP.caller) | |
661 | - | let dz = dX._1 | |
662 | - | let dA = dX._2 | |
663 | - | let dn = parseIntValue(dX._9) | |
664 | - | let dB = dX._10 | |
665 | - | if (if (aV()) | |
666 | - | then true | |
667 | - | else (dn == s)) | |
668 | - | then throw(("Admin blocked: " + toString(dn))) | |
669 | - | else $Tuple5(dz, dA, dL, df, dB) | |
670 | - | } | |
671 | - | ||
672 | - | ||
673 | - | func fl (fm,ah,fn,fo,bW,dI,dJ,dK,dL,dM) = { | |
674 | - | let dX = dC(ah, bW, value(fn).amount, value(fn).assetId, value(fo).amount, value(fo).assetId, fm, (ah == ""), dI, dJ, dK, dL, dM) | |
675 | - | let dn = parseIntValue(dX._8) | |
676 | - | if (if (if (aV()) | |
677 | - | then true | |
678 | - | else (dn == q)) | |
679 | - | then true | |
680 | - | else (dn == s)) | |
681 | - | then throw(("Blocked:" + toString(dn))) | |
682 | - | else dX | |
683 | - | } | |
684 | - | ||
685 | - | ||
686 | - | func fp (fq,df,dh,ah,fr) = { | |
687 | - | let dj = toBase58String(value(bm)) | |
688 | - | let dk = toBase58String(value(bn)) | |
689 | - | let di = bl | |
690 | - | let dR = bo | |
691 | - | let dS = bp | |
692 | - | let eQ = toBigInt(valueOrErrorMessage(assetInfo(di), "invalid lp asset").quantity) | |
693 | - | let fs = if ((eQ > e)) | |
621 | + | func eH (eI,cm,co,aa,eJ) = { | |
622 | + | let aT = aL() | |
623 | + | let cq = aT[u] | |
624 | + | let cr = aT[v] | |
625 | + | let cp = aT[t] | |
626 | + | let cY = parseIntValue(aT[w]) | |
627 | + | let cZ = parseIntValue(aT[x]) | |
628 | + | let eK = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cp)), "invalid lp asset").quantity) | |
629 | + | let eL = if ((eK > e)) | |
694 | 630 | then true | |
695 | 631 | else throw("initial deposit requires all coins") | |
696 | - | if (( | |
632 | + | if ((eL == eL)) | |
697 | 633 | then { | |
698 | - | let | |
699 | - | let | |
700 | - | let | |
701 | - | then $Tuple2( | |
702 | - | else if (( | |
703 | - | then if (( | |
634 | + | let cw = by(cq) | |
635 | + | let cy = by(cr) | |
636 | + | let eM = if ((aa == "")) | |
637 | + | then $Tuple2(cw, cy) | |
638 | + | else if ((cm == cq)) | |
639 | + | then if ((eI > cw)) | |
704 | 640 | then throw("invalid payment amount") | |
705 | - | else $Tuple2(( | |
706 | - | else if (( | |
707 | - | then if (( | |
641 | + | else $Tuple2((cw - eI), cy) | |
642 | + | else if ((cm == cr)) | |
643 | + | then if ((eI > cy)) | |
708 | 644 | then throw("invalid payment amount") | |
709 | - | else $Tuple2( | |
645 | + | else $Tuple2(cw, (cy - eI)) | |
710 | 646 | else throw("wrong pmtAssetId") | |
711 | - | let | |
712 | - | let | |
713 | - | let | |
714 | - | then $Tuple2( | |
715 | - | else if (( | |
716 | - | then $Tuple2(0, | |
647 | + | let eN = eM._1 | |
648 | + | let eO = eM._2 | |
649 | + | let eP = if ((cm == cq)) | |
650 | + | then $Tuple2(eI, 0) | |
651 | + | else if ((cm == cr)) | |
652 | + | then $Tuple2(0, eI) | |
717 | 653 | else throw("invalid payment") | |
718 | - | let | |
719 | - | let | |
720 | - | let | |
721 | - | then $Tuple3( | |
722 | - | else $Tuple3( | |
723 | - | let | |
724 | - | let | |
725 | - | let | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | let | |
730 | - | let | |
654 | + | let eQ = eP._1 | |
655 | + | let eR = eP._2 | |
656 | + | let eS = if (eJ) | |
657 | + | then $Tuple3(cg(eQ, aE)._1, cg(eR, aE)._1, cg(eI, aE)._2) | |
658 | + | else $Tuple3(eQ, eR, 0) | |
659 | + | let eT = eS._1 | |
660 | + | let eU = eS._2 | |
661 | + | let cj = eS._3 | |
662 | + | let eV = (eN + eT) | |
663 | + | let eW = (eO + eU) | |
664 | + | let bL = dS([toBigInt(eN), toBigInt(eO)]) | |
665 | + | let bK = dS([toBigInt(eV), toBigInt(eW)]) | |
666 | + | let eX = if ((bK > bL)) | |
731 | 667 | then true | |
732 | 668 | else throw() | |
733 | - | if (( | |
669 | + | if ((eX == eX)) | |
734 | 670 | then { | |
735 | - | let | |
736 | - | let | |
737 | - | let | |
738 | - | let | |
739 | - | let | |
740 | - | let | |
741 | - | let | |
742 | - | let | |
743 | - | $Tuple4(toInt( | |
671 | + | let eY = fraction(eK, (bK - bL), bL) | |
672 | + | let cB = I(bA(F(eW, cZ), F(eV, cY)), a) | |
673 | + | let dx = [IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB), StringEntry(Y(co, aa), bj(eQ, eR, toInt(eY), cB, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
674 | + | let eZ = fraction(eO, a, eN) | |
675 | + | let fa = fraction(eI, a, (eZ + a)) | |
676 | + | let fb = (eI - fa) | |
677 | + | let fc = fraction(eK, toBigInt(fb), toBigInt(eO)) | |
678 | + | let fd = toInt(fraction((eY - fc), b, fc)) | |
679 | + | $Tuple4(toInt(eY), dx, cj, fd) | |
744 | 680 | } | |
745 | 681 | else throw("Strict value is not equal to itself.") | |
746 | 682 | } | |
747 | 683 | else throw("Strict value is not equal to itself.") | |
748 | 684 | } | |
749 | 685 | ||
750 | 686 | ||
751 | - | func fK (fL,fM,fN,fm,fO,fP) = { | |
752 | - | let di = toBase58String(value(bl)) | |
753 | - | let dj = toBase58String(value(bm)) | |
754 | - | let dk = toBase58String(value(bn)) | |
755 | - | let fQ = bo | |
756 | - | let fR = bp | |
757 | - | let fS = bk | |
758 | - | let dh = if ((fm == bx)) | |
759 | - | then fO | |
760 | - | else fm | |
761 | - | let fk = value(fN[0]) | |
762 | - | let df = value(fk.assetId) | |
763 | - | let dL = fk.amount | |
764 | - | let eR = eK(e, e, e) | |
765 | - | if ((eR == eR)) | |
766 | - | then { | |
767 | - | let de = toBase58String(fP) | |
768 | - | if ((di != toBase58String(df))) | |
769 | - | then throw("Wrong LP") | |
770 | - | else { | |
771 | - | let dp = bN(dj) | |
772 | - | let dr = bN(dk) | |
773 | - | let fT = { | |
774 | - | let aS = invoke(this, "getOneTknV2READONLY", [fL, dL], nil) | |
775 | - | if ($isInstanceOf(aS, "(Int, Int)")) | |
776 | - | then aS | |
777 | - | else throw(($getType(aS) + " couldn't be cast to (Int, Int)")) | |
778 | - | } | |
779 | - | if ((fT == fT)) | |
687 | + | func fe (ff,fg,fh,dP,fi,fj) = { | |
688 | + | let aT = aL() | |
689 | + | let cp = aT[t] | |
690 | + | let cq = aT[u] | |
691 | + | let cr = aT[v] | |
692 | + | let fk = parseIntValue(aT[w]) | |
693 | + | let fl = parseIntValue(aT[x]) | |
694 | + | let fm = aT[s] | |
695 | + | let co = if ((dP == bi)) | |
696 | + | then fi | |
697 | + | else dP | |
698 | + | let dN = value(fh[0]) | |
699 | + | let cm = value(dN.assetId) | |
700 | + | let cS = dN.amount | |
701 | + | let cl = toBase58String(fj) | |
702 | + | if ((cp != toBase58String(cm))) | |
703 | + | then throw("Wrong LP") | |
704 | + | else { | |
705 | + | let cw = by(cq) | |
706 | + | let cy = by(cr) | |
707 | + | let fn = { | |
708 | + | let aF = invoke(this, "getOneTknV2READONLY", [ff, cS], nil) | |
709 | + | if ($isInstanceOf(aF, "(Int, Int)")) | |
710 | + | then aF | |
711 | + | else throw(($getType(aF) + " couldn't be cast to (Int, Int)")) | |
712 | + | } | |
713 | + | if ((fn == fn)) | |
714 | + | then { | |
715 | + | let cj = fn._2 | |
716 | + | let fo = fn._1 | |
717 | + | let fp = if (if ((fg > 0)) | |
718 | + | then (fg > fo) | |
719 | + | else false) | |
720 | + | then aB(makeString(["amount to receive is less than ", toString(fg)], "")) | |
721 | + | else fo | |
722 | + | let fq = if ((ff == cq)) | |
723 | + | then $Tuple4(fp, 0, ((cw - fp) - cj), cy) | |
724 | + | else if ((ff == cr)) | |
725 | + | then $Tuple4(0, fp, cw, ((cy - fp) - cj)) | |
726 | + | else throw("invalid out asset id") | |
727 | + | let fr = fq._1 | |
728 | + | let fs = fq._2 | |
729 | + | let eV = fq._3 | |
730 | + | let eW = fq._4 | |
731 | + | let ft = bA(F(eW, fl), F(eV, fk)) | |
732 | + | let fu = I(ft, a) | |
733 | + | let fv = if ((ff == "WAVES")) | |
734 | + | then unit | |
735 | + | else fromBase58String(ff) | |
736 | + | let fw = if ((cj > 0)) | |
737 | + | then [ScriptTransfer(aK, cj, fv)] | |
738 | + | else nil | |
739 | + | let cI = ([ScriptTransfer(co, fp, fv), StringEntry(ab(toString(co), cl), bu(fr, fs, cS, fu, height, lastBlock.timestamp)), IntegerEntry(U(), fu), IntegerEntry(V(height, lastBlock.timestamp), fu)] ++ fw) | |
740 | + | if ((cI == cI)) | |
780 | 741 | then { | |
781 | - | let cx = fT._2 | |
782 | - | let fU = fT._1 | |
783 | - | let fV = if (if ((fM > 0)) | |
784 | - | then (fM > fU) | |
785 | - | else false) | |
786 | - | then aN(makeString(["amount to receive is less than ", toString(fM)], "")) | |
787 | - | else fU | |
788 | - | let fW = if ((fL == dj)) | |
789 | - | then $Tuple4(fV, 0, ((dp - fV) - cx), dr) | |
790 | - | else if ((fL == dk)) | |
791 | - | then $Tuple4(0, fV, dp, ((dr - fV) - cx)) | |
792 | - | else throw("invalid out asset id") | |
793 | - | let fX = fW._1 | |
794 | - | let fY = fW._2 | |
795 | - | let fC = fW._3 | |
796 | - | let fD = fW._4 | |
797 | - | let fZ = bP(H(fD, fR), H(fC, fQ)) | |
798 | - | let ga = L(fZ, a) | |
799 | - | let gb = if ((fL == "WAVES")) | |
800 | - | then unit | |
801 | - | else fromBase58String(fL) | |
802 | - | let gc = if ((cx > 0)) | |
803 | - | then [ScriptTransfer(aX, cx, gb)] | |
804 | - | else nil | |
805 | - | let dB = ([ScriptTransfer(dh, fV, gb), StringEntry(ai(toString(dh), de), bJ(fX, fY, dL, ga, height, lastBlock.timestamp)), IntegerEntry(ab(), ga), IntegerEntry(ac(height, lastBlock.timestamp), ga)] ++ gc) | |
806 | - | if ((dB == dB)) | |
807 | - | then { | |
808 | - | let gd = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)]) | |
809 | - | if ((gd == gd)) | |
810 | - | then { | |
811 | - | let ge = { | |
812 | - | let gf = if ((this == aX)) | |
813 | - | then 0 | |
814 | - | else cx | |
815 | - | let gg = if ((bc(fL) == bm)) | |
816 | - | then true | |
817 | - | else false | |
818 | - | if (gg) | |
819 | - | then $Tuple2(-((fU + gf)), 0) | |
820 | - | else $Tuple2(0, -((fU + gf))) | |
821 | - | } | |
822 | - | let eT = ge._1 | |
823 | - | let eU = ge._2 | |
824 | - | let gh = eS(eT, eU, 0) | |
825 | - | let gi = gh._1 | |
826 | - | let eJ = gh._2 | |
827 | - | let gj = eW(eR, eJ) | |
828 | - | if ((gj == gj)) | |
829 | - | then $Tuple2((dB ++ gi), fV) | |
830 | - | else throw("Strict value is not equal to itself.") | |
831 | - | } | |
832 | - | else throw("Strict value is not equal to itself.") | |
833 | - | } | |
742 | + | let fx = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)]) | |
743 | + | if ((fx == fx)) | |
744 | + | then $Tuple2(cI, fp) | |
834 | 745 | else throw("Strict value is not equal to itself.") | |
835 | 746 | } | |
836 | 747 | else throw("Strict value is not equal to itself.") | |
837 | 748 | } | |
749 | + | else throw("Strict value is not equal to itself.") | |
838 | 750 | } | |
839 | - | else throw("Strict value is not equal to itself.") | |
840 | 751 | } | |
841 | 752 | ||
842 | 753 | ||
843 | - | func | |
844 | - | let | |
845 | - | if ($isInstanceOf( | |
754 | + | func fy () = { | |
755 | + | let av = getString(S()) | |
756 | + | if ($isInstanceOf(av, "String")) | |
846 | 757 | then { | |
847 | - | let | |
848 | - | fromBase58String( | |
758 | + | let dZ = av | |
759 | + | fromBase58String(dZ) | |
849 | 760 | } | |
850 | - | else if ($isInstanceOf( | |
761 | + | else if ($isInstanceOf(av, "Unit")) | |
851 | 762 | then unit | |
852 | 763 | else throw("Match error") | |
853 | 764 | } | |
854 | 765 | ||
855 | 766 | ||
856 | - | func | |
857 | - | let | |
858 | - | if ($isInstanceOf( | |
767 | + | func fz () = { | |
768 | + | let av = getString(T()) | |
769 | + | if ($isInstanceOf(av, "String")) | |
859 | 770 | then { | |
860 | - | let | |
861 | - | fromBase58String( | |
771 | + | let dZ = av | |
772 | + | fromBase58String(dZ) | |
862 | 773 | } | |
863 | - | else if ($isInstanceOf( | |
774 | + | else if ($isInstanceOf(av, "Unit")) | |
864 | 775 | then unit | |
865 | 776 | else throw("Match error") | |
866 | 777 | } | |
867 | 778 | ||
868 | 779 | ||
869 | - | let | |
780 | + | let fA = throw("Permission denied") | |
870 | 781 | ||
871 | - | func | |
872 | - | let | |
873 | - | if ($isInstanceOf( | |
782 | + | func fB (dM) = { | |
783 | + | let av = fy() | |
784 | + | if ($isInstanceOf(av, "ByteVector")) | |
874 | 785 | then { | |
875 | - | let | |
876 | - | ( | |
786 | + | let fC = av | |
787 | + | (dM.callerPublicKey == fC) | |
877 | 788 | } | |
878 | - | else if ($isInstanceOf( | |
879 | - | then ( | |
789 | + | else if ($isInstanceOf(av, "Unit")) | |
790 | + | then (dM.caller == this) | |
880 | 791 | else throw("Match error") | |
881 | 792 | } | |
882 | 793 | ||
883 | 794 | ||
884 | - | func | |
885 | - | let | |
886 | - | if ($isInstanceOf( | |
795 | + | func fD (dM) = { | |
796 | + | let av = fy() | |
797 | + | if ($isInstanceOf(av, "ByteVector")) | |
887 | 798 | then { | |
888 | - | let | |
889 | - | if (( | |
799 | + | let fC = av | |
800 | + | if ((dM.callerPublicKey == fC)) | |
890 | 801 | then true | |
891 | - | else | |
802 | + | else fA | |
892 | 803 | } | |
893 | - | else if ($isInstanceOf( | |
894 | - | then if (( | |
804 | + | else if ($isInstanceOf(av, "Unit")) | |
805 | + | then if ((dM.caller == this)) | |
895 | 806 | then true | |
896 | - | else | |
807 | + | else fA | |
897 | 808 | else throw("Match error") | |
898 | 809 | } | |
899 | 810 | ||
900 | 811 | ||
901 | - | func gr (gs,et,gt) = { | |
902 | - | let bg = aY() | |
903 | - | let dj = bg[w] | |
904 | - | let dk = bg[x] | |
905 | - | let eu = g | |
906 | - | let ew = parseBigIntValue(l) | |
907 | - | let cD = (parseBigIntValue(aU) * ew) | |
908 | - | let cz = if ((gs == false)) | |
909 | - | then [(toBigInt(bN(dj)) + gt), toBigInt(bN(dk))] | |
910 | - | else [(toBigInt(bN(dk)) + gt), toBigInt(bN(dj))] | |
911 | - | let ev = cz[0] | |
912 | - | let cC = ev | |
913 | - | let cE = (cD * eu) | |
914 | - | let ex = (((((et * et) / (ev * eu)) * et) * ew) / (cE * eu)) | |
915 | - | let ey = ((cC + ((et * ew) / cE)) - et) | |
916 | - | func cN (cO,ez) = { | |
917 | - | let gu = cO | |
918 | - | let eB = gu._1 | |
919 | - | let dc = gu._2 | |
920 | - | if ((dc != unit)) | |
921 | - | then cO | |
922 | - | else { | |
923 | - | let eC = (((eB * eB) + ex) / ((g * eB) + ey)) | |
924 | - | let eD = X((eC - value(eB))) | |
925 | - | if ((f >= eD)) | |
926 | - | then $Tuple2(eC, ez) | |
927 | - | else $Tuple2(eC, unit) | |
928 | - | } | |
929 | - | } | |
930 | - | ||
931 | - | let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
932 | - | let gv = { | |
933 | - | let cV = cT | |
934 | - | let cW = size(cV) | |
935 | - | let cX = $Tuple2(et, unit) | |
936 | - | func cY (cZ,da) = if ((da >= cW)) | |
937 | - | then cZ | |
938 | - | else cN(cZ, cV[da]) | |
939 | - | ||
940 | - | func db (cZ,da) = if ((da >= cW)) | |
941 | - | then cZ | |
942 | - | else throw("List size exceeds 15") | |
943 | - | ||
944 | - | db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
945 | - | } | |
946 | - | let eB = gv._1 | |
947 | - | let dc = gv._2 | |
948 | - | if ((dc != unit)) | |
949 | - | then eB | |
950 | - | else throw(("Y calculation error, Y = " + toString(eB))) | |
951 | - | } | |
952 | - | ||
953 | - | ||
954 | - | @Callable(cP) | |
955 | - | func calculateAmountOutForSwapREADONLY (gw,gs,gx) = { | |
956 | - | let gy = if ((gs == false)) | |
957 | - | then { | |
958 | - | let gz = aJ(this, ak()) | |
959 | - | let gt = (toBigInt(bN(aJ(this, aj()))) + toBigInt(gw)) | |
960 | - | $Tuple2(gz, gt) | |
961 | - | } | |
962 | - | else { | |
963 | - | let gz = aJ(this, aj()) | |
964 | - | let gt = (toBigInt(bN(aJ(this, ak()))) + toBigInt(gw)) | |
965 | - | $Tuple2(gz, gt) | |
966 | - | } | |
967 | - | let gz = gy._1 | |
968 | - | let gt = gy._2 | |
969 | - | let bg = aY() | |
970 | - | let dj = bg[w] | |
971 | - | let dk = bg[x] | |
972 | - | let cz = [toBigInt(bN(dj)), toBigInt(bN(dk))] | |
973 | - | let et = cy(cz) | |
974 | - | let eB = gr(gs, et, toBigInt(gw)) | |
975 | - | let gA = ((toBigInt(bN(gz)) - eB) - toBigInt(1)) | |
976 | - | let gB = max([0, toInt(gA)]) | |
977 | - | let gC = if ((gs == false)) | |
978 | - | then [((toBigInt(bN(dj)) + toBigInt(gw)) + toBigInt(gx)), (toBigInt(bN(dk)) - gA)] | |
979 | - | else [(toBigInt(bN(dj)) - gA), ((toBigInt(bN(dk)) + toBigInt(gw)) + toBigInt(gx))] | |
980 | - | let gD = cy(gC) | |
981 | - | let dY = if ((gD >= et)) | |
982 | - | then true | |
983 | - | else throw(makeString(["new D is fewer error", toString(et), toString(gD)], "__")) | |
984 | - | if ((dY == dY)) | |
985 | - | then $Tuple2(nil, gB) | |
812 | + | @Callable(dM) | |
813 | + | func constructor (R) = { | |
814 | + | let eA = fD(dM) | |
815 | + | if ((eA == eA)) | |
816 | + | then [StringEntry(R(), R)] | |
986 | 817 | else throw("Strict value is not equal to itself.") | |
987 | 818 | } | |
988 | 819 | ||
989 | 820 | ||
990 | 821 | ||
991 | - | @Callable(cP) | |
992 | - | func calculateAmountOutForSwapAndSendTokens (gw,gs,gE,gF,gx) = { | |
993 | - | let gG = { | |
994 | - | let aS = invoke(aQ, "getSwapContractREADONLY", nil, nil) | |
995 | - | if ($isInstanceOf(aS, "String")) | |
996 | - | then aS | |
997 | - | else throw(($getType(aS) + " couldn't be cast to String")) | |
998 | - | } | |
999 | - | let gH = [if ((value(cP.payments[0]).amount >= gw)) | |
1000 | - | then true | |
1001 | - | else aN("Wrong amount"), if ((cP.caller == addressFromStringValue(gG))) | |
1002 | - | then true | |
1003 | - | else aN("Permission denied")] | |
1004 | - | if ((gH == gH)) | |
822 | + | @Callable(dM) | |
823 | + | func setManager (fE) = { | |
824 | + | let eA = fD(dM) | |
825 | + | if ((eA == eA)) | |
1005 | 826 | then { | |
1006 | - | let fk = value(cP.payments[0]) | |
1007 | - | let gI = be(fk.assetId) | |
1008 | - | let gJ = if ((gs == false)) | |
1009 | - | then { | |
1010 | - | let gz = aJ(this, ak()) | |
1011 | - | let gt = (bN(gI) - value(cP.payments[0]).amount) | |
1012 | - | $Tuple2(gz, gt) | |
1013 | - | } | |
1014 | - | else { | |
1015 | - | let gz = aJ(this, aj()) | |
1016 | - | let gt = (bN(gI) - value(cP.payments[0]).amount) | |
1017 | - | $Tuple2(gz, gt) | |
1018 | - | } | |
1019 | - | let gz = gJ._1 | |
1020 | - | let gt = gJ._2 | |
1021 | - | let bg = aY() | |
1022 | - | let dj = bg[w] | |
1023 | - | let dk = bg[x] | |
1024 | - | let cz = if ((gs == false)) | |
1025 | - | then [(toBigInt(bN(dj)) - toBigInt(value(cP.payments[0]).amount)), toBigInt(bN(dk))] | |
1026 | - | else [toBigInt(bN(dj)), (toBigInt(bN(dk)) - toBigInt(value(cP.payments[0]).amount))] | |
1027 | - | let et = cy(cz) | |
1028 | - | let eB = gr(gs, et, toBigInt(0)) | |
1029 | - | let gA = ((toBigInt(bN(gz)) - eB) - toBigInt(1)) | |
1030 | - | let gB = max([0, toInt(gA)]) | |
1031 | - | let gK = if ((gB >= gE)) | |
1032 | - | then true | |
1033 | - | else throw("Exchange result is fewer coins than expected") | |
1034 | - | if ((gK == gK)) | |
1035 | - | then { | |
1036 | - | let gC = if ((gs == false)) | |
1037 | - | then [(toBigInt(bN(dj)) + toBigInt(gx)), (toBigInt(bN(dk)) - gA)] | |
1038 | - | else [(toBigInt(bN(dj)) - gA), (toBigInt(bN(dk)) + toBigInt(gx))] | |
1039 | - | let gD = cy(gC) | |
1040 | - | let dY = if ((gD >= et)) | |
1041 | - | then true | |
1042 | - | else throw("new D is fewer error") | |
1043 | - | if ((dY == dY)) | |
1044 | - | then $Tuple2([ScriptTransfer(addressFromStringValue(gF), gB, bc(gz))], gB) | |
1045 | - | else throw("Strict value is not equal to itself.") | |
1046 | - | } | |
827 | + | let fF = fromBase58String(fE) | |
828 | + | if ((fF == fF)) | |
829 | + | then [StringEntry(T(), fE)] | |
1047 | 830 | else throw("Strict value is not equal to itself.") | |
1048 | 831 | } | |
1049 | 832 | else throw("Strict value is not equal to itself.") | |
1050 | 833 | } | |
1051 | 834 | ||
1052 | 835 | ||
1053 | 836 | ||
1054 | - | @Callable(cP) | |
1055 | - | func constructor (Y) = { | |
1056 | - | let ex = gq(cP) | |
1057 | - | if ((ex == ex)) | |
1058 | - | then [StringEntry(Y(), Y)] | |
1059 | - | else throw("Strict value is not equal to itself.") | |
1060 | - | } | |
1061 | - | ||
1062 | - | ||
1063 | - | ||
1064 | - | @Callable(cP) | |
1065 | - | func setManager (gL) = { | |
1066 | - | let ex = gq(cP) | |
1067 | - | if ((ex == ex)) | |
837 | + | @Callable(dM) | |
838 | + | func confirmManager () = { | |
839 | + | let cf = fz() | |
840 | + | let fG = if (isDefined(cf)) | |
841 | + | then true | |
842 | + | else throw("No pending manager") | |
843 | + | if ((fG == fG)) | |
1068 | 844 | then { | |
1069 | - | let gM = fromBase58String(gL) | |
1070 | - | if ((gM == gM)) | |
1071 | - | then [StringEntry(aa(), gL)] | |
845 | + | let fH = if ((dM.callerPublicKey == value(cf))) | |
846 | + | then true | |
847 | + | else throw("You are not pending manager") | |
848 | + | if ((fH == fH)) | |
849 | + | then [StringEntry(S(), toBase58String(value(cf))), DeleteEntry(T())] | |
1072 | 850 | else throw("Strict value is not equal to itself.") | |
1073 | 851 | } | |
1074 | 852 | else throw("Strict value is not equal to itself.") | |
1075 | 853 | } | |
1076 | 854 | ||
1077 | 855 | ||
1078 | 856 | ||
1079 | - | @Callable(cP) | |
1080 | - | func confirmManager () = { | |
1081 | - | let cu = gm() | |
1082 | - | let gN = if (isDefined(cu)) | |
1083 | - | then true | |
1084 | - | else throw("No pending manager") | |
1085 | - | if ((gN == gN)) | |
1086 | - | then { | |
1087 | - | let gO = if ((cP.callerPublicKey == value(cu))) | |
1088 | - | then true | |
1089 | - | else throw("You are not pending manager") | |
1090 | - | if ((gO == gO)) | |
1091 | - | then [StringEntry(Z(), toBase58String(value(cu))), DeleteEntry(aa())] | |
1092 | - | else throw("Strict value is not equal to itself.") | |
1093 | - | } | |
1094 | - | else throw("Strict value is not equal to itself.") | |
1095 | - | } | |
1096 | - | ||
1097 | - | ||
1098 | - | ||
1099 | - | @Callable(cP) | |
1100 | - | func put (gP,gQ) = { | |
1101 | - | let gR = bs() | |
1102 | - | let gS = valueOrErrorMessage(addressFromString(gR[C]), "Wr st addr") | |
1103 | - | let gT = valueOrErrorMessage(addressFromString(gR[E]), "Wr sl addr") | |
1104 | - | if ((0 > gP)) | |
857 | + | @Callable(dM) | |
858 | + | func put (fI,fJ) = { | |
859 | + | let fK = bd() | |
860 | + | let fL = valueOrErrorMessage(addressFromString(fK[A]), "Wr st addr") | |
861 | + | let fM = valueOrErrorMessage(addressFromString(fK[C]), "Wr sl addr") | |
862 | + | if ((0 > fI)) | |
1105 | 863 | then throw("Wrong slippage") | |
1106 | - | else if ((size( | |
864 | + | else if ((size(dM.payments) != 2)) | |
1107 | 865 | then throw("2 pmnts expd") | |
1108 | 866 | else { | |
1109 | - | let gU = toBigInt(value(cP.payments[0]).amount) | |
1110 | - | let gV = toBigInt(value(cP.payments[1]).amount) | |
1111 | - | let eO = (toBigInt(bN(be(bm))) - gU) | |
1112 | - | if ((eO == eO)) | |
867 | + | let fN = dO(toString(dM.caller), toBase58String(dM.transactionId), AttachedPayment(value(dM.payments[0]).assetId, value(dM.payments[0]).amount), dM.payments[1], fI, true, false, true, 0, "") | |
868 | + | let dr = fN._2 | |
869 | + | let fO = fN._7 | |
870 | + | let cI = fN._9 | |
871 | + | let ds = fN._10 | |
872 | + | let dt = fN._11 | |
873 | + | let cq = fN._12 | |
874 | + | let cr = fN._13 | |
875 | + | let de = invoke(aD, "emit", [dr], nil) | |
876 | + | if ((de == de)) | |
1113 | 877 | then { | |
1114 | - | let eP = (toBigInt(bN(be(bn))) - gV) | |
1115 | - | if ((eP == eP)) | |
878 | + | let fP = { | |
879 | + | let av = de | |
880 | + | if ($isInstanceOf(av, "Address")) | |
881 | + | then { | |
882 | + | let fQ = av | |
883 | + | invoke(fQ, "emit", [dr], nil) | |
884 | + | } | |
885 | + | else unit | |
886 | + | } | |
887 | + | if ((fP == fP)) | |
1116 | 888 | then { | |
1117 | - | let eQ = toBigInt(value(assetInfo(bl)).quantity) | |
1118 | - | if ((eQ == eQ)) | |
889 | + | let fR = if ((ds > 0)) | |
890 | + | then invoke(fM, "put", nil, [AttachedPayment(cq, ds)]) | |
891 | + | else nil | |
892 | + | if ((fR == fR)) | |
1119 | 893 | then { | |
1120 | - | let eR = eK(gU, gV, toBigInt(0)) | |
1121 | - | if ((eR == eR)) | |
894 | + | let fS = if ((dt > 0)) | |
895 | + | then invoke(fM, "put", nil, [AttachedPayment(cr, dt)]) | |
896 | + | else nil | |
897 | + | if ((fS == fS)) | |
1122 | 898 | then { | |
1123 | - | let gW = fl(toString(cP.caller), toBase58String(cP.transactionId), AttachedPayment(value(cP.payments[0]).assetId, value(cP.payments[0]).amount), cP.payments[1], gP, true, false, true, 0, "") | |
1124 | - | let el = gW._2 | |
1125 | - | let gX = gW._7 | |
1126 | - | let dB = gW._9 | |
1127 | - | let em = gW._10 | |
1128 | - | let en = gW._11 | |
1129 | - | let dj = gW._12 | |
1130 | - | let dk = gW._13 | |
1131 | - | let dX = invoke(aQ, "emit", [el], nil) | |
1132 | - | if ((dX == dX)) | |
899 | + | let fT = if (fJ) | |
1133 | 900 | then { | |
1134 | - | let gY = { | |
1135 | - | let gl = dX | |
1136 | - | if ($isInstanceOf(gl, "Address")) | |
1137 | - | then { | |
1138 | - | let gZ = gl | |
1139 | - | invoke(gZ, "emit", [el], nil) | |
1140 | - | } | |
1141 | - | else unit | |
1142 | - | } | |
1143 | - | if ((gY == gY)) | |
1144 | - | then { | |
1145 | - | let ha = if ((em > 0)) | |
1146 | - | then invoke(gT, "put", nil, [AttachedPayment(dj, em)]) | |
1147 | - | else nil | |
1148 | - | if ((ha == ha)) | |
1149 | - | then { | |
1150 | - | let hb = if ((en > 0)) | |
1151 | - | then invoke(gT, "put", nil, [AttachedPayment(dk, en)]) | |
1152 | - | else nil | |
1153 | - | if ((hb == hb)) | |
1154 | - | then { | |
1155 | - | let hc = if (gQ) | |
1156 | - | then { | |
1157 | - | let hd = invoke(gS, "stake", nil, [AttachedPayment(gX, el)]) | |
1158 | - | if ((hd == hd)) | |
1159 | - | then nil | |
1160 | - | else throw("Strict value is not equal to itself.") | |
1161 | - | } | |
1162 | - | else [ScriptTransfer(cP.caller, el, gX)] | |
1163 | - | let he = eS(0, 0, 0) | |
1164 | - | let gi = he._1 | |
1165 | - | let eJ = he._2 | |
1166 | - | let hf = if ((eJ >= eR)) | |
1167 | - | then true | |
1168 | - | else aN(makeString(["updated DLp lower than current DLp", toString(eO), toString(eP), toString(eQ), toString(eR), toString(eJ), toString(em), toString(en)], " ")) | |
1169 | - | if ((hf == hf)) | |
1170 | - | then { | |
1171 | - | let hg = value(assetInfo(bl)).quantity | |
1172 | - | if ((hg == hg)) | |
1173 | - | then ((dB ++ hc) ++ gi) | |
1174 | - | else throw("Strict value is not equal to itself.") | |
1175 | - | } | |
1176 | - | else throw("Strict value is not equal to itself.") | |
1177 | - | } | |
1178 | - | else throw("Strict value is not equal to itself.") | |
1179 | - | } | |
1180 | - | else throw("Strict value is not equal to itself.") | |
1181 | - | } | |
901 | + | let fU = invoke(fL, "stake", nil, [AttachedPayment(fO, dr)]) | |
902 | + | if ((fU == fU)) | |
903 | + | then nil | |
1182 | 904 | else throw("Strict value is not equal to itself.") | |
1183 | 905 | } | |
1184 | - | else throw("Strict value is not equal to itself.") | |
906 | + | else [ScriptTransfer(dM.caller, dr, fO)] | |
907 | + | (cI ++ fT) | |
1185 | 908 | } | |
1186 | 909 | else throw("Strict value is not equal to itself.") | |
1187 | 910 | } | |
1188 | 911 | else throw("Strict value is not equal to itself.") | |
1189 | 912 | } | |
1190 | 913 | else throw("Strict value is not equal to itself.") | |
1191 | 914 | } | |
1192 | 915 | else throw("Strict value is not equal to itself.") | |
1193 | 916 | } | |
1194 | 917 | } | |
1195 | 918 | ||
1196 | 919 | ||
1197 | 920 | ||
1198 | - | @Callable( | |
1199 | - | func putOneTknV2 ( | |
1200 | - | let | |
1201 | - | let | |
1202 | - | if ($isInstanceOf( | |
1203 | - | then | |
1204 | - | else throw(($getType( | |
921 | + | @Callable(dM) | |
922 | + | func putOneTknV2 (fg,fJ) = { | |
923 | + | let fV = { | |
924 | + | let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
925 | + | if ($isInstanceOf(aF, "Boolean")) | |
926 | + | then aF | |
927 | + | else throw(($getType(aF) + " couldn't be cast to Boolean")) | |
1205 | 928 | } | |
1206 | - | let | |
929 | + | let fW = if (if (if (aI()) | |
1207 | 930 | then true | |
1208 | - | else ( | |
931 | + | else (aX == o)) | |
1209 | 932 | then true | |
1210 | - | else ( | |
933 | + | else (aX == q)) | |
1211 | 934 | then true | |
1212 | - | else | |
1213 | - | let | |
935 | + | else fV | |
936 | + | let fX = [if (if (!(fW)) | |
1214 | 937 | then true | |
1215 | - | else | |
938 | + | else fB(dM)) | |
1216 | 939 | then true | |
1217 | - | else | |
940 | + | else aB("put operation is blocked by admin"), if ((size(dM.payments) == 1)) | |
1218 | 941 | then true | |
1219 | - | else | |
1220 | - | if (( | |
942 | + | else aB("exactly 1 payment are expected")] | |
943 | + | if ((fX == fX)) | |
1221 | 944 | then { | |
1222 | - | let dj = toBase58String(value(bm)) | |
1223 | - | let dk = toBase58String(value(bn)) | |
1224 | - | let di = bl | |
1225 | - | let fQ = bo | |
1226 | - | let fR = bp | |
1227 | - | let dh = if ((cP.caller == this)) | |
1228 | - | then cP.originCaller | |
1229 | - | else cP.caller | |
1230 | - | let fk = value(cP.payments[0]) | |
1231 | - | let df = toBase58String(value(fk.assetId)) | |
1232 | - | let dL = fk.amount | |
1233 | - | let eR = if ((fk.assetId == bm)) | |
1234 | - | then eK(toBigInt(dL), toBigInt(0), toBigInt(0)) | |
1235 | - | else eK(toBigInt(0), toBigInt(dL), toBigInt(0)) | |
1236 | - | if ((eR == eR)) | |
945 | + | let aT = aL() | |
946 | + | let cq = aT[u] | |
947 | + | let cr = aT[v] | |
948 | + | let cp = fromBase58String(aT[t]) | |
949 | + | let fk = parseIntValue(aT[w]) | |
950 | + | let fl = parseIntValue(aT[x]) | |
951 | + | let co = if ((dM.caller == this)) | |
952 | + | then dM.originCaller | |
953 | + | else dM.caller | |
954 | + | let dN = value(dM.payments[0]) | |
955 | + | let cm = toBase58String(value(dN.assetId)) | |
956 | + | let cS = dN.amount | |
957 | + | let fY = eH(cS, cm, toString(co), toBase58String(dM.transactionId), true) | |
958 | + | if ((fY == fY)) | |
1237 | 959 | then { | |
1238 | - | let hj = fp(dL, df, toString(dh), toBase58String(cP.transactionId), true) | |
1239 | - | if ((hj == hj)) | |
960 | + | let cj = fY._3 | |
961 | + | let cI = fY._2 | |
962 | + | let fZ = fY._1 | |
963 | + | let dr = if (if ((fg > 0)) | |
964 | + | then (fg > fZ) | |
965 | + | else false) | |
966 | + | then aB(makeString(["amount to receive is less than ", toString(fg)], "")) | |
967 | + | else fZ | |
968 | + | let fN = invoke(aD, "emit", [dr], nil) | |
969 | + | if ((fN == fN)) | |
1240 | 970 | then { | |
1241 | - | let | |
1242 | - | let | |
1243 | - | | |
1244 | - | | |
1245 | - | | |
1246 | - | | |
1247 | - | | |
1248 | - | else | |
1249 | - | | |
1250 | - | if (( | |
971 | + | let fP = { | |
972 | + | let av = fN | |
973 | + | if ($isInstanceOf(av, "Address")) | |
974 | + | then { | |
975 | + | let fQ = av | |
976 | + | invoke(fQ, "emit", [dr], nil) | |
977 | + | } | |
978 | + | else unit | |
979 | + | } | |
980 | + | if ((fP == fP)) | |
1251 | 981 | then { | |
1252 | - | let gY = { | |
1253 | - | let gl = gW | |
1254 | - | if ($isInstanceOf(gl, "Address")) | |
1255 | - | then { | |
1256 | - | let gZ = gl | |
1257 | - | invoke(gZ, "emit", [el], nil) | |
1258 | - | } | |
1259 | - | else unit | |
1260 | - | } | |
1261 | - | if ((gY == gY)) | |
982 | + | let fT = if (fJ) | |
1262 | 983 | then { | |
1263 | - | let hc = if (gQ) | |
1264 | - | then { | |
1265 | - | let hd = invoke(bu, "stake", nil, [AttachedPayment(di, el)]) | |
1266 | - | if ((hd == hd)) | |
1267 | - | then nil | |
1268 | - | else throw("Strict value is not equal to itself.") | |
1269 | - | } | |
1270 | - | else [ScriptTransfer(cP.caller, el, di)] | |
1271 | - | let gc = if ((cx > 0)) | |
1272 | - | then [ScriptTransfer(aX, cx, fromBase58String(df))] | |
1273 | - | else nil | |
1274 | - | let hl = if ((this == aX)) | |
1275 | - | then $Tuple2(0, 0) | |
1276 | - | else { | |
1277 | - | let hm = if ((fk.assetId == bm)) | |
1278 | - | then true | |
1279 | - | else false | |
1280 | - | if (hm) | |
1281 | - | then $Tuple2(-(cx), 0) | |
1282 | - | else $Tuple2(0, -(cx)) | |
1283 | - | } | |
1284 | - | let eT = hl._1 | |
1285 | - | let eU = hl._2 | |
1286 | - | let hn = eS(eT, eU, 0) | |
1287 | - | let gi = hn._1 | |
1288 | - | let eJ = hn._2 | |
1289 | - | let gj = eW(eR, eJ) | |
1290 | - | if ((gj == gj)) | |
1291 | - | then $Tuple2((((dB ++ hc) ++ gc) ++ gi), el) | |
984 | + | let fU = invoke(bf, "stake", nil, [AttachedPayment(cp, dr)]) | |
985 | + | if ((fU == fU)) | |
986 | + | then nil | |
1292 | 987 | else throw("Strict value is not equal to itself.") | |
1293 | 988 | } | |
1294 | - | else throw("Strict value is not equal to itself.") | |
989 | + | else [ScriptTransfer(dM.caller, dr, cp)] | |
990 | + | let fw = if ((cj > 0)) | |
991 | + | then [ScriptTransfer(aK, cj, fromBase58String(cm))] | |
992 | + | else nil | |
993 | + | $Tuple2(((cI ++ fT) ++ fw), dr) | |
1295 | 994 | } | |
1296 | 995 | else throw("Strict value is not equal to itself.") | |
1297 | 996 | } | |
1298 | 997 | else throw("Strict value is not equal to itself.") | |
1299 | 998 | } | |
1300 | 999 | else throw("Strict value is not equal to itself.") | |
1301 | 1000 | } | |
1302 | 1001 | else throw("Strict value is not equal to itself.") | |
1303 | 1002 | } | |
1304 | 1003 | ||
1305 | 1004 | ||
1306 | 1005 | ||
1307 | - | @Callable( | |
1308 | - | func putForFree ( | |
1006 | + | @Callable(dM) | |
1007 | + | func putForFree (ga) = if ((0 > ga)) | |
1309 | 1008 | then throw("Wrong slpg") | |
1310 | - | else if ((size( | |
1009 | + | else if ((size(dM.payments) != 2)) | |
1311 | 1010 | then throw("2 pmnts expd") | |
1312 | 1011 | else { | |
1313 | - | let hp = fl(toString(cP.caller), toBase58String(cP.transactionId), AttachedPayment(value(cP.payments[0]).assetId, value(cP.payments[0]).amount), cP.payments[1], ho, false, false, true, 0, "") | |
1314 | - | let dB = hp._9 | |
1315 | - | let gU = toBigInt(value(cP.payments[0]).amount) | |
1316 | - | let gV = toBigInt(value(cP.payments[1]).amount) | |
1317 | - | let eR = eK(gU, gV, toBigInt(0)) | |
1318 | - | if ((eR == eR)) | |
1319 | - | then { | |
1320 | - | let hq = eS(0, 0, 0) | |
1321 | - | let gi = hq._1 | |
1322 | - | let eJ = hq._2 | |
1323 | - | let gj = eW(eR, eJ) | |
1324 | - | if ((gj == gj)) | |
1325 | - | then (dB ++ gi) | |
1326 | - | else throw("Strict value is not equal to itself.") | |
1327 | - | } | |
1328 | - | else throw("Strict value is not equal to itself.") | |
1012 | + | let gb = dO(toString(dM.caller), toBase58String(dM.transactionId), AttachedPayment(value(dM.payments[0]).assetId, value(dM.payments[0]).amount), dM.payments[1], ga, false, false, true, 0, "") | |
1013 | + | gb._9 | |
1329 | 1014 | } | |
1330 | 1015 | ||
1331 | 1016 | ||
1332 | 1017 | ||
1333 | - | @Callable( | |
1018 | + | @Callable(dM) | |
1334 | 1019 | func get () = { | |
1335 | - | let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1336 | - | if ((eR == eR)) | |
1020 | + | let de = dL(dM) | |
1021 | + | let gc = de._1 | |
1022 | + | let cH = de._2 | |
1023 | + | let cS = de._3 | |
1024 | + | let cm = de._4 | |
1025 | + | let cI = de._5 | |
1026 | + | let eB = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)]) | |
1027 | + | if ((eB == eB)) | |
1028 | + | then cI | |
1029 | + | else throw("Strict value is not equal to itself.") | |
1030 | + | } | |
1031 | + | ||
1032 | + | ||
1033 | + | ||
1034 | + | @Callable(dM) | |
1035 | + | func getOneTknV2 (ff,fg) = { | |
1036 | + | let fV = { | |
1037 | + | let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1038 | + | if ($isInstanceOf(aF, "Boolean")) | |
1039 | + | then aF | |
1040 | + | else throw(($getType(aF) + " couldn't be cast to Boolean")) | |
1041 | + | } | |
1042 | + | let gd = if (if (aI()) | |
1043 | + | then true | |
1044 | + | else (aX == q)) | |
1045 | + | then true | |
1046 | + | else fV | |
1047 | + | let fX = [if (if (!(gd)) | |
1048 | + | then true | |
1049 | + | else fB(dM)) | |
1050 | + | then true | |
1051 | + | else aB("get operation is blocked by admin"), if ((size(dM.payments) == 1)) | |
1052 | + | then true | |
1053 | + | else aB("exactly 1 payment are expected")] | |
1054 | + | if ((fX == fX)) | |
1337 | 1055 | then { | |
1338 | - | let dX = fj(cP) | |
1339 | - | let hr = dX._1 | |
1340 | - | let dA = dX._2 | |
1341 | - | let dL = dX._3 | |
1342 | - | let df = dX._4 | |
1343 | - | let dB = dX._5 | |
1344 | - | let ey = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)]) | |
1345 | - | if ((ey == ey)) | |
1346 | - | then { | |
1347 | - | let hs = eS(-(hr), -(dA), 0) | |
1348 | - | let gi = hs._1 | |
1349 | - | let eJ = hs._2 | |
1350 | - | let gj = eW(eR, eJ) | |
1351 | - | if ((gj == gj)) | |
1352 | - | then (dB ++ gi) | |
1353 | - | else throw("Strict value is not equal to itself.") | |
1354 | - | } | |
1355 | - | else throw("Strict value is not equal to itself.") | |
1056 | + | let ge = fe(ff, fg, dM.payments, dM.caller, dM.originCaller, dM.transactionId) | |
1057 | + | let cI = ge._1 | |
1058 | + | let fp = ge._2 | |
1059 | + | $Tuple2(cI, fp) | |
1356 | 1060 | } | |
1357 | 1061 | else throw("Strict value is not equal to itself.") | |
1358 | 1062 | } | |
1359 | 1063 | ||
1360 | 1064 | ||
1361 | 1065 | ||
1362 | - | @Callable(cP) | |
1363 | - | func getOneTknV2 (fL,fM) = { | |
1364 | - | let hh = { | |
1365 | - | let aS = invoke(aQ, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1366 | - | if ($isInstanceOf(aS, "Boolean")) | |
1367 | - | then aS | |
1368 | - | else throw(($getType(aS) + " couldn't be cast to Boolean")) | |
1369 | - | } | |
1370 | - | let ht = if (if (aV()) | |
1371 | - | then true | |
1372 | - | else (bk == s)) | |
1373 | - | then true | |
1374 | - | else hh | |
1375 | - | let gH = [if (if (!(ht)) | |
1376 | - | then true | |
1377 | - | else go(cP)) | |
1378 | - | then true | |
1379 | - | else aN("get operation is blocked by admin"), if ((size(cP.payments) == 1)) | |
1380 | - | then true | |
1381 | - | else aN("exactly 1 payment are expected")] | |
1382 | - | if ((gH == gH)) | |
1383 | - | then { | |
1384 | - | let hu = fK(fL, fM, cP.payments, cP.caller, cP.originCaller, cP.transactionId) | |
1385 | - | let dB = hu._1 | |
1386 | - | let fV = hu._2 | |
1387 | - | $Tuple2(dB, fV) | |
1388 | - | } | |
1389 | - | else throw("Strict value is not equal to itself.") | |
1066 | + | @Callable(dM) | |
1067 | + | func getOneTknV2READONLY (ff,gf) = { | |
1068 | + | let aT = aL() | |
1069 | + | let cq = aT[u] | |
1070 | + | let cr = aT[v] | |
1071 | + | let cp = aT[t] | |
1072 | + | let dT = [toBigInt(by(cq)), toBigInt(by(cr))] | |
1073 | + | let gg = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cp)), "invalid lp asset").quantity) | |
1074 | + | let bL = dS(dT) | |
1075 | + | let bK = (bL - fraction(toBigInt(gf), bL, gg)) | |
1076 | + | let gh = if ((ff == cq)) | |
1077 | + | then 0 | |
1078 | + | else if ((ff == cr)) | |
1079 | + | then 1 | |
1080 | + | else throw("invalid out asset id") | |
1081 | + | let gi = ex(dT, gh, bK) | |
1082 | + | let gj = (dT[gh] - gi) | |
1083 | + | let gk = max([0, toInt((gj - f))]) | |
1084 | + | let gl = cg(gk, aG) | |
1085 | + | let fo = gl._1 | |
1086 | + | let cj = gl._2 | |
1087 | + | $Tuple2(nil, $Tuple2(fo, cj)) | |
1390 | 1088 | } | |
1391 | 1089 | ||
1392 | 1090 | ||
1393 | 1091 | ||
1394 | - | @Callable(cP) | |
1395 | - | func refreshDLp () = { | |
1396 | - | let hv = valueOrElse(getInteger(aq), 0) | |
1397 | - | let hw = if (((height - hv) >= at)) | |
1398 | - | then unit | |
1399 | - | else aN(makeString([toString(at), " blocks have not passed since the previous call"], "")) | |
1400 | - | if ((hw == hw)) | |
1401 | - | then { | |
1402 | - | let fd = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, ap), "0")), aP("invalid dLp")) | |
1403 | - | let hx = eS(0, 0, 0) | |
1404 | - | let hy = hx._1 | |
1405 | - | let eJ = hx._2 | |
1406 | - | let eV = if ((fd != eJ)) | |
1407 | - | then hy | |
1408 | - | else aN("nothing to refresh") | |
1409 | - | $Tuple2(eV, toString(eJ)) | |
1410 | - | } | |
1411 | - | else throw("Strict value is not equal to itself.") | |
1092 | + | @Callable(dM) | |
1093 | + | func getOneTknV2WithBonusREADONLY (ff,gf) = { | |
1094 | + | let aT = aL() | |
1095 | + | let cq = aT[u] | |
1096 | + | let cr = aT[v] | |
1097 | + | let cp = aT[t] | |
1098 | + | let cw = by(cq) | |
1099 | + | let cy = by(cr) | |
1100 | + | let gm = { | |
1101 | + | let aF = invoke(this, "getOneTknV2READONLY", [ff, gf], nil) | |
1102 | + | if ($isInstanceOf(aF, "(Int, Int)")) | |
1103 | + | then aF | |
1104 | + | else throw(($getType(aF) + " couldn't be cast to (Int, Int)")) | |
1105 | + | } | |
1106 | + | let fo = gm._1 | |
1107 | + | let cj = gm._2 | |
1108 | + | let de = ck("", cp, gf, this) | |
1109 | + | let cG = de._1 | |
1110 | + | let cH = de._2 | |
1111 | + | let gn = (cG + cH) | |
1112 | + | let fd = if ((gn == 0)) | |
1113 | + | then if ((fo == 0)) | |
1114 | + | then 0 | |
1115 | + | else throw("bonus calculation error") | |
1116 | + | else fraction((fo - gn), a, gn) | |
1117 | + | $Tuple2(nil, $Tuple3(fo, cj, fd)) | |
1412 | 1118 | } | |
1413 | 1119 | ||
1414 | 1120 | ||
1415 | 1121 | ||
1416 | - | @Callable(cP) | |
1417 | - | func getOneTknV2READONLY (fL,hz) = { | |
1418 | - | let dj = toBase58String(value(bm)) | |
1419 | - | let dk = toBase58String(value(bn)) | |
1420 | - | let di = toBase58String(value(bl)) | |
1421 | - | let cz = [toBigInt(bN(dj)), toBigInt(bN(dk))] | |
1422 | - | let eI = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(di)), "invalid lp asset").quantity) | |
1423 | - | let cb = cy(cz) | |
1424 | - | let ca = (cb - fraction(toBigInt(hz), cb, eI)) | |
1425 | - | let hA = if ((fL == dj)) | |
1426 | - | then 0 | |
1427 | - | else if ((fL == dk)) | |
1428 | - | then 1 | |
1429 | - | else throw("invalid out asset id") | |
1430 | - | let hB = es(cz, hA, ca) | |
1431 | - | let gA = (cz[hA] - hB) | |
1432 | - | let gB = max([0, toInt((gA - f))]) | |
1433 | - | let hC = cv(gB, aT) | |
1434 | - | let fU = hC._1 | |
1435 | - | let cx = hC._2 | |
1436 | - | $Tuple2(nil, $Tuple2(fU, cx)) | |
1437 | - | } | |
1438 | - | ||
1439 | - | ||
1440 | - | ||
1441 | - | @Callable(cP) | |
1442 | - | func getOneTknV2WithBonusREADONLY (fL,hz) = { | |
1443 | - | let dj = toBase58String(value(bm)) | |
1444 | - | let dk = toBase58String(value(bn)) | |
1445 | - | let di = toBase58String(value(bl)) | |
1446 | - | let dp = bN(dj) | |
1447 | - | let dr = bN(dk) | |
1448 | - | let hD = { | |
1449 | - | let aS = invoke(this, "getOneTknV2READONLY", [fL, hz], nil) | |
1450 | - | if ($isInstanceOf(aS, "(Int, Int)")) | |
1451 | - | then aS | |
1452 | - | else throw(($getType(aS) + " couldn't be cast to (Int, Int)")) | |
1453 | - | } | |
1454 | - | let fU = hD._1 | |
1455 | - | let cx = hD._2 | |
1456 | - | let dX = dd("", di, hz, this) | |
1457 | - | let dz = dX._1 | |
1458 | - | let dA = dX._2 | |
1459 | - | let hE = (dz + dA) | |
1460 | - | let fJ = if ((hE == 0)) | |
1461 | - | then if ((fU == 0)) | |
1462 | - | then 0 | |
1463 | - | else throw("bonus calculation error") | |
1464 | - | else fraction((fU - hE), a, hE) | |
1465 | - | $Tuple2(nil, $Tuple3(fU, cx, fJ)) | |
1466 | - | } | |
1467 | - | ||
1468 | - | ||
1469 | - | ||
1470 | - | @Callable(cP) | |
1471 | - | func getNoLess (hF,hG) = { | |
1472 | - | let dX = fj(cP) | |
1473 | - | let dz = dX._1 | |
1474 | - | let dA = dX._2 | |
1475 | - | let dL = dX._3 | |
1476 | - | let df = dX._4 | |
1477 | - | let dB = dX._5 | |
1478 | - | if ((hF > dz)) | |
1479 | - | then throw(((("Failed: " + toString(dz)) + " < ") + toString(hF))) | |
1480 | - | else if ((hG > dA)) | |
1481 | - | then throw(((("Failed: " + toString(dA)) + " < ") + toString(hG))) | |
1122 | + | @Callable(dM) | |
1123 | + | func getNoLess (go,gp) = { | |
1124 | + | let de = dL(dM) | |
1125 | + | let cG = de._1 | |
1126 | + | let cH = de._2 | |
1127 | + | let cS = de._3 | |
1128 | + | let cm = de._4 | |
1129 | + | let cI = de._5 | |
1130 | + | if ((go > cG)) | |
1131 | + | then throw(((("Failed: " + toString(cG)) + " < ") + toString(go))) | |
1132 | + | else if ((gp > cH)) | |
1133 | + | then throw(((("Failed: " + toString(cH)) + " < ") + toString(gp))) | |
1482 | 1134 | else { | |
1483 | - | let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1484 | - | if ((eR == eR)) | |
1485 | - | then { | |
1486 | - | let hH = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)]) | |
1487 | - | if ((hH == hH)) | |
1488 | - | then { | |
1489 | - | let hI = eS(-(dz), -(dA), 0) | |
1490 | - | let gi = hI._1 | |
1491 | - | let eJ = hI._2 | |
1492 | - | let gj = eW(eR, eJ) | |
1493 | - | if ((gj == gj)) | |
1494 | - | then (dB ++ gi) | |
1495 | - | else throw("Strict value is not equal to itself.") | |
1496 | - | } | |
1497 | - | else throw("Strict value is not equal to itself.") | |
1498 | - | } | |
1135 | + | let gq = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)]) | |
1136 | + | if ((gq == gq)) | |
1137 | + | then cI | |
1499 | 1138 | else throw("Strict value is not equal to itself.") | |
1500 | 1139 | } | |
1501 | 1140 | } | |
1502 | 1141 | ||
1503 | 1142 | ||
1504 | 1143 | ||
1505 | - | @Callable( | |
1506 | - | func unstakeAndGet ( | |
1507 | - | let | |
1144 | + | @Callable(dM) | |
1145 | + | func unstakeAndGet (ch) = { | |
1146 | + | let gr = if ((size(dM.payments) != 0)) | |
1508 | 1147 | then throw("No pmnts expd") | |
1509 | 1148 | else true | |
1510 | - | if (( | |
1149 | + | if ((gr == gr)) | |
1511 | 1150 | then { | |
1512 | - | let hK = bs() | |
1513 | - | let gX = bl | |
1514 | - | let hL = valueOrErrorMessage(addressFromString(hK[C]), "Wr st addr") | |
1515 | - | let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1516 | - | if ((eR == eR)) | |
1151 | + | let bX = aL() | |
1152 | + | let gs = bd() | |
1153 | + | let fO = fromBase58String(bX[t]) | |
1154 | + | let gt = valueOrErrorMessage(addressFromString(gs[A]), "Wr st addr") | |
1155 | + | let gu = invoke(gt, "unstake", [toBase58String(fO), ch], nil) | |
1156 | + | if ((gu == gu)) | |
1517 | 1157 | then { | |
1518 | - | let hM = invoke(hL, "unstake", [toBase58String(gX), cw], nil) | |
1519 | - | if ((hM == hM)) | |
1158 | + | let de = ck(toBase58String(dM.transactionId), toBase58String(fO), ch, dM.caller) | |
1159 | + | let cu = parseIntValue(de._9) | |
1160 | + | let cI = de._10 | |
1161 | + | let gv = if (if (aI()) | |
1162 | + | then true | |
1163 | + | else (cu == q)) | |
1164 | + | then throw(("Blocked: " + toString(cu))) | |
1165 | + | else true | |
1166 | + | if ((gv == gv)) | |
1520 | 1167 | then { | |
1521 | - | let dX = dd(toBase58String(cP.transactionId), toBase58String(gX), cw, cP.caller) | |
1522 | - | let dz = dX._1 | |
1523 | - | let dA = dX._2 | |
1524 | - | let dn = parseIntValue(dX._9) | |
1525 | - | let dB = dX._10 | |
1526 | - | let hN = if (if (aV()) | |
1527 | - | then true | |
1528 | - | else (dn == s)) | |
1529 | - | then throw(("Blocked: " + toString(dn))) | |
1530 | - | else true | |
1531 | - | if ((hN == hN)) | |
1532 | - | then { | |
1533 | - | let hO = invoke(aQ, "burn", [cw], [AttachedPayment(gX, cw)]) | |
1534 | - | if ((hO == hO)) | |
1535 | - | then { | |
1536 | - | let hP = eS(-(dz), -(dA), 0) | |
1537 | - | let gi = hP._1 | |
1538 | - | let eJ = hP._2 | |
1539 | - | let gj = eW(eR, eJ) | |
1540 | - | if ((gj == gj)) | |
1541 | - | then (dB ++ gi) | |
1542 | - | else throw("Strict value is not equal to itself.") | |
1543 | - | } | |
1544 | - | else throw("Strict value is not equal to itself.") | |
1545 | - | } | |
1168 | + | let gw = invoke(aD, "burn", [ch], [AttachedPayment(fO, ch)]) | |
1169 | + | if ((gw == gw)) | |
1170 | + | then cI | |
1546 | 1171 | else throw("Strict value is not equal to itself.") | |
1547 | 1172 | } | |
1548 | 1173 | else throw("Strict value is not equal to itself.") | |
1549 | 1174 | } | |
1550 | 1175 | else throw("Strict value is not equal to itself.") | |
1551 | 1176 | } | |
1552 | 1177 | else throw("Strict value is not equal to itself.") | |
1553 | 1178 | } | |
1554 | 1179 | ||
1555 | 1180 | ||
1556 | 1181 | ||
1557 | - | @Callable( | |
1558 | - | func unstakeAndGetNoLess ( | |
1559 | - | let | |
1182 | + | @Callable(dM) | |
1183 | + | func unstakeAndGetNoLess (gx,gy,gp) = { | |
1184 | + | let gd = if (aI()) | |
1560 | 1185 | then true | |
1561 | - | else ( | |
1562 | - | let | |
1186 | + | else (aX == q) | |
1187 | + | let fX = [if (!(gd)) | |
1563 | 1188 | then true | |
1564 | - | else throw("get operation is blocked by admin"), if ((size( | |
1189 | + | else throw("get operation is blocked by admin"), if ((size(dM.payments) == 0)) | |
1565 | 1190 | then true | |
1566 | 1191 | else throw("no payments are expected")] | |
1567 | - | if (( | |
1192 | + | if ((fX == fX)) | |
1568 | 1193 | then { | |
1569 | - | let | |
1570 | - | if (( | |
1194 | + | let gu = invoke(bf, "unstake", [toBase58String(aY), gx], nil) | |
1195 | + | if ((gu == gu)) | |
1571 | 1196 | then { | |
1572 | - | let hM = invoke(bu, "unstake", [toBase58String(bl), hQ], nil) | |
1573 | - | if ((hM == hM)) | |
1197 | + | let gz = ck(toBase58String(dM.transactionId), toBase58String(aY), gx, dM.caller) | |
1198 | + | let cG = gz._1 | |
1199 | + | let cH = gz._2 | |
1200 | + | let cI = gz._10 | |
1201 | + | let gA = [if ((cG >= gy)) | |
1202 | + | then true | |
1203 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(gy)], "")), if ((cH >= gp)) | |
1204 | + | then true | |
1205 | + | else throw(makeString(["price asset amount to receive is less than ", toString(gp)], ""))] | |
1206 | + | if ((gA == gA)) | |
1574 | 1207 | then { | |
1575 | - | let hS = dd(toBase58String(cP.transactionId), toBase58String(bl), hQ, cP.caller) | |
1576 | - | let dz = hS._1 | |
1577 | - | let dA = hS._2 | |
1578 | - | let dB = hS._10 | |
1579 | - | let hT = [if ((dz >= hR)) | |
1580 | - | then true | |
1581 | - | else throw(makeString(["amount asset amount to receive is less than ", toString(hR)], "")), if ((dA >= hG)) | |
1582 | - | then true | |
1583 | - | else throw(makeString(["price asset amount to receive is less than ", toString(hG)], ""))] | |
1584 | - | if ((hT == hT)) | |
1585 | - | then { | |
1586 | - | let hH = invoke(aQ, "burn", [hQ], [AttachedPayment(bl, hQ)]) | |
1587 | - | if ((hH == hH)) | |
1588 | - | then { | |
1589 | - | let hU = eS(-(dz), -(dA), 0) | |
1590 | - | let gi = hU._1 | |
1591 | - | let eJ = hU._2 | |
1592 | - | let gj = eW(eR, eJ) | |
1593 | - | if ((gj == gj)) | |
1594 | - | then (dB ++ gi) | |
1595 | - | else throw("Strict value is not equal to itself.") | |
1596 | - | } | |
1597 | - | else throw("Strict value is not equal to itself.") | |
1598 | - | } | |
1208 | + | let gq = invoke(aD, "burn", [gx], [AttachedPayment(aY, gx)]) | |
1209 | + | if ((gq == gq)) | |
1210 | + | then cI | |
1599 | 1211 | else throw("Strict value is not equal to itself.") | |
1600 | 1212 | } | |
1601 | 1213 | else throw("Strict value is not equal to itself.") | |
1602 | 1214 | } | |
1603 | 1215 | else throw("Strict value is not equal to itself.") | |
1604 | 1216 | } | |
1605 | 1217 | else throw("Strict value is not equal to itself.") | |
1606 | 1218 | } | |
1607 | 1219 | ||
1608 | 1220 | ||
1609 | 1221 | ||
1610 | - | @Callable( | |
1611 | - | func unstakeAndGetOneTknV2 ( | |
1612 | - | let | |
1613 | - | let | |
1614 | - | if ($isInstanceOf( | |
1615 | - | then | |
1616 | - | else throw(($getType( | |
1222 | + | @Callable(dM) | |
1223 | + | func unstakeAndGetOneTknV2 (gx,ff,fg) = { | |
1224 | + | let fV = { | |
1225 | + | let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1226 | + | if ($isInstanceOf(aF, "Boolean")) | |
1227 | + | then aF | |
1228 | + | else throw(($getType(aF) + " couldn't be cast to Boolean")) | |
1617 | 1229 | } | |
1618 | - | let | |
1230 | + | let gd = if (if (aI()) | |
1619 | 1231 | then true | |
1620 | - | else ( | |
1232 | + | else (aX == q)) | |
1621 | 1233 | then true | |
1622 | - | else | |
1623 | - | let | |
1234 | + | else fV | |
1235 | + | let fX = [if (if (!(gd)) | |
1624 | 1236 | then true | |
1625 | - | else | |
1237 | + | else fB(dM)) | |
1626 | 1238 | then true | |
1627 | - | else | |
1239 | + | else aB("get operation is blocked by admin"), if ((size(dM.payments) == 0)) | |
1628 | 1240 | then true | |
1629 | - | else | |
1630 | - | if (( | |
1241 | + | else aB("no payments are expected")] | |
1242 | + | if ((fX == fX)) | |
1631 | 1243 | then { | |
1632 | - | let hK = bs() | |
1633 | - | let gX = bl | |
1634 | - | let hL = valueOrErrorMessage(addressFromString(hK[C]), "Wr st addr") | |
1635 | - | let hM = invoke(hL, "unstake", [toBase58String(gX), hQ], nil) | |
1636 | - | if ((hM == hM)) | |
1244 | + | let bX = aL() | |
1245 | + | let gs = bd() | |
1246 | + | let fO = fromBase58String(bX[t]) | |
1247 | + | let gt = valueOrErrorMessage(addressFromString(gs[A]), "Wr st addr") | |
1248 | + | let co = dM.caller | |
1249 | + | let gB = this | |
1250 | + | let gu = invoke(gt, "unstakeINTERNAL", [fO, gx, co.bytes, gB.bytes], nil) | |
1251 | + | if ((gu == gu)) | |
1637 | 1252 | then { | |
1638 | - | let | |
1639 | - | let | |
1640 | - | let | |
1641 | - | $Tuple2( | |
1253 | + | let gC = fe(ff, fg, [AttachedPayment(fO, gx)], dM.caller, dM.originCaller, dM.transactionId) | |
1254 | + | let cI = gC._1 | |
1255 | + | let fp = gC._2 | |
1256 | + | $Tuple2(cI, fp) | |
1642 | 1257 | } | |
1643 | 1258 | else throw("Strict value is not equal to itself.") | |
1644 | 1259 | } | |
1645 | 1260 | else throw("Strict value is not equal to itself.") | |
1646 | 1261 | } | |
1647 | 1262 | ||
1648 | 1263 | ||
1649 | 1264 | ||
1650 | - | @Callable(cP) | |
1651 | - | func putOneTknV2WithBonusREADONLY (hW,hX) = { | |
1652 | - | let hY = fp(hW, hX, "", "", true) | |
1653 | - | let fE = hY._1 | |
1654 | - | let dB = hY._2 | |
1655 | - | let cx = hY._3 | |
1656 | - | let fJ = hY._4 | |
1657 | - | $Tuple2(nil, $Tuple3(fE, cx, fJ)) | |
1265 | + | @Callable(dM) | |
1266 | + | func putOneTknV2WithBonusREADONLY (gD,gE) = { | |
1267 | + | let aT = aL() | |
1268 | + | let cq = aT[u] | |
1269 | + | let cr = aT[v] | |
1270 | + | let cp = aT[t] | |
1271 | + | let gF = eH(gD, gE, "", "", true) | |
1272 | + | let eY = gF._1 | |
1273 | + | let cI = gF._2 | |
1274 | + | let cj = gF._3 | |
1275 | + | let fd = gF._4 | |
1276 | + | $Tuple2(nil, $Tuple3(eY, cj, fd)) | |
1658 | 1277 | } | |
1659 | 1278 | ||
1660 | 1279 | ||
1661 | 1280 | ||
1662 | - | @Callable(cP) | |
1663 | - | func putOneTknV2WithoutTakeFeeREADONLY (hW,hX) = { | |
1664 | - | let hZ = fp(hW, hX, "", "", false) | |
1665 | - | let fE = hZ._1 | |
1666 | - | let dB = hZ._2 | |
1667 | - | let cx = hZ._3 | |
1668 | - | let fJ = hZ._4 | |
1669 | - | $Tuple2(nil, $Tuple3(fE, cx, fJ)) | |
1281 | + | @Callable(dM) | |
1282 | + | func putOneTknV2WithoutTakeFeeREADONLY (gD,gE) = { | |
1283 | + | let aT = aL() | |
1284 | + | let cq = aT[u] | |
1285 | + | let cr = aT[v] | |
1286 | + | let cp = aT[t] | |
1287 | + | let gG = eH(gD, gE, "", "", false) | |
1288 | + | let eY = gG._1 | |
1289 | + | let cI = gG._2 | |
1290 | + | let cj = gG._3 | |
1291 | + | let fd = gG._4 | |
1292 | + | $Tuple2(nil, $Tuple3(eY, cj, fd)) | |
1670 | 1293 | } | |
1671 | 1294 | ||
1672 | 1295 | ||
1673 | 1296 | ||
1674 | - | @Callable( | |
1675 | - | func activate ( | |
1297 | + | @Callable(dM) | |
1298 | + | func activate (gH,gI) = if ((toString(dM.caller) != toString(aD))) | |
1676 | 1299 | then throw("denied") | |
1677 | - | else $Tuple2([StringEntry( | |
1300 | + | else $Tuple2([StringEntry(ac(), gH), StringEntry(ad(), gI)], "success") | |
1678 | 1301 | ||
1679 | 1302 | ||
1680 | 1303 | ||
1681 | - | @Callable( | |
1682 | - | func setS ( | |
1683 | - | then | |
1684 | - | else [StringEntry( | |
1304 | + | @Callable(dM) | |
1305 | + | func setS (gJ,gv) = if ((toString(dM.caller) != ax(this, af()))) | |
1306 | + | then fA | |
1307 | + | else [StringEntry(gJ, gv)] | |
1685 | 1308 | ||
1686 | 1309 | ||
1687 | 1310 | ||
1688 | - | @Callable( | |
1689 | - | func setI ( | |
1690 | - | then | |
1691 | - | else [IntegerEntry( | |
1311 | + | @Callable(dM) | |
1312 | + | func setI (gJ,gv) = if ((toString(dM.caller) != ax(this, af()))) | |
1313 | + | then fA | |
1314 | + | else [IntegerEntry(gJ, gv)] | |
1692 | 1315 | ||
1693 | 1316 | ||
1694 | 1317 | ||
1695 | - | @Callable( | |
1696 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, | |
1318 | + | @Callable(dM) | |
1319 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aL()) | |
1697 | 1320 | ||
1698 | 1321 | ||
1699 | 1322 | ||
1700 | - | @Callable( | |
1701 | - | func getAccBalanceWrapperREADONLY ( | |
1323 | + | @Callable(dM) | |
1324 | + | func getAccBalanceWrapperREADONLY (bz) = $Tuple2(nil, by(bz)) | |
1702 | 1325 | ||
1703 | 1326 | ||
1704 | 1327 | ||
1705 | - | @Callable( | |
1706 | - | func calcPricesWrapperREADONLY ( | |
1707 | - | let | |
1708 | - | $Tuple2(nil, [toString( | |
1328 | + | @Callable(dM) | |
1329 | + | func calcPricesWrapperREADONLY (bR,bS,bW) = { | |
1330 | + | let gK = bV(bR, bS, bW) | |
1331 | + | $Tuple2(nil, [toString(gK[0]), toString(gK[1]), toString(gK[2])]) | |
1709 | 1332 | } | |
1710 | 1333 | ||
1711 | 1334 | ||
1712 | 1335 | ||
1713 | - | @Callable( | |
1714 | - | func fromX18WrapperREADONLY ( | |
1336 | + | @Callable(dM) | |
1337 | + | func fromX18WrapperREADONLY (J,gL) = $Tuple2(nil, I(parseBigIntValue(J), gL)) | |
1715 | 1338 | ||
1716 | 1339 | ||
1717 | 1340 | ||
1718 | - | @Callable( | |
1719 | - | func toX18WrapperREADONLY ( | |
1341 | + | @Callable(dM) | |
1342 | + | func toX18WrapperREADONLY (G,H) = $Tuple2(nil, toString(F(G, H))) | |
1720 | 1343 | ||
1721 | 1344 | ||
1722 | 1345 | ||
1723 | - | @Callable( | |
1724 | - | func calcPriceBigIntWrapperREADONLY ( | |
1346 | + | @Callable(dM) | |
1347 | + | func calcPriceBigIntWrapperREADONLY (bB,bC) = $Tuple2(nil, toString(bA(parseBigIntValue(bB), parseBigIntValue(bC)))) | |
1725 | 1348 | ||
1726 | 1349 | ||
1727 | 1350 | ||
1728 | - | @Callable( | |
1729 | - | func estimatePutOperationWrapperREADONLY ( | |
1351 | + | @Callable(dM) | |
1352 | + | func estimatePutOperationWrapperREADONLY (cl,bG,cK,cL,cM,cN,gM,cO,cP) = $Tuple2(nil, cJ(cl, bG, cK, cL, cM, cN, gM, cO, cP, true, false, 0, "")) | |
1730 | 1353 | ||
1731 | 1354 | ||
1732 | 1355 | ||
1733 | - | @Callable( | |
1734 | - | func estimateGetOperationWrapperREADONLY ( | |
1735 | - | let | |
1736 | - | $Tuple2(nil, $Tuple10( | |
1356 | + | @Callable(dM) | |
1357 | + | func estimateGetOperationWrapperREADONLY (cl,gN,cn,gM) = { | |
1358 | + | let de = ck(cl, gN, cn, addressFromStringValue(gM)) | |
1359 | + | $Tuple2(nil, $Tuple10(de._1, de._2, de._3, de._4, de._5, de._6, de._7, toString(de._8), de._9, de._10)) | |
1737 | 1360 | } | |
1738 | 1361 | ||
1739 | 1362 | ||
1740 | - | @Verifier( | |
1741 | - | func | |
1742 | - | let | |
1743 | - | let | |
1744 | - | if ($isInstanceOf( | |
1363 | + | @Verifier(gO) | |
1364 | + | func gP () = { | |
1365 | + | let gQ = { | |
1366 | + | let av = fy() | |
1367 | + | if ($isInstanceOf(av, "ByteVector")) | |
1745 | 1368 | then { | |
1746 | - | let | |
1747 | - | | |
1369 | + | let fC = av | |
1370 | + | fC | |
1748 | 1371 | } | |
1749 | - | else if ($isInstanceOf( | |
1750 | - | then | |
1372 | + | else if ($isInstanceOf(av, "Unit")) | |
1373 | + | then gO.senderPublicKey | |
1751 | 1374 | else throw("Match error") | |
1752 | 1375 | } | |
1753 | - | let | |
1754 | - | if ($isInstanceOf( | |
1376 | + | let av = gO | |
1377 | + | if ($isInstanceOf(av, "Order")) | |
1755 | 1378 | then { | |
1756 | - | let eZ = gl | |
1757 | - | let ik = aW() | |
1758 | - | let il = eY(eZ) | |
1759 | - | let aF = il._1 | |
1760 | - | let aG = il._2 | |
1761 | - | let aH = sigVerify(eZ.bodyBytes, eZ.proofs[0], eZ.senderPublicKey) | |
1762 | - | let aI = sigVerify(eZ.bodyBytes, eZ.proofs[1], ik) | |
1763 | - | if (if (if (aF) | |
1764 | - | then aH | |
1379 | + | let dz = av | |
1380 | + | let gR = aJ() | |
1381 | + | let gS = dy(dz) | |
1382 | + | let gT = sigVerify(dz.bodyBytes, dz.proofs[0], dz.senderPublicKey) | |
1383 | + | let gU = sigVerify(dz.bodyBytes, dz.proofs[1], gR) | |
1384 | + | if (if (if (gS) | |
1385 | + | then gT | |
1765 | 1386 | else false) | |
1766 | - | then | |
1387 | + | then gU | |
1767 | 1388 | else false) | |
1768 | 1389 | then true | |
1769 | - | else | |
1390 | + | else aq(gS, gT, gU) | |
1770 | 1391 | } | |
1771 | - | else if ($isInstanceOf( | |
1392 | + | else if ($isInstanceOf(av, "SetScriptTransaction")) | |
1772 | 1393 | then { | |
1773 | - | let cC = gl | |
1774 | - | if (sigVerify(ih.bodyBytes, ih.proofs[0], ij)) | |
1394 | + | let dZ = av | |
1395 | + | let gV = blake2b256(value(dZ.script)) | |
1396 | + | let gW = fromBase64String(value(getString(aD, ao()))) | |
1397 | + | let gX = scriptHash(this) | |
1398 | + | if (if ((gW == gV)) | |
1399 | + | then (gX != gV) | |
1400 | + | else false) | |
1775 | 1401 | then true | |
1776 | - | else { | |
1777 | - | let im = blake2b256(value(cC.script)) | |
1778 | - | let in = fromBase64String(value(getString(aQ, aC()))) | |
1779 | - | let io = scriptHash(this) | |
1780 | - | if ((in == im)) | |
1781 | - | then (io != im) | |
1782 | - | else false | |
1783 | - | } | |
1402 | + | else sigVerify(gO.bodyBytes, gO.proofs[0], gQ) | |
1784 | 1403 | } | |
1785 | - | else sigVerify( | |
1404 | + | else sigVerify(gO.bodyBytes, gO.proofs[0], gQ) | |
1786 | 1405 | } | |
1787 | 1406 |
github/deemru/w8io/169f3d6 353.27 ms ◑