tx · A11g2KZKrFVUaRkTBrXML2droNDVrLU2E94bthSVX56S 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA: -0.03200000 Waves 2023.01.12 12:25 [2401548] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves
{ "type": 13, "id": "A11g2KZKrFVUaRkTBrXML2droNDVrLU2E94bthSVX56S", "fee": 3200000, "feeAssetId": null, "timestamp": 1673515554124, "version": 1, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "2RCDohghK3CWxumNAX9u9uUpTn4iPZ2neDy4NcLjVh4bMqyazpzbhijf5xfKxG769ekDdmzobgNXd5EV2ZV1pZrF" ], "script": "base64:BgK/IggCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIECgIIARIECgIIARIECgIBARIDCgEBEgUKAwEBARIFCgMBCAESBAoCAQgSBAoCAQgSBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCCIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiCnNsaXBwYWdlNEQiC3dhdmVzU3RyaW5nIgVBbXVsdCIFRGNvbnYiA1NFUCIFRU1QVFkiClBvb2xBY3RpdmUiClBvb2xQdXREaXMiDlBvb2xNYXRjaGVyRGlzIgxQb29sU2h1dGRvd24iDmlkeFBvb2xBZGRyZXNzIglpZHhQb29sU3QiCWlkeExQQXNJZCIJaWR4QW1Bc0lkIglpZHhQckFzSWQiC2lkeEFtdEFzRGNtIg1pZHhQcmljZUFzRGNtIgtpZHhJQW10QXNJZCINaWR4SVByaWNlQXNJZCIPaWR4RmFjdFN0YWtDbnRyIhJpZHhGYWN0b3J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AIBAgtNYXRjaCBlcnJvcgQCYXYFAmdPAwkAAQIFAmF2AgVPcmRlcgQCZHoFAmF2BAJnUgkBAmFKAAQCZ1MJAQJkeQEFAmR6BAJnVAkA9AMDCAUCZHoJYm9keUJ5dGVzCQCRAwIIBQJkegZwcm9vZnMAAAgFAmR6D3NlbmRlclB1YmxpY0tleQQCZ1UJAPQDAwgFAmR6CWJvZHlCeXRlcwkAkQMCCAUCZHoGcHJvb2ZzAAEFAmdSAwMDBQJnUwUCZ1QHBQJnVQcGCQECYXEDBQJnUwUCZ1QFAmdVAwkAAQIFAmF2AhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZFoFAmF2BAJnVgkA9gMBCQEFdmFsdWUBCAUCZFoGc2NyaXB0BAJnVwkA2wQBCQEFdmFsdWUBCQCdCAIFAmFECQECYW8ABAJnWAkA8QcBBQR0aGlzAwMJAAACBQJnVwUCZ1YJAQIhPQIFAmdYBQJnVgcGCQD0AwMIBQJnTwlib2R5Qnl0ZXMJAJEDAggFAmdPBnByb29mcwAABQJnUQkA9AMDCAUCZ08JYm9keUJ5dGVzCQCRAwIIBQJnTwZwcm9vZnMAAAUCZ1GEykE/", "chainId": 84, "height": 2401548, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DZx7tfgjUFPoyfZ7kyqETntiHayMTZyUThsP2mhQUno4 Next: ASAAGHZyM5rSntq681qtfsq8R4v3RaxqhPDdPQWKJPFe Diff:
Old | New | Differences | |
---|---|---|---|
1226 | 1226 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1227 | 1227 | let userAddress = i.caller | |
1228 | 1228 | let lpAssetRecipientAddress = this | |
1229 | - | let unstakeInv = invoke(staking, "unstakeINTERNAL", [ | |
1229 | + | let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil) | |
1230 | 1230 | if ((unstakeInv == unstakeInv)) | |
1231 | 1231 | then { | |
1232 | - | let $ | |
1233 | - | let state = $ | |
1234 | - | let totalAmount = $ | |
1232 | + | let $t04168341871 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1233 | + | let state = $t04168341871._1 | |
1234 | + | let totalAmount = $t04168341871._2 | |
1235 | 1235 | $Tuple2(state, totalAmount) | |
1236 | 1236 | } | |
1237 | 1237 | else throw("Strict value is not equal to itself.") | |
1247 | 1247 | let amId = poolConfig[idxAmAsId] | |
1248 | 1248 | let prId = poolConfig[idxPrAsId] | |
1249 | 1249 | let lpId = poolConfig[idxLPAsId] | |
1250 | - | let $ | |
1251 | - | let lpAmount = $ | |
1252 | - | let state = $ | |
1253 | - | let feeAmount = $ | |
1254 | - | let bonus = $ | |
1250 | + | let $t04213042233 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1251 | + | let lpAmount = $t04213042233._1 | |
1252 | + | let state = $t04213042233._2 | |
1253 | + | let feeAmount = $t04213042233._3 | |
1254 | + | let bonus = $t04213042233._4 | |
1255 | 1255 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1256 | 1256 | } | |
1257 | 1257 | ||
1263 | 1263 | let amId = poolConfig[idxAmAsId] | |
1264 | 1264 | let prId = poolConfig[idxPrAsId] | |
1265 | 1265 | let lpId = poolConfig[idxLPAsId] | |
1266 | - | let $ | |
1267 | - | let lpAmount = $ | |
1268 | - | let state = $ | |
1269 | - | let feeAmount = $ | |
1270 | - | let bonus = $ | |
1266 | + | let $t04251242616 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1267 | + | let lpAmount = $t04251242616._1 | |
1268 | + | let state = $t04251242616._2 | |
1269 | + | let feeAmount = $t04251242616._3 | |
1270 | + | let bonus = $t04251242616._4 | |
1271 | 1271 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1272 | 1272 | } | |
1273 | 1273 |
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 big0 = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big1 = toBigInt(1) | |
15 | 15 | ||
16 | 16 | let big2 = toBigInt(2) | |
17 | 17 | ||
18 | 18 | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
19 | 19 | ||
20 | 20 | let wavesString = "WAVES" | |
21 | 21 | ||
22 | 22 | let Amult = "100" | |
23 | 23 | ||
24 | 24 | let Dconv = "1" | |
25 | 25 | ||
26 | 26 | let SEP = "__" | |
27 | 27 | ||
28 | 28 | let EMPTY = "" | |
29 | 29 | ||
30 | 30 | let PoolActive = 1 | |
31 | 31 | ||
32 | 32 | let PoolPutDis = 2 | |
33 | 33 | ||
34 | 34 | let PoolMatcherDis = 3 | |
35 | 35 | ||
36 | 36 | let PoolShutdown = 4 | |
37 | 37 | ||
38 | 38 | let idxPoolAddress = 1 | |
39 | 39 | ||
40 | 40 | let idxPoolSt = 2 | |
41 | 41 | ||
42 | 42 | let idxLPAsId = 3 | |
43 | 43 | ||
44 | 44 | let idxAmAsId = 4 | |
45 | 45 | ||
46 | 46 | let idxPrAsId = 5 | |
47 | 47 | ||
48 | 48 | let idxAmtAsDcm = 6 | |
49 | 49 | ||
50 | 50 | let idxPriceAsDcm = 7 | |
51 | 51 | ||
52 | 52 | let idxIAmtAsId = 8 | |
53 | 53 | ||
54 | 54 | let idxIPriceAsId = 9 | |
55 | 55 | ||
56 | 56 | let idxFactStakCntr = 1 | |
57 | 57 | ||
58 | 58 | let idxFactoryRestCntr = 6 | |
59 | 59 | ||
60 | 60 | let idxFactSlippCntr = 7 | |
61 | 61 | ||
62 | 62 | let idxFactGwxRewCntr = 10 | |
63 | 63 | ||
64 | 64 | let feeDefault = fraction(10, scale8, 10000) | |
65 | 65 | ||
66 | 66 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func abs (val) = if ((zeroBigInt > val)) | |
76 | 76 | then -(val) | |
77 | 77 | else val | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func absBigInt (val) = if ((zeroBigInt > val)) | |
81 | 81 | then -(val) | |
82 | 82 | else val | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func fc () = "%s__factoryContract" | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func mpk () = "%s__managerPublicKey" | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func pmpk () = "%s__pendingManagerPublicKey" | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func pl () = "%s%s__price__last" | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func aa () = "%s__amountAsset" | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func pa () = "%s__priceAsset" | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func amp () = "%s__amp" | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func ada () = "%s__addonAddr" | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func fcfg () = "%s__factoryConfig" | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func mtpk () = "%s%s__matcher__publicKey" | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func aps () = "%s__shutdown" | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func keyFeeCollectorAddress () = "%s__feeCollectorAddress" | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func str (val) = match val { | |
143 | 143 | case valStr: String => | |
144 | 144 | valStr | |
145 | 145 | case _ => | |
146 | 146 | throw("fail cast to String") | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " ")) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | let fca = addressFromStringValue(strf(this, fc())) | |
160 | 160 | ||
161 | 161 | let inFee = { | |
162 | 162 | let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil) | |
163 | 163 | if ($isInstanceOf(@, "Int")) | |
164 | 164 | then @ | |
165 | 165 | else throw(($getType(@) + " couldn't be cast to Int")) | |
166 | 166 | } | |
167 | 167 | ||
168 | 168 | let outFee = { | |
169 | 169 | let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil) | |
170 | 170 | if ($isInstanceOf(@, "Int")) | |
171 | 171 | then @ | |
172 | 172 | else throw(($getType(@) + " couldn't be cast to Int")) | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | let A = strf(this, amp()) | |
176 | 176 | ||
177 | 177 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func mp () = fromBase58String(strf(fca, mtpk())) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress())) | |
184 | 184 | ||
185 | 185 | func gpc () = { | |
186 | 186 | let amtAs = strf(this, aa()) | |
187 | 187 | let priceAs = strf(this, pa()) | |
188 | 188 | let iPriceAs = intf(fca, mba(priceAs)) | |
189 | 189 | let iAmtAs = intf(fca, mba(amtAs)) | |
190 | 190 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func parseAssetId (input) = if ((input == wavesString)) | |
195 | 195 | then unit | |
196 | 196 | else fromBase58String(input) | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func assetIdToString (input) = if ((input == unit)) | |
200 | 200 | then wavesString | |
201 | 201 | else toBase58String(value(input)) | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm])) | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | let poolConfigParsed = parsePoolConfig(gpc()) | |
208 | 208 | ||
209 | 209 | let $t069097095 = poolConfigParsed | |
210 | 210 | ||
211 | 211 | let cfgPoolAddress = $t069097095._1 | |
212 | 212 | ||
213 | 213 | let cfgPoolStatus = $t069097095._2 | |
214 | 214 | ||
215 | 215 | let cfgLpAssetId = $t069097095._3 | |
216 | 216 | ||
217 | 217 | let cfgAmountAssetId = $t069097095._4 | |
218 | 218 | ||
219 | 219 | let cfgPriceAssetId = $t069097095._5 | |
220 | 220 | ||
221 | 221 | let cfgAmountAssetDecimals = $t069097095._6 | |
222 | 222 | ||
223 | 223 | let cfgPriceAssetDecimals = $t069097095._7 | |
224 | 224 | ||
225 | 225 | func gfc () = split(strf(fca, fcfg()), SEP) | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | let factoryConfig = gfc() | |
229 | 229 | ||
230 | 230 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
231 | 231 | ||
232 | 232 | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
233 | 233 | ||
234 | 234 | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
235 | 235 | ||
236 | 236 | let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address") | |
237 | 237 | ||
238 | 238 | 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) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | 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) | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
245 | 245 | then wavesBalance(this).available | |
246 | 246 | else assetBalance(this, fromBase58String(assetId)) | |
247 | 247 | ||
248 | 248 | ||
249 | 249 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
250 | 250 | ||
251 | 251 | ||
252 | 252 | func vad (A1,A2,slippage) = { | |
253 | 253 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
254 | 254 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
255 | 255 | if (!(pass)) | |
256 | 256 | then throw(("Big slpg: " + toString(diff))) | |
257 | 257 | else $Tuple2(pass, min([A1, A2])) | |
258 | 258 | } | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | func vd (D1,D0,slpg) = { | |
262 | 262 | let diff = fraction(D0, scale8BigInt, D1) | |
263 | 263 | let fail = (slpg > diff) | |
264 | 264 | if (if (fail) | |
265 | 265 | then true | |
266 | 266 | else (D0 > D1)) | |
267 | 267 | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
268 | 268 | else fail | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
273 | 273 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
274 | 274 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
275 | 275 | cpbi(prAsAmtX18, amtAsAmtX18) | |
276 | 276 | } | |
277 | 277 | ||
278 | 278 | ||
279 | 279 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
280 | 280 | let cfg = gpc() | |
281 | 281 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
282 | 282 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
283 | 283 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
284 | 284 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
285 | 285 | let prAmtX18 = t1(prAmt, prAsDcm) | |
286 | 286 | let lpAmtX18 = t1(lpAmt, scale8) | |
287 | 287 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
288 | 288 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
289 | 289 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
290 | 290 | } | |
291 | 291 | ||
292 | 292 | ||
293 | 293 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
294 | 294 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
295 | 295 | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
296 | 296 | } | |
297 | 297 | ||
298 | 298 | ||
299 | 299 | func takeFee (amount,fee) = { | |
300 | 300 | let feeAmount = if ((fee == 0)) | |
301 | 301 | then 0 | |
302 | 302 | else fraction(amount, fee, scale8) | |
303 | 303 | $Tuple2((amount - feeAmount), feeAmount) | |
304 | 304 | } | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
308 | 308 | let cfg = gpc() | |
309 | 309 | let lpId = cfg[idxLPAsId] | |
310 | 310 | let amId = cfg[idxAmAsId] | |
311 | 311 | let prId = cfg[idxPrAsId] | |
312 | 312 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
313 | 313 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
314 | 314 | let sts = cfg[idxPoolSt] | |
315 | 315 | let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity | |
316 | 316 | if ((lpId != pmtAssetId)) | |
317 | 317 | then throw("Wrong pmt asset") | |
318 | 318 | else { | |
319 | 319 | let amBalance = getAccBalance(amId) | |
320 | 320 | let amBalanceX18 = t1(amBalance, amDcm) | |
321 | 321 | let prBalance = getAccBalance(prId) | |
322 | 322 | let prBalanceX18 = t1(prBalance, prDcm) | |
323 | 323 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
324 | 324 | let curPrice = f1(curPriceX18, scale8) | |
325 | 325 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
326 | 326 | let lpEmissX18 = t1(lpEmiss, scale8) | |
327 | 327 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
328 | 328 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
329 | 329 | let outAmAmt = f1(outAmAmtX18, amDcm) | |
330 | 330 | let outPrAmt = f1(outPrAmtX18, prDcm) | |
331 | 331 | let state = if ((txId58 == "")) | |
332 | 332 | then nil | |
333 | 333 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
334 | 334 | then unit | |
335 | 335 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
336 | 336 | then unit | |
337 | 337 | 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)] | |
338 | 338 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
339 | 339 | } | |
340 | 340 | } | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
344 | 344 | let cfg = gpc() | |
345 | 345 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
346 | 346 | let amIdStr = cfg[idxAmAsId] | |
347 | 347 | let prIdStr = cfg[idxPrAsId] | |
348 | 348 | let inAmIdStr = cfg[idxIAmtAsId] | |
349 | 349 | let inPrIdStr = cfg[idxIPriceAsId] | |
350 | 350 | let amtDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
351 | 351 | let priceDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
352 | 352 | let sts = cfg[idxPoolSt] | |
353 | 353 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
354 | 354 | let amBalance = if (isEval) | |
355 | 355 | then getAccBalance(amIdStr) | |
356 | 356 | else if (if (isOneAsset) | |
357 | 357 | then (pmtId == amIdStr) | |
358 | 358 | else false) | |
359 | 359 | then (getAccBalance(amIdStr) - pmtAmt) | |
360 | 360 | else if (isOneAsset) | |
361 | 361 | then getAccBalance(amIdStr) | |
362 | 362 | else (getAccBalance(amIdStr) - inAmAmt) | |
363 | 363 | let prBalance = if (isEval) | |
364 | 364 | then getAccBalance(prIdStr) | |
365 | 365 | else if (if (isOneAsset) | |
366 | 366 | then (pmtId == prIdStr) | |
367 | 367 | else false) | |
368 | 368 | then (getAccBalance(prIdStr) - pmtAmt) | |
369 | 369 | else if (isOneAsset) | |
370 | 370 | then getAccBalance(prIdStr) | |
371 | 371 | else (getAccBalance(prIdStr) - inPrAmt) | |
372 | 372 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
373 | 373 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
374 | 374 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
375 | 375 | let amBalanceX18 = t1(amBalance, amtDcm) | |
376 | 376 | let prBalanceX18 = t1(prBalance, priceDcm) | |
377 | 377 | let r = if ((lpEm == 0)) | |
378 | 378 | then { | |
379 | 379 | let curPriceX18 = zeroBigInt | |
380 | 380 | let slippageX18 = zeroBigInt | |
381 | 381 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
382 | 382 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
383 | 383 | } | |
384 | 384 | else { | |
385 | 385 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
386 | 386 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
387 | 387 | let slippageX18 = t1(slippage, scale8) | |
388 | 388 | if (if (if (validateSlippage) | |
389 | 389 | then (curPriceX18 != zeroBigInt) | |
390 | 390 | else false) | |
391 | 391 | then (slippageRealX18 > slippageX18) | |
392 | 392 | else false) | |
393 | 393 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
394 | 394 | else { | |
395 | 395 | let lpEmissionX18 = t1(lpEm, scale8) | |
396 | 396 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
397 | 397 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
398 | 398 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
399 | 399 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
400 | 400 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
401 | 401 | let expAmtAssetAmtX18 = expectedAmts._1 | |
402 | 402 | let expPriceAssetAmtX18 = expectedAmts._2 | |
403 | 403 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
404 | 404 | $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
405 | 405 | } | |
406 | 406 | } | |
407 | 407 | let calcLpAmt = r._1 | |
408 | 408 | let calcAmAssetPmt = r._2 | |
409 | 409 | let calcPrAssetPmt = r._3 | |
410 | 410 | let curPrice = f1(r._4, scale8) | |
411 | 411 | let slippageCalc = f1(r._5, scale8) | |
412 | 412 | if ((0 >= calcLpAmt)) | |
413 | 413 | then throw("LP <= 0") | |
414 | 414 | else { | |
415 | 415 | let emitLpAmt = if (!(emitLp)) | |
416 | 416 | then 0 | |
417 | 417 | else calcLpAmt | |
418 | 418 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
419 | 419 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
420 | 420 | let $t01756217907 = if (if (isOneAsset) | |
421 | 421 | then (pmtId == amIdStr) | |
422 | 422 | else false) | |
423 | 423 | then $Tuple2(pmtAmt, 0) | |
424 | 424 | else if (if (isOneAsset) | |
425 | 425 | then (pmtId == prIdStr) | |
426 | 426 | else false) | |
427 | 427 | then $Tuple2(0, pmtAmt) | |
428 | 428 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
429 | 429 | let writeAmAmt = $t01756217907._1 | |
430 | 430 | let writePrAmt = $t01756217907._2 | |
431 | 431 | 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))] | |
432 | 432 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
433 | 433 | } | |
434 | 434 | } | |
435 | 435 | ||
436 | 436 | ||
437 | 437 | func moa (order) = { | |
438 | 438 | let cfg = gpc() | |
439 | 439 | let amtAsId = cfg[idxAmAsId] | |
440 | 440 | let prAsId = cfg[idxPrAsId] | |
441 | 441 | let sts = parseIntValue(cfg[idxPoolSt]) | |
442 | 442 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
443 | 443 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
444 | 444 | let accAmtAsBalance = getAccBalance(amtAsId) | |
445 | 445 | let accPrAsBalance = getAccBalance(prAsId) | |
446 | 446 | let curPriceX18 = if ((order.orderType == Buy)) | |
447 | 447 | then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance) | |
448 | 448 | else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance) | |
449 | 449 | let curPrice = f1(curPriceX18, scale8) | |
450 | 450 | if (if (if (igs()) | |
451 | 451 | then true | |
452 | 452 | else (sts == PoolMatcherDis)) | |
453 | 453 | then true | |
454 | 454 | else (sts == PoolShutdown)) | |
455 | 455 | then throw("Admin blocked") | |
456 | 456 | else { | |
457 | 457 | let orAmtAsset = order.assetPair.amountAsset | |
458 | 458 | let orAmtAsStr = if ((orAmtAsset == unit)) | |
459 | 459 | then "WAVES" | |
460 | 460 | else toBase58String(value(orAmtAsset)) | |
461 | 461 | let orPrAsset = order.assetPair.priceAsset | |
462 | 462 | let orPrAsStr = if ((orPrAsset == unit)) | |
463 | 463 | then "WAVES" | |
464 | 464 | else toBase58String(value(orPrAsset)) | |
465 | 465 | if (if ((orAmtAsStr != amtAsId)) | |
466 | 466 | then true | |
467 | 467 | else (orPrAsStr != prAsId)) | |
468 | 468 | then throw("Wr assets") | |
469 | 469 | else { | |
470 | 470 | let orderPrice = order.price | |
471 | 471 | let priceDcm = fraction(scale8, prAsDcm, amtAsDcm) | |
472 | 472 | let castOrderPrice = ts(orderPrice, scale8, priceDcm) | |
473 | 473 | let isOrderPriceValid = if ((order.orderType == Buy)) | |
474 | 474 | then (curPrice >= castOrderPrice) | |
475 | 475 | else (castOrderPrice >= curPrice) | |
476 | 476 | true | |
477 | 477 | } | |
478 | 478 | } | |
479 | 479 | } | |
480 | 480 | ||
481 | 481 | ||
482 | 482 | func cg (i) = if ((size(i.payments) != 1)) | |
483 | 483 | then throw("1 pmnt exp") | |
484 | 484 | else { | |
485 | 485 | let pmt = value(i.payments[0]) | |
486 | 486 | let pmtAssetId = value(pmt.assetId) | |
487 | 487 | let pmtAmt = pmt.amount | |
488 | 488 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
489 | 489 | let outAmAmt = r._1 | |
490 | 490 | let outPrAmt = r._2 | |
491 | 491 | let sts = parseIntValue(r._9) | |
492 | 492 | let state = r._10 | |
493 | 493 | if (if (igs()) | |
494 | 494 | then true | |
495 | 495 | else (sts == PoolShutdown)) | |
496 | 496 | then throw(("Admin blocked: " + toString(sts))) | |
497 | 497 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
498 | 498 | } | |
499 | 499 | ||
500 | 500 | ||
501 | 501 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
502 | 502 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
503 | 503 | let sts = parseIntValue(r._8) | |
504 | 504 | if (if (if (igs()) | |
505 | 505 | then true | |
506 | 506 | else (sts == PoolPutDis)) | |
507 | 507 | then true | |
508 | 508 | else (sts == PoolShutdown)) | |
509 | 509 | then throw(("Blocked:" + toString(sts))) | |
510 | 510 | else r | |
511 | 511 | } | |
512 | 512 | ||
513 | 513 | ||
514 | 514 | func getD (xp) = { | |
515 | 515 | let n = big2 | |
516 | 516 | let xp0 = xp[0] | |
517 | 517 | let xp1 = xp[1] | |
518 | 518 | let aPrecision = parseBigIntValue(Amult) | |
519 | 519 | let a = (parseBigIntValue(A) * aPrecision) | |
520 | 520 | let s = (xp0 + xp1) | |
521 | 521 | if ((s == big0)) | |
522 | 522 | then big0 | |
523 | 523 | else { | |
524 | 524 | let ann = (a * n) | |
525 | 525 | let xp0_xp1_n_n = (((xp0 * xp1) * n) * n) | |
526 | 526 | let ann_s_aPrecision = ((ann * s) / aPrecision) | |
527 | 527 | let ann_aPrecision = (ann - aPrecision) | |
528 | 528 | let n1 = (n + big1) | |
529 | 529 | func calc (acc,cur) = { | |
530 | 530 | let $t02245922479 = acc | |
531 | 531 | let d = $t02245922479._1 | |
532 | 532 | let found = $t02245922479._2 | |
533 | 533 | if ((found != unit)) | |
534 | 534 | then acc | |
535 | 535 | else { | |
536 | 536 | let dp = (((d * d) * d) / xp0_xp1_n_n) | |
537 | 537 | let dNext = (((ann_s_aPrecision + (dp * n)) * d) / (((ann_aPrecision * d) / aPrecision) + (n1 * dp))) | |
538 | 538 | let dDiff = absBigInt((dNext - value(d))) | |
539 | 539 | if ((big1 >= dDiff)) | |
540 | 540 | then $Tuple2(dNext, cur) | |
541 | 541 | else $Tuple2(dNext, unit) | |
542 | 542 | } | |
543 | 543 | } | |
544 | 544 | ||
545 | 545 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
546 | 546 | let $t02290022947 = { | |
547 | 547 | let $l = arr | |
548 | 548 | let $s = size($l) | |
549 | 549 | let $acc0 = $Tuple2(s, unit) | |
550 | 550 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
551 | 551 | then $a | |
552 | 552 | else calc($a, $l[$i]) | |
553 | 553 | ||
554 | 554 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
555 | 555 | then $a | |
556 | 556 | else throw("List size exceeds 15") | |
557 | 557 | ||
558 | 558 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
559 | 559 | } | |
560 | 560 | let d = $t02290022947._1 | |
561 | 561 | let found = $t02290022947._2 | |
562 | 562 | if ((found != unit)) | |
563 | 563 | then d | |
564 | 564 | else throw(("D calculation error, D = " + toString(d))) | |
565 | 565 | } | |
566 | 566 | } | |
567 | 567 | ||
568 | 568 | ||
569 | 569 | func getYD (xp,i,D) = { | |
570 | 570 | let n = big2 | |
571 | 571 | let x = xp[if ((i == 0)) | |
572 | 572 | then 1 | |
573 | 573 | else 0] | |
574 | 574 | let aPrecision = parseBigIntValue(Amult) | |
575 | 575 | let a = (parseBigIntValue(A) * aPrecision) | |
576 | 576 | let s = x | |
577 | 577 | let ann = (a * n) | |
578 | 578 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
579 | 579 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
580 | 580 | func calc (acc,cur) = { | |
581 | 581 | let $t02344723467 = acc | |
582 | 582 | let y = $t02344723467._1 | |
583 | 583 | let found = $t02344723467._2 | |
584 | 584 | if ((found != unit)) | |
585 | 585 | then acc | |
586 | 586 | else { | |
587 | 587 | let yNext = (((y * y) + c) / ((big2 * y) + b)) | |
588 | 588 | let yDiff = absBigInt((yNext - value(y))) | |
589 | 589 | if ((big1 >= yDiff)) | |
590 | 590 | then $Tuple2(yNext, cur) | |
591 | 591 | else $Tuple2(yNext, unit) | |
592 | 592 | } | |
593 | 593 | } | |
594 | 594 | ||
595 | 595 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
596 | 596 | let $t02377423821 = { | |
597 | 597 | let $l = arr | |
598 | 598 | let $s = size($l) | |
599 | 599 | let $acc0 = $Tuple2(D, unit) | |
600 | 600 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
601 | 601 | then $a | |
602 | 602 | else calc($a, $l[$i]) | |
603 | 603 | ||
604 | 604 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
605 | 605 | then $a | |
606 | 606 | else throw("List size exceeds 15") | |
607 | 607 | ||
608 | 608 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
609 | 609 | } | |
610 | 610 | let y = $t02377423821._1 | |
611 | 611 | let found = $t02377423821._2 | |
612 | 612 | if ((found != unit)) | |
613 | 613 | then y | |
614 | 614 | else throw(("Y calculation error, Y = " + toString(y))) | |
615 | 615 | } | |
616 | 616 | ||
617 | 617 | ||
618 | 618 | func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = { | |
619 | 619 | let poolConfig = gpc() | |
620 | 620 | let amId = poolConfig[idxAmAsId] | |
621 | 621 | let prId = poolConfig[idxPrAsId] | |
622 | 622 | let lpId = poolConfig[idxLPAsId] | |
623 | 623 | let amtDcm = parseIntValue(poolConfig[idxAmtAsDcm]) | |
624 | 624 | let priceDcm = parseIntValue(poolConfig[idxPriceAsDcm]) | |
625 | 625 | let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
626 | 626 | let chechEmission = if ((lpAssetEmission > big0)) | |
627 | 627 | then true | |
628 | 628 | else throw("initial deposit requires all coins") | |
629 | 629 | if ((chechEmission == chechEmission)) | |
630 | 630 | then { | |
631 | 631 | let amBalance = getAccBalance(amId) | |
632 | 632 | let prBalance = getAccBalance(prId) | |
633 | 633 | let $t02460425066 = if ((txId == "")) | |
634 | 634 | then $Tuple2(amBalance, prBalance) | |
635 | 635 | else if ((pmtAssetId == amId)) | |
636 | 636 | then if ((pmtAmtRaw > amBalance)) | |
637 | 637 | then throw("invalid payment amount") | |
638 | 638 | else $Tuple2((amBalance - pmtAmtRaw), prBalance) | |
639 | 639 | else if ((pmtAssetId == prId)) | |
640 | 640 | then if ((pmtAmtRaw > prBalance)) | |
641 | 641 | then throw("invalid payment amount") | |
642 | 642 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
643 | 643 | else throw("wrong pmtAssetId") | |
644 | 644 | let amBalanceOld = $t02460425066._1 | |
645 | 645 | let prBalanceOld = $t02460425066._2 | |
646 | 646 | let $t02507225248 = if ((pmtAssetId == amId)) | |
647 | 647 | then $Tuple2(pmtAmtRaw, 0) | |
648 | 648 | else if ((pmtAssetId == prId)) | |
649 | 649 | then $Tuple2(0, pmtAmtRaw) | |
650 | 650 | else throw("invalid payment") | |
651 | 651 | let amAmountRaw = $t02507225248._1 | |
652 | 652 | let prAmountRaw = $t02507225248._2 | |
653 | 653 | let $t02525225506 = if (withTakeFee) | |
654 | 654 | then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2) | |
655 | 655 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
656 | 656 | let amAmount = $t02525225506._1 | |
657 | 657 | let prAmount = $t02525225506._2 | |
658 | 658 | let feeAmount = $t02525225506._3 | |
659 | 659 | let amBalanceNew = (amBalanceOld + amAmount) | |
660 | 660 | let prBalanceNew = (prBalanceOld + prAmount) | |
661 | 661 | let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)]) | |
662 | 662 | let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)]) | |
663 | 663 | let checkD = if ((D1 > D0)) | |
664 | 664 | then true | |
665 | 665 | else throw() | |
666 | 666 | if ((checkD == checkD)) | |
667 | 667 | then { | |
668 | 668 | let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0) | |
669 | 669 | let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8) | |
670 | 670 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId), dataPutActionInfo(amAmountRaw, prAmountRaw, toInt(lpAmount), curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
671 | 671 | let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld) | |
672 | 672 | let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8)) | |
673 | 673 | let priceAssetPart = (pmtAmtRaw - amountAssetPart) | |
674 | 674 | let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld)) | |
675 | 675 | let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
676 | 676 | $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus) | |
677 | 677 | } | |
678 | 678 | else throw("Strict value is not equal to itself.") | |
679 | 679 | } | |
680 | 680 | else throw("Strict value is not equal to itself.") | |
681 | 681 | } | |
682 | 682 | ||
683 | 683 | ||
684 | 684 | func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = { | |
685 | 685 | let poolConfig = gpc() | |
686 | 686 | let lpId = poolConfig[idxLPAsId] | |
687 | 687 | let amId = poolConfig[idxAmAsId] | |
688 | 688 | let prId = poolConfig[idxPrAsId] | |
689 | 689 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
690 | 690 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
691 | 691 | let poolStatus = poolConfig[idxPoolSt] | |
692 | 692 | let userAddress = if ((caller == restContract)) | |
693 | 693 | then originCaller | |
694 | 694 | else caller | |
695 | 695 | let pmt = value(payments[0]) | |
696 | 696 | let pmtAssetId = value(pmt.assetId) | |
697 | 697 | let pmtAmt = pmt.amount | |
698 | 698 | let txId58 = toBase58String(transactionId) | |
699 | 699 | if ((lpId != toBase58String(pmtAssetId))) | |
700 | 700 | then throw("Wrong LP") | |
701 | 701 | else { | |
702 | 702 | let amBalance = getAccBalance(amId) | |
703 | 703 | let prBalance = getAccBalance(prId) | |
704 | 704 | let $t02750827619 = { | |
705 | 705 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
706 | 706 | if ($isInstanceOf(@, "(Int, Int)")) | |
707 | 707 | then @ | |
708 | 708 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
709 | 709 | } | |
710 | 710 | if (($t02750827619 == $t02750827619)) | |
711 | 711 | then { | |
712 | 712 | let feeAmount = $t02750827619._2 | |
713 | 713 | let totalGet = $t02750827619._1 | |
714 | 714 | let totalAmount = if (if ((minOutAmount > 0)) | |
715 | 715 | then (minOutAmount > totalGet) | |
716 | 716 | else false) | |
717 | 717 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
718 | 718 | else totalGet | |
719 | 719 | let $t02780928116 = if ((outAssetId == amId)) | |
720 | 720 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
721 | 721 | else if ((outAssetId == prId)) | |
722 | 722 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
723 | 723 | else throw("invalid out asset id") | |
724 | 724 | let outAm = $t02780928116._1 | |
725 | 725 | let outPr = $t02780928116._2 | |
726 | 726 | let amBalanceNew = $t02780928116._3 | |
727 | 727 | let prBalanceNew = $t02780928116._4 | |
728 | 728 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
729 | 729 | let curPr = f1(curPrX18, scale8) | |
730 | 730 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
731 | 731 | then unit | |
732 | 732 | else fromBase58String(outAssetId) | |
733 | 733 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
734 | 734 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
735 | 735 | else nil | |
736 | 736 | let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher) | |
737 | 737 | if ((state == state)) | |
738 | 738 | then { | |
739 | 739 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
740 | 740 | if ((burn == burn)) | |
741 | 741 | then $Tuple2(state, totalAmount) | |
742 | 742 | else throw("Strict value is not equal to itself.") | |
743 | 743 | } | |
744 | 744 | else throw("Strict value is not equal to itself.") | |
745 | 745 | } | |
746 | 746 | else throw("Strict value is not equal to itself.") | |
747 | 747 | } | |
748 | 748 | } | |
749 | 749 | ||
750 | 750 | ||
751 | 751 | func m () = match getString(mpk()) { | |
752 | 752 | case s: String => | |
753 | 753 | fromBase58String(s) | |
754 | 754 | case _: Unit => | |
755 | 755 | unit | |
756 | 756 | case _ => | |
757 | 757 | throw("Match error") | |
758 | 758 | } | |
759 | 759 | ||
760 | 760 | ||
761 | 761 | func pm () = match getString(pmpk()) { | |
762 | 762 | case s: String => | |
763 | 763 | fromBase58String(s) | |
764 | 764 | case _: Unit => | |
765 | 765 | unit | |
766 | 766 | case _ => | |
767 | 767 | throw("Match error") | |
768 | 768 | } | |
769 | 769 | ||
770 | 770 | ||
771 | 771 | let pd = throw("Permission denied") | |
772 | 772 | ||
773 | 773 | func isManager (i) = match m() { | |
774 | 774 | case pk: ByteVector => | |
775 | 775 | (i.callerPublicKey == pk) | |
776 | 776 | case _: Unit => | |
777 | 777 | (i.caller == this) | |
778 | 778 | case _ => | |
779 | 779 | throw("Match error") | |
780 | 780 | } | |
781 | 781 | ||
782 | 782 | ||
783 | 783 | func mm (i) = match m() { | |
784 | 784 | case pk: ByteVector => | |
785 | 785 | if ((i.callerPublicKey == pk)) | |
786 | 786 | then true | |
787 | 787 | else pd | |
788 | 788 | case _: Unit => | |
789 | 789 | if ((i.caller == this)) | |
790 | 790 | then true | |
791 | 791 | else pd | |
792 | 792 | case _ => | |
793 | 793 | throw("Match error") | |
794 | 794 | } | |
795 | 795 | ||
796 | 796 | ||
797 | 797 | @Callable(i) | |
798 | 798 | func constructor (fc) = { | |
799 | 799 | let c = mm(i) | |
800 | 800 | if ((c == c)) | |
801 | 801 | then [StringEntry(fc(), fc)] | |
802 | 802 | else throw("Strict value is not equal to itself.") | |
803 | 803 | } | |
804 | 804 | ||
805 | 805 | ||
806 | 806 | ||
807 | 807 | @Callable(i) | |
808 | 808 | func setManager (pendingManagerPublicKey) = { | |
809 | 809 | let c = mm(i) | |
810 | 810 | if ((c == c)) | |
811 | 811 | then { | |
812 | 812 | let cm = fromBase58String(pendingManagerPublicKey) | |
813 | 813 | if ((cm == cm)) | |
814 | 814 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
815 | 815 | else throw("Strict value is not equal to itself.") | |
816 | 816 | } | |
817 | 817 | else throw("Strict value is not equal to itself.") | |
818 | 818 | } | |
819 | 819 | ||
820 | 820 | ||
821 | 821 | ||
822 | 822 | @Callable(i) | |
823 | 823 | func confirmManager () = { | |
824 | 824 | let p = pm() | |
825 | 825 | let hpm = if (isDefined(p)) | |
826 | 826 | then true | |
827 | 827 | else throw("No pending manager") | |
828 | 828 | if ((hpm == hpm)) | |
829 | 829 | then { | |
830 | 830 | let cpm = if ((i.callerPublicKey == value(p))) | |
831 | 831 | then true | |
832 | 832 | else throw("You are not pending manager") | |
833 | 833 | if ((cpm == cpm)) | |
834 | 834 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
835 | 835 | else throw("Strict value is not equal to itself.") | |
836 | 836 | } | |
837 | 837 | else throw("Strict value is not equal to itself.") | |
838 | 838 | } | |
839 | 839 | ||
840 | 840 | ||
841 | 841 | ||
842 | 842 | @Callable(i) | |
843 | 843 | func put (slip,autoStake) = { | |
844 | 844 | let factCfg = gfc() | |
845 | 845 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
846 | 846 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
847 | 847 | if ((0 > slip)) | |
848 | 848 | then throw("Wrong slippage") | |
849 | 849 | else if ((size(i.payments) != 2)) | |
850 | 850 | then throw("2 pmnts expd") | |
851 | 851 | else { | |
852 | 852 | 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, "") | |
853 | 853 | let emitLpAmt = e._2 | |
854 | 854 | let lpAssetId = e._7 | |
855 | 855 | let state = e._9 | |
856 | 856 | let amDiff = e._10 | |
857 | 857 | let prDiff = e._11 | |
858 | 858 | let amId = e._12 | |
859 | 859 | let prId = e._13 | |
860 | 860 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
861 | 861 | if ((r == r)) | |
862 | 862 | then { | |
863 | 863 | let el = match r { | |
864 | 864 | case legacy: Address => | |
865 | 865 | invoke(legacy, "emit", [emitLpAmt], nil) | |
866 | 866 | case _ => | |
867 | 867 | unit | |
868 | 868 | } | |
869 | 869 | if ((el == el)) | |
870 | 870 | then { | |
871 | 871 | let sa = if ((amDiff > 0)) | |
872 | 872 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
873 | 873 | else nil | |
874 | 874 | if ((sa == sa)) | |
875 | 875 | then { | |
876 | 876 | let sp = if ((prDiff > 0)) | |
877 | 877 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
878 | 878 | else nil | |
879 | 879 | if ((sp == sp)) | |
880 | 880 | then { | |
881 | 881 | let lpTrnsfr = if (autoStake) | |
882 | 882 | then { | |
883 | 883 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
884 | 884 | if ((ss == ss)) | |
885 | 885 | then nil | |
886 | 886 | else throw("Strict value is not equal to itself.") | |
887 | 887 | } | |
888 | 888 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
889 | 889 | (state ++ lpTrnsfr) | |
890 | 890 | } | |
891 | 891 | else throw("Strict value is not equal to itself.") | |
892 | 892 | } | |
893 | 893 | else throw("Strict value is not equal to itself.") | |
894 | 894 | } | |
895 | 895 | else throw("Strict value is not equal to itself.") | |
896 | 896 | } | |
897 | 897 | else throw("Strict value is not equal to itself.") | |
898 | 898 | } | |
899 | 899 | } | |
900 | 900 | ||
901 | 901 | ||
902 | 902 | ||
903 | 903 | @Callable(i) | |
904 | 904 | func putOneTknV2 (minOutAmount,autoStake) = { | |
905 | 905 | let isPoolOneTokenOperationsDisabled = { | |
906 | 906 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
907 | 907 | if ($isInstanceOf(@, "Boolean")) | |
908 | 908 | then @ | |
909 | 909 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
910 | 910 | } | |
911 | 911 | let isPutDisabled = if (if (if (igs()) | |
912 | 912 | then true | |
913 | 913 | else (cfgPoolStatus == PoolPutDis)) | |
914 | 914 | then true | |
915 | 915 | else (cfgPoolStatus == PoolShutdown)) | |
916 | 916 | then true | |
917 | 917 | else isPoolOneTokenOperationsDisabled | |
918 | 918 | let checks = [if (if (!(isPutDisabled)) | |
919 | 919 | then true | |
920 | 920 | else isManager(i)) | |
921 | 921 | then true | |
922 | 922 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
923 | 923 | then true | |
924 | 924 | else throwErr("exactly 1 payment are expected")] | |
925 | 925 | if ((checks == checks)) | |
926 | 926 | then { | |
927 | 927 | let poolConfig = gpc() | |
928 | 928 | let amId = poolConfig[idxAmAsId] | |
929 | 929 | let prId = poolConfig[idxPrAsId] | |
930 | 930 | let lpId = fromBase58String(poolConfig[idxLPAsId]) | |
931 | 931 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
932 | 932 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
933 | 933 | let userAddress = if ((i.caller == this)) | |
934 | 934 | then i.originCaller | |
935 | 935 | else i.caller | |
936 | 936 | let pmt = value(i.payments[0]) | |
937 | 937 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
938 | 938 | let pmtAmt = pmt.amount | |
939 | 939 | let $t03347833636 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
940 | 940 | if (($t03347833636 == $t03347833636)) | |
941 | 941 | then { | |
942 | 942 | let feeAmount = $t03347833636._3 | |
943 | 943 | let state = $t03347833636._2 | |
944 | 944 | let estimLP = $t03347833636._1 | |
945 | 945 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
946 | 946 | then (minOutAmount > estimLP) | |
947 | 947 | else false) | |
948 | 948 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
949 | 949 | else estimLP | |
950 | 950 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
951 | 951 | if ((e == e)) | |
952 | 952 | then { | |
953 | 953 | let el = match e { | |
954 | 954 | case legacy: Address => | |
955 | 955 | invoke(legacy, "emit", [emitLpAmt], nil) | |
956 | 956 | case _ => | |
957 | 957 | unit | |
958 | 958 | } | |
959 | 959 | if ((el == el)) | |
960 | 960 | then { | |
961 | 961 | let lpTrnsfr = if (autoStake) | |
962 | 962 | then { | |
963 | 963 | let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)]) | |
964 | 964 | if ((ss == ss)) | |
965 | 965 | then nil | |
966 | 966 | else throw("Strict value is not equal to itself.") | |
967 | 967 | } | |
968 | 968 | else [ScriptTransfer(i.caller, emitLpAmt, lpId)] | |
969 | 969 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
970 | 970 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
971 | 971 | else nil | |
972 | 972 | $Tuple2(((state ++ lpTrnsfr) ++ sendFeeToMatcher), emitLpAmt) | |
973 | 973 | } | |
974 | 974 | else throw("Strict value is not equal to itself.") | |
975 | 975 | } | |
976 | 976 | else throw("Strict value is not equal to itself.") | |
977 | 977 | } | |
978 | 978 | else throw("Strict value is not equal to itself.") | |
979 | 979 | } | |
980 | 980 | else throw("Strict value is not equal to itself.") | |
981 | 981 | } | |
982 | 982 | ||
983 | 983 | ||
984 | 984 | ||
985 | 985 | @Callable(i) | |
986 | 986 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
987 | 987 | then throw("Wrong slpg") | |
988 | 988 | else if ((size(i.payments) != 2)) | |
989 | 989 | then throw("2 pmnts expd") | |
990 | 990 | else { | |
991 | 991 | 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, "") | |
992 | 992 | estPut._9 | |
993 | 993 | } | |
994 | 994 | ||
995 | 995 | ||
996 | 996 | ||
997 | 997 | @Callable(i) | |
998 | 998 | func get () = { | |
999 | 999 | let r = cg(i) | |
1000 | 1000 | let outAmtAmt = r._1 | |
1001 | 1001 | let outPrAmt = r._2 | |
1002 | 1002 | let pmtAmt = r._3 | |
1003 | 1003 | let pmtAssetId = r._4 | |
1004 | 1004 | let state = r._5 | |
1005 | 1005 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1006 | 1006 | if ((b == b)) | |
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 | @Callable(i) | |
1014 | 1014 | func getOneTknV2 (outAssetId,minOutAmount) = { | |
1015 | 1015 | let isPoolOneTokenOperationsDisabled = { | |
1016 | 1016 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1017 | 1017 | if ($isInstanceOf(@, "Boolean")) | |
1018 | 1018 | then @ | |
1019 | 1019 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1020 | 1020 | } | |
1021 | 1021 | let isGetDisabled = if (if (igs()) | |
1022 | 1022 | then true | |
1023 | 1023 | else (cfgPoolStatus == PoolShutdown)) | |
1024 | 1024 | then true | |
1025 | 1025 | else isPoolOneTokenOperationsDisabled | |
1026 | 1026 | let checks = [if (if (!(isGetDisabled)) | |
1027 | 1027 | then true | |
1028 | 1028 | else isManager(i)) | |
1029 | 1029 | then true | |
1030 | 1030 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1031 | 1031 | then true | |
1032 | 1032 | else throwErr("exactly 1 payment are expected")] | |
1033 | 1033 | if ((checks == checks)) | |
1034 | 1034 | then { | |
1035 | 1035 | let $t03625836413 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1036 | 1036 | let state = $t03625836413._1 | |
1037 | 1037 | let totalAmount = $t03625836413._2 | |
1038 | 1038 | $Tuple2(state, totalAmount) | |
1039 | 1039 | } | |
1040 | 1040 | else throw("Strict value is not equal to itself.") | |
1041 | 1041 | } | |
1042 | 1042 | ||
1043 | 1043 | ||
1044 | 1044 | ||
1045 | 1045 | @Callable(i) | |
1046 | 1046 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
1047 | 1047 | let poolConfig = gpc() | |
1048 | 1048 | let amId = poolConfig[idxAmAsId] | |
1049 | 1049 | let prId = poolConfig[idxPrAsId] | |
1050 | 1050 | let lpId = poolConfig[idxLPAsId] | |
1051 | 1051 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
1052 | 1052 | let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
1053 | 1053 | let D0 = getD(xp) | |
1054 | 1054 | let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission)) | |
1055 | 1055 | let index = if ((outAssetId == amId)) | |
1056 | 1056 | then 0 | |
1057 | 1057 | else if ((outAssetId == prId)) | |
1058 | 1058 | then 1 | |
1059 | 1059 | else throw("invalid out asset id") | |
1060 | 1060 | let newY = getYD(xp, index, D1) | |
1061 | 1061 | let dy = (xp[index] - newY) | |
1062 | 1062 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1063 | 1063 | let $t03720337258 = takeFee(totalGetRaw, outFee) | |
1064 | 1064 | let totalGet = $t03720337258._1 | |
1065 | 1065 | let feeAmount = $t03720337258._2 | |
1066 | 1066 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1067 | 1067 | } | |
1068 | 1068 | ||
1069 | 1069 | ||
1070 | 1070 | ||
1071 | 1071 | @Callable(i) | |
1072 | 1072 | func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = { | |
1073 | 1073 | let poolConfig = gpc() | |
1074 | 1074 | let amId = poolConfig[idxAmAsId] | |
1075 | 1075 | let prId = poolConfig[idxPrAsId] | |
1076 | 1076 | let lpId = poolConfig[idxLPAsId] | |
1077 | 1077 | let amBalance = getAccBalance(amId) | |
1078 | 1078 | let prBalance = getAccBalance(prId) | |
1079 | 1079 | let $t03760337718 = { | |
1080 | 1080 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1081 | 1081 | if ($isInstanceOf(@, "(Int, Int)")) | |
1082 | 1082 | then @ | |
1083 | 1083 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1084 | 1084 | } | |
1085 | 1085 | let totalGet = $t03760337718._1 | |
1086 | 1086 | let feeAmount = $t03760337718._2 | |
1087 | 1087 | let r = ego("", lpId, lpAssetAmount, this) | |
1088 | 1088 | let outAmAmt = r._1 | |
1089 | 1089 | let outPrAmt = r._2 | |
1090 | 1090 | let sumOfGetAssets = (outAmAmt + outPrAmt) | |
1091 | 1091 | let bonus = if ((sumOfGetAssets == 0)) | |
1092 | 1092 | then if ((totalGet == 0)) | |
1093 | 1093 | then 0 | |
1094 | 1094 | else throw("bonus calculation error") | |
1095 | 1095 | else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets) | |
1096 | 1096 | $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus)) | |
1097 | 1097 | } | |
1098 | 1098 | ||
1099 | 1099 | ||
1100 | 1100 | ||
1101 | 1101 | @Callable(i) | |
1102 | 1102 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1103 | 1103 | let r = cg(i) | |
1104 | 1104 | let outAmAmt = r._1 | |
1105 | 1105 | let outPrAmt = r._2 | |
1106 | 1106 | let pmtAmt = r._3 | |
1107 | 1107 | let pmtAssetId = r._4 | |
1108 | 1108 | let state = r._5 | |
1109 | 1109 | if ((noLessThenAmtAsset > outAmAmt)) | |
1110 | 1110 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1111 | 1111 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1112 | 1112 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1113 | 1113 | else { | |
1114 | 1114 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1115 | 1115 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1116 | 1116 | then state | |
1117 | 1117 | else throw("Strict value is not equal to itself.") | |
1118 | 1118 | } | |
1119 | 1119 | } | |
1120 | 1120 | ||
1121 | 1121 | ||
1122 | 1122 | ||
1123 | 1123 | @Callable(i) | |
1124 | 1124 | func unstakeAndGet (amount) = { | |
1125 | 1125 | let checkPayments = if ((size(i.payments) != 0)) | |
1126 | 1126 | then throw("No pmnts expd") | |
1127 | 1127 | else true | |
1128 | 1128 | if ((checkPayments == checkPayments)) | |
1129 | 1129 | then { | |
1130 | 1130 | let cfg = gpc() | |
1131 | 1131 | let factoryCfg = gfc() | |
1132 | 1132 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1133 | 1133 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1134 | 1134 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1135 | 1135 | if ((unstakeInv == unstakeInv)) | |
1136 | 1136 | then { | |
1137 | 1137 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1138 | 1138 | let sts = parseIntValue(r._9) | |
1139 | 1139 | let state = r._10 | |
1140 | 1140 | let v = if (if (igs()) | |
1141 | 1141 | then true | |
1142 | 1142 | else (sts == PoolShutdown)) | |
1143 | 1143 | then throw(("Blocked: " + toString(sts))) | |
1144 | 1144 | else true | |
1145 | 1145 | if ((v == v)) | |
1146 | 1146 | then { | |
1147 | 1147 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1148 | 1148 | if ((burnA == burnA)) | |
1149 | 1149 | then state | |
1150 | 1150 | else throw("Strict value is not equal to itself.") | |
1151 | 1151 | } | |
1152 | 1152 | else throw("Strict value is not equal to itself.") | |
1153 | 1153 | } | |
1154 | 1154 | else throw("Strict value is not equal to itself.") | |
1155 | 1155 | } | |
1156 | 1156 | else throw("Strict value is not equal to itself.") | |
1157 | 1157 | } | |
1158 | 1158 | ||
1159 | 1159 | ||
1160 | 1160 | ||
1161 | 1161 | @Callable(i) | |
1162 | 1162 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1163 | 1163 | let isGetDisabled = if (igs()) | |
1164 | 1164 | then true | |
1165 | 1165 | else (cfgPoolStatus == PoolShutdown) | |
1166 | 1166 | let checks = [if (!(isGetDisabled)) | |
1167 | 1167 | then true | |
1168 | 1168 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1169 | 1169 | then true | |
1170 | 1170 | else throw("no payments are expected")] | |
1171 | 1171 | if ((checks == checks)) | |
1172 | 1172 | then { | |
1173 | 1173 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1174 | 1174 | if ((unstakeInv == unstakeInv)) | |
1175 | 1175 | then { | |
1176 | 1176 | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1177 | 1177 | let outAmAmt = res._1 | |
1178 | 1178 | let outPrAmt = res._2 | |
1179 | 1179 | let state = res._10 | |
1180 | 1180 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1181 | 1181 | then true | |
1182 | 1182 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1183 | 1183 | then true | |
1184 | 1184 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1185 | 1185 | if ((checkAmounts == checkAmounts)) | |
1186 | 1186 | then { | |
1187 | 1187 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1188 | 1188 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1189 | 1189 | then state | |
1190 | 1190 | else throw("Strict value is not equal to itself.") | |
1191 | 1191 | } | |
1192 | 1192 | else throw("Strict value is not equal to itself.") | |
1193 | 1193 | } | |
1194 | 1194 | else throw("Strict value is not equal to itself.") | |
1195 | 1195 | } | |
1196 | 1196 | else throw("Strict value is not equal to itself.") | |
1197 | 1197 | } | |
1198 | 1198 | ||
1199 | 1199 | ||
1200 | 1200 | ||
1201 | 1201 | @Callable(i) | |
1202 | 1202 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1203 | 1203 | let isPoolOneTokenOperationsDisabled = { | |
1204 | 1204 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1205 | 1205 | if ($isInstanceOf(@, "Boolean")) | |
1206 | 1206 | then @ | |
1207 | 1207 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1208 | 1208 | } | |
1209 | 1209 | let isGetDisabled = if (if (igs()) | |
1210 | 1210 | then true | |
1211 | 1211 | else (cfgPoolStatus == PoolShutdown)) | |
1212 | 1212 | then true | |
1213 | 1213 | else isPoolOneTokenOperationsDisabled | |
1214 | 1214 | let checks = [if (if (!(isGetDisabled)) | |
1215 | 1215 | then true | |
1216 | 1216 | else isManager(i)) | |
1217 | 1217 | then true | |
1218 | 1218 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1219 | 1219 | then true | |
1220 | 1220 | else throwErr("no payments are expected")] | |
1221 | 1221 | if ((checks == checks)) | |
1222 | 1222 | then { | |
1223 | 1223 | let cfg = gpc() | |
1224 | 1224 | let factoryCfg = gfc() | |
1225 | 1225 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1226 | 1226 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1227 | 1227 | let userAddress = i.caller | |
1228 | 1228 | let lpAssetRecipientAddress = this | |
1229 | - | let unstakeInv = invoke(staking, "unstakeINTERNAL", [ | |
1229 | + | let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil) | |
1230 | 1230 | if ((unstakeInv == unstakeInv)) | |
1231 | 1231 | then { | |
1232 | - | let $ | |
1233 | - | let state = $ | |
1234 | - | let totalAmount = $ | |
1232 | + | let $t04168341871 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1233 | + | let state = $t04168341871._1 | |
1234 | + | let totalAmount = $t04168341871._2 | |
1235 | 1235 | $Tuple2(state, totalAmount) | |
1236 | 1236 | } | |
1237 | 1237 | else throw("Strict value is not equal to itself.") | |
1238 | 1238 | } | |
1239 | 1239 | else throw("Strict value is not equal to itself.") | |
1240 | 1240 | } | |
1241 | 1241 | ||
1242 | 1242 | ||
1243 | 1243 | ||
1244 | 1244 | @Callable(i) | |
1245 | 1245 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1246 | 1246 | let poolConfig = gpc() | |
1247 | 1247 | let amId = poolConfig[idxAmAsId] | |
1248 | 1248 | let prId = poolConfig[idxPrAsId] | |
1249 | 1249 | let lpId = poolConfig[idxLPAsId] | |
1250 | - | let $ | |
1251 | - | let lpAmount = $ | |
1252 | - | let state = $ | |
1253 | - | let feeAmount = $ | |
1254 | - | let bonus = $ | |
1250 | + | let $t04213042233 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1251 | + | let lpAmount = $t04213042233._1 | |
1252 | + | let state = $t04213042233._2 | |
1253 | + | let feeAmount = $t04213042233._3 | |
1254 | + | let bonus = $t04213042233._4 | |
1255 | 1255 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1256 | 1256 | } | |
1257 | 1257 | ||
1258 | 1258 | ||
1259 | 1259 | ||
1260 | 1260 | @Callable(i) | |
1261 | 1261 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1262 | 1262 | let poolConfig = gpc() | |
1263 | 1263 | let amId = poolConfig[idxAmAsId] | |
1264 | 1264 | let prId = poolConfig[idxPrAsId] | |
1265 | 1265 | let lpId = poolConfig[idxLPAsId] | |
1266 | - | let $ | |
1267 | - | let lpAmount = $ | |
1268 | - | let state = $ | |
1269 | - | let feeAmount = $ | |
1270 | - | let bonus = $ | |
1266 | + | let $t04251242616 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1267 | + | let lpAmount = $t04251242616._1 | |
1268 | + | let state = $t04251242616._2 | |
1269 | + | let feeAmount = $t04251242616._3 | |
1270 | + | let bonus = $t04251242616._4 | |
1271 | 1271 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1272 | 1272 | } | |
1273 | 1273 | ||
1274 | 1274 | ||
1275 | 1275 | ||
1276 | 1276 | @Callable(i) | |
1277 | 1277 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1278 | 1278 | then throw("denied") | |
1279 | 1279 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1280 | 1280 | ||
1281 | 1281 | ||
1282 | 1282 | ||
1283 | 1283 | @Callable(i) | |
1284 | 1284 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1285 | 1285 | then pd | |
1286 | 1286 | else [StringEntry(k, v)] | |
1287 | 1287 | ||
1288 | 1288 | ||
1289 | 1289 | ||
1290 | 1290 | @Callable(i) | |
1291 | 1291 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1292 | 1292 | then pd | |
1293 | 1293 | else [IntegerEntry(k, v)] | |
1294 | 1294 | ||
1295 | 1295 | ||
1296 | 1296 | ||
1297 | 1297 | @Callable(i) | |
1298 | 1298 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1299 | 1299 | ||
1300 | 1300 | ||
1301 | 1301 | ||
1302 | 1302 | @Callable(i) | |
1303 | 1303 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1304 | 1304 | ||
1305 | 1305 | ||
1306 | 1306 | ||
1307 | 1307 | @Callable(i) | |
1308 | 1308 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1309 | 1309 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1310 | 1310 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1311 | 1311 | } | |
1312 | 1312 | ||
1313 | 1313 | ||
1314 | 1314 | ||
1315 | 1315 | @Callable(i) | |
1316 | 1316 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1317 | 1317 | ||
1318 | 1318 | ||
1319 | 1319 | ||
1320 | 1320 | @Callable(i) | |
1321 | 1321 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1322 | 1322 | ||
1323 | 1323 | ||
1324 | 1324 | ||
1325 | 1325 | @Callable(i) | |
1326 | 1326 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1327 | 1327 | ||
1328 | 1328 | ||
1329 | 1329 | ||
1330 | 1330 | @Callable(i) | |
1331 | 1331 | 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, "")) | |
1332 | 1332 | ||
1333 | 1333 | ||
1334 | 1334 | ||
1335 | 1335 | @Callable(i) | |
1336 | 1336 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1337 | 1337 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1338 | 1338 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1339 | 1339 | } | |
1340 | 1340 | ||
1341 | 1341 | ||
1342 | 1342 | @Verifier(tx) | |
1343 | 1343 | func verify () = { | |
1344 | 1344 | let targetPublicKey = match m() { | |
1345 | 1345 | case pk: ByteVector => | |
1346 | 1346 | pk | |
1347 | 1347 | case _: Unit => | |
1348 | 1348 | tx.senderPublicKey | |
1349 | 1349 | case _ => | |
1350 | 1350 | throw("Match error") | |
1351 | 1351 | } | |
1352 | 1352 | match tx { | |
1353 | 1353 | case order: Order => | |
1354 | 1354 | let matcherPub = mp() | |
1355 | 1355 | let orderValid = moa(order) | |
1356 | 1356 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1357 | 1357 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1358 | 1358 | if (if (if (orderValid) | |
1359 | 1359 | then senderValid | |
1360 | 1360 | else false) | |
1361 | 1361 | then matcherValid | |
1362 | 1362 | else false) | |
1363 | 1363 | then true | |
1364 | 1364 | else toe(orderValid, senderValid, matcherValid) | |
1365 | 1365 | case s: SetScriptTransaction => | |
1366 | 1366 | let newHash = blake2b256(value(s.script)) | |
1367 | 1367 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1368 | 1368 | let currentHash = scriptHash(this) | |
1369 | 1369 | if (if ((allowedHash == newHash)) | |
1370 | 1370 | then (currentHash != newHash) | |
1371 | 1371 | else false) | |
1372 | 1372 | then true | |
1373 | 1373 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1374 | 1374 | case _ => | |
1375 | 1375 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1376 | 1376 | } | |
1377 | 1377 | } | |
1378 | 1378 |
github/deemru/w8io/026f985 129.42 ms ◑