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