tx · 3LvLfCUn7h9EuUrVkC8gW3BsmyBWXW3UtdF1q9t3gpXr 3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8: -0.01800000 Waves 2022.09.14 16:31 [2228834] smart account 3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8 > SELF 0.00000000 Waves
{ "type": 13, "id": "3LvLfCUn7h9EuUrVkC8gW3BsmyBWXW3UtdF1q9t3gpXr", "fee": 1800000, "feeAssetId": null, "timestamp": 1663162306241, "version": 2, "chainId": 84, "sender": "3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8", "senderPublicKey": "4ja2PX5eqM576zv9KGzu5Qe7M92Z3jbuSmkLPdGjK4ue", "proofs": [ "4djGD5VUyav9nHHsdsErz8C9SSvHKUopRCnQhDtDfE84RNNWP1jJBRWpVeqiBRMoKH8pNX3gjDLECSHSun3YmyN", "ZxijV1sbxF1akxm2ZrzcwtdT7maNFp41TaXinJnURbxpAeU7cyrCdEmhT81EBRcCeNuibZpTH9F2rkNLW16anVY" ], "script": "base64:AAIFAAAAAAAAABAIAhIICgYYGBERGAESABIAAAAAJgAAAAAHa0FjdGl2ZQIAAAAGYWN0aXZlAAAAAAZrQ2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAAA1rUG9vbEluT3JhY2xlAgAAAAVwb29sXwAAAAAOa1VzZXJTd29wSW5Hb3YCAAAADF9TV09QX2Ftb3VudAAAAAAKa0Rpc2NvdW50cwIAAAAJZGlzY291bnRzAAAAAA9rRGlzY291bnRWYWx1ZXMCAAAAD2Rpc2NvdW50X3ZhbHVlcwAAAAALa1JvdXRpbmdGZWUCAAAAC3JvdXRpbmdfZmVlAAAAAA1rQWRtaW5QdWJLZXkxAgAAAAthZG1pbl9wdWJfMQAAAAANa0FkbWluUHViS2V5MgIAAAALYWRtaW5fcHViXzIAAAAADWtBZG1pblB1YktleTMCAAAAC2FkbWluX3B1Yl8zAAAAABBrTW9uZXlCb3hBZGRyZXNzAgAAABFtb25leV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AAAAAAABAAAABJhZG1pblB1YktleTNTaWduZWQDCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgUAAAAMYWRtaW5QdWJLZXkzAAAAAAAAAAABAAAAAAAAAAAACQAAZwAAAAIJAABkAAAAAgkAAGQAAAACBQAAABJhZG1pblB1YktleTFTaWduZWQFAAAAEmFkbWluUHViS2V5MlNpZ25lZAUAAAASYWRtaW5QdWJLZXkzU2lnbmVkAAAAAAAAAAACBAAAAAckbWF0Y2gwBQAAAAJ0eAUAAAATbXVsdGlTaWduZWRCeUFkbWluc35GTJE=", "height": 2228834, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 71JE7V6wKjCbGbgtWhk4gSeV2duKEy4aX6qT6RKthMpk Next: 4jdaVsnFUKrCNtGdLQa86YTMNggtpz3fYWcGaE9tD6Qb Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kActive = "active" | |
126 | 126 | let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount, toString(caller)], nil) | |
127 | 127 | if ($isInstanceOf(@, "(Int, Int)")) | |
128 | 128 | then @ | |
129 | - | else throw( | |
129 | + | else throw("Couldn't cast Any to (Int, Int)") | |
130 | 130 | } | |
131 | 131 | if ((inv == inv)) | |
132 | 132 | then inv._1 | |
158 | 158 | let @ = invoke(addressFromStringValue(exchangers[1]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee, toString(caller)], nil) | |
159 | 159 | if ($isInstanceOf(@, "(Int, Int)")) | |
160 | 160 | then @ | |
161 | - | else throw( | |
161 | + | else throw("Couldn't cast Any to (Int, Int)") | |
162 | 162 | } | |
163 | 163 | if ((inv == inv)) | |
164 | 164 | then inv._1 | |
218 | 218 | let exchangerAddress = addressFromStringValue(exchanger) | |
219 | 219 | if ((exchangersType[exchangeCounter] == "cpmm")) | |
220 | 220 | then { | |
221 | - | let | |
222 | - | let @ = invoke(exchangerAddress, " | |
223 | - | if ($isInstanceOf(@, " | |
221 | + | let $t085528711 = { | |
222 | + | let @ = invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
223 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
224 | 224 | then @ | |
225 | - | else throw( | |
225 | + | else throw("Couldn't cast Any to (Int, Int)") | |
226 | 226 | } | |
227 | - | if ((inv == inv)) | |
228 | - | then $Tuple3((exchangeCounter + 1), inv[0], inv[1]) | |
227 | + | if (($t085528711 == $t085528711)) | |
228 | + | then { | |
229 | + | let assetId = $t085528711._2 | |
230 | + | let amount = $t085528711._1 | |
231 | + | $Tuple3((exchangeCounter + 1), amount, assetId) | |
232 | + | } | |
229 | 233 | else throw("Strict value is not equal to itself.") | |
230 | 234 | } | |
231 | 235 | else if ((exchangersType[exchangeCounter] == "flat")) | |
234 | 238 | let @ = invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
235 | 239 | if ($isInstanceOf(@, "List[Any]")) | |
236 | 240 | then @ | |
237 | - | else throw( | |
241 | + | else throw("Couldn't cast Any to List[Any]") | |
238 | 242 | } | |
239 | 243 | if ((inv == inv)) | |
240 | 244 | then $Tuple3((exchangeCounter + 1), inv[0], inv[1]) | |
246 | 250 | let @ = invoke(exchangerAddress, "exchange", [routingAssetsKeys[((exchangeCounter * 2) + 1)], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
247 | 251 | if ($isInstanceOf(@, "List[Any]")) | |
248 | 252 | then @ | |
249 | - | else throw( | |
253 | + | else throw("Couldn't cast Any to List[Any]") | |
250 | 254 | } | |
251 | 255 | if ((inv == inv)) | |
252 | 256 | then $Tuple3((exchangeCounter + 1), inv[0], inv[1]) | |
257 | 261 | else accumulated | |
258 | 262 | } | |
259 | 263 | ||
260 | - | let $ | |
264 | + | let $t095689674 = { | |
261 | 265 | let $l = exchangers | |
262 | 266 | let $s = size($l) | |
263 | 267 | let $acc0 = $Tuple3(0, 0, base58'') | |
271 | 275 | ||
272 | 276 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
273 | 277 | } | |
274 | - | let exchangeCounter = $ | |
275 | - | let amountWithoutFee = $ | |
276 | - | let assetIdSend = $ | |
278 | + | let exchangeCounter = $t095689674._1 | |
279 | + | let amountWithoutFee = $t095689674._2 | |
280 | + | let assetIdSend = $t095689674._3 | |
277 | 281 | let amountWithFee = fraction(amountWithoutFee, (feeScale6 - routingFee), feeScale6) | |
278 | 282 | if (if ((exchangeCounter == routingSize)) | |
279 | 283 | then (amountWithFee >= minAmountToReceive) |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kActive = "active" | |
5 | 5 | ||
6 | 6 | let kCause = "shutdown_cause" | |
7 | 7 | ||
8 | 8 | let kPoolInOracle = "pool_" | |
9 | 9 | ||
10 | 10 | let kUserSwopInGov = "_SWOP_amount" | |
11 | 11 | ||
12 | 12 | let kDiscounts = "discounts" | |
13 | 13 | ||
14 | 14 | let kDiscountValues = "discount_values" | |
15 | 15 | ||
16 | 16 | let kRoutingFee = "routing_fee" | |
17 | 17 | ||
18 | 18 | let kAdminPubKey1 = "admin_pub_1" | |
19 | 19 | ||
20 | 20 | let kAdminPubKey2 = "admin_pub_2" | |
21 | 21 | ||
22 | 22 | let kAdminPubKey3 = "admin_pub_3" | |
23 | 23 | ||
24 | 24 | let kMoneyBoxAddress = "money_box_address" | |
25 | 25 | ||
26 | 26 | let kGovAddress = "governance_address" | |
27 | 27 | ||
28 | 28 | let kFee = "commission" | |
29 | 29 | ||
30 | 30 | let kMultyAssetBalance = "_balance" | |
31 | 31 | ||
32 | 32 | let digits8 = 8 | |
33 | 33 | ||
34 | 34 | let scale8 = 100000000 | |
35 | 35 | ||
36 | 36 | let scale16 = 10000000000000000 | |
37 | 37 | ||
38 | 38 | let alpha = 50 | |
39 | 39 | ||
40 | 40 | let alphaDigits = 2 | |
41 | 41 | ||
42 | 42 | let beta = 4600000000000000 | |
43 | 43 | ||
44 | 44 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
45 | 45 | ||
46 | 46 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
47 | 47 | case string: String => | |
48 | 48 | fromBase58String(string) | |
49 | 49 | case nothing => | |
50 | 50 | throw((key + "is empty")) | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
55 | 55 | ||
56 | 56 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
57 | 57 | ||
58 | 58 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
59 | 59 | ||
60 | 60 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
61 | 61 | ||
62 | 62 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
63 | 63 | ||
64 | 64 | let active = valueOrElse(getBoolean(this, kActive), true) | |
65 | 65 | ||
66 | 66 | let routingFee = valueOrErrorMessage(getInteger(oracle, kRoutingFee), "routing_fee is empty") | |
67 | 67 | ||
68 | 68 | let feeScale6 = 1000000 | |
69 | 69 | ||
70 | 70 | func isActive () = if (active) | |
71 | 71 | then unit | |
72 | 72 | else throw("DApp is inactive at this moment") | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
76 | 76 | then unit | |
77 | 77 | else throw("Only admin can call this function") | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func throwIsActive () = throw("DApp is already active") | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func invariantCalc (x,y) = { | |
90 | 90 | let sk = skewness(x, y) | |
91 | 91 | (fraction((x + y), scale16, pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(x), toBigInt(y), toBigInt(scale8)), 0, toBigInt(5), 1, (digits8 / 2), DOWN)), pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN), scale8))) | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func calculateFeeDiscount (userAddr) = { | |
96 | 96 | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
97 | 97 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
98 | 98 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
99 | 99 | if (if ((swopAmount >= parseIntValue(discountValues[0]))) | |
100 | 100 | then (parseIntValue(discountValues[1]) > swopAmount) | |
101 | 101 | else false) | |
102 | 102 | then (feeScale6 - parseIntValue(discounts[0])) | |
103 | 103 | else if (if ((swopAmount >= parseIntValue(discountValues[1]))) | |
104 | 104 | then (parseIntValue(discountValues[2]) > swopAmount) | |
105 | 105 | else false) | |
106 | 106 | then (feeScale6 - parseIntValue(discounts[1])) | |
107 | 107 | else if (if ((swopAmount >= parseIntValue(discountValues[2]))) | |
108 | 108 | then (parseIntValue(discountValues[3]) > swopAmount) | |
109 | 109 | else false) | |
110 | 110 | then (feeScale6 - parseIntValue(discounts[2])) | |
111 | 111 | else if (if ((swopAmount >= parseIntValue(discountValues[3]))) | |
112 | 112 | then (parseIntValue(discountValues[4]) > swopAmount) | |
113 | 113 | else false) | |
114 | 114 | then (feeScale6 - parseIntValue(discounts[3])) | |
115 | 115 | else if ((swopAmount >= parseIntValue(discountValues[4]))) | |
116 | 116 | then (feeScale6 - parseIntValue(discounts[4])) | |
117 | 117 | else feeScale6 | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func checkPossibility (caller,pmtAmount,minAmountToReceive,exchangers,exchangersType,routingAssetsKeys,args1,args2) = { | |
122 | 122 | let feeDiscount = calculateFeeDiscount(caller) | |
123 | 123 | let getFrom1TradeWithFee = if ((exchangersType[0] == "curveMultyFlat")) | |
124 | 124 | then { | |
125 | 125 | let inv = { | |
126 | 126 | let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount, toString(caller)], nil) | |
127 | 127 | if ($isInstanceOf(@, "(Int, Int)")) | |
128 | 128 | then @ | |
129 | - | else throw( | |
129 | + | else throw("Couldn't cast Any to (Int, Int)") | |
130 | 130 | } | |
131 | 131 | if ((inv == inv)) | |
132 | 132 | then inv._1 | |
133 | 133 | else throw("Strict value is not equal to itself.") | |
134 | 134 | } | |
135 | 135 | else { | |
136 | 136 | let dApp1TokenPay = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[0]) | |
137 | 137 | let dApp1TokenGet = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[1]) | |
138 | 138 | if ((exchangersType[0] == "cpmm")) | |
139 | 139 | then { | |
140 | 140 | let fee = getIntegerValue(addressFromStringValue(exchangers[0]), kFee) | |
141 | 141 | let getFrom1TradeWithoutFee = fraction(dApp1TokenGet, pmtAmount, (pmtAmount + dApp1TokenPay)) | |
142 | 142 | fraction(getFrom1TradeWithoutFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6)), feeScale6) | |
143 | 143 | } | |
144 | 144 | else if ((exchangersType[0] == "flat")) | |
145 | 145 | then { | |
146 | 146 | let invariant = invariantCalc(dApp1TokenPay, dApp1TokenGet) | |
147 | 147 | let minAmountToReceive1 = args2[0] | |
148 | 148 | let invariantNew = invariantCalc((dApp1TokenPay + pmtAmount), (dApp1TokenGet - minAmountToReceive1)) | |
149 | 149 | if ((invariantNew >= invariant)) | |
150 | 150 | then minAmountToReceive1 | |
151 | 151 | else throw("Flat contract: invariantNew < invariant") | |
152 | 152 | } | |
153 | 153 | else throw("Incorrect exchange type") | |
154 | 154 | } | |
155 | 155 | let getFrom2TradeWithFee = if ((exchangersType[1] == "curveMultyFlat")) | |
156 | 156 | then { | |
157 | 157 | let inv = { | |
158 | 158 | let @ = invoke(addressFromStringValue(exchangers[1]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee, toString(caller)], nil) | |
159 | 159 | if ($isInstanceOf(@, "(Int, Int)")) | |
160 | 160 | then @ | |
161 | - | else throw( | |
161 | + | else throw("Couldn't cast Any to (Int, Int)") | |
162 | 162 | } | |
163 | 163 | if ((inv == inv)) | |
164 | 164 | then inv._1 | |
165 | 165 | else throw("Strict value is not equal to itself.") | |
166 | 166 | } | |
167 | 167 | else { | |
168 | 168 | let dApp2TokenPay = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[2]) | |
169 | 169 | let dApp2TokenGet = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[3]) | |
170 | 170 | if ((exchangersType[1] == "cpmm")) | |
171 | 171 | then { | |
172 | 172 | let getFrom2TradeWithoutFee = fraction(dApp2TokenGet, getFrom1TradeWithFee, (getFrom1TradeWithFee + dApp2TokenPay)) | |
173 | 173 | let fee = getIntegerValue(addressFromStringValue(exchangers[1]), kFee) | |
174 | 174 | fraction(getFrom2TradeWithoutFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6)), feeScale6) | |
175 | 175 | } | |
176 | 176 | else if ((exchangersType[1] == "flat")) | |
177 | 177 | then { | |
178 | 178 | let invariant = invariantCalc(dApp2TokenPay, dApp2TokenGet) | |
179 | 179 | let minAmountToReceive2 = args2[1] | |
180 | 180 | let invariantNew = invariantCalc((dApp2TokenPay + getFrom1TradeWithFee), (dApp2TokenGet - minAmountToReceive2)) | |
181 | 181 | if ((invariantNew >= invariant)) | |
182 | 182 | then minAmountToReceive2 | |
183 | 183 | else throw("Flat contract: invariantNew < invariant") | |
184 | 184 | } | |
185 | 185 | else throw("Incorrect exchange type") | |
186 | 186 | } | |
187 | 187 | (getFrom2TradeWithFee >= minAmountToReceive) | |
188 | 188 | } | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | @Callable(i) | |
192 | 192 | func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive) = valueOrElse(isActive(), { | |
193 | 193 | let $t074417515 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
194 | 194 | let pmtAmount = $t074417515._1 | |
195 | 195 | let pmtAssetId = $t074417515._2 | |
196 | 196 | if (!(checkPossibility(i.caller, pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2))) | |
197 | 197 | then throw("Check transaction possibilty: declined") | |
198 | 198 | else if (if (!(isDefined(getString(oracle, (kPoolInOracle + exchangers[0]))))) | |
199 | 199 | then true | |
200 | 200 | else !(isDefined(getString(oracle, (kPoolInOracle + exchangers[1]))))) | |
201 | 201 | then throw("Pool is not in oracle") | |
202 | 202 | else { | |
203 | 203 | let routingSize = size(exchangers) | |
204 | 204 | func exchangeFold (accumulated,exchanger) = { | |
205 | 205 | let $t080298094 = accumulated | |
206 | 206 | let exchangeCounter = $t080298094._1 | |
207 | 207 | let amountsWithFee = $t080298094._2 | |
208 | 208 | let assetsIdSend = $t080298094._3 | |
209 | 209 | let $t081078305 = if ((exchangeCounter == 0)) | |
210 | 210 | then $Tuple2(pmtAssetId, pmtAmount) | |
211 | 211 | else $Tuple2(assetsIdSend, amountsWithFee) | |
212 | 212 | let pmtAssetIdRout = $t081078305._1 | |
213 | 213 | let pmtAmountRout = $t081078305._2 | |
214 | 214 | if (((if ((exchangeCounter >= 0)) | |
215 | 215 | then (routingSize > exchangeCounter) | |
216 | 216 | else false) == true)) | |
217 | 217 | then { | |
218 | 218 | let exchangerAddress = addressFromStringValue(exchanger) | |
219 | 219 | if ((exchangersType[exchangeCounter] == "cpmm")) | |
220 | 220 | then { | |
221 | - | let | |
222 | - | let @ = invoke(exchangerAddress, " | |
223 | - | if ($isInstanceOf(@, " | |
221 | + | let $t085528711 = { | |
222 | + | let @ = invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
223 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
224 | 224 | then @ | |
225 | - | else throw( | |
225 | + | else throw("Couldn't cast Any to (Int, Int)") | |
226 | 226 | } | |
227 | - | if ((inv == inv)) | |
228 | - | then $Tuple3((exchangeCounter + 1), inv[0], inv[1]) | |
227 | + | if (($t085528711 == $t085528711)) | |
228 | + | then { | |
229 | + | let assetId = $t085528711._2 | |
230 | + | let amount = $t085528711._1 | |
231 | + | $Tuple3((exchangeCounter + 1), amount, assetId) | |
232 | + | } | |
229 | 233 | else throw("Strict value is not equal to itself.") | |
230 | 234 | } | |
231 | 235 | else if ((exchangersType[exchangeCounter] == "flat")) | |
232 | 236 | then { | |
233 | 237 | let inv = { | |
234 | 238 | let @ = invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
235 | 239 | if ($isInstanceOf(@, "List[Any]")) | |
236 | 240 | then @ | |
237 | - | else throw( | |
241 | + | else throw("Couldn't cast Any to List[Any]") | |
238 | 242 | } | |
239 | 243 | if ((inv == inv)) | |
240 | 244 | then $Tuple3((exchangeCounter + 1), inv[0], inv[1]) | |
241 | 245 | else throw("Strict value is not equal to itself.") | |
242 | 246 | } | |
243 | 247 | else if ((exchangersType[exchangeCounter] == "curveMultyFlat")) | |
244 | 248 | then { | |
245 | 249 | let inv = { | |
246 | 250 | let @ = invoke(exchangerAddress, "exchange", [routingAssetsKeys[((exchangeCounter * 2) + 1)], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
247 | 251 | if ($isInstanceOf(@, "List[Any]")) | |
248 | 252 | then @ | |
249 | - | else throw( | |
253 | + | else throw("Couldn't cast Any to List[Any]") | |
250 | 254 | } | |
251 | 255 | if ((inv == inv)) | |
252 | 256 | then $Tuple3((exchangeCounter + 1), inv[0], inv[1]) | |
253 | 257 | else throw("Strict value is not equal to itself.") | |
254 | 258 | } | |
255 | 259 | else throw("Incorrect exchange type") | |
256 | 260 | } | |
257 | 261 | else accumulated | |
258 | 262 | } | |
259 | 263 | ||
260 | - | let $ | |
264 | + | let $t095689674 = { | |
261 | 265 | let $l = exchangers | |
262 | 266 | let $s = size($l) | |
263 | 267 | let $acc0 = $Tuple3(0, 0, base58'') | |
264 | 268 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
265 | 269 | then $a | |
266 | 270 | else exchangeFold($a, $l[$i]) | |
267 | 271 | ||
268 | 272 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
269 | 273 | then $a | |
270 | 274 | else throw("List size exceeds 3") | |
271 | 275 | ||
272 | 276 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
273 | 277 | } | |
274 | - | let exchangeCounter = $ | |
275 | - | let amountWithoutFee = $ | |
276 | - | let assetIdSend = $ | |
278 | + | let exchangeCounter = $t095689674._1 | |
279 | + | let amountWithoutFee = $t095689674._2 | |
280 | + | let assetIdSend = $t095689674._3 | |
277 | 281 | let amountWithFee = fraction(amountWithoutFee, (feeScale6 - routingFee), feeScale6) | |
278 | 282 | if (if ((exchangeCounter == routingSize)) | |
279 | 283 | then (amountWithFee >= minAmountToReceive) | |
280 | 284 | else false) | |
281 | 285 | then [ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, (amountWithoutFee - amountWithFee), assetIdSend)] | |
282 | 286 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
283 | 287 | } | |
284 | 288 | }) | |
285 | 289 | ||
286 | 290 | ||
287 | 291 | ||
288 | 292 | @Callable(i) | |
289 | 293 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
290 | 294 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
291 | 295 | else suspend("Paused by admin")) | |
292 | 296 | ||
293 | 297 | ||
294 | 298 | ||
295 | 299 | @Callable(i) | |
296 | 300 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
297 | 301 | then throwIsActive() | |
298 | 302 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
299 | 303 | ||
300 | 304 | ||
301 | 305 | @Verifier(tx) | |
302 | 306 | func verify () = { | |
303 | 307 | let multiSignedByAdmins = { | |
304 | 308 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
305 | 309 | then 1 | |
306 | 310 | else 0 | |
307 | 311 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
308 | 312 | then 1 | |
309 | 313 | else 0 | |
310 | 314 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
311 | 315 | then 1 | |
312 | 316 | else 0 | |
313 | 317 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
314 | 318 | } | |
315 | 319 | match tx { | |
316 | 320 | case _ => | |
317 | 321 | multiSignedByAdmins | |
318 | 322 | } | |
319 | 323 | } | |
320 | 324 |
github/deemru/w8io/169f3d6 177.53 ms ◑