tx · EQs3rqtgjLGaffwFe44r69HtHjE9k441eMzLcCYdC2d4 3NB8EK63rzHfJzv6tQaHgbaUotzTUd6NtVw: -0.10000000 Waves 2023.01.24 12:09 [2418841] smart account 3NB8EK63rzHfJzv6tQaHgbaUotzTUd6NtVw > SELF 0.00000000 Waves
{ "type": 13, "id": "EQs3rqtgjLGaffwFe44r69HtHjE9k441eMzLcCYdC2d4", "fee": 10000000, "feeAssetId": null, "timestamp": 1674551426973, "version": 2, "chainId": 84, "sender": "3NB8EK63rzHfJzv6tQaHgbaUotzTUd6NtVw", "senderPublicKey": "MyikFpSXjC2zCj7sX9V9t8P9qGxTG7MM37abMRQ1DEJ", "proofs": [ "3ikmvX8W9Y6Ykk8FcJE6BaudenvgRLbcTXW7YPVEGGhL7PJeCN8JToPNVB16XwjyuVm9CYCP1a6Y4ngnK8c3YS7B", "2v6VeyrY7HJiCwSqhwNUBKH1gggh1KXV4JvZCkUpCc3ApyoQsCz9dx8bAWSi68VKY2ZsccutVD2j9rkHKDbJvYr1" ], "script": "base64:BgIQCAISCAoGGBgRERgBEgASACYAB2tBY3RpdmUCBmFjdGl2ZQAGa0NhdXNlAg5zaHV0ZG93bl9jYXVzZQANa1Bvb2xJbk9yYWNsZQIFcG9vbF8ADmtVc2VyU3dvcEluR292AgxfU1dPUF9hbW91bnQACmtEaXNjb3VudHMCCWRpc2NvdW50cwAPa0Rpc2NvdW50VmFsdWVzAg9kaXNjb3VudF92YWx1ZXMAC2tSb3V0aW5nRmVlAgtyb3V0aW5nX2ZlZQANa0FkbWluUHViS2V5MQILYWRtaW5fcHViXzEADWtBZG1pblB1YktleTICC2FkbWluX3B1Yl8yAA1rQWRtaW5QdWJLZXkzAgthZG1pbl9wdWJfMwAQa01vbmV5Qm94QWRkcmVzcwIRbW9uZXlfYm94X2FkZHJlc3MAC2tHb3ZBZGRyZXNzAhJnb3Zlcm5hbmNlX2FkZHJlc3MABGtGZWUCCmNvbW1pc3Npb24AEmtNdWx0eUFzc2V0Q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4BnByb29mcwABBQxhZG1pblB1YktleTIAAQAABBJhZG1pblB1YktleTNTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIEByRtYXRjaDAFAnR4BRNtdWx0aVNpZ25lZEJ5QWRtaW5zEcBatg==", "height": 2418841, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FvQcJYJbXkuqj8CQi9qZzXBg4nMKZxWmUXP19YV1HaTh Next: 88TDaRL4Wc2Re5E4wzN7raDf21hJvgpCXdAAdk2Ffy3x Diff:
Old | New | Differences | |
---|---|---|---|
190 | 190 | ||
191 | 191 | @Callable(i) | |
192 | 192 | func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive) = valueOrElse(isActive(), { | |
193 | - | let $ | |
194 | - | let pmtAmount = $ | |
195 | - | let pmtAssetId = $ | |
193 | + | let $t069216995 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
194 | + | let pmtAmount = $t069216995._1 | |
195 | + | let pmtAssetId = $t069216995._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]))))) | |
202 | 202 | else { | |
203 | 203 | let routingSize = size(exchangers) | |
204 | 204 | func exchangeFold (accumulated,exchanger) = { | |
205 | - | let $ | |
206 | - | let exchangeCounter = $ | |
207 | - | let amountsWithFee = $ | |
208 | - | let assetsIdSend = $ | |
209 | - | let $ | |
205 | + | let $t075097574 = accumulated | |
206 | + | let exchangeCounter = $t075097574._1 | |
207 | + | let amountsWithFee = $t075097574._2 | |
208 | + | let assetsIdSend = $t075097574._3 | |
209 | + | let $t075877785 = if ((exchangeCounter == 0)) | |
210 | 210 | then $Tuple2(pmtAssetId, pmtAmount) | |
211 | 211 | else $Tuple2(assetsIdSend, amountsWithFee) | |
212 | - | let pmtAssetIdRout = $ | |
213 | - | let pmtAmountRout = $ | |
212 | + | let pmtAssetIdRout = $t075877785._1 | |
213 | + | let pmtAmountRout = $t075877785._2 | |
214 | 214 | if (((if ((exchangeCounter >= 0)) | |
215 | 215 | then (routingSize > exchangeCounter) | |
216 | 216 | else false) == true)) | |
225 | 225 | else throw("Incorrect exchange type") | |
226 | 226 | if ((inv == inv)) | |
227 | 227 | then { | |
228 | - | let $ | |
228 | + | let $t088119358 = match inv { | |
229 | 229 | case inv: List[Any] => | |
230 | 230 | match $Tuple2(inv[0], inv[1]) { | |
231 | 231 | case r: (Int, Unit)|(Int, ByteVector) => | |
238 | 238 | case _ => | |
239 | 239 | throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
240 | 240 | } | |
241 | - | let amountWithFee = $ | |
242 | - | let assetIdSend = $ | |
241 | + | let amountWithFee = $t088119358._1 | |
242 | + | let assetIdSend = $t088119358._2 | |
243 | 243 | $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend) | |
244 | 244 | } | |
245 | 245 | else throw("Strict value is not equal to itself.") | |
247 | 247 | else accumulated | |
248 | 248 | } | |
249 | 249 | ||
250 | - | let $ | |
250 | + | let $t094889594 = { | |
251 | 251 | let $l = exchangers | |
252 | 252 | let $s = size($l) | |
253 | 253 | let $acc0 = $Tuple3(0, 0, base58'') | |
261 | 261 | ||
262 | 262 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
263 | 263 | } | |
264 | - | let exchangeCounter = $ | |
265 | - | let amountWithoutFee = $ | |
266 | - | let assetIdSend = $ | |
264 | + | let exchangeCounter = $t094889594._1 | |
265 | + | let amountWithoutFee = $t094889594._2 | |
266 | + | let assetIdSend = $t094889594._3 | |
267 | 267 | let amountWithFee = fraction(amountWithoutFee, (feeScale6 - routingFee), feeScale6) | |
268 | 268 | if (if ((exchangeCounter == routingSize)) | |
269 | 269 | then (amountWithFee >= minAmountToReceive) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
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'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
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 | 129 | else throw(($getType(@) + " couldn't be cast 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 | 161 | else throw(($getType(@) + " couldn't be cast 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 | - | let $ | |
194 | - | let pmtAmount = $ | |
195 | - | let pmtAssetId = $ | |
193 | + | let $t069216995 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
194 | + | let pmtAmount = $t069216995._1 | |
195 | + | let pmtAssetId = $t069216995._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 | - | let $ | |
206 | - | let exchangeCounter = $ | |
207 | - | let amountsWithFee = $ | |
208 | - | let assetsIdSend = $ | |
209 | - | let $ | |
205 | + | let $t075097574 = accumulated | |
206 | + | let exchangeCounter = $t075097574._1 | |
207 | + | let amountsWithFee = $t075097574._2 | |
208 | + | let assetsIdSend = $t075097574._3 | |
209 | + | let $t075877785 = if ((exchangeCounter == 0)) | |
210 | 210 | then $Tuple2(pmtAssetId, pmtAmount) | |
211 | 211 | else $Tuple2(assetsIdSend, amountsWithFee) | |
212 | - | let pmtAssetIdRout = $ | |
213 | - | let pmtAmountRout = $ | |
212 | + | let pmtAssetIdRout = $t075877785._1 | |
213 | + | let pmtAmountRout = $t075877785._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 | let inv = if ((exchangersType[exchangeCounter] == "cpmm")) | |
220 | 220 | then invoke(exchangerAddress, "callFunction", ["exchange", [toString(args1[exchangeCounter])]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
221 | 221 | else if ((exchangersType[exchangeCounter] == "flat")) | |
222 | 222 | then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
223 | 223 | else if ((exchangersType[exchangeCounter] == "curveMultyFlat")) | |
224 | 224 | then invoke(exchangerAddress, "exchange", [routingAssetsKeys[((exchangeCounter * 2) + 1)], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
225 | 225 | else throw("Incorrect exchange type") | |
226 | 226 | if ((inv == inv)) | |
227 | 227 | then { | |
228 | - | let $ | |
228 | + | let $t088119358 = match inv { | |
229 | 229 | case inv: List[Any] => | |
230 | 230 | match $Tuple2(inv[0], inv[1]) { | |
231 | 231 | case r: (Int, Unit)|(Int, ByteVector) => | |
232 | 232 | $Tuple2(r._1, r._2) | |
233 | 233 | case _ => | |
234 | 234 | throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
235 | 235 | } | |
236 | 236 | case inv: (Int, Unit)|(Int, ByteVector) => | |
237 | 237 | $Tuple2(inv._1, inv._2) | |
238 | 238 | case _ => | |
239 | 239 | throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
240 | 240 | } | |
241 | - | let amountWithFee = $ | |
242 | - | let assetIdSend = $ | |
241 | + | let amountWithFee = $t088119358._1 | |
242 | + | let assetIdSend = $t088119358._2 | |
243 | 243 | $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend) | |
244 | 244 | } | |
245 | 245 | else throw("Strict value is not equal to itself.") | |
246 | 246 | } | |
247 | 247 | else accumulated | |
248 | 248 | } | |
249 | 249 | ||
250 | - | let $ | |
250 | + | let $t094889594 = { | |
251 | 251 | let $l = exchangers | |
252 | 252 | let $s = size($l) | |
253 | 253 | let $acc0 = $Tuple3(0, 0, base58'') | |
254 | 254 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
255 | 255 | then $a | |
256 | 256 | else exchangeFold($a, $l[$i]) | |
257 | 257 | ||
258 | 258 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
259 | 259 | then $a | |
260 | 260 | else throw("List size exceeds 3") | |
261 | 261 | ||
262 | 262 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
263 | 263 | } | |
264 | - | let exchangeCounter = $ | |
265 | - | let amountWithoutFee = $ | |
266 | - | let assetIdSend = $ | |
264 | + | let exchangeCounter = $t094889594._1 | |
265 | + | let amountWithoutFee = $t094889594._2 | |
266 | + | let assetIdSend = $t094889594._3 | |
267 | 267 | let amountWithFee = fraction(amountWithoutFee, (feeScale6 - routingFee), feeScale6) | |
268 | 268 | if (if ((exchangeCounter == routingSize)) | |
269 | 269 | then (amountWithFee >= minAmountToReceive) | |
270 | 270 | else false) | |
271 | 271 | then [ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, (amountWithoutFee - amountWithFee), assetIdSend)] | |
272 | 272 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
273 | 273 | } | |
274 | 274 | }) | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | ||
278 | 278 | @Callable(i) | |
279 | 279 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
280 | 280 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
281 | 281 | else suspend("Paused by admin")) | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | ||
285 | 285 | @Callable(i) | |
286 | 286 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
287 | 287 | then throwIsActive() | |
288 | 288 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
289 | 289 | ||
290 | 290 | ||
291 | 291 | @Verifier(tx) | |
292 | 292 | func verify () = { | |
293 | 293 | let multiSignedByAdmins = { | |
294 | 294 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
295 | 295 | then 1 | |
296 | 296 | else 0 | |
297 | 297 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
298 | 298 | then 1 | |
299 | 299 | else 0 | |
300 | 300 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
301 | 301 | then 1 | |
302 | 302 | else 0 | |
303 | 303 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
304 | 304 | } | |
305 | 305 | match tx { | |
306 | 306 | case _ => | |
307 | 307 | multiSignedByAdmins | |
308 | 308 | } | |
309 | 309 | } | |
310 | 310 |
github/deemru/w8io/026f985 55.69 ms ◑