tx · HoBkWVKfhCY6CT6o9pJa5Bh7BoXNyyzXueiTkoJ9xrXH 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT: -0.01400000 Waves 2022.03.05 11:38 [1950435] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves
{ "type": 13, "id": "HoBkWVKfhCY6CT6o9pJa5Bh7BoXNyyzXueiTkoJ9xrXH", "fee": 1400000, "feeAssetId": null, "timestamp": 1646469573559, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "2CTF7AEe8Z2be6BUTETD7w1zuzLHaZt2dwQeRaKLXQKdELMb4miowvgqEVKjMCnxzuiCL8ohFiQqYF4C9c6C7dzF" ], "script": "base64:AAIFAAAAAAAAAHMIAhIDCgEIEgMKAQgSABIECgIBBBIHCgUBAQEBBBIDCgEBEgASBwoFAQEBCAESBAoCAQESAwoBARIECgIICBIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIAAAASQAAAAAGc2NhbGU4AAAAAAAF9eEAAAAAAAxzY2FsZThCaWdJbnQJAAE2AAAAAQAAAAAABfXhAAAAAAAHc2NhbGUxOAkAATYAAAABAA3gtrOnZAAAAAAAAAp6ZXJvQmlnSW50CQABNgAAAAEAAAAAAAAAAAAAAAAACW9uZUJpZ0ludAkAATYAAAABAAAAAAAAAAABAAAAAApzbGlwcGFnZTRECQABNgAAAAEJAABlAAAAAgUAAAAGc2NhbGU4CQAAaQAAAAIJAABoAAAAAgUAAAAGc2NhbGU4AAAAAAAAAAABBQAAAAZzY2FsZTgAAAAABUFtdWx0AgAAAAMxMDAAAAAABURjb252AgAAAAExAAAAAANTRVACAAAAAl9fAAAAAAVFTVBUWQIAAAAAAAAAAApQb29sQWN0aXZlAAAAAAAAAAABAAAAAApQb29sUHV0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AABW9yZGVyAAAABnByb29mcwAAAAAAAAAAAQUAAAAHbXRjaFB1YgMDAwUAAAADb3JWBQAAAAVzbmRyVgcFAAAABW10Y2hWBwYJAQAAAAN0b2UAAAADBQAAAANvclYFAAAABXNuZHJWBQAAAAVtdGNoVgQAAAAPdGFyZ2V0UHVibGljS2V5BAAAAAckbWF0Y2gxCQEAAAABbQAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDECAAAACkJ5dGVWZWN0b3IEAAAAAnBrBQAAAAckbWF0Y2gxBQAAAAJwawMJAAABAAAAAgUAAAAHJG1hdGNoMQIAAAAEVW5pdAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAD3RhcmdldFB1YmxpY0tleVF8+x8=", "chainId": 84, "height": 1950435, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4MTC5ZxvRo4oqDpLsiALQX3ixB41kpBUAfJa7fTKxMP5 Next: H6HZXTixTucinKTV6qeUaDY6LuWug6aKXWXxURTf5AEY Diff:
Old | New | Differences | |
---|---|---|---|
53 | 53 | ||
54 | 54 | let idxFactGwxRewCntr = 10 | |
55 | 55 | ||
56 | - | func | |
56 | + | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
57 | 57 | ||
58 | 58 | ||
59 | - | func | |
59 | + | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
60 | 60 | ||
61 | 61 | ||
62 | - | func | |
62 | + | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func abs (val) = if ((zeroBigInt > val)) | |
67 | 67 | else val | |
68 | 68 | ||
69 | 69 | ||
70 | - | func | |
70 | + | func fc () = "%s__factoryContract" | |
71 | 71 | ||
72 | 72 | ||
73 | - | func | |
73 | + | func mpk () = "%s__managerPublicKey" | |
74 | 74 | ||
75 | 75 | ||
76 | - | func | |
76 | + | func pmpk () = "%s__pendingManagerPublicKey" | |
77 | 77 | ||
78 | 78 | ||
79 | - | func | |
79 | + | func pl () = "%s%s__price__last" | |
80 | 80 | ||
81 | 81 | ||
82 | - | func | |
82 | + | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
83 | 83 | ||
84 | 84 | ||
85 | - | func | |
85 | + | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
86 | 86 | ||
87 | 87 | ||
88 | - | func | |
88 | + | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
89 | 89 | ||
90 | 90 | ||
91 | - | func | |
91 | + | func aa () = "%s__amountAsset" | |
92 | 92 | ||
93 | 93 | ||
94 | - | func | |
94 | + | func pa () = "%s__priceAsset" | |
95 | 95 | ||
96 | 96 | ||
97 | - | func | |
97 | + | func amp () = "%s__amp" | |
98 | 98 | ||
99 | 99 | ||
100 | - | func | |
100 | + | func ada () = "%s__addonAddr" | |
101 | 101 | ||
102 | 102 | ||
103 | - | func | |
103 | + | func fcfg () = "%s__factoryConfig" | |
104 | 104 | ||
105 | 105 | ||
106 | - | func | |
106 | + | func mtpk () = "%s%s__matcher__publicKey" | |
107 | 107 | ||
108 | 108 | ||
109 | - | func | |
109 | + | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
110 | 110 | ||
111 | 111 | ||
112 | - | func | |
112 | + | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
113 | 113 | ||
114 | 114 | ||
115 | - | func | |
115 | + | func aps () = "%s__shutdown" | |
116 | 116 | ||
117 | 117 | ||
118 | - | func | |
118 | + | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
119 | 119 | ||
120 | 120 | ||
121 | - | func | |
121 | + | func str (val) = match val { | |
122 | 122 | case valStr: String => | |
123 | 123 | valStr | |
124 | 124 | case _ => | |
126 | 126 | } | |
127 | 127 | ||
128 | 128 | ||
129 | - | func | |
129 | + | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
130 | 130 | ||
131 | 131 | ||
132 | - | func | |
132 | + | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
133 | 133 | ||
134 | 134 | ||
135 | - | let | |
135 | + | let fca = addressFromStringValue(strf(this, fc())) | |
136 | 136 | ||
137 | - | let A = | |
137 | + | let A = strf(this, amp()) | |
138 | 138 | ||
139 | - | func | |
139 | + | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
140 | 140 | ||
141 | 141 | ||
142 | - | func | |
142 | + | func mp () = fromBase58String(strf(fca, mtpk())) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
146 | - | let amtAs = | |
147 | - | let priceAs = | |
148 | - | let iPriceAs = | |
149 | - | let iAmtAs = | |
150 | - | split( | |
145 | + | func gpc () = { | |
146 | + | let amtAs = strf(this, aa()) | |
147 | + | let priceAs = strf(this, pa()) | |
148 | + | let iPriceAs = intf(fca, mba(priceAs)) | |
149 | + | let iAmtAs = intf(fca, mba(amtAs)) | |
150 | + | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
151 | 151 | } | |
152 | 152 | ||
153 | 153 | ||
154 | - | func | |
154 | + | func gfc () = split(strf(fca, fcfg()), SEP) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP) | |
165 | 165 | else assetBalance(this, fromBase58String(assetId)) | |
166 | 166 | ||
167 | 167 | ||
168 | - | func | |
168 | + | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
169 | 169 | ||
170 | 170 | ||
171 | - | func | |
171 | + | func vad (A1,A2,slippage) = { | |
172 | 172 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
173 | 173 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
174 | 174 | if (!(pass)) | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | - | func | |
180 | + | func vd (D1,D0,slpg) = { | |
181 | 181 | let diff = fraction(D0, scale8BigInt, D1) | |
182 | 182 | let fail = (slpg > diff) | |
183 | 183 | if (if (fail) | |
188 | 188 | } | |
189 | 189 | ||
190 | 190 | ||
191 | - | func | |
192 | - | let amtAsAmtX18 = | |
193 | - | let prAsAmtX18 = | |
194 | - | | |
191 | + | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
192 | + | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
193 | + | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
194 | + | cpbi(prAsAmtX18, amtAsAmtX18) | |
195 | 195 | } | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
199 | - | let cfg = | |
199 | + | let cfg = gpc() | |
200 | 200 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
201 | 201 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
202 | - | let priceX18 = | |
203 | - | let amAmtX18 = | |
204 | - | let prAmtX18 = | |
205 | - | let lpAmtX18 = | |
206 | - | let lpPrInAmAsX18 = | |
207 | - | let lpPrInPrAsX18 = | |
202 | + | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
203 | + | let amAmtX18 = t1(amAmt, amtAsDcm) | |
204 | + | let prAmtX18 = t1(prAmt, prAsDcm) | |
205 | + | let lpAmtX18 = t1(lpAmt, scale8) | |
206 | + | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
207 | + | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
208 | 208 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
209 | 209 | } | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
213 | 213 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
214 | - | [ | |
214 | + | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
215 | 215 | } | |
216 | 216 | ||
217 | 217 | ||
218 | - | func | |
219 | - | let cfg = | |
218 | + | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
219 | + | let cfg = gpc() | |
220 | 220 | let lpId = cfg[idxLPAsId] | |
221 | 221 | let amId = cfg[idxAmAsId] | |
222 | 222 | let prId = cfg[idxPrAsId] | |
228 | 228 | then throw("Wrong pmt asset") | |
229 | 229 | else { | |
230 | 230 | let amBalance = getAccBalance(amId) | |
231 | - | let amBalanceX18 = | |
231 | + | let amBalanceX18 = t1(amBalance, amDcm) | |
232 | 232 | let prBalance = getAccBalance(prId) | |
233 | - | let prBalanceX18 = | |
234 | - | let curPriceX18 = | |
235 | - | let curPrice = | |
236 | - | let pmtLpAmtX18 = | |
237 | - | let lpEmissX18 = | |
233 | + | let prBalanceX18 = t1(prBalance, prDcm) | |
234 | + | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
235 | + | let curPrice = f1(curPriceX18, scale8) | |
236 | + | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
237 | + | let lpEmissX18 = t1(lpEmiss, scale8) | |
238 | 238 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
239 | 239 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
240 | - | let outAmAmt = | |
241 | - | let outPrAmt = | |
240 | + | let outAmAmt = f1(outAmAmtX18, amDcm) | |
241 | + | let outPrAmt = f1(outPrAmtX18, prDcm) | |
242 | 242 | let state = if ((txId58 == "")) | |
243 | 243 | then nil | |
244 | 244 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
245 | 245 | then unit | |
246 | 246 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
247 | 247 | then unit | |
248 | - | else fromBase58String(prId)), StringEntry( | |
248 | + | else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
249 | 249 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
250 | 250 | } | |
251 | 251 | } | |
252 | 252 | ||
253 | 253 | ||
254 | - | func | |
255 | - | let cfg = | |
254 | + | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,pmtAmt,pmtId) = { | |
255 | + | let cfg = gpc() | |
256 | 256 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
257 | 257 | let amIdStr = cfg[idxAmAsId] | |
258 | 258 | let prIdStr = cfg[idxPrAsId] | |
280 | 280 | else if (isOneAsset) | |
281 | 281 | then getAccBalance(prIdStr) | |
282 | 282 | else (getAccBalance(prIdStr) - inPrAmt) | |
283 | - | let inAmAssetAmtX18 = | |
284 | - | let inPrAssetAmtX18 = | |
285 | - | let userPriceX18 = | |
286 | - | let amBalanceX18 = | |
287 | - | let prBalanceX18 = | |
288 | - | let | |
283 | + | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
284 | + | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
285 | + | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
286 | + | let amBalanceX18 = t1(amBalance, amtDcm) | |
287 | + | let prBalanceX18 = t1(prBalance, priceDcm) | |
288 | + | let r = if ((lpEm == 0)) | |
289 | 289 | then { | |
290 | 290 | let curPriceX18 = zeroBigInt | |
291 | 291 | let slippageX18 = zeroBigInt | |
292 | 292 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
293 | - | $Tuple5( | |
293 | + | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
294 | 294 | } | |
295 | 295 | else { | |
296 | - | let curPriceX18 = | |
296 | + | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
297 | 297 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
298 | - | let slippageX18 = | |
298 | + | let slippageX18 = t1(slippage, scale8) | |
299 | 299 | if (if ((curPriceX18 != zeroBigInt)) | |
300 | 300 | then (slippageRealX18 > slippageX18) | |
301 | 301 | else false) | |
302 | 302 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
303 | 303 | else { | |
304 | - | let lpEmissionX18 = | |
304 | + | let lpEmissionX18 = t1(lpEm, scale8) | |
305 | 305 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
306 | 306 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
307 | 307 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
310 | 310 | let expAmtAssetAmtX18 = expectedAmts._1 | |
311 | 311 | let expPriceAssetAmtX18 = expectedAmts._2 | |
312 | 312 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
313 | - | $Tuple5( | |
313 | + | $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
314 | 314 | } | |
315 | 315 | } | |
316 | - | let calcLpAmt = | |
317 | - | let calcAmAssetPmt = | |
318 | - | let calcPrAssetPmt = | |
319 | - | let curPrice = | |
320 | - | let slippageCalc = | |
316 | + | let calcLpAmt = r._1 | |
317 | + | let calcAmAssetPmt = r._2 | |
318 | + | let calcPrAssetPmt = r._3 | |
319 | + | let curPrice = f1(r._4, scale8) | |
320 | + | let slippageCalc = f1(r._5, scale8) | |
321 | 321 | if ((0 >= calcLpAmt)) | |
322 | 322 | then throw("LP <= 0") | |
323 | 323 | else { | |
326 | 326 | else calcLpAmt | |
327 | 327 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
328 | 328 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
329 | - | let $ | |
329 | + | let $t01529615641 = if (if (isOneAsset) | |
330 | 330 | then (pmtId == amIdStr) | |
331 | 331 | else false) | |
332 | 332 | then $Tuple2(pmtAmt, 0) | |
335 | 335 | else false) | |
336 | 336 | then $Tuple2(0, pmtAmt) | |
337 | 337 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
338 | - | let writeAmAmt = $ | |
339 | - | let writePrAmt = $ | |
340 | - | let commonState = [IntegerEntry( | |
338 | + | let writeAmAmt = $t01529615641._1 | |
339 | + | let writePrAmt = $t01529615641._2 | |
340 | + | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
341 | 341 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
342 | 342 | } | |
343 | 343 | } | |
344 | 344 | ||
345 | 345 | ||
346 | - | func | |
347 | - | let cfg = | |
346 | + | func moa (order) = { | |
347 | + | let cfg = gpc() | |
348 | 348 | let amtAsId = cfg[idxAmAsId] | |
349 | 349 | let prAsId = cfg[idxPrAsId] | |
350 | 350 | let sts = parseIntValue(cfg[idxPoolSt]) | |
353 | 353 | let accAmtAsBalance = getAccBalance(amtAsId) | |
354 | 354 | let accPrAsBalance = getAccBalance(prAsId) | |
355 | 355 | let curPriceX18 = if ((order.orderType == Buy)) | |
356 | - | then | |
357 | - | else | |
358 | - | let curPrice = | |
359 | - | if (if (if ( | |
356 | + | then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance) | |
357 | + | else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance) | |
358 | + | let curPrice = f1(curPriceX18, scale8) | |
359 | + | if (if (if (igs()) | |
360 | 360 | then true | |
361 | 361 | else (sts == PoolMatcherDis)) | |
362 | 362 | then true | |
378 | 378 | else { | |
379 | 379 | let orderPrice = order.price | |
380 | 380 | let priceDcm = fraction(scale8, prAsDcm, amtAsDcm) | |
381 | - | let castOrderPrice = | |
381 | + | let castOrderPrice = ts(orderPrice, scale8, priceDcm) | |
382 | 382 | let isOrderPriceValid = if ((order.orderType == Buy)) | |
383 | 383 | then (curPrice >= castOrderPrice) | |
384 | 384 | else (castOrderPrice >= curPrice) | |
388 | 388 | } | |
389 | 389 | ||
390 | 390 | ||
391 | - | func | |
391 | + | func cg (i) = if ((size(i.payments) != 1)) | |
392 | 392 | then throw("1 pmnt exp") | |
393 | 393 | else { | |
394 | 394 | let pmt = value(i.payments[0]) | |
395 | 395 | let pmtAssetId = value(pmt.assetId) | |
396 | 396 | let pmtAmt = pmt.amount | |
397 | - | let | |
398 | - | let outAmAmt = | |
399 | - | let outPrAmt = | |
400 | - | let sts = parseIntValue( | |
401 | - | let state = | |
402 | - | if (if ( | |
397 | + | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
398 | + | let outAmAmt = r._1 | |
399 | + | let outPrAmt = r._2 | |
400 | + | let sts = parseIntValue(r._9) | |
401 | + | let state = r._10 | |
402 | + | if (if (igs()) | |
403 | 403 | then true | |
404 | 404 | else (sts == PoolShutdown)) | |
405 | 405 | then throw(("Admin blocked: " + toString(sts))) | |
407 | 407 | } | |
408 | 408 | ||
409 | 409 | ||
410 | - | func | |
411 | - | let r = | |
410 | + | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,pmtAmt,pmtId) = { | |
411 | + | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp, isOneAsset, pmtAmt, pmtId) | |
412 | 412 | let sts = parseIntValue(r._8) | |
413 | - | if (if (if ( | |
413 | + | if (if (if (igs()) | |
414 | 414 | then true | |
415 | 415 | else (sts == PoolPutDis)) | |
416 | 416 | then true | |
420 | 420 | } | |
421 | 421 | ||
422 | 422 | ||
423 | + | func m () = match getString(mpk()) { | |
424 | + | case s: String => | |
425 | + | fromBase58String(s) | |
426 | + | case _: Unit => | |
427 | + | unit | |
428 | + | case _ => | |
429 | + | throw("Match error") | |
430 | + | } | |
431 | + | ||
432 | + | ||
433 | + | func pm () = match getString(pmpk()) { | |
434 | + | case s: String => | |
435 | + | fromBase58String(s) | |
436 | + | case _: Unit => | |
437 | + | unit | |
438 | + | case _ => | |
439 | + | throw("Match error") | |
440 | + | } | |
441 | + | ||
442 | + | ||
443 | + | func mm (i) = { | |
444 | + | let pd = throw("Permission denied") | |
445 | + | match m() { | |
446 | + | case pk: ByteVector => | |
447 | + | if ((i.callerPublicKey == pk)) | |
448 | + | then true | |
449 | + | else pd | |
450 | + | case _: Unit => | |
451 | + | if ((i.caller == this)) | |
452 | + | then true | |
453 | + | else pd | |
454 | + | case _ => | |
455 | + | throw("Match error") | |
456 | + | } | |
457 | + | } | |
458 | + | ||
459 | + | ||
423 | 460 | @Callable(i) | |
424 | - | func constructor (factoryContract,managerPublicKey) = if ((i.caller != this)) | |
425 | - | then throw("denied") | |
426 | - | else [StringEntry(keyFactCntr(), factoryContract), StringEntry(keyManPubKey(), managerPublicKey)] | |
461 | + | func constructor (fc) = { | |
462 | + | let c = mm(i) | |
463 | + | if ((c == c)) | |
464 | + | then [StringEntry(fc(), fc)] | |
465 | + | else throw("Strict value is not equal to itself.") | |
466 | + | } | |
467 | + | ||
468 | + | ||
469 | + | ||
470 | + | @Callable(i) | |
471 | + | func setManager (pendingManagerPublicKey) = { | |
472 | + | let c = mm(i) | |
473 | + | if ((c == c)) | |
474 | + | then { | |
475 | + | let cm = fromBase58String(pendingManagerPublicKey) | |
476 | + | if ((cm == cm)) | |
477 | + | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
478 | + | else throw("Strict value is not equal to itself.") | |
479 | + | } | |
480 | + | else throw("Strict value is not equal to itself.") | |
481 | + | } | |
482 | + | ||
483 | + | ||
484 | + | ||
485 | + | @Callable(i) | |
486 | + | func confirmManager () = { | |
487 | + | let p = pm() | |
488 | + | let hpm = if (isDefined(p)) | |
489 | + | then true | |
490 | + | else throw("No pending manager") | |
491 | + | if ((hpm == hpm)) | |
492 | + | then { | |
493 | + | let cpm = if ((i.callerPublicKey == value(p))) | |
494 | + | then true | |
495 | + | else throw("You are not pending manager") | |
496 | + | if ((cpm == cpm)) | |
497 | + | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
498 | + | else throw("Strict value is not equal to itself.") | |
499 | + | } | |
500 | + | else throw("Strict value is not equal to itself.") | |
501 | + | } | |
427 | 502 | ||
428 | 503 | ||
429 | 504 | ||
430 | 505 | @Callable(i) | |
431 | 506 | func put (slip,autoStake) = { | |
432 | - | let factCfg = | |
507 | + | let factCfg = gfc() | |
433 | 508 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
434 | 509 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
435 | 510 | if ((0 > slip)) | |
437 | 512 | else if ((size(i.payments) != 2)) | |
438 | 513 | then throw("2 pmnts expd") | |
439 | 514 | else { | |
440 | - | let | |
441 | - | let emitLpAmt = | |
442 | - | let lpAssetId = | |
443 | - | let state = | |
444 | - | let amDiff = | |
445 | - | let prDiff = | |
446 | - | let amId = | |
447 | - | let prId = | |
448 | - | let | |
449 | - | if (( | |
515 | + | let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, 0, "") | |
516 | + | let emitLpAmt = e._2 | |
517 | + | let lpAssetId = e._7 | |
518 | + | let state = e._9 | |
519 | + | let amDiff = e._10 | |
520 | + | let prDiff = e._11 | |
521 | + | let amId = e._12 | |
522 | + | let prId = e._13 | |
523 | + | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
524 | + | if ((r == r)) | |
450 | 525 | then { | |
451 | - | let slippageAInv = if ((amDiff > 0)) | |
452 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
453 | - | else nil | |
454 | - | if ((slippageAInv == slippageAInv)) | |
526 | + | let el = match r { | |
527 | + | case legacy: Address => | |
528 | + | invoke(legacy, "emit", [emitLpAmt], nil) | |
529 | + | case _ => | |
530 | + | unit | |
531 | + | } | |
532 | + | if ((el == el)) | |
455 | 533 | then { | |
456 | - | let | |
457 | - | then invoke(slipCntr, "put", nil, [AttachedPayment( | |
534 | + | let sa = if ((amDiff > 0)) | |
535 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
458 | 536 | else nil | |
459 | - | if (( | |
537 | + | if ((sa == sa)) | |
460 | 538 | then { | |
461 | - | let lpTrnsfr = if (autoStake) | |
539 | + | let sp = if ((prDiff > 0)) | |
540 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
541 | + | else nil | |
542 | + | if ((sp == sp)) | |
462 | 543 | then { | |
463 | - | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
464 | - | if ((slpStakeInv == slpStakeInv)) | |
465 | - | then nil | |
466 | - | else throw("Strict value is not equal to itself.") | |
544 | + | let lpTrnsfr = if (autoStake) | |
545 | + | then { | |
546 | + | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
547 | + | if ((ss == ss)) | |
548 | + | then nil | |
549 | + | else throw("Strict value is not equal to itself.") | |
550 | + | } | |
551 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
552 | + | (state ++ lpTrnsfr) | |
467 | 553 | } | |
468 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
469 | - | (state ++ lpTrnsfr) | |
554 | + | else throw("Strict value is not equal to itself.") | |
470 | 555 | } | |
471 | 556 | else throw("Strict value is not equal to itself.") | |
472 | 557 | } | |
480 | 565 | ||
481 | 566 | @Callable(i) | |
482 | 567 | func putOneTkn (amAssetPart,prAssetPart,outLp,slippage,autoStake) = { | |
483 | - | let cfg = | |
568 | + | let cfg = gfc() | |
484 | 569 | let stakingCntr = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Wr st addr") | |
485 | 570 | let slipCntr = valueOrErrorMessage(addressFromString(cfg[idxFactSlippCntr]), "Wr sl addr") | |
486 | 571 | let gwxCntr = valueOrErrorMessage(addressFromString(cfg[idxFactGwxRewCntr]), "Wr gwx addr") | |
487 | - | let poolCfg = | |
572 | + | let poolCfg = gpc() | |
488 | 573 | let amId = poolCfg[idxAmAsId] | |
489 | 574 | let prId = poolCfg[idxPrAsId] | |
490 | 575 | let amDcm = parseIntValue(poolCfg[idxAmtAsDcm]) | |
512 | 597 | else { | |
513 | 598 | let amBalance = getAccBalance(amId) | |
514 | 599 | let prBalance = getAccBalance(prId) | |
515 | - | let $ | |
600 | + | let $t02418924569 = if ((pmtAssetId == amId)) | |
516 | 601 | then $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0) | |
517 | 602 | else if ((pmtAssetId == prId)) | |
518 | 603 | then $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart) | |
519 | 604 | else throw("wrong pmtAssetId") | |
520 | - | let amBalanceNow = $ | |
521 | - | let prBalanceNow = $ | |
522 | - | let virtSwapInAm = $ | |
523 | - | let virtSwapOutPr = $ | |
524 | - | let virtSwapInPr = $ | |
525 | - | let virtSwapOutAm = $ | |
605 | + | let amBalanceNow = $t02418924569._1 | |
606 | + | let prBalanceNow = $t02418924569._2 | |
607 | + | let virtSwapInAm = $t02418924569._3 | |
608 | + | let virtSwapOutPr = $t02418924569._4 | |
609 | + | let virtSwapInPr = $t02418924569._5 | |
610 | + | let virtSwapOutAm = $t02418924569._6 | |
526 | 611 | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
527 | 612 | let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil) | |
528 | - | let D0vsD1 = | |
613 | + | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
529 | 614 | if ((D0vsD1 == D0vsD1)) | |
530 | 615 | then { | |
531 | - | let estPut = | |
616 | + | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId) | |
532 | 617 | let estimLP = estPut._2 | |
533 | 618 | let lpAssetId = estPut._7 | |
534 | 619 | let state = estPut._9 | |
535 | 620 | let amDiff = estPut._10 | |
536 | 621 | let prDiff = estPut._11 | |
537 | - | let lpCalcRes = | |
622 | + | let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage)) | |
538 | 623 | let emitLpAmt = toInt(lpCalcRes._2) | |
539 | - | let | |
540 | - | if (( | |
624 | + | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
625 | + | if ((e == e)) | |
541 | 626 | then { | |
542 | - | let slippageAInv = if ((amDiff > 0)) | |
543 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
544 | - | else nil | |
545 | - | if ((slippageAInv == slippageAInv)) | |
627 | + | let el = match e { | |
628 | + | case legacy: Address => | |
629 | + | invoke(legacy, "emit", [emitLpAmt], nil) | |
630 | + | case _ => | |
631 | + | unit | |
632 | + | } | |
633 | + | if ((el == el)) | |
546 | 634 | then { | |
547 | - | let | |
548 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String( | |
635 | + | let sa = if ((amDiff > 0)) | |
636 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
549 | 637 | else nil | |
550 | - | if (( | |
638 | + | if ((sa == sa)) | |
551 | 639 | then { | |
552 | - | let lpTrnsfr = if (autoStake) | |
640 | + | let sp = if ((prDiff > 0)) | |
641 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
642 | + | else nil | |
643 | + | if ((sp == sp)) | |
553 | 644 | then { | |
554 | - | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
555 | - | if ((slpStakeInv == slpStakeInv)) | |
556 | - | then nil | |
557 | - | else throw("Strict value is not equal to itself.") | |
645 | + | let lpTrnsfr = if (autoStake) | |
646 | + | then { | |
647 | + | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
648 | + | if ((ss == ss)) | |
649 | + | then nil | |
650 | + | else throw("Strict value is not equal to itself.") | |
651 | + | } | |
652 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
653 | + | (state ++ lpTrnsfr) | |
558 | 654 | } | |
559 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
560 | - | (state ++ lpTrnsfr) | |
655 | + | else throw("Strict value is not equal to itself.") | |
561 | 656 | } | |
562 | 657 | else throw("Strict value is not equal to itself.") | |
563 | 658 | } | |
578 | 673 | else if ((size(i.payments) != 2)) | |
579 | 674 | then throw("2 pmnts expd") | |
580 | 675 | else { | |
581 | - | let estPut = | |
676 | + | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, 0, "") | |
582 | 677 | estPut._9 | |
583 | 678 | } | |
584 | 679 | ||
586 | 681 | ||
587 | 682 | @Callable(i) | |
588 | 683 | func get () = { | |
589 | - | let | |
590 | - | let outAmtAmt = | |
591 | - | let outPrAmt = | |
592 | - | let pmtAmt = | |
593 | - | let pmtAssetId = | |
594 | - | let state = | |
595 | - | let | |
596 | - | if (( | |
684 | + | let r = cg(i) | |
685 | + | let outAmtAmt = r._1 | |
686 | + | let outPrAmt = r._2 | |
687 | + | let pmtAmt = r._3 | |
688 | + | let pmtAssetId = r._4 | |
689 | + | let state = r._5 | |
690 | + | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
691 | + | if ((b == b)) | |
597 | 692 | then state | |
598 | 693 | else throw("Strict value is not equal to itself.") | |
599 | 694 | } | |
604 | 699 | func getOneTkn (exchResult,notUsed,outAmount,outAssetId,slippage) = if ((size(i.payments) != 1)) | |
605 | 700 | then throw("1 pmnt expd") | |
606 | 701 | else { | |
607 | - | let cfg = | |
702 | + | let cfg = gpc() | |
608 | 703 | let lpId = cfg[idxLPAsId] | |
609 | 704 | let amId = cfg[idxAmAsId] | |
610 | 705 | let prId = cfg[idxPrAsId] | |
611 | 706 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
612 | 707 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
613 | 708 | let sts = cfg[idxPoolSt] | |
614 | - | let | |
615 | - | let gwxCntr = valueOrErrorMessage(addressFromString( | |
709 | + | let factCfg = gfc() | |
710 | + | let gwxCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactGwxRewCntr]), "Wr sl addr") | |
616 | 711 | let pmt = value(i.payments[0]) | |
617 | - | let addon = valueOrElse(getString(this, | |
712 | + | let addon = valueOrElse(getString(this, ada()), "") | |
618 | 713 | let userAddress = if ((addon == toString(i.caller))) | |
619 | 714 | then i.originCaller | |
620 | 715 | else i.caller | |
632 | 727 | else if ((lpId != toBase58String(pmtAssetId))) | |
633 | 728 | then throw("Wrong LP") | |
634 | 729 | else { | |
635 | - | let r = | |
730 | + | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
636 | 731 | let estimAmAmt = r._1 | |
637 | 732 | let estimPrAmt = r._2 | |
638 | 733 | let amBalance = getAccBalance(amId) | |
639 | 734 | let prBalance = getAccBalance(prId) | |
640 | - | let $ | |
735 | + | let $t02934829805 = if ((outAssetId == amId)) | |
641 | 736 | then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult)) | |
642 | 737 | else if ((outAssetId == prId)) | |
643 | 738 | then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult)) | |
644 | 739 | else throw("wrong outAssetId") | |
645 | - | let amBalanceNow = $ | |
646 | - | let prBalanceNow = $ | |
647 | - | let virtSwapInAm = $ | |
648 | - | let virtSwapOutPr = $ | |
649 | - | let virtSwapInPr = $ | |
650 | - | let virtSwapOutAm = $ | |
651 | - | let totalGet = $ | |
740 | + | let amBalanceNow = $t02934829805._1 | |
741 | + | let prBalanceNow = $t02934829805._2 | |
742 | + | let virtSwapInAm = $t02934829805._3 | |
743 | + | let virtSwapOutPr = $t02934829805._4 | |
744 | + | let virtSwapInPr = $t02934829805._5 | |
745 | + | let virtSwapOutAm = $t02934829805._6 | |
746 | + | let totalGet = $t02934829805._7 | |
652 | 747 | if (if ((0 > virtSwapInAm)) | |
653 | 748 | then true | |
654 | 749 | else (0 > virtSwapInPr)) | |
656 | 751 | else { | |
657 | 752 | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
658 | 753 | let D1 = invoke(gwxCntr, "calcD", [toString(((amBalanceNow - virtSwapInAm) + virtSwapOutAm)), toString(((prBalanceNow + virtSwapOutPr) - virtSwapInPr)), A, Amult, Dconv], nil) | |
659 | - | let D0vsD1 = | |
754 | + | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
660 | 755 | if ((D0vsD1 == D0vsD1)) | |
661 | 756 | then { | |
662 | - | let finalRes = | |
757 | + | let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage)) | |
663 | 758 | if ((finalRes == finalRes)) | |
664 | 759 | then { | |
665 | - | let $ | |
760 | + | let $t03051030614 = if ((outAssetId == amId)) | |
666 | 761 | then $Tuple2(toInt(finalRes._2), 0) | |
667 | 762 | else $Tuple2(0, toInt(finalRes._2)) | |
668 | - | let outAm = $ | |
669 | - | let outPr = $ | |
670 | - | let curPrX18 = | |
671 | - | let curPr = | |
763 | + | let outAm = $t03051030614._1 | |
764 | + | let outPr = $t03051030614._2 | |
765 | + | let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm)) | |
766 | + | let curPr = f1(curPrX18, scale8) | |
672 | 767 | let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES")) | |
673 | 768 | then unit | |
674 | - | else fromBase58String(outAssetId)), StringEntry( | |
769 | + | else fromBase58String(outAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] | |
675 | 770 | if ((state == state)) | |
676 | 771 | then { | |
677 | - | let burn = invoke( | |
772 | + | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
678 | 773 | if ((burn == burn)) | |
679 | 774 | then state | |
680 | 775 | else throw("Strict value is not equal to itself.") | |
692 | 787 | ||
693 | 788 | @Callable(i) | |
694 | 789 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
695 | - | let | |
696 | - | let outAmAmt = | |
697 | - | let outPrAmt = | |
698 | - | let pmtAmt = | |
699 | - | let pmtAssetId = | |
700 | - | let state = | |
790 | + | let r = cg(i) | |
791 | + | let outAmAmt = r._1 | |
792 | + | let outPrAmt = r._2 | |
793 | + | let pmtAmt = r._3 | |
794 | + | let pmtAssetId = r._4 | |
795 | + | let state = r._5 | |
701 | 796 | if ((noLessThenAmtAsset > outAmAmt)) | |
702 | 797 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
703 | 798 | else if ((noLessThenPriceAsset > outPrAmt)) | |
704 | 799 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
705 | 800 | else { | |
706 | - | let burnLPAssetOnFactory = invoke( | |
801 | + | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
707 | 802 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
708 | 803 | then state | |
709 | 804 | else throw("Strict value is not equal to itself.") | |
719 | 814 | else true | |
720 | 815 | if ((checkPayments == checkPayments)) | |
721 | 816 | then { | |
722 | - | let cfg = | |
723 | - | let factoryCfg = | |
817 | + | let cfg = gpc() | |
818 | + | let factoryCfg = gfc() | |
724 | 819 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
725 | 820 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
726 | 821 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
727 | 822 | if ((unstakeInv == unstakeInv)) | |
728 | 823 | then { | |
729 | - | let r = | |
824 | + | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
730 | 825 | let sts = parseIntValue(r._9) | |
731 | 826 | let state = r._10 | |
732 | - | let v = if (if ( | |
827 | + | let v = if (if (igs()) | |
733 | 828 | then true | |
734 | 829 | else (sts == PoolShutdown)) | |
735 | 830 | then throw(("Blocked: " + toString(sts))) | |
736 | 831 | else true | |
737 | 832 | if ((v == v)) | |
738 | 833 | then { | |
739 | - | let burnA = invoke( | |
834 | + | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
740 | 835 | if ((burnA == burnA)) | |
741 | 836 | then state | |
742 | 837 | else throw("Strict value is not equal to itself.") | |
751 | 846 | ||
752 | 847 | ||
753 | 848 | @Callable(i) | |
754 | - | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString( | |
849 | + | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
755 | 850 | then throw("denied") | |
756 | - | else $Tuple2([StringEntry( | |
851 | + | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
757 | 852 | ||
758 | 853 | ||
759 | 854 | ||
760 | 855 | @Callable(i) | |
761 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, | |
856 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
762 | 857 | ||
763 | 858 | ||
764 | 859 | ||
776 | 871 | ||
777 | 872 | ||
778 | 873 | @Callable(i) | |
779 | - | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, | |
874 | + | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
780 | 875 | ||
781 | 876 | ||
782 | 877 | ||
783 | 878 | @Callable(i) | |
784 | - | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString( | |
879 | + | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
785 | 880 | ||
786 | 881 | ||
787 | 882 | ||
788 | 883 | @Callable(i) | |
789 | - | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString( | |
884 | + | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
790 | 885 | ||
791 | 886 | ||
792 | 887 | ||
793 | 888 | @Callable(i) | |
794 | - | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, | |
889 | + | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, false, 0, "")) | |
795 | 890 | ||
796 | 891 | ||
797 | 892 | ||
798 | 893 | @Callable(i) | |
799 | 894 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
800 | - | let | |
801 | - | $Tuple2(nil, $Tuple10( | |
895 | + | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
896 | + | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
802 | 897 | } | |
803 | 898 | ||
804 | 899 | ||
805 | 900 | @Verifier(tx) | |
806 | 901 | func verify () = match tx { | |
807 | 902 | case order: Order => | |
808 | - | let mtchPub = | |
809 | - | let orV = | |
903 | + | let mtchPub = mp() | |
904 | + | let orV = moa(order) | |
810 | 905 | let sndrV = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
811 | 906 | let mtchV = sigVerify(order.bodyBytes, order.proofs[1], mtchPub) | |
812 | 907 | if (if (if (orV) | |
815 | 910 | then mtchV | |
816 | 911 | else false) | |
817 | 912 | then true | |
818 | - | else | |
913 | + | else toe(orV, sndrV, mtchV) | |
819 | 914 | case _ => | |
820 | - | let admin = valueOrElse(getString(this, keyManPubKey()), EMPTY) | |
821 | - | if ((admin == EMPTY)) | |
822 | - | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
823 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(admin)) | |
915 | + | let targetPublicKey = match m() { | |
916 | + | case pk: ByteVector => | |
917 | + | pk | |
918 | + | case _: Unit => | |
919 | + | tx.senderPublicKey | |
920 | + | case _ => | |
921 | + | throw("Match error") | |
922 | + | } | |
923 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
824 | 924 | } | |
825 | 925 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let scale8 = 100000000 | |
5 | 5 | ||
6 | 6 | let scale8BigInt = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | let scale18 = toBigInt(1000000000000000000) | |
9 | 9 | ||
10 | 10 | let zeroBigInt = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let oneBigInt = toBigInt(1) | |
13 | 13 | ||
14 | 14 | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
15 | 15 | ||
16 | 16 | let Amult = "100" | |
17 | 17 | ||
18 | 18 | let Dconv = "1" | |
19 | 19 | ||
20 | 20 | let SEP = "__" | |
21 | 21 | ||
22 | 22 | let EMPTY = "" | |
23 | 23 | ||
24 | 24 | let PoolActive = 1 | |
25 | 25 | ||
26 | 26 | let PoolPutDis = 2 | |
27 | 27 | ||
28 | 28 | let PoolMatcherDis = 3 | |
29 | 29 | ||
30 | 30 | let PoolShutdown = 4 | |
31 | 31 | ||
32 | 32 | let idxPoolAddress = 1 | |
33 | 33 | ||
34 | 34 | let idxPoolSt = 2 | |
35 | 35 | ||
36 | 36 | let idxLPAsId = 3 | |
37 | 37 | ||
38 | 38 | let idxAmAsId = 4 | |
39 | 39 | ||
40 | 40 | let idxPrAsId = 5 | |
41 | 41 | ||
42 | 42 | let idxAmtAsDcm = 6 | |
43 | 43 | ||
44 | 44 | let idxPriceAsDcm = 7 | |
45 | 45 | ||
46 | 46 | let idxIAmtAsId = 8 | |
47 | 47 | ||
48 | 48 | let idxIPriceAsId = 9 | |
49 | 49 | ||
50 | 50 | let idxFactStakCntr = 1 | |
51 | 51 | ||
52 | 52 | let idxFactSlippCntr = 7 | |
53 | 53 | ||
54 | 54 | let idxFactGwxRewCntr = 10 | |
55 | 55 | ||
56 | - | func | |
56 | + | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
57 | 57 | ||
58 | 58 | ||
59 | - | func | |
59 | + | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
60 | 60 | ||
61 | 61 | ||
62 | - | func | |
62 | + | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func abs (val) = if ((zeroBigInt > val)) | |
66 | 66 | then -(val) | |
67 | 67 | else val | |
68 | 68 | ||
69 | 69 | ||
70 | - | func | |
70 | + | func fc () = "%s__factoryContract" | |
71 | 71 | ||
72 | 72 | ||
73 | - | func | |
73 | + | func mpk () = "%s__managerPublicKey" | |
74 | 74 | ||
75 | 75 | ||
76 | - | func | |
76 | + | func pmpk () = "%s__pendingManagerPublicKey" | |
77 | 77 | ||
78 | 78 | ||
79 | - | func | |
79 | + | func pl () = "%s%s__price__last" | |
80 | 80 | ||
81 | 81 | ||
82 | - | func | |
82 | + | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
83 | 83 | ||
84 | 84 | ||
85 | - | func | |
85 | + | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
86 | 86 | ||
87 | 87 | ||
88 | - | func | |
88 | + | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
89 | 89 | ||
90 | 90 | ||
91 | - | func | |
91 | + | func aa () = "%s__amountAsset" | |
92 | 92 | ||
93 | 93 | ||
94 | - | func | |
94 | + | func pa () = "%s__priceAsset" | |
95 | 95 | ||
96 | 96 | ||
97 | - | func | |
97 | + | func amp () = "%s__amp" | |
98 | 98 | ||
99 | 99 | ||
100 | - | func | |
100 | + | func ada () = "%s__addonAddr" | |
101 | 101 | ||
102 | 102 | ||
103 | - | func | |
103 | + | func fcfg () = "%s__factoryConfig" | |
104 | 104 | ||
105 | 105 | ||
106 | - | func | |
106 | + | func mtpk () = "%s%s__matcher__publicKey" | |
107 | 107 | ||
108 | 108 | ||
109 | - | func | |
109 | + | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
110 | 110 | ||
111 | 111 | ||
112 | - | func | |
112 | + | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
113 | 113 | ||
114 | 114 | ||
115 | - | func | |
115 | + | func aps () = "%s__shutdown" | |
116 | 116 | ||
117 | 117 | ||
118 | - | func | |
118 | + | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
119 | 119 | ||
120 | 120 | ||
121 | - | func | |
121 | + | func str (val) = match val { | |
122 | 122 | case valStr: String => | |
123 | 123 | valStr | |
124 | 124 | case _ => | |
125 | 125 | throw("fail cast to String") | |
126 | 126 | } | |
127 | 127 | ||
128 | 128 | ||
129 | - | func | |
129 | + | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
130 | 130 | ||
131 | 131 | ||
132 | - | func | |
132 | + | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
133 | 133 | ||
134 | 134 | ||
135 | - | let | |
135 | + | let fca = addressFromStringValue(strf(this, fc())) | |
136 | 136 | ||
137 | - | let A = | |
137 | + | let A = strf(this, amp()) | |
138 | 138 | ||
139 | - | func | |
139 | + | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
140 | 140 | ||
141 | 141 | ||
142 | - | func | |
142 | + | func mp () = fromBase58String(strf(fca, mtpk())) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
146 | - | let amtAs = | |
147 | - | let priceAs = | |
148 | - | let iPriceAs = | |
149 | - | let iAmtAs = | |
150 | - | split( | |
145 | + | func gpc () = { | |
146 | + | let amtAs = strf(this, aa()) | |
147 | + | let priceAs = strf(this, pa()) | |
148 | + | let iPriceAs = intf(fca, mba(priceAs)) | |
149 | + | let iAmtAs = intf(fca, mba(amtAs)) | |
150 | + | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
151 | 151 | } | |
152 | 152 | ||
153 | 153 | ||
154 | - | func | |
154 | + | func gfc () = split(strf(fca, fcfg()), SEP) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
164 | 164 | then wavesBalance(this).available | |
165 | 165 | else assetBalance(this, fromBase58String(assetId)) | |
166 | 166 | ||
167 | 167 | ||
168 | - | func | |
168 | + | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
169 | 169 | ||
170 | 170 | ||
171 | - | func | |
171 | + | func vad (A1,A2,slippage) = { | |
172 | 172 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
173 | 173 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
174 | 174 | if (!(pass)) | |
175 | 175 | then throw(("Big slpg: " + toString(diff))) | |
176 | 176 | else $Tuple2(pass, min([A1, A2])) | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | - | func | |
180 | + | func vd (D1,D0,slpg) = { | |
181 | 181 | let diff = fraction(D0, scale8BigInt, D1) | |
182 | 182 | let fail = (slpg > diff) | |
183 | 183 | if (if (fail) | |
184 | 184 | then true | |
185 | 185 | else (D0 > D1)) | |
186 | 186 | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
187 | 187 | else fail | |
188 | 188 | } | |
189 | 189 | ||
190 | 190 | ||
191 | - | func | |
192 | - | let amtAsAmtX18 = | |
193 | - | let prAsAmtX18 = | |
194 | - | | |
191 | + | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
192 | + | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
193 | + | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
194 | + | cpbi(prAsAmtX18, amtAsAmtX18) | |
195 | 195 | } | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
199 | - | let cfg = | |
199 | + | let cfg = gpc() | |
200 | 200 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
201 | 201 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
202 | - | let priceX18 = | |
203 | - | let amAmtX18 = | |
204 | - | let prAmtX18 = | |
205 | - | let lpAmtX18 = | |
206 | - | let lpPrInAmAsX18 = | |
207 | - | let lpPrInPrAsX18 = | |
202 | + | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
203 | + | let amAmtX18 = t1(amAmt, amtAsDcm) | |
204 | + | let prAmtX18 = t1(prAmt, prAsDcm) | |
205 | + | let lpAmtX18 = t1(lpAmt, scale8) | |
206 | + | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
207 | + | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
208 | 208 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
209 | 209 | } | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
213 | 213 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
214 | - | [ | |
214 | + | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
215 | 215 | } | |
216 | 216 | ||
217 | 217 | ||
218 | - | func | |
219 | - | let cfg = | |
218 | + | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
219 | + | let cfg = gpc() | |
220 | 220 | let lpId = cfg[idxLPAsId] | |
221 | 221 | let amId = cfg[idxAmAsId] | |
222 | 222 | let prId = cfg[idxPrAsId] | |
223 | 223 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
224 | 224 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
225 | 225 | let sts = cfg[idxPoolSt] | |
226 | 226 | let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity | |
227 | 227 | if ((lpId != pmtAssetId)) | |
228 | 228 | then throw("Wrong pmt asset") | |
229 | 229 | else { | |
230 | 230 | let amBalance = getAccBalance(amId) | |
231 | - | let amBalanceX18 = | |
231 | + | let amBalanceX18 = t1(amBalance, amDcm) | |
232 | 232 | let prBalance = getAccBalance(prId) | |
233 | - | let prBalanceX18 = | |
234 | - | let curPriceX18 = | |
235 | - | let curPrice = | |
236 | - | let pmtLpAmtX18 = | |
237 | - | let lpEmissX18 = | |
233 | + | let prBalanceX18 = t1(prBalance, prDcm) | |
234 | + | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
235 | + | let curPrice = f1(curPriceX18, scale8) | |
236 | + | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
237 | + | let lpEmissX18 = t1(lpEmiss, scale8) | |
238 | 238 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
239 | 239 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
240 | - | let outAmAmt = | |
241 | - | let outPrAmt = | |
240 | + | let outAmAmt = f1(outAmAmtX18, amDcm) | |
241 | + | let outPrAmt = f1(outPrAmtX18, prDcm) | |
242 | 242 | let state = if ((txId58 == "")) | |
243 | 243 | then nil | |
244 | 244 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
245 | 245 | then unit | |
246 | 246 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
247 | 247 | then unit | |
248 | - | else fromBase58String(prId)), StringEntry( | |
248 | + | else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
249 | 249 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
250 | 250 | } | |
251 | 251 | } | |
252 | 252 | ||
253 | 253 | ||
254 | - | func | |
255 | - | let cfg = | |
254 | + | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,pmtAmt,pmtId) = { | |
255 | + | let cfg = gpc() | |
256 | 256 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
257 | 257 | let amIdStr = cfg[idxAmAsId] | |
258 | 258 | let prIdStr = cfg[idxPrAsId] | |
259 | 259 | let inAmIdStr = cfg[idxIAmtAsId] | |
260 | 260 | let inPrIdStr = cfg[idxIPriceAsId] | |
261 | 261 | let amtDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
262 | 262 | let priceDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
263 | 263 | let sts = cfg[idxPoolSt] | |
264 | 264 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
265 | 265 | let amBalance = if (isEval) | |
266 | 266 | then getAccBalance(amIdStr) | |
267 | 267 | else if (if (isOneAsset) | |
268 | 268 | then (pmtId == amIdStr) | |
269 | 269 | else false) | |
270 | 270 | then (getAccBalance(amIdStr) - pmtAmt) | |
271 | 271 | else if (isOneAsset) | |
272 | 272 | then getAccBalance(amIdStr) | |
273 | 273 | else (getAccBalance(amIdStr) - inAmAmt) | |
274 | 274 | let prBalance = if (isEval) | |
275 | 275 | then getAccBalance(prIdStr) | |
276 | 276 | else if (if (isOneAsset) | |
277 | 277 | then (pmtId == prIdStr) | |
278 | 278 | else false) | |
279 | 279 | then (getAccBalance(prIdStr) - pmtAmt) | |
280 | 280 | else if (isOneAsset) | |
281 | 281 | then getAccBalance(prIdStr) | |
282 | 282 | else (getAccBalance(prIdStr) - inPrAmt) | |
283 | - | let inAmAssetAmtX18 = | |
284 | - | let inPrAssetAmtX18 = | |
285 | - | let userPriceX18 = | |
286 | - | let amBalanceX18 = | |
287 | - | let prBalanceX18 = | |
288 | - | let | |
283 | + | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
284 | + | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
285 | + | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
286 | + | let amBalanceX18 = t1(amBalance, amtDcm) | |
287 | + | let prBalanceX18 = t1(prBalance, priceDcm) | |
288 | + | let r = if ((lpEm == 0)) | |
289 | 289 | then { | |
290 | 290 | let curPriceX18 = zeroBigInt | |
291 | 291 | let slippageX18 = zeroBigInt | |
292 | 292 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
293 | - | $Tuple5( | |
293 | + | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
294 | 294 | } | |
295 | 295 | else { | |
296 | - | let curPriceX18 = | |
296 | + | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
297 | 297 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
298 | - | let slippageX18 = | |
298 | + | let slippageX18 = t1(slippage, scale8) | |
299 | 299 | if (if ((curPriceX18 != zeroBigInt)) | |
300 | 300 | then (slippageRealX18 > slippageX18) | |
301 | 301 | else false) | |
302 | 302 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
303 | 303 | else { | |
304 | - | let lpEmissionX18 = | |
304 | + | let lpEmissionX18 = t1(lpEm, scale8) | |
305 | 305 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
306 | 306 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
307 | 307 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
308 | 308 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
309 | 309 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
310 | 310 | let expAmtAssetAmtX18 = expectedAmts._1 | |
311 | 311 | let expPriceAssetAmtX18 = expectedAmts._2 | |
312 | 312 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
313 | - | $Tuple5( | |
313 | + | $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
314 | 314 | } | |
315 | 315 | } | |
316 | - | let calcLpAmt = | |
317 | - | let calcAmAssetPmt = | |
318 | - | let calcPrAssetPmt = | |
319 | - | let curPrice = | |
320 | - | let slippageCalc = | |
316 | + | let calcLpAmt = r._1 | |
317 | + | let calcAmAssetPmt = r._2 | |
318 | + | let calcPrAssetPmt = r._3 | |
319 | + | let curPrice = f1(r._4, scale8) | |
320 | + | let slippageCalc = f1(r._5, scale8) | |
321 | 321 | if ((0 >= calcLpAmt)) | |
322 | 322 | then throw("LP <= 0") | |
323 | 323 | else { | |
324 | 324 | let emitLpAmt = if (!(emitLp)) | |
325 | 325 | then 0 | |
326 | 326 | else calcLpAmt | |
327 | 327 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
328 | 328 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
329 | - | let $ | |
329 | + | let $t01529615641 = if (if (isOneAsset) | |
330 | 330 | then (pmtId == amIdStr) | |
331 | 331 | else false) | |
332 | 332 | then $Tuple2(pmtAmt, 0) | |
333 | 333 | else if (if (isOneAsset) | |
334 | 334 | then (pmtId == prIdStr) | |
335 | 335 | else false) | |
336 | 336 | then $Tuple2(0, pmtAmt) | |
337 | 337 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
338 | - | let writeAmAmt = $ | |
339 | - | let writePrAmt = $ | |
340 | - | let commonState = [IntegerEntry( | |
338 | + | let writeAmAmt = $t01529615641._1 | |
339 | + | let writePrAmt = $t01529615641._2 | |
340 | + | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
341 | 341 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
342 | 342 | } | |
343 | 343 | } | |
344 | 344 | ||
345 | 345 | ||
346 | - | func | |
347 | - | let cfg = | |
346 | + | func moa (order) = { | |
347 | + | let cfg = gpc() | |
348 | 348 | let amtAsId = cfg[idxAmAsId] | |
349 | 349 | let prAsId = cfg[idxPrAsId] | |
350 | 350 | let sts = parseIntValue(cfg[idxPoolSt]) | |
351 | 351 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
352 | 352 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
353 | 353 | let accAmtAsBalance = getAccBalance(amtAsId) | |
354 | 354 | let accPrAsBalance = getAccBalance(prAsId) | |
355 | 355 | let curPriceX18 = if ((order.orderType == Buy)) | |
356 | - | then | |
357 | - | else | |
358 | - | let curPrice = | |
359 | - | if (if (if ( | |
356 | + | then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance) | |
357 | + | else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance) | |
358 | + | let curPrice = f1(curPriceX18, scale8) | |
359 | + | if (if (if (igs()) | |
360 | 360 | then true | |
361 | 361 | else (sts == PoolMatcherDis)) | |
362 | 362 | then true | |
363 | 363 | else (sts == PoolShutdown)) | |
364 | 364 | then throw("Admin blocked") | |
365 | 365 | else { | |
366 | 366 | let orAmtAsset = order.assetPair.amountAsset | |
367 | 367 | let orAmtAsStr = if ((orAmtAsset == unit)) | |
368 | 368 | then "WAVES" | |
369 | 369 | else toBase58String(value(orAmtAsset)) | |
370 | 370 | let orPrAsset = order.assetPair.priceAsset | |
371 | 371 | let orPrAsStr = if ((orPrAsset == unit)) | |
372 | 372 | then "WAVES" | |
373 | 373 | else toBase58String(value(orPrAsset)) | |
374 | 374 | if (if ((orAmtAsStr != amtAsId)) | |
375 | 375 | then true | |
376 | 376 | else (orPrAsStr != prAsId)) | |
377 | 377 | then throw("Wr assets") | |
378 | 378 | else { | |
379 | 379 | let orderPrice = order.price | |
380 | 380 | let priceDcm = fraction(scale8, prAsDcm, amtAsDcm) | |
381 | - | let castOrderPrice = | |
381 | + | let castOrderPrice = ts(orderPrice, scale8, priceDcm) | |
382 | 382 | let isOrderPriceValid = if ((order.orderType == Buy)) | |
383 | 383 | then (curPrice >= castOrderPrice) | |
384 | 384 | else (castOrderPrice >= curPrice) | |
385 | 385 | true | |
386 | 386 | } | |
387 | 387 | } | |
388 | 388 | } | |
389 | 389 | ||
390 | 390 | ||
391 | - | func | |
391 | + | func cg (i) = if ((size(i.payments) != 1)) | |
392 | 392 | then throw("1 pmnt exp") | |
393 | 393 | else { | |
394 | 394 | let pmt = value(i.payments[0]) | |
395 | 395 | let pmtAssetId = value(pmt.assetId) | |
396 | 396 | let pmtAmt = pmt.amount | |
397 | - | let | |
398 | - | let outAmAmt = | |
399 | - | let outPrAmt = | |
400 | - | let sts = parseIntValue( | |
401 | - | let state = | |
402 | - | if (if ( | |
397 | + | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
398 | + | let outAmAmt = r._1 | |
399 | + | let outPrAmt = r._2 | |
400 | + | let sts = parseIntValue(r._9) | |
401 | + | let state = r._10 | |
402 | + | if (if (igs()) | |
403 | 403 | then true | |
404 | 404 | else (sts == PoolShutdown)) | |
405 | 405 | then throw(("Admin blocked: " + toString(sts))) | |
406 | 406 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
407 | 407 | } | |
408 | 408 | ||
409 | 409 | ||
410 | - | func | |
411 | - | let r = | |
410 | + | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,pmtAmt,pmtId) = { | |
411 | + | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp, isOneAsset, pmtAmt, pmtId) | |
412 | 412 | let sts = parseIntValue(r._8) | |
413 | - | if (if (if ( | |
413 | + | if (if (if (igs()) | |
414 | 414 | then true | |
415 | 415 | else (sts == PoolPutDis)) | |
416 | 416 | then true | |
417 | 417 | else (sts == PoolShutdown)) | |
418 | 418 | then throw(("Blocked:" + toString(sts))) | |
419 | 419 | else r | |
420 | 420 | } | |
421 | 421 | ||
422 | 422 | ||
423 | + | func m () = match getString(mpk()) { | |
424 | + | case s: String => | |
425 | + | fromBase58String(s) | |
426 | + | case _: Unit => | |
427 | + | unit | |
428 | + | case _ => | |
429 | + | throw("Match error") | |
430 | + | } | |
431 | + | ||
432 | + | ||
433 | + | func pm () = match getString(pmpk()) { | |
434 | + | case s: String => | |
435 | + | fromBase58String(s) | |
436 | + | case _: Unit => | |
437 | + | unit | |
438 | + | case _ => | |
439 | + | throw("Match error") | |
440 | + | } | |
441 | + | ||
442 | + | ||
443 | + | func mm (i) = { | |
444 | + | let pd = throw("Permission denied") | |
445 | + | match m() { | |
446 | + | case pk: ByteVector => | |
447 | + | if ((i.callerPublicKey == pk)) | |
448 | + | then true | |
449 | + | else pd | |
450 | + | case _: Unit => | |
451 | + | if ((i.caller == this)) | |
452 | + | then true | |
453 | + | else pd | |
454 | + | case _ => | |
455 | + | throw("Match error") | |
456 | + | } | |
457 | + | } | |
458 | + | ||
459 | + | ||
423 | 460 | @Callable(i) | |
424 | - | func constructor (factoryContract,managerPublicKey) = if ((i.caller != this)) | |
425 | - | then throw("denied") | |
426 | - | else [StringEntry(keyFactCntr(), factoryContract), StringEntry(keyManPubKey(), managerPublicKey)] | |
461 | + | func constructor (fc) = { | |
462 | + | let c = mm(i) | |
463 | + | if ((c == c)) | |
464 | + | then [StringEntry(fc(), fc)] | |
465 | + | else throw("Strict value is not equal to itself.") | |
466 | + | } | |
467 | + | ||
468 | + | ||
469 | + | ||
470 | + | @Callable(i) | |
471 | + | func setManager (pendingManagerPublicKey) = { | |
472 | + | let c = mm(i) | |
473 | + | if ((c == c)) | |
474 | + | then { | |
475 | + | let cm = fromBase58String(pendingManagerPublicKey) | |
476 | + | if ((cm == cm)) | |
477 | + | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
478 | + | else throw("Strict value is not equal to itself.") | |
479 | + | } | |
480 | + | else throw("Strict value is not equal to itself.") | |
481 | + | } | |
482 | + | ||
483 | + | ||
484 | + | ||
485 | + | @Callable(i) | |
486 | + | func confirmManager () = { | |
487 | + | let p = pm() | |
488 | + | let hpm = if (isDefined(p)) | |
489 | + | then true | |
490 | + | else throw("No pending manager") | |
491 | + | if ((hpm == hpm)) | |
492 | + | then { | |
493 | + | let cpm = if ((i.callerPublicKey == value(p))) | |
494 | + | then true | |
495 | + | else throw("You are not pending manager") | |
496 | + | if ((cpm == cpm)) | |
497 | + | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
498 | + | else throw("Strict value is not equal to itself.") | |
499 | + | } | |
500 | + | else throw("Strict value is not equal to itself.") | |
501 | + | } | |
427 | 502 | ||
428 | 503 | ||
429 | 504 | ||
430 | 505 | @Callable(i) | |
431 | 506 | func put (slip,autoStake) = { | |
432 | - | let factCfg = | |
507 | + | let factCfg = gfc() | |
433 | 508 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
434 | 509 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
435 | 510 | if ((0 > slip)) | |
436 | 511 | then throw("Wrong slippage") | |
437 | 512 | else if ((size(i.payments) != 2)) | |
438 | 513 | then throw("2 pmnts expd") | |
439 | 514 | else { | |
440 | - | let | |
441 | - | let emitLpAmt = | |
442 | - | let lpAssetId = | |
443 | - | let state = | |
444 | - | let amDiff = | |
445 | - | let prDiff = | |
446 | - | let amId = | |
447 | - | let prId = | |
448 | - | let | |
449 | - | if (( | |
515 | + | let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, 0, "") | |
516 | + | let emitLpAmt = e._2 | |
517 | + | let lpAssetId = e._7 | |
518 | + | let state = e._9 | |
519 | + | let amDiff = e._10 | |
520 | + | let prDiff = e._11 | |
521 | + | let amId = e._12 | |
522 | + | let prId = e._13 | |
523 | + | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
524 | + | if ((r == r)) | |
450 | 525 | then { | |
451 | - | let slippageAInv = if ((amDiff > 0)) | |
452 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
453 | - | else nil | |
454 | - | if ((slippageAInv == slippageAInv)) | |
526 | + | let el = match r { | |
527 | + | case legacy: Address => | |
528 | + | invoke(legacy, "emit", [emitLpAmt], nil) | |
529 | + | case _ => | |
530 | + | unit | |
531 | + | } | |
532 | + | if ((el == el)) | |
455 | 533 | then { | |
456 | - | let | |
457 | - | then invoke(slipCntr, "put", nil, [AttachedPayment( | |
534 | + | let sa = if ((amDiff > 0)) | |
535 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
458 | 536 | else nil | |
459 | - | if (( | |
537 | + | if ((sa == sa)) | |
460 | 538 | then { | |
461 | - | let lpTrnsfr = if (autoStake) | |
539 | + | let sp = if ((prDiff > 0)) | |
540 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
541 | + | else nil | |
542 | + | if ((sp == sp)) | |
462 | 543 | then { | |
463 | - | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
464 | - | if ((slpStakeInv == slpStakeInv)) | |
465 | - | then nil | |
466 | - | else throw("Strict value is not equal to itself.") | |
544 | + | let lpTrnsfr = if (autoStake) | |
545 | + | then { | |
546 | + | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
547 | + | if ((ss == ss)) | |
548 | + | then nil | |
549 | + | else throw("Strict value is not equal to itself.") | |
550 | + | } | |
551 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
552 | + | (state ++ lpTrnsfr) | |
467 | 553 | } | |
468 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
469 | - | (state ++ lpTrnsfr) | |
554 | + | else throw("Strict value is not equal to itself.") | |
470 | 555 | } | |
471 | 556 | else throw("Strict value is not equal to itself.") | |
472 | 557 | } | |
473 | 558 | else throw("Strict value is not equal to itself.") | |
474 | 559 | } | |
475 | 560 | else throw("Strict value is not equal to itself.") | |
476 | 561 | } | |
477 | 562 | } | |
478 | 563 | ||
479 | 564 | ||
480 | 565 | ||
481 | 566 | @Callable(i) | |
482 | 567 | func putOneTkn (amAssetPart,prAssetPart,outLp,slippage,autoStake) = { | |
483 | - | let cfg = | |
568 | + | let cfg = gfc() | |
484 | 569 | let stakingCntr = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Wr st addr") | |
485 | 570 | let slipCntr = valueOrErrorMessage(addressFromString(cfg[idxFactSlippCntr]), "Wr sl addr") | |
486 | 571 | let gwxCntr = valueOrErrorMessage(addressFromString(cfg[idxFactGwxRewCntr]), "Wr gwx addr") | |
487 | - | let poolCfg = | |
572 | + | let poolCfg = gpc() | |
488 | 573 | let amId = poolCfg[idxAmAsId] | |
489 | 574 | let prId = poolCfg[idxPrAsId] | |
490 | 575 | let amDcm = parseIntValue(poolCfg[idxAmtAsDcm]) | |
491 | 576 | let prDcm = parseIntValue(poolCfg[idxPriceAsDcm]) | |
492 | 577 | if (if (if (if ((0 >= slippage)) | |
493 | 578 | then true | |
494 | 579 | else (0 >= amAssetPart)) | |
495 | 580 | then true | |
496 | 581 | else (0 >= prAssetPart)) | |
497 | 582 | then true | |
498 | 583 | else (0 >= outLp)) | |
499 | 584 | then throw("Wrong params") | |
500 | 585 | else if ((size(i.payments) != 1)) | |
501 | 586 | then throw("1 pmnt expd") | |
502 | 587 | else { | |
503 | 588 | let pmt = value(i.payments[0]) | |
504 | 589 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
505 | 590 | let pmtAmt = pmt.amount | |
506 | 591 | if (if (if ((amAssetPart > pmtAmt)) | |
507 | 592 | then true | |
508 | 593 | else (prAssetPart > pmtAmt)) | |
509 | 594 | then true | |
510 | 595 | else (10000000 > pmtAmt)) | |
511 | 596 | then throw("Wrong pmt amt") | |
512 | 597 | else { | |
513 | 598 | let amBalance = getAccBalance(amId) | |
514 | 599 | let prBalance = getAccBalance(prId) | |
515 | - | let $ | |
600 | + | let $t02418924569 = if ((pmtAssetId == amId)) | |
516 | 601 | then $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0) | |
517 | 602 | else if ((pmtAssetId == prId)) | |
518 | 603 | then $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart) | |
519 | 604 | else throw("wrong pmtAssetId") | |
520 | - | let amBalanceNow = $ | |
521 | - | let prBalanceNow = $ | |
522 | - | let virtSwapInAm = $ | |
523 | - | let virtSwapOutPr = $ | |
524 | - | let virtSwapInPr = $ | |
525 | - | let virtSwapOutAm = $ | |
605 | + | let amBalanceNow = $t02418924569._1 | |
606 | + | let prBalanceNow = $t02418924569._2 | |
607 | + | let virtSwapInAm = $t02418924569._3 | |
608 | + | let virtSwapOutPr = $t02418924569._4 | |
609 | + | let virtSwapInPr = $t02418924569._5 | |
610 | + | let virtSwapOutAm = $t02418924569._6 | |
526 | 611 | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
527 | 612 | let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil) | |
528 | - | let D0vsD1 = | |
613 | + | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
529 | 614 | if ((D0vsD1 == D0vsD1)) | |
530 | 615 | then { | |
531 | - | let estPut = | |
616 | + | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId) | |
532 | 617 | let estimLP = estPut._2 | |
533 | 618 | let lpAssetId = estPut._7 | |
534 | 619 | let state = estPut._9 | |
535 | 620 | let amDiff = estPut._10 | |
536 | 621 | let prDiff = estPut._11 | |
537 | - | let lpCalcRes = | |
622 | + | let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage)) | |
538 | 623 | let emitLpAmt = toInt(lpCalcRes._2) | |
539 | - | let | |
540 | - | if (( | |
624 | + | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
625 | + | if ((e == e)) | |
541 | 626 | then { | |
542 | - | let slippageAInv = if ((amDiff > 0)) | |
543 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
544 | - | else nil | |
545 | - | if ((slippageAInv == slippageAInv)) | |
627 | + | let el = match e { | |
628 | + | case legacy: Address => | |
629 | + | invoke(legacy, "emit", [emitLpAmt], nil) | |
630 | + | case _ => | |
631 | + | unit | |
632 | + | } | |
633 | + | if ((el == el)) | |
546 | 634 | then { | |
547 | - | let | |
548 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String( | |
635 | + | let sa = if ((amDiff > 0)) | |
636 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
549 | 637 | else nil | |
550 | - | if (( | |
638 | + | if ((sa == sa)) | |
551 | 639 | then { | |
552 | - | let lpTrnsfr = if (autoStake) | |
640 | + | let sp = if ((prDiff > 0)) | |
641 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
642 | + | else nil | |
643 | + | if ((sp == sp)) | |
553 | 644 | then { | |
554 | - | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
555 | - | if ((slpStakeInv == slpStakeInv)) | |
556 | - | then nil | |
557 | - | else throw("Strict value is not equal to itself.") | |
645 | + | let lpTrnsfr = if (autoStake) | |
646 | + | then { | |
647 | + | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
648 | + | if ((ss == ss)) | |
649 | + | then nil | |
650 | + | else throw("Strict value is not equal to itself.") | |
651 | + | } | |
652 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
653 | + | (state ++ lpTrnsfr) | |
558 | 654 | } | |
559 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
560 | - | (state ++ lpTrnsfr) | |
655 | + | else throw("Strict value is not equal to itself.") | |
561 | 656 | } | |
562 | 657 | else throw("Strict value is not equal to itself.") | |
563 | 658 | } | |
564 | 659 | else throw("Strict value is not equal to itself.") | |
565 | 660 | } | |
566 | 661 | else throw("Strict value is not equal to itself.") | |
567 | 662 | } | |
568 | 663 | else throw("Strict value is not equal to itself.") | |
569 | 664 | } | |
570 | 665 | } | |
571 | 666 | } | |
572 | 667 | ||
573 | 668 | ||
574 | 669 | ||
575 | 670 | @Callable(i) | |
576 | 671 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
577 | 672 | then throw("Wrong slpg") | |
578 | 673 | else if ((size(i.payments) != 2)) | |
579 | 674 | then throw("2 pmnts expd") | |
580 | 675 | else { | |
581 | - | let estPut = | |
676 | + | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, 0, "") | |
582 | 677 | estPut._9 | |
583 | 678 | } | |
584 | 679 | ||
585 | 680 | ||
586 | 681 | ||
587 | 682 | @Callable(i) | |
588 | 683 | func get () = { | |
589 | - | let | |
590 | - | let outAmtAmt = | |
591 | - | let outPrAmt = | |
592 | - | let pmtAmt = | |
593 | - | let pmtAssetId = | |
594 | - | let state = | |
595 | - | let | |
596 | - | if (( | |
684 | + | let r = cg(i) | |
685 | + | let outAmtAmt = r._1 | |
686 | + | let outPrAmt = r._2 | |
687 | + | let pmtAmt = r._3 | |
688 | + | let pmtAssetId = r._4 | |
689 | + | let state = r._5 | |
690 | + | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
691 | + | if ((b == b)) | |
597 | 692 | then state | |
598 | 693 | else throw("Strict value is not equal to itself.") | |
599 | 694 | } | |
600 | 695 | ||
601 | 696 | ||
602 | 697 | ||
603 | 698 | @Callable(i) | |
604 | 699 | func getOneTkn (exchResult,notUsed,outAmount,outAssetId,slippage) = if ((size(i.payments) != 1)) | |
605 | 700 | then throw("1 pmnt expd") | |
606 | 701 | else { | |
607 | - | let cfg = | |
702 | + | let cfg = gpc() | |
608 | 703 | let lpId = cfg[idxLPAsId] | |
609 | 704 | let amId = cfg[idxAmAsId] | |
610 | 705 | let prId = cfg[idxPrAsId] | |
611 | 706 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
612 | 707 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
613 | 708 | let sts = cfg[idxPoolSt] | |
614 | - | let | |
615 | - | let gwxCntr = valueOrErrorMessage(addressFromString( | |
709 | + | let factCfg = gfc() | |
710 | + | let gwxCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactGwxRewCntr]), "Wr sl addr") | |
616 | 711 | let pmt = value(i.payments[0]) | |
617 | - | let addon = valueOrElse(getString(this, | |
712 | + | let addon = valueOrElse(getString(this, ada()), "") | |
618 | 713 | let userAddress = if ((addon == toString(i.caller))) | |
619 | 714 | then i.originCaller | |
620 | 715 | else i.caller | |
621 | 716 | let txId58 = toBase58String(i.transactionId) | |
622 | 717 | let pmtAssetId = value(pmt.assetId) | |
623 | 718 | let pmtAmt = pmt.amount | |
624 | 719 | if ((1000000000 > pmtAmt)) | |
625 | 720 | then throw("Min pmt 10 LP") | |
626 | 721 | else if (if (if ((0 > slippage)) | |
627 | 722 | then true | |
628 | 723 | else (0 > exchResult)) | |
629 | 724 | then true | |
630 | 725 | else (0 > outAmount)) | |
631 | 726 | then throw("Wrong params") | |
632 | 727 | else if ((lpId != toBase58String(pmtAssetId))) | |
633 | 728 | then throw("Wrong LP") | |
634 | 729 | else { | |
635 | - | let r = | |
730 | + | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
636 | 731 | let estimAmAmt = r._1 | |
637 | 732 | let estimPrAmt = r._2 | |
638 | 733 | let amBalance = getAccBalance(amId) | |
639 | 734 | let prBalance = getAccBalance(prId) | |
640 | - | let $ | |
735 | + | let $t02934829805 = if ((outAssetId == amId)) | |
641 | 736 | then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult)) | |
642 | 737 | else if ((outAssetId == prId)) | |
643 | 738 | then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult)) | |
644 | 739 | else throw("wrong outAssetId") | |
645 | - | let amBalanceNow = $ | |
646 | - | let prBalanceNow = $ | |
647 | - | let virtSwapInAm = $ | |
648 | - | let virtSwapOutPr = $ | |
649 | - | let virtSwapInPr = $ | |
650 | - | let virtSwapOutAm = $ | |
651 | - | let totalGet = $ | |
740 | + | let amBalanceNow = $t02934829805._1 | |
741 | + | let prBalanceNow = $t02934829805._2 | |
742 | + | let virtSwapInAm = $t02934829805._3 | |
743 | + | let virtSwapOutPr = $t02934829805._4 | |
744 | + | let virtSwapInPr = $t02934829805._5 | |
745 | + | let virtSwapOutAm = $t02934829805._6 | |
746 | + | let totalGet = $t02934829805._7 | |
652 | 747 | if (if ((0 > virtSwapInAm)) | |
653 | 748 | then true | |
654 | 749 | else (0 > virtSwapInPr)) | |
655 | 750 | then throw("Wrong calc") | |
656 | 751 | else { | |
657 | 752 | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
658 | 753 | let D1 = invoke(gwxCntr, "calcD", [toString(((amBalanceNow - virtSwapInAm) + virtSwapOutAm)), toString(((prBalanceNow + virtSwapOutPr) - virtSwapInPr)), A, Amult, Dconv], nil) | |
659 | - | let D0vsD1 = | |
754 | + | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
660 | 755 | if ((D0vsD1 == D0vsD1)) | |
661 | 756 | then { | |
662 | - | let finalRes = | |
757 | + | let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage)) | |
663 | 758 | if ((finalRes == finalRes)) | |
664 | 759 | then { | |
665 | - | let $ | |
760 | + | let $t03051030614 = if ((outAssetId == amId)) | |
666 | 761 | then $Tuple2(toInt(finalRes._2), 0) | |
667 | 762 | else $Tuple2(0, toInt(finalRes._2)) | |
668 | - | let outAm = $ | |
669 | - | let outPr = $ | |
670 | - | let curPrX18 = | |
671 | - | let curPr = | |
763 | + | let outAm = $t03051030614._1 | |
764 | + | let outPr = $t03051030614._2 | |
765 | + | let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm)) | |
766 | + | let curPr = f1(curPrX18, scale8) | |
672 | 767 | let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES")) | |
673 | 768 | then unit | |
674 | - | else fromBase58String(outAssetId)), StringEntry( | |
769 | + | else fromBase58String(outAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] | |
675 | 770 | if ((state == state)) | |
676 | 771 | then { | |
677 | - | let burn = invoke( | |
772 | + | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
678 | 773 | if ((burn == burn)) | |
679 | 774 | then state | |
680 | 775 | else throw("Strict value is not equal to itself.") | |
681 | 776 | } | |
682 | 777 | else throw("Strict value is not equal to itself.") | |
683 | 778 | } | |
684 | 779 | else throw("Strict value is not equal to itself.") | |
685 | 780 | } | |
686 | 781 | else throw("Strict value is not equal to itself.") | |
687 | 782 | } | |
688 | 783 | } | |
689 | 784 | } | |
690 | 785 | ||
691 | 786 | ||
692 | 787 | ||
693 | 788 | @Callable(i) | |
694 | 789 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
695 | - | let | |
696 | - | let outAmAmt = | |
697 | - | let outPrAmt = | |
698 | - | let pmtAmt = | |
699 | - | let pmtAssetId = | |
700 | - | let state = | |
790 | + | let r = cg(i) | |
791 | + | let outAmAmt = r._1 | |
792 | + | let outPrAmt = r._2 | |
793 | + | let pmtAmt = r._3 | |
794 | + | let pmtAssetId = r._4 | |
795 | + | let state = r._5 | |
701 | 796 | if ((noLessThenAmtAsset > outAmAmt)) | |
702 | 797 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
703 | 798 | else if ((noLessThenPriceAsset > outPrAmt)) | |
704 | 799 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
705 | 800 | else { | |
706 | - | let burnLPAssetOnFactory = invoke( | |
801 | + | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
707 | 802 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
708 | 803 | then state | |
709 | 804 | else throw("Strict value is not equal to itself.") | |
710 | 805 | } | |
711 | 806 | } | |
712 | 807 | ||
713 | 808 | ||
714 | 809 | ||
715 | 810 | @Callable(i) | |
716 | 811 | func unstakeAndGet (amount) = { | |
717 | 812 | let checkPayments = if ((size(i.payments) != 0)) | |
718 | 813 | then throw("No pmnts expd") | |
719 | 814 | else true | |
720 | 815 | if ((checkPayments == checkPayments)) | |
721 | 816 | then { | |
722 | - | let cfg = | |
723 | - | let factoryCfg = | |
817 | + | let cfg = gpc() | |
818 | + | let factoryCfg = gfc() | |
724 | 819 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
725 | 820 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
726 | 821 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
727 | 822 | if ((unstakeInv == unstakeInv)) | |
728 | 823 | then { | |
729 | - | let r = | |
824 | + | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
730 | 825 | let sts = parseIntValue(r._9) | |
731 | 826 | let state = r._10 | |
732 | - | let v = if (if ( | |
827 | + | let v = if (if (igs()) | |
733 | 828 | then true | |
734 | 829 | else (sts == PoolShutdown)) | |
735 | 830 | then throw(("Blocked: " + toString(sts))) | |
736 | 831 | else true | |
737 | 832 | if ((v == v)) | |
738 | 833 | then { | |
739 | - | let burnA = invoke( | |
834 | + | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
740 | 835 | if ((burnA == burnA)) | |
741 | 836 | then state | |
742 | 837 | else throw("Strict value is not equal to itself.") | |
743 | 838 | } | |
744 | 839 | else throw("Strict value is not equal to itself.") | |
745 | 840 | } | |
746 | 841 | else throw("Strict value is not equal to itself.") | |
747 | 842 | } | |
748 | 843 | else throw("Strict value is not equal to itself.") | |
749 | 844 | } | |
750 | 845 | ||
751 | 846 | ||
752 | 847 | ||
753 | 848 | @Callable(i) | |
754 | - | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString( | |
849 | + | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
755 | 850 | then throw("denied") | |
756 | - | else $Tuple2([StringEntry( | |
851 | + | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
757 | 852 | ||
758 | 853 | ||
759 | 854 | ||
760 | 855 | @Callable(i) | |
761 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, | |
856 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
762 | 857 | ||
763 | 858 | ||
764 | 859 | ||
765 | 860 | @Callable(i) | |
766 | 861 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
767 | 862 | ||
768 | 863 | ||
769 | 864 | ||
770 | 865 | @Callable(i) | |
771 | 866 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
772 | 867 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
773 | 868 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
774 | 869 | } | |
775 | 870 | ||
776 | 871 | ||
777 | 872 | ||
778 | 873 | @Callable(i) | |
779 | - | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, | |
874 | + | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
780 | 875 | ||
781 | 876 | ||
782 | 877 | ||
783 | 878 | @Callable(i) | |
784 | - | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString( | |
879 | + | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
785 | 880 | ||
786 | 881 | ||
787 | 882 | ||
788 | 883 | @Callable(i) | |
789 | - | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString( | |
884 | + | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
790 | 885 | ||
791 | 886 | ||
792 | 887 | ||
793 | 888 | @Callable(i) | |
794 | - | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, | |
889 | + | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, false, 0, "")) | |
795 | 890 | ||
796 | 891 | ||
797 | 892 | ||
798 | 893 | @Callable(i) | |
799 | 894 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
800 | - | let | |
801 | - | $Tuple2(nil, $Tuple10( | |
895 | + | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
896 | + | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
802 | 897 | } | |
803 | 898 | ||
804 | 899 | ||
805 | 900 | @Verifier(tx) | |
806 | 901 | func verify () = match tx { | |
807 | 902 | case order: Order => | |
808 | - | let mtchPub = | |
809 | - | let orV = | |
903 | + | let mtchPub = mp() | |
904 | + | let orV = moa(order) | |
810 | 905 | let sndrV = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
811 | 906 | let mtchV = sigVerify(order.bodyBytes, order.proofs[1], mtchPub) | |
812 | 907 | if (if (if (orV) | |
813 | 908 | then sndrV | |
814 | 909 | else false) | |
815 | 910 | then mtchV | |
816 | 911 | else false) | |
817 | 912 | then true | |
818 | - | else | |
913 | + | else toe(orV, sndrV, mtchV) | |
819 | 914 | case _ => | |
820 | - | let admin = valueOrElse(getString(this, keyManPubKey()), EMPTY) | |
821 | - | if ((admin == EMPTY)) | |
822 | - | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
823 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(admin)) | |
915 | + | let targetPublicKey = match m() { | |
916 | + | case pk: ByteVector => | |
917 | + | pk | |
918 | + | case _: Unit => | |
919 | + | tx.senderPublicKey | |
920 | + | case _ => | |
921 | + | throw("Match error") | |
922 | + | } | |
923 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
824 | 924 | } | |
825 | 925 |
github/deemru/w8io/026f985 199.84 ms ◑