tx · 3VhvBibdaQ7p13BL2tV2mV6ByTiGTGTBeCoawoVXCzUG 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA: -0.03400000 Waves 2022.09.14 17:45 [2228909] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves
{ "type": 13, "id": "3VhvBibdaQ7p13BL2tV2mV6ByTiGTGTBeCoawoVXCzUG", "fee": 3400000, "feeAssetId": null, "timestamp": 1663166748681, "version": 2, "chainId": 84, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "5NjeNRZqJJpz3phW2iwEPGUVgc8trqGPaUbfvQkB9WRozPjUmDC2bwS26j5HZnWbu4QhZfV5yJVcSbkr7oGvCaD" ], "script": "base64:BgKcAQgCEgMKAQgSAwoBCBIAEgQKAgEEEgcKBQEBAQEEEgQKAgEEEgQKAgEIEgQKAgEIEgMKAQESABIECgIIARIECgIIARIECgIBARIDCgEBEgYKBAEBCAESBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCFMABnNjYWxlOACAwtcvAAxzY2FsZThCaWdJbnQJALYCAQCAwtcvAAdzY2FsZTE4CQC2AgEAgICQu7rWrfANAAp6ZXJvQmlnSW50CQC2AgEAAAAJb25lQmlnSW50CQC2AgEAAQAKc2xpcHBhZ2U0RAkAtgIBCQBlAgUGc2NhbGU4CQBpAgkAaAIFBnNjYWxlOAABBQZzY2FsZTgABUFtdWx0AgMxMDAABURjb252AgExAANTRVACAl9fAAVFTVBUWQIAAApQb29sQWN0aXZlAAEAClBvb2xQdXREaXMAAgAOUG9vbE1hdGNoZXJEaXMAAwAMUG9vbFNodXRkb3duAAQADmlkeFBvb2xBZGRyZXNzAAEACWlkeFBvb2xTdAACAAlpZHhMUEFzSWQAAwAJ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aWQJAPQDAwgFBW9yZGVyCWJvZHlCeXRlcwkAkQMCCAUFb3JkZXIGcHJvb2ZzAAEFCm1hdGNoZXJQdWIDAwMFCm9yZGVyVmFsaWQFC3NlbmRlclZhbGlkBwUMbWF0Y2hlclZhbGlkBwYJAQN0b2UDBQpvcmRlclZhbGlkBQtzZW5kZXJWYWxpZAUMbWF0Y2hlclZhbGlkAwkAAQIFByRtYXRjaDACFFNldFNjcmlwdFRyYW5zYWN0aW9uBAFzBQckbWF0Y2gwBAduZXdIYXNoCQD2AwEJAQV2YWx1ZQEIBQFzBnNjcmlwdAQLYWxsb3dlZEhhc2gJANsEAQkBBXZhbHVlAQkAnQgCBQNmY2EJARxrZXlBbGxvd2VkTHBTdGFibGVTY3JpcHRIYXNoAAQLY3VycmVudEhhc2gJAPEHAQUEdGhpcwMDCQAAAgULYWxsb3dlZEhhc2gFB25ld0hhc2gJAQIhPQIFC2N1cnJlbnRIYXNoBQduZXdIYXNoBwYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tleQkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5BpkAyg==", "height": 2228909, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 43WEka1CrkCccKrAkVzm6Zj3AzHQhpHa67ZS9E9pUjsJ Next: FWRCYY4zue6snFDicJRebUw6dB8rWpyb7KNVM8TUAQR3 Diff:
Old | New | Differences | |
---|---|---|---|
859 | 859 | else (priceAssetAmount / estimLP) | |
860 | 860 | let lpAssetPriceBoth = ((priceAssetAmount + amountAssetAmount) / lpAmtBoth) | |
861 | 861 | let bonus = ((lpAssetPriceOne - lpAssetPriceBoth) / lpAssetPriceOne) | |
862 | - | $Tuple2(nil, | |
862 | + | $Tuple2(nil, lpAmtBoth) | |
863 | 863 | } | |
864 | 864 | ||
865 | 865 | ||
929 | 929 | else false) | |
930 | 930 | then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
931 | 931 | else totalGet | |
932 | - | let $ | |
932 | + | let $t03575335840 = if ((outAssetId == amId)) | |
933 | 933 | then $Tuple2(totalAmount, 0) | |
934 | 934 | else $Tuple2(0, totalAmount) | |
935 | - | let outAm = $ | |
936 | - | let outPr = $ | |
935 | + | let outAm = $t03575335840._1 | |
936 | + | let outPr = $t03575335840._2 | |
937 | 937 | let curPrX18 = cpbi(t1(prBalance, prDecimals), t1(amBalance, amDecimals)) | |
938 | 938 | let curPr = f1(curPrX18, scale8) | |
939 | 939 | let state = [ScriptTransfer(userAddress, totalAmount, if ((outAssetId == "WAVES")) | |
966 | 966 | let prBalance = getAccBalance(prId) | |
967 | 967 | let amBalanceNow = (amBalance - estimAmAmt) | |
968 | 968 | let prBalanceNow = (prBalance - estimPrAmt) | |
969 | - | let $ | |
969 | + | let $t03693437205 = if ((outAssetId == amId)) | |
970 | 970 | then $Tuple3(prBalanceNow, amBalanceNow, estimPrAmt) | |
971 | 971 | else if ((outAssetId == prId)) | |
972 | 972 | then $Tuple3(amBalanceNow, prBalanceNow, estimAmAmt) | |
973 | 973 | else throw("wrong outAssetId") | |
974 | - | let amountBalanceForSwap = $ | |
975 | - | let priceBalanceForSwap = $ | |
976 | - | let amountToSwap = $ | |
974 | + | let amountBalanceForSwap = $t03693437205._1 | |
975 | + | let priceBalanceForSwap = $t03693437205._2 | |
976 | + | let amountToSwap = $t03693437205._3 | |
977 | 977 | let yPrecision = 1 | |
978 | 978 | let exchResult = { | |
979 | 979 | let @ = invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
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 | 56 | let delay = "%s__delay" | |
57 | 57 | ||
58 | 58 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func abs (val) = if ((zeroBigInt > val)) | |
68 | 68 | then -(val) | |
69 | 69 | else val | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func fc () = "%s__factoryContract" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func mpk () = "%s__managerPublicKey" | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func pmpk () = "%s__pendingManagerPublicKey" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func pl () = "%s%s__price__last" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func aa () = "%s__amountAsset" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func pa () = "%s__priceAsset" | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func amp () = "%s__amp" | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func ada () = "%s__addonAddr" | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func lgotc (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func lsotc (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func fcfg () = "%s__factoryConfig" | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func mtpk () = "%s%s__matcher__publicKey" | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func aps () = "%s__shutdown" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func str (val) = match val { | |
133 | 133 | case valStr: String => | |
134 | 134 | valStr | |
135 | 135 | case _ => | |
136 | 136 | throw("fail cast to String") | |
137 | 137 | } | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | let fca = addressFromStringValue(strf(this, fc())) | |
147 | 147 | ||
148 | 148 | let A = strf(this, amp()) | |
149 | 149 | ||
150 | 150 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func mp () = fromBase58String(strf(fca, mtpk())) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func gpc () = { | |
157 | 157 | let amtAs = strf(this, aa()) | |
158 | 158 | let priceAs = strf(this, pa()) | |
159 | 159 | let iPriceAs = intf(fca, mba(priceAs)) | |
160 | 160 | let iAmtAs = intf(fca, mba(amtAs)) | |
161 | 161 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
162 | 162 | } | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func gfc () = split(strf(fca, fcfg()), SEP) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | let factoryConfig = gfc() | |
169 | 169 | ||
170 | 170 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
171 | 171 | ||
172 | 172 | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
173 | 173 | ||
174 | 174 | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
175 | 175 | ||
176 | 176 | 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) | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | 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) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
183 | 183 | then wavesBalance(this).available | |
184 | 184 | else assetBalance(this, fromBase58String(assetId)) | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func vad (A1,A2,slippage) = { | |
191 | 191 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
192 | 192 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
193 | 193 | if (!(pass)) | |
194 | 194 | then throw(("Big slpg: " + toString(diff))) | |
195 | 195 | else $Tuple2(pass, min([A1, A2])) | |
196 | 196 | } | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func vd (D1,D0,slpg) = { | |
200 | 200 | let diff = fraction(D0, scale8BigInt, D1) | |
201 | 201 | let fail = (slpg > diff) | |
202 | 202 | if (if (fail) | |
203 | 203 | then true | |
204 | 204 | else (D0 > D1)) | |
205 | 205 | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
206 | 206 | else fail | |
207 | 207 | } | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
211 | 211 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
212 | 212 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
213 | 213 | cpbi(prAsAmtX18, amtAsAmtX18) | |
214 | 214 | } | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
218 | 218 | let cfg = gpc() | |
219 | 219 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
220 | 220 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
221 | 221 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
222 | 222 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
223 | 223 | let prAmtX18 = t1(prAmt, prAsDcm) | |
224 | 224 | let lpAmtX18 = t1(lpAmt, scale8) | |
225 | 225 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
226 | 226 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
227 | 227 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
228 | 228 | } | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
232 | 232 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
233 | 233 | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
234 | 234 | } | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
238 | 238 | let cfg = gpc() | |
239 | 239 | let lpId = cfg[idxLPAsId] | |
240 | 240 | let amId = cfg[idxAmAsId] | |
241 | 241 | let prId = cfg[idxPrAsId] | |
242 | 242 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
243 | 243 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
244 | 244 | let sts = cfg[idxPoolSt] | |
245 | 245 | let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity | |
246 | 246 | if ((lpId != pmtAssetId)) | |
247 | 247 | then throw("Wrong pmt asset") | |
248 | 248 | else { | |
249 | 249 | let amBalance = getAccBalance(amId) | |
250 | 250 | let amBalanceX18 = t1(amBalance, amDcm) | |
251 | 251 | let prBalance = getAccBalance(prId) | |
252 | 252 | let prBalanceX18 = t1(prBalance, prDcm) | |
253 | 253 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
254 | 254 | let curPrice = f1(curPriceX18, scale8) | |
255 | 255 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
256 | 256 | let lpEmissX18 = t1(lpEmiss, scale8) | |
257 | 257 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
258 | 258 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
259 | 259 | let outAmAmt = f1(outAmAmtX18, amDcm) | |
260 | 260 | let outPrAmt = f1(outPrAmtX18, prDcm) | |
261 | 261 | let state = if ((txId58 == "")) | |
262 | 262 | then nil | |
263 | 263 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
264 | 264 | then unit | |
265 | 265 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
266 | 266 | then unit | |
267 | 267 | 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)] | |
268 | 268 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
269 | 269 | } | |
270 | 270 | } | |
271 | 271 | ||
272 | 272 | ||
273 | 273 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
274 | 274 | let cfg = gpc() | |
275 | 275 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
276 | 276 | let amIdStr = cfg[idxAmAsId] | |
277 | 277 | let prIdStr = cfg[idxPrAsId] | |
278 | 278 | let inAmIdStr = cfg[idxIAmtAsId] | |
279 | 279 | let inPrIdStr = cfg[idxIPriceAsId] | |
280 | 280 | let amtDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
281 | 281 | let priceDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
282 | 282 | let sts = cfg[idxPoolSt] | |
283 | 283 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
284 | 284 | let amBalance = if (isEval) | |
285 | 285 | then getAccBalance(amIdStr) | |
286 | 286 | else if (if (isOneAsset) | |
287 | 287 | then (pmtId == amIdStr) | |
288 | 288 | else false) | |
289 | 289 | then (getAccBalance(amIdStr) - pmtAmt) | |
290 | 290 | else if (isOneAsset) | |
291 | 291 | then getAccBalance(amIdStr) | |
292 | 292 | else (getAccBalance(amIdStr) - inAmAmt) | |
293 | 293 | let prBalance = if (isEval) | |
294 | 294 | then getAccBalance(prIdStr) | |
295 | 295 | else if (if (isOneAsset) | |
296 | 296 | then (pmtId == prIdStr) | |
297 | 297 | else false) | |
298 | 298 | then (getAccBalance(prIdStr) - pmtAmt) | |
299 | 299 | else if (isOneAsset) | |
300 | 300 | then getAccBalance(prIdStr) | |
301 | 301 | else (getAccBalance(prIdStr) - inPrAmt) | |
302 | 302 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
303 | 303 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
304 | 304 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
305 | 305 | let amBalanceX18 = t1(amBalance, amtDcm) | |
306 | 306 | let prBalanceX18 = t1(prBalance, priceDcm) | |
307 | 307 | let r = if ((lpEm == 0)) | |
308 | 308 | then { | |
309 | 309 | let curPriceX18 = zeroBigInt | |
310 | 310 | let slippageX18 = zeroBigInt | |
311 | 311 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
312 | 312 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
313 | 313 | } | |
314 | 314 | else { | |
315 | 315 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
316 | 316 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
317 | 317 | let slippageX18 = t1(slippage, scale8) | |
318 | 318 | if (if (if (validateSlippage) | |
319 | 319 | then (curPriceX18 != zeroBigInt) | |
320 | 320 | else false) | |
321 | 321 | then (slippageRealX18 > slippageX18) | |
322 | 322 | else false) | |
323 | 323 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
324 | 324 | else { | |
325 | 325 | let lpEmissionX18 = t1(lpEm, scale8) | |
326 | 326 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
327 | 327 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
328 | 328 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
329 | 329 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
330 | 330 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
331 | 331 | let expAmtAssetAmtX18 = expectedAmts._1 | |
332 | 332 | let expPriceAssetAmtX18 = expectedAmts._2 | |
333 | 333 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
334 | 334 | $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
335 | 335 | } | |
336 | 336 | } | |
337 | 337 | let calcLpAmt = r._1 | |
338 | 338 | let calcAmAssetPmt = r._2 | |
339 | 339 | let calcPrAssetPmt = r._3 | |
340 | 340 | let curPrice = f1(r._4, scale8) | |
341 | 341 | let slippageCalc = f1(r._5, scale8) | |
342 | 342 | if ((0 >= calcLpAmt)) | |
343 | 343 | then throw("LP <= 0") | |
344 | 344 | else { | |
345 | 345 | let emitLpAmt = if (!(emitLp)) | |
346 | 346 | then 0 | |
347 | 347 | else calcLpAmt | |
348 | 348 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
349 | 349 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
350 | 350 | let $t01608316428 = if (if (isOneAsset) | |
351 | 351 | then (pmtId == amIdStr) | |
352 | 352 | else false) | |
353 | 353 | then $Tuple2(pmtAmt, 0) | |
354 | 354 | else if (if (isOneAsset) | |
355 | 355 | then (pmtId == prIdStr) | |
356 | 356 | else false) | |
357 | 357 | then $Tuple2(0, pmtAmt) | |
358 | 358 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
359 | 359 | let writeAmAmt = $t01608316428._1 | |
360 | 360 | let writePrAmt = $t01608316428._2 | |
361 | 361 | 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))] | |
362 | 362 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
363 | 363 | } | |
364 | 364 | } | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | func moa (order) = { | |
368 | 368 | let cfg = gpc() | |
369 | 369 | let amtAsId = cfg[idxAmAsId] | |
370 | 370 | let prAsId = cfg[idxPrAsId] | |
371 | 371 | let sts = parseIntValue(cfg[idxPoolSt]) | |
372 | 372 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
373 | 373 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
374 | 374 | let accAmtAsBalance = getAccBalance(amtAsId) | |
375 | 375 | let accPrAsBalance = getAccBalance(prAsId) | |
376 | 376 | let curPriceX18 = if ((order.orderType == Buy)) | |
377 | 377 | then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance) | |
378 | 378 | else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance) | |
379 | 379 | let curPrice = f1(curPriceX18, scale8) | |
380 | 380 | if (if (if (igs()) | |
381 | 381 | then true | |
382 | 382 | else (sts == PoolMatcherDis)) | |
383 | 383 | then true | |
384 | 384 | else (sts == PoolShutdown)) | |
385 | 385 | then throw("Admin blocked") | |
386 | 386 | else { | |
387 | 387 | let orAmtAsset = order.assetPair.amountAsset | |
388 | 388 | let orAmtAsStr = if ((orAmtAsset == unit)) | |
389 | 389 | then "WAVES" | |
390 | 390 | else toBase58String(value(orAmtAsset)) | |
391 | 391 | let orPrAsset = order.assetPair.priceAsset | |
392 | 392 | let orPrAsStr = if ((orPrAsset == unit)) | |
393 | 393 | then "WAVES" | |
394 | 394 | else toBase58String(value(orPrAsset)) | |
395 | 395 | if (if ((orAmtAsStr != amtAsId)) | |
396 | 396 | then true | |
397 | 397 | else (orPrAsStr != prAsId)) | |
398 | 398 | then throw("Wr assets") | |
399 | 399 | else { | |
400 | 400 | let orderPrice = order.price | |
401 | 401 | let priceDcm = fraction(scale8, prAsDcm, amtAsDcm) | |
402 | 402 | let castOrderPrice = ts(orderPrice, scale8, priceDcm) | |
403 | 403 | let isOrderPriceValid = if ((order.orderType == Buy)) | |
404 | 404 | then (curPrice >= castOrderPrice) | |
405 | 405 | else (castOrderPrice >= curPrice) | |
406 | 406 | true | |
407 | 407 | } | |
408 | 408 | } | |
409 | 409 | } | |
410 | 410 | ||
411 | 411 | ||
412 | 412 | func cg (i) = if ((size(i.payments) != 1)) | |
413 | 413 | then throw("1 pmnt exp") | |
414 | 414 | else { | |
415 | 415 | let pmt = value(i.payments[0]) | |
416 | 416 | let pmtAssetId = value(pmt.assetId) | |
417 | 417 | let pmtAmt = pmt.amount | |
418 | 418 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
419 | 419 | let outAmAmt = r._1 | |
420 | 420 | let outPrAmt = r._2 | |
421 | 421 | let sts = parseIntValue(r._9) | |
422 | 422 | let state = r._10 | |
423 | 423 | if (if (igs()) | |
424 | 424 | then true | |
425 | 425 | else (sts == PoolShutdown)) | |
426 | 426 | then throw(("Admin blocked: " + toString(sts))) | |
427 | 427 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
428 | 428 | } | |
429 | 429 | ||
430 | 430 | ||
431 | 431 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
432 | 432 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
433 | 433 | let sts = parseIntValue(r._8) | |
434 | 434 | if (if (if (igs()) | |
435 | 435 | then true | |
436 | 436 | else (sts == PoolPutDis)) | |
437 | 437 | then true | |
438 | 438 | else (sts == PoolShutdown)) | |
439 | 439 | then throw(("Blocked:" + toString(sts))) | |
440 | 440 | else r | |
441 | 441 | } | |
442 | 442 | ||
443 | 443 | ||
444 | 444 | func estimatePutOneTknV2 (pmtAmt,pmtAssetId,userAddress,txId) = { | |
445 | 445 | let poolConfig = gpc() | |
446 | 446 | let amId = poolConfig[idxAmAsId] | |
447 | 447 | let prId = poolConfig[idxPrAsId] | |
448 | 448 | let amBalance = getAccBalance(amId) | |
449 | 449 | let prBalance = getAccBalance(prId) | |
450 | 450 | let $t02075121200 = if ((txId == "")) | |
451 | 451 | then $Tuple2(amBalance, prBalance) | |
452 | 452 | else if ((pmtAssetId == amId)) | |
453 | 453 | then if ((pmtAmt > amBalance)) | |
454 | 454 | then throw("invalid payment amount") | |
455 | 455 | else $Tuple2((amBalance - pmtAmt), prBalance) | |
456 | 456 | else if ((pmtAssetId == prId)) | |
457 | 457 | then if ((pmtAmt > prBalance)) | |
458 | 458 | then throw("invalid payment amount") | |
459 | 459 | else $Tuple2(amBalance, (prBalance - pmtAmt)) | |
460 | 460 | else throw("wrong pmtAssetId") | |
461 | 461 | let amBalanceNow = $t02075121200._1 | |
462 | 462 | let prBalanceNow = $t02075121200._2 | |
463 | 463 | let $t02120421338 = if ((pmtAssetId == amId)) | |
464 | 464 | then $Tuple2(amBalanceNow, prBalanceNow) | |
465 | 465 | else $Tuple2(prBalanceNow, amBalanceNow) | |
466 | 466 | let amBalanceForCalc = $t02120421338._1 | |
467 | 467 | let prBalanceForCalc = $t02120421338._2 | |
468 | 468 | let xPrecision = 1 | |
469 | 469 | let result = { | |
470 | 470 | let @ = invoke(gwxContract, "calcPutXOnly", [toString(pmtAmt), toString(amBalanceForCalc), toString(prBalanceForCalc), "", A, Amult, toString(xPrecision), Dconv], nil) | |
471 | 471 | if ($isInstanceOf(@, "(Int, Int)")) | |
472 | 472 | then @ | |
473 | 473 | else throw(($getType(invoke(gwxContract, "calcPutXOnly", [toString(pmtAmt), toString(amBalanceForCalc), toString(prBalanceForCalc), "", A, Amult, toString(xPrecision), Dconv], nil)) + " couldn't be cast to (Int, Int)")) | |
474 | 474 | } | |
475 | 475 | let $t02180721903 = if ((pmtAssetId == amId)) | |
476 | 476 | then result | |
477 | 477 | else $Tuple2(result._2, result._1) | |
478 | 478 | let amAssetPart = $t02180721903._1 | |
479 | 479 | let prAssetPart = $t02180721903._2 | |
480 | 480 | let estPut = cp(userAddress, txId, AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), 0, true, true, false, pmtAmt, pmtAssetId) | |
481 | 481 | let estimLP = estPut._2 | |
482 | 482 | let lpAssetId = estPut._7 | |
483 | 483 | let state = estPut._9 | |
484 | 484 | let amDiff = estPut._10 | |
485 | 485 | let prDiff = estPut._11 | |
486 | 486 | estPut | |
487 | 487 | } | |
488 | 488 | ||
489 | 489 | ||
490 | 490 | func m () = match getString(mpk()) { | |
491 | 491 | case s: String => | |
492 | 492 | fromBase58String(s) | |
493 | 493 | case _: Unit => | |
494 | 494 | unit | |
495 | 495 | case _ => | |
496 | 496 | throw("Match error") | |
497 | 497 | } | |
498 | 498 | ||
499 | 499 | ||
500 | 500 | func pm () = match getString(pmpk()) { | |
501 | 501 | case s: String => | |
502 | 502 | fromBase58String(s) | |
503 | 503 | case _: Unit => | |
504 | 504 | unit | |
505 | 505 | case _ => | |
506 | 506 | throw("Match error") | |
507 | 507 | } | |
508 | 508 | ||
509 | 509 | ||
510 | 510 | let pd = throw("Permission denied") | |
511 | 511 | ||
512 | 512 | func mm (i) = match m() { | |
513 | 513 | case pk: ByteVector => | |
514 | 514 | if ((i.callerPublicKey == pk)) | |
515 | 515 | then true | |
516 | 516 | else pd | |
517 | 517 | case _: Unit => | |
518 | 518 | if ((i.caller == this)) | |
519 | 519 | then true | |
520 | 520 | else pd | |
521 | 521 | case _ => | |
522 | 522 | throw("Match error") | |
523 | 523 | } | |
524 | 524 | ||
525 | 525 | ||
526 | 526 | @Callable(i) | |
527 | 527 | func constructor (fc) = { | |
528 | 528 | let c = mm(i) | |
529 | 529 | if ((c == c)) | |
530 | 530 | then [StringEntry(fc(), fc)] | |
531 | 531 | else throw("Strict value is not equal to itself.") | |
532 | 532 | } | |
533 | 533 | ||
534 | 534 | ||
535 | 535 | ||
536 | 536 | @Callable(i) | |
537 | 537 | func setManager (pendingManagerPublicKey) = { | |
538 | 538 | let c = mm(i) | |
539 | 539 | if ((c == c)) | |
540 | 540 | then { | |
541 | 541 | let cm = fromBase58String(pendingManagerPublicKey) | |
542 | 542 | if ((cm == cm)) | |
543 | 543 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
544 | 544 | else throw("Strict value is not equal to itself.") | |
545 | 545 | } | |
546 | 546 | else throw("Strict value is not equal to itself.") | |
547 | 547 | } | |
548 | 548 | ||
549 | 549 | ||
550 | 550 | ||
551 | 551 | @Callable(i) | |
552 | 552 | func confirmManager () = { | |
553 | 553 | let p = pm() | |
554 | 554 | let hpm = if (isDefined(p)) | |
555 | 555 | then true | |
556 | 556 | else throw("No pending manager") | |
557 | 557 | if ((hpm == hpm)) | |
558 | 558 | then { | |
559 | 559 | let cpm = if ((i.callerPublicKey == value(p))) | |
560 | 560 | then true | |
561 | 561 | else throw("You are not pending manager") | |
562 | 562 | if ((cpm == cpm)) | |
563 | 563 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
564 | 564 | else throw("Strict value is not equal to itself.") | |
565 | 565 | } | |
566 | 566 | else throw("Strict value is not equal to itself.") | |
567 | 567 | } | |
568 | 568 | ||
569 | 569 | ||
570 | 570 | ||
571 | 571 | @Callable(i) | |
572 | 572 | func put (slip,autoStake) = { | |
573 | 573 | let factCfg = gfc() | |
574 | 574 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
575 | 575 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
576 | 576 | if ((0 > slip)) | |
577 | 577 | then throw("Wrong slippage") | |
578 | 578 | else if ((size(i.payments) != 2)) | |
579 | 579 | then throw("2 pmnts expd") | |
580 | 580 | else { | |
581 | 581 | 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, true, 0, "") | |
582 | 582 | let emitLpAmt = e._2 | |
583 | 583 | let lpAssetId = e._7 | |
584 | 584 | let state = e._9 | |
585 | 585 | let amDiff = e._10 | |
586 | 586 | let prDiff = e._11 | |
587 | 587 | let amId = e._12 | |
588 | 588 | let prId = e._13 | |
589 | 589 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
590 | 590 | if ((r == r)) | |
591 | 591 | then { | |
592 | 592 | let el = match r { | |
593 | 593 | case legacy: Address => | |
594 | 594 | invoke(legacy, "emit", [emitLpAmt], nil) | |
595 | 595 | case _ => | |
596 | 596 | unit | |
597 | 597 | } | |
598 | 598 | if ((el == el)) | |
599 | 599 | then { | |
600 | 600 | let sa = if ((amDiff > 0)) | |
601 | 601 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
602 | 602 | else nil | |
603 | 603 | if ((sa == sa)) | |
604 | 604 | then { | |
605 | 605 | let sp = if ((prDiff > 0)) | |
606 | 606 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
607 | 607 | else nil | |
608 | 608 | if ((sp == sp)) | |
609 | 609 | then { | |
610 | 610 | let lpTrnsfr = if (autoStake) | |
611 | 611 | then { | |
612 | 612 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
613 | 613 | if ((ss == ss)) | |
614 | 614 | then nil | |
615 | 615 | else throw("Strict value is not equal to itself.") | |
616 | 616 | } | |
617 | 617 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
618 | 618 | (state ++ lpTrnsfr) | |
619 | 619 | } | |
620 | 620 | else throw("Strict value is not equal to itself.") | |
621 | 621 | } | |
622 | 622 | else throw("Strict value is not equal to itself.") | |
623 | 623 | } | |
624 | 624 | else throw("Strict value is not equal to itself.") | |
625 | 625 | } | |
626 | 626 | else throw("Strict value is not equal to itself.") | |
627 | 627 | } | |
628 | 628 | } | |
629 | 629 | ||
630 | 630 | ||
631 | 631 | ||
632 | 632 | @Callable(i) | |
633 | 633 | func putOneTkn (amAssetPart,prAssetPart,outLp,slippage,autoStake) = { | |
634 | 634 | let cfg = gfc() | |
635 | 635 | let stakingCntr = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Wr st addr") | |
636 | 636 | let slipCntr = valueOrErrorMessage(addressFromString(cfg[idxFactSlippCntr]), "Wr sl addr") | |
637 | 637 | let gwxCntr = valueOrErrorMessage(addressFromString(cfg[idxFactGwxRewCntr]), "Wr gwx addr") | |
638 | 638 | let poolCfg = gpc() | |
639 | 639 | let amId = poolCfg[idxAmAsId] | |
640 | 640 | let prId = poolCfg[idxPrAsId] | |
641 | 641 | let amDcm = parseIntValue(poolCfg[idxAmtAsDcm]) | |
642 | 642 | let prDcm = parseIntValue(poolCfg[idxPriceAsDcm]) | |
643 | 643 | let addon = valueOrElse(getString(this, ada()), "") | |
644 | 644 | let userAddress = if ((addon == toString(i.caller))) | |
645 | 645 | then i.originCaller | |
646 | 646 | else i.caller | |
647 | 647 | let addonContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(ada()), "no addons")), "addon address in not valid") | |
648 | 648 | let check = reentrantInvoke(addonContract, "ensureCanPutOneTkn", [toString(userAddress)], nil) | |
649 | 649 | if ((check == check)) | |
650 | 650 | then if (if (if (if ((0 >= slippage)) | |
651 | 651 | then true | |
652 | 652 | else (0 >= amAssetPart)) | |
653 | 653 | then true | |
654 | 654 | else (0 >= prAssetPart)) | |
655 | 655 | then true | |
656 | 656 | else (0 >= outLp)) | |
657 | 657 | then throw("Wrong params") | |
658 | 658 | else if ((size(i.payments) != 1)) | |
659 | 659 | then throw("1 pmnt expd") | |
660 | 660 | else { | |
661 | 661 | let pmt = value(i.payments[0]) | |
662 | 662 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
663 | 663 | let pmtAmt = pmt.amount | |
664 | 664 | if ((10000000 > pmtAmt)) | |
665 | 665 | then throw("Wrong pmt amt") | |
666 | 666 | else { | |
667 | 667 | let amBalance = getAccBalance(amId) | |
668 | 668 | let prBalance = getAccBalance(prId) | |
669 | 669 | let $t02727627852 = if ((pmtAssetId == amId)) | |
670 | 670 | then if (if ((pmtAmt > amBalance)) | |
671 | 671 | then true | |
672 | 672 | else (amAssetPart > pmtAmt)) | |
673 | 673 | then throw("invalid payment amount") | |
674 | 674 | else $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0) | |
675 | 675 | else if ((pmtAssetId == prId)) | |
676 | 676 | then if (if ((pmtAmt > prBalance)) | |
677 | 677 | then true | |
678 | 678 | else (prAssetPart > pmtAmt)) | |
679 | 679 | then throw("invalid payment amount") | |
680 | 680 | else $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart) | |
681 | 681 | else throw("wrong pmtAssetId") | |
682 | 682 | let amBalanceNow = $t02727627852._1 | |
683 | 683 | let prBalanceNow = $t02727627852._2 | |
684 | 684 | let virtSwapInAm = $t02727627852._3 | |
685 | 685 | let virtSwapOutPr = $t02727627852._4 | |
686 | 686 | let virtSwapInPr = $t02727627852._5 | |
687 | 687 | let virtSwapOutAm = $t02727627852._6 | |
688 | 688 | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
689 | 689 | let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil) | |
690 | 690 | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
691 | 691 | if ((D0vsD1 == D0vsD1)) | |
692 | 692 | then { | |
693 | 693 | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, true, pmtAmt, pmtAssetId) | |
694 | 694 | let estimLP = estPut._2 | |
695 | 695 | let lpAssetId = estPut._7 | |
696 | 696 | let state = estPut._9 | |
697 | 697 | let amDiff = estPut._10 | |
698 | 698 | let prDiff = estPut._11 | |
699 | 699 | let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage)) | |
700 | 700 | let emitLpAmt = toInt(lpCalcRes._2) | |
701 | 701 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
702 | 702 | if ((e == e)) | |
703 | 703 | then { | |
704 | 704 | let el = match e { | |
705 | 705 | case legacy: Address => | |
706 | 706 | invoke(legacy, "emit", [emitLpAmt], nil) | |
707 | 707 | case _ => | |
708 | 708 | unit | |
709 | 709 | } | |
710 | 710 | if ((el == el)) | |
711 | 711 | then { | |
712 | 712 | let sa = if ((amDiff > 0)) | |
713 | 713 | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
714 | 714 | else nil | |
715 | 715 | if ((sa == sa)) | |
716 | 716 | then { | |
717 | 717 | let sp = if ((prDiff > 0)) | |
718 | 718 | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
719 | 719 | else nil | |
720 | 720 | if ((sp == sp)) | |
721 | 721 | then { | |
722 | 722 | let lpTrnsfr = if (autoStake) | |
723 | 723 | then { | |
724 | 724 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
725 | 725 | if ((ss == ss)) | |
726 | 726 | then nil | |
727 | 727 | else throw("Strict value is not equal to itself.") | |
728 | 728 | } | |
729 | 729 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
730 | 730 | (state ++ lpTrnsfr) | |
731 | 731 | } | |
732 | 732 | else throw("Strict value is not equal to itself.") | |
733 | 733 | } | |
734 | 734 | else throw("Strict value is not equal to itself.") | |
735 | 735 | } | |
736 | 736 | else throw("Strict value is not equal to itself.") | |
737 | 737 | } | |
738 | 738 | else throw("Strict value is not equal to itself.") | |
739 | 739 | } | |
740 | 740 | else throw("Strict value is not equal to itself.") | |
741 | 741 | } | |
742 | 742 | } | |
743 | 743 | else throw("Strict value is not equal to itself.") | |
744 | 744 | } | |
745 | 745 | ||
746 | 746 | ||
747 | 747 | ||
748 | 748 | @Callable(i) | |
749 | 749 | func putOneTknV2 (minOutAmount,autoStake) = if ((size(i.payments) != 1)) | |
750 | 750 | then throw("1 pmnt expd") | |
751 | 751 | else { | |
752 | 752 | let poolConfig = gpc() | |
753 | 753 | let amId = poolConfig[idxAmAsId] | |
754 | 754 | let prId = poolConfig[idxPrAsId] | |
755 | 755 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
756 | 756 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
757 | 757 | let userAddress = if ((i.caller == this)) | |
758 | 758 | then i.originCaller | |
759 | 759 | else i.caller | |
760 | 760 | let pmt = value(i.payments[0]) | |
761 | 761 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
762 | 762 | let pmtAmt = pmt.amount | |
763 | 763 | if ((10000000 > pmtAmt)) | |
764 | 764 | then throw("Wrong pmt amt") | |
765 | 765 | else { | |
766 | 766 | let r = estimatePutOneTknV2(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId)) | |
767 | 767 | let estimLP = r._2 | |
768 | 768 | let lpAssetId = r._7 | |
769 | 769 | let state = r._9 | |
770 | 770 | let amDiff = r._10 | |
771 | 771 | let prDiff = r._11 | |
772 | 772 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
773 | 773 | then (minOutAmount > estimLP) | |
774 | 774 | else false) | |
775 | 775 | then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
776 | 776 | else estimLP | |
777 | 777 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
778 | 778 | if ((e == e)) | |
779 | 779 | then { | |
780 | 780 | let el = match e { | |
781 | 781 | case legacy: Address => | |
782 | 782 | invoke(legacy, "emit", [emitLpAmt], nil) | |
783 | 783 | case _ => | |
784 | 784 | unit | |
785 | 785 | } | |
786 | 786 | if ((el == el)) | |
787 | 787 | then { | |
788 | 788 | let sa = if ((amDiff > 0)) | |
789 | 789 | then invoke(slipageContract, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
790 | 790 | else nil | |
791 | 791 | if ((sa == sa)) | |
792 | 792 | then { | |
793 | 793 | let sp = if ((prDiff > 0)) | |
794 | 794 | then invoke(slipageContract, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
795 | 795 | else nil | |
796 | 796 | if ((sp == sp)) | |
797 | 797 | then { | |
798 | 798 | let lpTrnsfr = if (autoStake) | |
799 | 799 | then { | |
800 | 800 | let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
801 | 801 | if ((ss == ss)) | |
802 | 802 | then nil | |
803 | 803 | else throw("Strict value is not equal to itself.") | |
804 | 804 | } | |
805 | 805 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
806 | 806 | $Tuple2((state ++ lpTrnsfr), emitLpAmt) | |
807 | 807 | } | |
808 | 808 | else throw("Strict value is not equal to itself.") | |
809 | 809 | } | |
810 | 810 | else throw("Strict value is not equal to itself.") | |
811 | 811 | } | |
812 | 812 | else throw("Strict value is not equal to itself.") | |
813 | 813 | } | |
814 | 814 | else throw("Strict value is not equal to itself.") | |
815 | 815 | } | |
816 | 816 | } | |
817 | 817 | ||
818 | 818 | ||
819 | 819 | ||
820 | 820 | @Callable(i) | |
821 | 821 | func putOneTknV2READONLY (paymentAmount,paymentAssetId) = { | |
822 | 822 | let r = estimatePutOneTknV2(paymentAmount, paymentAssetId, "", "") | |
823 | 823 | let estimLP = r._2 | |
824 | 824 | let lpAssetId = r._7 | |
825 | 825 | let state = r._9 | |
826 | 826 | let amDiff = r._10 | |
827 | 827 | let prDiff = r._11 | |
828 | 828 | $Tuple2(nil, estimLP) | |
829 | 829 | } | |
830 | 830 | ||
831 | 831 | ||
832 | 832 | ||
833 | 833 | @Callable(i) | |
834 | 834 | func putOneTknV2WithBonusREADONLY (paymentAmount,paymentAssetId) = { | |
835 | 835 | let poolConfig = gpc() | |
836 | 836 | let amId = poolConfig[idxAmAsId] | |
837 | 837 | let prId = poolConfig[idxPrAsId] | |
838 | 838 | let amBalance = getAccBalance(amId) | |
839 | 839 | let prBalance = getAccBalance(prId) | |
840 | 840 | let r = estimatePutOneTknV2(paymentAmount, paymentAssetId, "", "") | |
841 | 841 | let estimLP = r._2 | |
842 | 842 | let curPrice = r._3 | |
843 | 843 | let lpAssetEmission = r._6 | |
844 | 844 | let lpAssetId = r._7 | |
845 | 845 | let $t03251532824 = if ((paymentAssetId == amId)) | |
846 | 846 | then { | |
847 | 847 | let priceAssetAmount = fraction(paymentAmount, curPrice, scale8) | |
848 | 848 | $Tuple2(paymentAmount, priceAssetAmount) | |
849 | 849 | } | |
850 | 850 | else { | |
851 | 851 | let amountAssetAmount = fraction(paymentAmount, scale8, curPrice) | |
852 | 852 | $Tuple2(amountAssetAmount, paymentAmount) | |
853 | 853 | } | |
854 | 854 | let amountAssetAmount = $t03251532824._1 | |
855 | 855 | let priceAssetAmount = $t03251532824._2 | |
856 | 856 | let lpAmtBoth = fraction(lpAssetEmission, priceAssetAmount, prBalance) | |
857 | 857 | let lpAssetPriceOne = if ((paymentAssetId == amId)) | |
858 | 858 | then (amountAssetAmount / estimLP) | |
859 | 859 | else (priceAssetAmount / estimLP) | |
860 | 860 | let lpAssetPriceBoth = ((priceAssetAmount + amountAssetAmount) / lpAmtBoth) | |
861 | 861 | let bonus = ((lpAssetPriceOne - lpAssetPriceBoth) / lpAssetPriceOne) | |
862 | - | $Tuple2(nil, | |
862 | + | $Tuple2(nil, lpAmtBoth) | |
863 | 863 | } | |
864 | 864 | ||
865 | 865 | ||
866 | 866 | ||
867 | 867 | @Callable(i) | |
868 | 868 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
869 | 869 | then throw("Wrong slpg") | |
870 | 870 | else if ((size(i.payments) != 2)) | |
871 | 871 | then throw("2 pmnts expd") | |
872 | 872 | else { | |
873 | 873 | 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, true, 0, "") | |
874 | 874 | estPut._9 | |
875 | 875 | } | |
876 | 876 | ||
877 | 877 | ||
878 | 878 | ||
879 | 879 | @Callable(i) | |
880 | 880 | func get () = { | |
881 | 881 | let r = cg(i) | |
882 | 882 | let outAmtAmt = r._1 | |
883 | 883 | let outPrAmt = r._2 | |
884 | 884 | let pmtAmt = r._3 | |
885 | 885 | let pmtAssetId = r._4 | |
886 | 886 | let state = r._5 | |
887 | 887 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
888 | 888 | if ((b == b)) | |
889 | 889 | then state | |
890 | 890 | else throw("Strict value is not equal to itself.") | |
891 | 891 | } | |
892 | 892 | ||
893 | 893 | ||
894 | 894 | ||
895 | 895 | @Callable(i) | |
896 | 896 | func getOneTknV2 (outAssetId,minOutAmount) = if ((size(i.payments) != 1)) | |
897 | 897 | then throw("1 pmnt expd") | |
898 | 898 | else { | |
899 | 899 | let poolConfig = gpc() | |
900 | 900 | let lpId = poolConfig[idxLPAsId] | |
901 | 901 | let amId = poolConfig[idxAmAsId] | |
902 | 902 | let prId = poolConfig[idxPrAsId] | |
903 | 903 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
904 | 904 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
905 | 905 | let poolStatus = poolConfig[idxPoolSt] | |
906 | 906 | let userAddress = if ((i.caller == this)) | |
907 | 907 | then i.originCaller | |
908 | 908 | else i.caller | |
909 | 909 | let pmt = value(i.payments[0]) | |
910 | 910 | let pmtAssetId = value(pmt.assetId) | |
911 | 911 | let pmtAmt = pmt.amount | |
912 | 912 | if ((1000000000 > pmtAmt)) | |
913 | 913 | then throw("Min pmt 10 LP") | |
914 | 914 | else { | |
915 | 915 | let txId58 = toBase58String(i.transactionId) | |
916 | 916 | if ((lpId != toBase58String(pmtAssetId))) | |
917 | 917 | then throw("Wrong LP") | |
918 | 918 | else { | |
919 | 919 | let amBalance = getAccBalance(amId) | |
920 | 920 | let prBalance = getAccBalance(prId) | |
921 | 921 | let totalGet = { | |
922 | 922 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
923 | 923 | if ($isInstanceOf(@, "Int")) | |
924 | 924 | then @ | |
925 | 925 | else throw(($getType(invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)) + " couldn't be cast to Int")) | |
926 | 926 | } | |
927 | 927 | let totalAmount = if (if ((minOutAmount > 0)) | |
928 | 928 | then (minOutAmount > totalGet) | |
929 | 929 | else false) | |
930 | 930 | then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
931 | 931 | else totalGet | |
932 | - | let $ | |
932 | + | let $t03575335840 = if ((outAssetId == amId)) | |
933 | 933 | then $Tuple2(totalAmount, 0) | |
934 | 934 | else $Tuple2(0, totalAmount) | |
935 | - | let outAm = $ | |
936 | - | let outPr = $ | |
935 | + | let outAm = $t03575335840._1 | |
936 | + | let outPr = $t03575335840._2 | |
937 | 937 | let curPrX18 = cpbi(t1(prBalance, prDecimals), t1(amBalance, amDecimals)) | |
938 | 938 | let curPr = f1(curPrX18, scale8) | |
939 | 939 | let state = [ScriptTransfer(userAddress, totalAmount, if ((outAssetId == "WAVES")) | |
940 | 940 | then unit | |
941 | 941 | 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)] | |
942 | 942 | if ((state == state)) | |
943 | 943 | then { | |
944 | 944 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
945 | 945 | if ((burn == burn)) | |
946 | 946 | then $Tuple2(state, totalAmount) | |
947 | 947 | else throw("Strict value is not equal to itself.") | |
948 | 948 | } | |
949 | 949 | else throw("Strict value is not equal to itself.") | |
950 | 950 | } | |
951 | 951 | } | |
952 | 952 | } | |
953 | 953 | ||
954 | 954 | ||
955 | 955 | ||
956 | 956 | @Callable(i) | |
957 | 957 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
958 | 958 | let poolConfig = gpc() | |
959 | 959 | let lpId = poolConfig[idxLPAsId] | |
960 | 960 | let amId = poolConfig[idxAmAsId] | |
961 | 961 | let prId = poolConfig[idxPrAsId] | |
962 | 962 | let r = ego("", lpId, lpAssetAmount, this) | |
963 | 963 | let estimAmAmt = r._1 | |
964 | 964 | let estimPrAmt = r._2 | |
965 | 965 | let amBalance = getAccBalance(amId) | |
966 | 966 | let prBalance = getAccBalance(prId) | |
967 | 967 | let amBalanceNow = (amBalance - estimAmAmt) | |
968 | 968 | let prBalanceNow = (prBalance - estimPrAmt) | |
969 | - | let $ | |
969 | + | let $t03693437205 = if ((outAssetId == amId)) | |
970 | 970 | then $Tuple3(prBalanceNow, amBalanceNow, estimPrAmt) | |
971 | 971 | else if ((outAssetId == prId)) | |
972 | 972 | then $Tuple3(amBalanceNow, prBalanceNow, estimAmAmt) | |
973 | 973 | else throw("wrong outAssetId") | |
974 | - | let amountBalanceForSwap = $ | |
975 | - | let priceBalanceForSwap = $ | |
976 | - | let amountToSwap = $ | |
974 | + | let amountBalanceForSwap = $t03693437205._1 | |
975 | + | let priceBalanceForSwap = $t03693437205._2 | |
976 | + | let amountToSwap = $t03693437205._3 | |
977 | 977 | let yPrecision = 1 | |
978 | 978 | let exchResult = { | |
979 | 979 | let @ = invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil) | |
980 | 980 | if ($isInstanceOf(@, "Int")) | |
981 | 981 | then @ | |
982 | 982 | else throw(($getType(invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil)) + " couldn't be cast to Int")) | |
983 | 983 | } | |
984 | 984 | let totalGet = (exchResult + (if ((outAssetId == amId)) | |
985 | 985 | then estimAmAmt | |
986 | 986 | else estimPrAmt)) | |
987 | 987 | $Tuple2(nil, totalGet) | |
988 | 988 | } | |
989 | 989 | ||
990 | 990 | ||
991 | 991 | ||
992 | 992 | @Callable(i) | |
993 | 993 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
994 | 994 | let r = cg(i) | |
995 | 995 | let outAmAmt = r._1 | |
996 | 996 | let outPrAmt = r._2 | |
997 | 997 | let pmtAmt = r._3 | |
998 | 998 | let pmtAssetId = r._4 | |
999 | 999 | let state = r._5 | |
1000 | 1000 | if ((noLessThenAmtAsset > outAmAmt)) | |
1001 | 1001 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1002 | 1002 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1003 | 1003 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1004 | 1004 | else { | |
1005 | 1005 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1006 | 1006 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1007 | 1007 | then state | |
1008 | 1008 | else throw("Strict value is not equal to itself.") | |
1009 | 1009 | } | |
1010 | 1010 | } | |
1011 | 1011 | ||
1012 | 1012 | ||
1013 | 1013 | ||
1014 | 1014 | @Callable(i) | |
1015 | 1015 | func unstakeAndGet (amount) = { | |
1016 | 1016 | let checkPayments = if ((size(i.payments) != 0)) | |
1017 | 1017 | then throw("No pmnts expd") | |
1018 | 1018 | else true | |
1019 | 1019 | if ((checkPayments == checkPayments)) | |
1020 | 1020 | then { | |
1021 | 1021 | let cfg = gpc() | |
1022 | 1022 | let factoryCfg = gfc() | |
1023 | 1023 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1024 | 1024 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1025 | 1025 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1026 | 1026 | if ((unstakeInv == unstakeInv)) | |
1027 | 1027 | then { | |
1028 | 1028 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1029 | 1029 | let sts = parseIntValue(r._9) | |
1030 | 1030 | let state = r._10 | |
1031 | 1031 | let v = if (if (igs()) | |
1032 | 1032 | then true | |
1033 | 1033 | else (sts == PoolShutdown)) | |
1034 | 1034 | then throw(("Blocked: " + toString(sts))) | |
1035 | 1035 | else true | |
1036 | 1036 | if ((v == v)) | |
1037 | 1037 | then { | |
1038 | 1038 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1039 | 1039 | if ((burnA == burnA)) | |
1040 | 1040 | then state | |
1041 | 1041 | else throw("Strict value is not equal to itself.") | |
1042 | 1042 | } | |
1043 | 1043 | else throw("Strict value is not equal to itself.") | |
1044 | 1044 | } | |
1045 | 1045 | else throw("Strict value is not equal to itself.") | |
1046 | 1046 | } | |
1047 | 1047 | else throw("Strict value is not equal to itself.") | |
1048 | 1048 | } | |
1049 | 1049 | ||
1050 | 1050 | ||
1051 | 1051 | ||
1052 | 1052 | @Callable(i) | |
1053 | 1053 | func unstakeAndGetOneTkn (amount,outAmount,outAssetId,slippage) = { | |
1054 | 1054 | let checkPayments = if ((size(i.payments) != 0)) | |
1055 | 1055 | then throw("No pmnts expd") | |
1056 | 1056 | else true | |
1057 | 1057 | if ((checkPayments == checkPayments)) | |
1058 | 1058 | then { | |
1059 | 1059 | let cfg = gpc() | |
1060 | 1060 | let factoryCfg = gfc() | |
1061 | 1061 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1062 | 1062 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1063 | 1063 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1064 | 1064 | if ((unstakeInv == unstakeInv)) | |
1065 | 1065 | then { | |
1066 | 1066 | let outAmountResult = { | |
1067 | 1067 | let @ = invoke(this, "getOneTknV2", [outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)]) | |
1068 | 1068 | if ($isInstanceOf(@, "Int")) | |
1069 | 1069 | then @ | |
1070 | 1070 | else unit | |
1071 | 1071 | } | |
1072 | 1072 | if ((outAmountResult == outAmountResult)) | |
1073 | 1073 | then $Tuple2(nil, outAmountResult) | |
1074 | 1074 | else throw("Strict value is not equal to itself.") | |
1075 | 1075 | } | |
1076 | 1076 | else throw("Strict value is not equal to itself.") | |
1077 | 1077 | } | |
1078 | 1078 | else throw("Strict value is not equal to itself.") | |
1079 | 1079 | } | |
1080 | 1080 | ||
1081 | 1081 | ||
1082 | 1082 | ||
1083 | 1083 | @Callable(i) | |
1084 | 1084 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1085 | 1085 | then throw("denied") | |
1086 | 1086 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1087 | 1087 | ||
1088 | 1088 | ||
1089 | 1089 | ||
1090 | 1090 | @Callable(i) | |
1091 | 1091 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1092 | 1092 | then pd | |
1093 | 1093 | else [StringEntry(k, v)] | |
1094 | 1094 | ||
1095 | 1095 | ||
1096 | 1096 | ||
1097 | 1097 | @Callable(i) | |
1098 | 1098 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1099 | 1099 | then pd | |
1100 | 1100 | else [IntegerEntry(k, v)] | |
1101 | 1101 | ||
1102 | 1102 | ||
1103 | 1103 | ||
1104 | 1104 | @Callable(i) | |
1105 | 1105 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1106 | 1106 | ||
1107 | 1107 | ||
1108 | 1108 | ||
1109 | 1109 | @Callable(i) | |
1110 | 1110 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1111 | 1111 | ||
1112 | 1112 | ||
1113 | 1113 | ||
1114 | 1114 | @Callable(i) | |
1115 | 1115 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1116 | 1116 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1117 | 1117 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1118 | 1118 | } | |
1119 | 1119 | ||
1120 | 1120 | ||
1121 | 1121 | ||
1122 | 1122 | @Callable(i) | |
1123 | 1123 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1124 | 1124 | ||
1125 | 1125 | ||
1126 | 1126 | ||
1127 | 1127 | @Callable(i) | |
1128 | 1128 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1129 | 1129 | ||
1130 | 1130 | ||
1131 | 1131 | ||
1132 | 1132 | @Callable(i) | |
1133 | 1133 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1134 | 1134 | ||
1135 | 1135 | ||
1136 | 1136 | ||
1137 | 1137 | @Callable(i) | |
1138 | 1138 | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, true, false, 0, "")) | |
1139 | 1139 | ||
1140 | 1140 | ||
1141 | 1141 | ||
1142 | 1142 | @Callable(i) | |
1143 | 1143 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1144 | 1144 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1145 | 1145 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1146 | 1146 | } | |
1147 | 1147 | ||
1148 | 1148 | ||
1149 | 1149 | @Verifier(tx) | |
1150 | 1150 | func verify () = { | |
1151 | 1151 | let targetPublicKey = match m() { | |
1152 | 1152 | case pk: ByteVector => | |
1153 | 1153 | pk | |
1154 | 1154 | case _: Unit => | |
1155 | 1155 | tx.senderPublicKey | |
1156 | 1156 | case _ => | |
1157 | 1157 | throw("Match error") | |
1158 | 1158 | } | |
1159 | 1159 | match tx { | |
1160 | 1160 | case order: Order => | |
1161 | 1161 | let matcherPub = mp() | |
1162 | 1162 | let orderValid = moa(order) | |
1163 | 1163 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1164 | 1164 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1165 | 1165 | if (if (if (orderValid) | |
1166 | 1166 | then senderValid | |
1167 | 1167 | else false) | |
1168 | 1168 | then matcherValid | |
1169 | 1169 | else false) | |
1170 | 1170 | then true | |
1171 | 1171 | else toe(orderValid, senderValid, matcherValid) | |
1172 | 1172 | case s: SetScriptTransaction => | |
1173 | 1173 | let newHash = blake2b256(value(s.script)) | |
1174 | 1174 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1175 | 1175 | let currentHash = scriptHash(this) | |
1176 | 1176 | if (if ((allowedHash == newHash)) | |
1177 | 1177 | then (currentHash != newHash) | |
1178 | 1178 | else false) | |
1179 | 1179 | then true | |
1180 | 1180 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1181 | 1181 | case _ => | |
1182 | 1182 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1183 | 1183 | } | |
1184 | 1184 | } | |
1185 | 1185 |
github/deemru/w8io/026f985 106.64 ms ◑