tx · 6q2hmAeZiscKrQkZybYsLj78M5wmEsbJPao2Qnv4qcmT

3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8:  -0.01700000 Waves

2022.09.05 14:21 [2215751] smart account 3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8 > SELF 0.00000000 Waves

{ "type": 13, "id": "6q2hmAeZiscKrQkZybYsLj78M5wmEsbJPao2Qnv4qcmT", "fee": 1700000, "feeAssetId": null, "timestamp": 1662376811051, "version": 2, "chainId": 84, "sender": "3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8", "senderPublicKey": "4ja2PX5eqM576zv9KGzu5Qe7M92Z3jbuSmkLPdGjK4ue", "proofs": [ "wVQPxu5q2ndUEa3KcY1Cy3DgnSzrwzXczQM8ieG17KD3kiNUcSfPtkAvMYHswFpwArE9WC2mxLSL9UY53TqVeKZ", "3GnkWBx652MqX5LWrbMMjK92tbMDeTvUmMVwq9kMufMffb3GBEiJWd8UVNuC4krn4m478sbnFbey8q3iPEJLkmEY" ], "script": "base64:AAIFAAAAAAAAABAIAhIICgYYGBERGAESABIAAAAAJgAAAAAHa0FjdGl2ZQIAAAAGYWN0aXZlAAAAAAZrQ2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAAA1rUG9vbEluT3JhY2xlAgAAAAVwb29sXwAAAAAOa1VzZXJTd29wSW5Hb3YCAAAADF9TV09QX2Ftb3VudAAAAAAKa0Rpc2NvdW50cwIAAAAJZGlzY291bnRzAAAAAA9rRGlzY291bnRWYWx1ZXMCAAAAD2Rpc2NvdW50X3ZhbHVlcwAAAAALa1JvdXRpbmdGZWUCAAAAC3JvdXRpbmdfZmVlAAAAAA1rQWRtaW5QdWJLZXkxAgAAAAthZG1pbl9wdWJfMQAAAAANa0FkbWluUHViS2V5MgIAAAALYWRtaW5fcHViXzIAAAAADWtBZG1pblB1YktleTMCAAAAC2FkbWluX3B1Yl8zAAAAABBrTW9uZXlCb3hBZGRyZXNzAgAAABFtb25leV9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cm9vZnMAAAAAAAAAAAAFAAAADGFkbWluUHViS2V5MQAAAAAAAAAAAQAAAAAAAAAAAAQAAAASYWRtaW5QdWJLZXkyU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEFAAAADGFkbWluUHViS2V5MgAAAAAAAAAAAQAAAAAAAAAAAAQAAAASYWRtaW5QdWJLZXkzU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIFAAAADGFkbWluUHViS2V5MwAAAAAAAAAAAQAAAAAAAAAAAAkAAGcAAAACCQAAZAAAAAIJAABkAAAAAgUAAAASYWRtaW5QdWJLZXkxU2lnbmVkBQAAABJhZG1pblB1YktleTJTaWduZWQFAAAAEmFkbWluUHViS2V5M1NpZ25lZAAAAAAAAAAAAgQAAAAHJG1hdGNoMAUAAAACdHgFAAAAE211bHRpU2lnbmVkQnlBZG1pbnP2Xq3d", "height": 2215751, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Biym8zuzwoGkgTG3NSyvWBURez2MKi48SYZM57ztUDi1 Next: C27KGitfbjQt7hWPUyqAJ7ymjNheTW14v74uGfgA9fdG Diff:
OldNewDifferences
123123 let getFrom1TradeWithFee = if ((exchangersType[0] == "curveMultyFlat"))
124124 then {
125125 let inv = {
126- let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount], nil)
126+ let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount, caller], nil)
127127 if ($isInstanceOf(@, "Int"))
128128 then @
129129 else throw("Couldn't cast Any to Int")
160160 let getFrom2TradeWithFee = if ((exchangersType[0] == "curveMultyFlat"))
161161 then {
162162 let inv = {
163- let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee], nil)
163+ let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee, caller], nil)
164164 if ($isInstanceOf(@, "Int"))
165165 then @
166166 else throw("Couldn't cast Any to Int")
195195
196196 @Callable(i)
197197 func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive) = valueOrElse(isActive(), {
198- let $t073977471 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
199- let pmtAmount = $t073977471._1
200- let pmtAssetId = $t073977471._2
198+ let $t074137487 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
199+ let pmtAmount = $t074137487._1
200+ let pmtAssetId = $t074137487._2
201201 if (!(checkPossibility(i.caller, pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
202202 then throw("Check transaction possibilty: declined")
203203 else if (if (!(isDefined(getString(oracle, (kPoolInOracle + exchangers[0])))))
207207 else {
208208 let routingSize = size(exchangers)
209209 func exchangeFold (accumulated,exchanger) = {
210- let $t079858050 = accumulated
211- let exchangeCounter = $t079858050._1
212- let amountsWithFee = $t079858050._2
213- let assetsIdSend = $t079858050._3
214- let $t080638261 = if ((exchangeCounter == 0))
210+ let $t080018066 = accumulated
211+ let exchangeCounter = $t080018066._1
212+ let amountsWithFee = $t080018066._2
213+ let assetsIdSend = $t080018066._3
214+ let $t080798277 = if ((exchangeCounter == 0))
215215 then $Tuple2(pmtAssetId, pmtAmount)
216216 else $Tuple2(assetsIdSend, amountsWithFee)
217- let pmtAssetIdRout = $t080638261._1
218- let pmtAmountRout = $t080638261._2
217+ let pmtAssetIdRout = $t080798277._1
218+ let pmtAmountRout = $t080798277._2
219219 if (((if ((exchangeCounter >= 0))
220220 then (routingSize > exchangeCounter)
221221 else false) == true))
239239 if ((inv == inv))
240240 then match inv {
241241 case inv: (Int, Unit)|(Int, ByteVector) =>
242- let $t091269164 = inv
243- let amountWithFee = $t091269164._1
244- let assetIdSend = $t091269164._2
242+ let $t091429180 = inv
243+ let amountWithFee = $t091429180._1
244+ let assetIdSend = $t091429180._2
245245 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
246246 case _ =>
247247 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
265265 else accumulated
266266 }
267267
268- let $t098609966 = {
268+ let $t098769982 = {
269269 let $l = exchangers
270270 let $s = size($l)
271271 let $acc0 = $Tuple3(0, 0, base58'')
279279
280280 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
281281 }
282- let exchangeCounter = $t098609966._1
283- let amountWithoutFee = $t098609966._2
284- let assetIdSend = $t098609966._3
282+ let exchangeCounter = $t098769982._1
283+ let amountWithoutFee = $t098769982._2
284+ let assetIdSend = $t098769982._3
285285 let amountWithFee = fraction(amountWithoutFee, (feeScale6 - routingFee), feeScale6)
286286 if (if ((exchangeCounter == routingSize))
287287 then (amountWithFee >= minAmountToReceive)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kActive = "active"
55
66 let kCause = "shutdown_cause"
77
88 let kPoolInOracle = "pool_"
99
1010 let kUserSwopInGov = "_SWOP_amount"
1111
1212 let kDiscounts = "discounts"
1313
1414 let kDiscountValues = "discount_values"
1515
1616 let kRoutingFee = "routing_fee"
1717
1818 let kAdminPubKey1 = "admin_pub_1"
1919
2020 let kAdminPubKey2 = "admin_pub_2"
2121
2222 let kAdminPubKey3 = "admin_pub_3"
2323
2424 let kMoneyBoxAddress = "money_box_address"
2525
2626 let kGovAddress = "governance_address"
2727
2828 let kFee = "commission"
2929
3030 let kMultyAssetBalance = "_balance"
3131
3232 let digits8 = 8
3333
3434 let scale8 = 100000000
3535
3636 let scale16 = 10000000000000000
3737
3838 let alpha = 50
3939
4040 let alphaDigits = 2
4141
4242 let beta = 4600000000000000
4343
4444 let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
4545
4646 func getBase58FromOracle (key) = match getString(oracle, key) {
4747 case string: String =>
4848 fromBase58String(string)
4949 case nothing =>
5050 throw((key + "is empty"))
5151 }
5252
5353
5454 let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
5555
5656 let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
5757
5858 let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
5959
6060 let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress))
6161
6262 let govAddress = Address(getBase58FromOracle(kGovAddress))
6363
6464 let active = valueOrElse(getBoolean(this, kActive), true)
6565
6666 let routingFee = valueOrErrorMessage(getInteger(oracle, kRoutingFee), "routing_fee is empty")
6767
6868 let feeScale6 = 1000000
6969
7070 func isActive () = if (active)
7171 then unit
7272 else throw("DApp is inactive at this moment")
7373
7474
7575 func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))
7676 then unit
7777 else throw("Only admin can call this function")
7878
7979
8080 func throwIsActive () = throw("DApp is already active")
8181
8282
8383 func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)]
8484
8585
8686 func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2)
8787
8888
8989 func invariantCalc (x,y) = {
9090 let sk = skewness(x, y)
9191 (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)))
9292 }
9393
9494
9595 func calculateFeeDiscount (userAddr) = {
9696 let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0)
9797 let discountValues = split(getStringValue(oracle, kDiscountValues), ",")
9898 let discounts = split(getStringValue(oracle, kDiscounts), ",")
9999 if (if ((swopAmount >= parseIntValue(discountValues[0])))
100100 then (parseIntValue(discountValues[1]) > swopAmount)
101101 else false)
102102 then (feeScale6 - parseIntValue(discounts[0]))
103103 else if (if ((swopAmount >= parseIntValue(discountValues[1])))
104104 then (parseIntValue(discountValues[2]) > swopAmount)
105105 else false)
106106 then (feeScale6 - parseIntValue(discounts[1]))
107107 else if (if ((swopAmount >= parseIntValue(discountValues[2])))
108108 then (parseIntValue(discountValues[3]) > swopAmount)
109109 else false)
110110 then (feeScale6 - parseIntValue(discounts[2]))
111111 else if (if ((swopAmount >= parseIntValue(discountValues[3])))
112112 then (parseIntValue(discountValues[4]) > swopAmount)
113113 else false)
114114 then (feeScale6 - parseIntValue(discounts[3]))
115115 else if ((swopAmount >= parseIntValue(discountValues[4])))
116116 then (feeScale6 - parseIntValue(discounts[4]))
117117 else feeScale6
118118 }
119119
120120
121121 func checkPossibility (caller,pmtAmount,minAmountToReceive,exchangers,exchangersType,routingAssetsKeys,args1,args2) = {
122122 let feeDiscount = calculateFeeDiscount(caller)
123123 let getFrom1TradeWithFee = if ((exchangersType[0] == "curveMultyFlat"))
124124 then {
125125 let inv = {
126- let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount], nil)
126+ let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount, caller], nil)
127127 if ($isInstanceOf(@, "Int"))
128128 then @
129129 else throw("Couldn't cast Any to Int")
130130 }
131131 if ((inv == inv))
132132 then {
133133 let @ = inv
134134 if ($isInstanceOf(@, "Int"))
135135 then @
136136 else throw("Couldn't cast Int to Int")
137137 }
138138 else throw("Strict value is not equal to itself.")
139139 }
140140 else {
141141 let dApp1TokenPay = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[0])
142142 let dApp1TokenGet = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[1])
143143 if ((exchangersType[0] == "cpmm"))
144144 then {
145145 let fee = getIntegerValue(addressFromStringValue(exchangers[0]), kFee)
146146 let getFrom1TradeWithoutFee = fraction(dApp1TokenGet, pmtAmount, (pmtAmount + dApp1TokenPay))
147147 fraction(getFrom1TradeWithoutFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6)), feeScale6)
148148 }
149149 else if ((exchangersType[0] == "flat"))
150150 then {
151151 let invariant = invariantCalc(dApp1TokenPay, dApp1TokenGet)
152152 let minAmountToReceive1 = args2[0]
153153 let invariantNew = invariantCalc((dApp1TokenPay + pmtAmount), (dApp1TokenGet - minAmountToReceive1))
154154 if ((invariantNew >= invariant))
155155 then minAmountToReceive1
156156 else throw("Flat contract: invariantNew < invariant")
157157 }
158158 else throw("Incorrect exchange type")
159159 }
160160 let getFrom2TradeWithFee = if ((exchangersType[0] == "curveMultyFlat"))
161161 then {
162162 let inv = {
163- let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee], nil)
163+ let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee, caller], nil)
164164 if ($isInstanceOf(@, "Int"))
165165 then @
166166 else throw("Couldn't cast Any to Int")
167167 }
168168 if ((inv == inv))
169169 then inv
170170 else throw("Strict value is not equal to itself.")
171171 }
172172 else {
173173 let dApp2TokenPay = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[2])
174174 let dApp2TokenGet = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[3])
175175 if ((exchangersType[1] == "cpmm"))
176176 then {
177177 let getFrom2TradeWithoutFee = fraction(dApp2TokenGet, getFrom1TradeWithFee, (getFrom1TradeWithFee + dApp2TokenPay))
178178 let fee = getIntegerValue(addressFromStringValue(exchangers[0]), kFee)
179179 fraction(getFrom2TradeWithoutFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6)), feeScale6)
180180 }
181181 else if ((exchangersType[1] == "flat"))
182182 then {
183183 let invariant = invariantCalc(dApp2TokenPay, dApp2TokenGet)
184184 let minAmountToReceive2 = args2[1]
185185 let invariantNew = invariantCalc((dApp2TokenPay + getFrom1TradeWithFee), (dApp2TokenGet - minAmountToReceive2))
186186 if ((invariantNew >= invariant))
187187 then minAmountToReceive2
188188 else throw("Flat contract: invariantNew < invariant")
189189 }
190190 else throw("Incorrect exchange type")
191191 }
192192 (getFrom2TradeWithFee >= minAmountToReceive)
193193 }
194194
195195
196196 @Callable(i)
197197 func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive) = valueOrElse(isActive(), {
198- let $t073977471 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
199- let pmtAmount = $t073977471._1
200- let pmtAssetId = $t073977471._2
198+ let $t074137487 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
199+ let pmtAmount = $t074137487._1
200+ let pmtAssetId = $t074137487._2
201201 if (!(checkPossibility(i.caller, pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
202202 then throw("Check transaction possibilty: declined")
203203 else if (if (!(isDefined(getString(oracle, (kPoolInOracle + exchangers[0])))))
204204 then true
205205 else !(isDefined(getString(oracle, (kPoolInOracle + exchangers[1])))))
206206 then throw("Pool is not in oracle")
207207 else {
208208 let routingSize = size(exchangers)
209209 func exchangeFold (accumulated,exchanger) = {
210- let $t079858050 = accumulated
211- let exchangeCounter = $t079858050._1
212- let amountsWithFee = $t079858050._2
213- let assetsIdSend = $t079858050._3
214- let $t080638261 = if ((exchangeCounter == 0))
210+ let $t080018066 = accumulated
211+ let exchangeCounter = $t080018066._1
212+ let amountsWithFee = $t080018066._2
213+ let assetsIdSend = $t080018066._3
214+ let $t080798277 = if ((exchangeCounter == 0))
215215 then $Tuple2(pmtAssetId, pmtAmount)
216216 else $Tuple2(assetsIdSend, amountsWithFee)
217- let pmtAssetIdRout = $t080638261._1
218- let pmtAmountRout = $t080638261._2
217+ let pmtAssetIdRout = $t080798277._1
218+ let pmtAmountRout = $t080798277._2
219219 if (((if ((exchangeCounter >= 0))
220220 then (routingSize > exchangeCounter)
221221 else false) == true))
222222 then {
223223 let exchangerAddress = addressFromStringValue(exchanger)
224224 if ((exchangersType[exchangeCounter] == "cpmm"))
225225 then {
226226 let inv = {
227227 let @ = invoke(exchangerAddress, "callFunction", ["exchange", [toString(args1[exchangeCounter])]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
228228 if ($isInstanceOf(@, "List[Any]"))
229229 then @
230230 else throw("Couldn't cast Any to List[Any]")
231231 }
232232 if ((inv == inv))
233233 then $Tuple3((exchangeCounter + 1), inv[0], inv[1])
234234 else throw("Strict value is not equal to itself.")
235235 }
236236 else if ((exchangersType[exchangeCounter] == "flat"))
237237 then {
238238 let inv = invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
239239 if ((inv == inv))
240240 then match inv {
241241 case inv: (Int, Unit)|(Int, ByteVector) =>
242- let $t091269164 = inv
243- let amountWithFee = $t091269164._1
244- let assetIdSend = $t091269164._2
242+ let $t091429180 = inv
243+ let amountWithFee = $t091429180._1
244+ let assetIdSend = $t091429180._2
245245 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
246246 case _ =>
247247 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
248248 }
249249 else throw("Strict value is not equal to itself.")
250250 }
251251 else if ((exchangersType[exchangeCounter] == "curveMultyFlat"))
252252 then {
253253 let inv = {
254254 let @ = invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
255255 if ($isInstanceOf(@, "List[Any]"))
256256 then @
257257 else throw("Couldn't cast Any to List[Any]")
258258 }
259259 if ((inv == inv))
260260 then $Tuple3((exchangeCounter + 1), inv[0], inv[1])
261261 else throw("Strict value is not equal to itself.")
262262 }
263263 else throw("Incorrect exchange type")
264264 }
265265 else accumulated
266266 }
267267
268- let $t098609966 = {
268+ let $t098769982 = {
269269 let $l = exchangers
270270 let $s = size($l)
271271 let $acc0 = $Tuple3(0, 0, base58'')
272272 func $f0_1 ($a,$i) = if (($i >= $s))
273273 then $a
274274 else exchangeFold($a, $l[$i])
275275
276276 func $f0_2 ($a,$i) = if (($i >= $s))
277277 then $a
278278 else throw("List size exceeds 3")
279279
280280 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
281281 }
282- let exchangeCounter = $t098609966._1
283- let amountWithoutFee = $t098609966._2
284- let assetIdSend = $t098609966._3
282+ let exchangeCounter = $t098769982._1
283+ let amountWithoutFee = $t098769982._2
284+ let assetIdSend = $t098769982._3
285285 let amountWithFee = fraction(amountWithoutFee, (feeScale6 - routingFee), feeScale6)
286286 if (if ((exchangeCounter == routingSize))
287287 then (amountWithFee >= minAmountToReceive)
288288 else false)
289289 then [ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, (amountWithoutFee - amountWithFee), assetIdSend)]
290290 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
291291 }
292292 })
293293
294294
295295
296296 @Callable(i)
297297 func shutdown () = valueOrElse(isAdminCall(i), if (!(active))
298298 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
299299 else suspend("Paused by admin"))
300300
301301
302302
303303 @Callable(i)
304304 func activate () = valueOrElse(isAdminCall(i), if (active)
305305 then throwIsActive()
306306 else [BooleanEntry(kActive, true), DeleteEntry(kCause)])
307307
308308
309309 @Verifier(tx)
310310 func verify () = {
311311 let multiSignedByAdmins = {
312312 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
313313 then 1
314314 else 0
315315 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
316316 then 1
317317 else 0
318318 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
319319 then 1
320320 else 0
321321 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
322322 }
323323 match tx {
324324 case _ =>
325325 multiSignedByAdmins
326326 }
327327 }
328328

github/deemru/w8io/026f985 
86.62 ms