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:AAIFAAAAAAAAABAIAhIICgYYGBERGAESABIAAAAAJgAAAAAHa0FjdGl2ZQIAAAAGYWN0aXZlAAAAAAZrQ2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAAA1rUG9vbEluT3JhY2xlAgAAAAVwb29sXwAAAAAOa1VzZXJTd29wSW5Hb3YCAAAADF9TV09QX2Ftb3VudAAAAAAKa0Rpc2NvdW50cwIAAAAJZGlzY291bnRzAAAAAA9rRGlzY291bnRWYWx1ZXMCAAAAD2Rpc2NvdW50X3ZhbHVlcwAAAAALa1JvdXRpbmdGZWUCAAAAC3JvdXRpbmdfZmVlAAAAAA1rQWRtaW5QdWJLZXkxAgAAAAthZG1pbl9wdWJfMQAAAAANa0FkbWluUHViS2V5MgIAAAALYWRtaW5fcHViXzIAAAAADWtBZG1pblB1YktleTMCAAAAC2FkbWluX3B1Yl8zAAAAABBrTW9uZXlCb3hBZGRyZXNzAgAAABFtb25le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AAAAAAAABAAAABJhZG1pblB1YktleTNTaWduZWQDCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgUAAAAMYWRtaW5QdWJLZXkzAAAAAAAAAAABAAAAAAAAAAAACQAAZwAAAAIJAABkAAAAAgkAAGQAAAACBQAAABJhZG1pblB1YktleTFTaWduZWQFAAAAEmFkbWluUHViS2V5MlNpZ25lZAUAAAASYWRtaW5QdWJLZXkzU2lnbmVkAAAAAAAAAAACBAAAAAckbWF0Y2gwBQAAAAJ0eAUAAAATbXVsdGlTaWduZWRCeUFkbWluc35GTJE=", "height": 2228834, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 71JE7V6wKjCbGbgtWhk4gSeV2duKEy4aX6qT6RKthMpk Next: 4jdaVsnFUKrCNtGdLQa86YTMNggtpz3fYWcGaE9tD6Qb Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kActive = "active"
126126 let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount, toString(caller)], nil)
127127 if ($isInstanceOf(@, "(Int, Int)"))
128128 then @
129- else throw(($getType(invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount, toString(caller)], nil)) + " couldn't be cast to (Int, Int)"))
129+ else throw("Couldn't cast Any to (Int, Int)")
130130 }
131131 if ((inv == inv))
132132 then inv._1
158158 let @ = invoke(addressFromStringValue(exchangers[1]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee, toString(caller)], nil)
159159 if ($isInstanceOf(@, "(Int, Int)"))
160160 then @
161- else throw(($getType(invoke(addressFromStringValue(exchangers[1]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee, toString(caller)], nil)) + " couldn't be cast to (Int, Int)"))
161+ else throw("Couldn't cast Any to (Int, Int)")
162162 }
163163 if ((inv == inv))
164164 then inv._1
218218 let exchangerAddress = addressFromStringValue(exchanger)
219219 if ((exchangersType[exchangeCounter] == "cpmm"))
220220 then {
221- let inv = {
222- let @ = invoke(exchangerAddress, "callFunction", ["exchange", [toString(args1[exchangeCounter])]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
223- if ($isInstanceOf(@, "List[Any]"))
221+ let $t085528711 = {
222+ let @ = invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
223+ if ($isInstanceOf(@, "(Int, Int)"))
224224 then @
225- else throw(($getType(invoke(exchangerAddress, "callFunction", ["exchange", [toString(args1[exchangeCounter])]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])) + " couldn't be cast to List[Any]"))
225+ else throw("Couldn't cast Any to (Int, Int)")
226226 }
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+ }
229233 else throw("Strict value is not equal to itself.")
230234 }
231235 else if ((exchangersType[exchangeCounter] == "flat"))
234238 let @ = invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
235239 if ($isInstanceOf(@, "List[Any]"))
236240 then @
237- else throw(($getType(invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])) + " couldn't be cast to List[Any]"))
241+ else throw("Couldn't cast Any to List[Any]")
238242 }
239243 if ((inv == inv))
240244 then $Tuple3((exchangeCounter + 1), inv[0], inv[1])
246250 let @ = invoke(exchangerAddress, "exchange", [routingAssetsKeys[((exchangeCounter * 2) + 1)], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
247251 if ($isInstanceOf(@, "List[Any]"))
248252 then @
249- else throw(($getType(invoke(exchangerAddress, "exchange", [routingAssetsKeys[((exchangeCounter * 2) + 1)], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])) + " couldn't be cast to List[Any]"))
253+ else throw("Couldn't cast Any to List[Any]")
250254 }
251255 if ((inv == inv))
252256 then $Tuple3((exchangeCounter + 1), inv[0], inv[1])
257261 else accumulated
258262 }
259263
260- let $t095819687 = {
264+ let $t095689674 = {
261265 let $l = exchangers
262266 let $s = size($l)
263267 let $acc0 = $Tuple3(0, 0, base58'')
271275
272276 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
273277 }
274- let exchangeCounter = $t095819687._1
275- let amountWithoutFee = $t095819687._2
276- let assetIdSend = $t095819687._3
278+ let exchangeCounter = $t095689674._1
279+ let amountWithoutFee = $t095689674._2
280+ let assetIdSend = $t095689674._3
277281 let amountWithFee = fraction(amountWithoutFee, (feeScale6 - routingFee), feeScale6)
278282 if (if ((exchangeCounter == routingSize))
279283 then (amountWithFee >= minAmountToReceive)
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# 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 = {
126126 let @ = invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount, toString(caller)], nil)
127127 if ($isInstanceOf(@, "(Int, Int)"))
128128 then @
129- else throw(($getType(invoke(addressFromStringValue(exchangers[0]), "getDy", [routingAssetsKeys[0], routingAssetsKeys[1], pmtAmount, toString(caller)], nil)) + " couldn't be cast to (Int, Int)"))
129+ else throw("Couldn't cast Any to (Int, Int)")
130130 }
131131 if ((inv == inv))
132132 then inv._1
133133 else throw("Strict value is not equal to itself.")
134134 }
135135 else {
136136 let dApp1TokenPay = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[0])
137137 let dApp1TokenGet = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[1])
138138 if ((exchangersType[0] == "cpmm"))
139139 then {
140140 let fee = getIntegerValue(addressFromStringValue(exchangers[0]), kFee)
141141 let getFrom1TradeWithoutFee = fraction(dApp1TokenGet, pmtAmount, (pmtAmount + dApp1TokenPay))
142142 fraction(getFrom1TradeWithoutFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6)), feeScale6)
143143 }
144144 else if ((exchangersType[0] == "flat"))
145145 then {
146146 let invariant = invariantCalc(dApp1TokenPay, dApp1TokenGet)
147147 let minAmountToReceive1 = args2[0]
148148 let invariantNew = invariantCalc((dApp1TokenPay + pmtAmount), (dApp1TokenGet - minAmountToReceive1))
149149 if ((invariantNew >= invariant))
150150 then minAmountToReceive1
151151 else throw("Flat contract: invariantNew < invariant")
152152 }
153153 else throw("Incorrect exchange type")
154154 }
155155 let getFrom2TradeWithFee = if ((exchangersType[1] == "curveMultyFlat"))
156156 then {
157157 let inv = {
158158 let @ = invoke(addressFromStringValue(exchangers[1]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee, toString(caller)], nil)
159159 if ($isInstanceOf(@, "(Int, Int)"))
160160 then @
161- else throw(($getType(invoke(addressFromStringValue(exchangers[1]), "getDy", [routingAssetsKeys[2], routingAssetsKeys[3], getFrom1TradeWithFee, toString(caller)], nil)) + " couldn't be cast to (Int, Int)"))
161+ else throw("Couldn't cast Any to (Int, Int)")
162162 }
163163 if ((inv == inv))
164164 then inv._1
165165 else throw("Strict value is not equal to itself.")
166166 }
167167 else {
168168 let dApp2TokenPay = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[2])
169169 let dApp2TokenGet = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[3])
170170 if ((exchangersType[1] == "cpmm"))
171171 then {
172172 let getFrom2TradeWithoutFee = fraction(dApp2TokenGet, getFrom1TradeWithFee, (getFrom1TradeWithFee + dApp2TokenPay))
173173 let fee = getIntegerValue(addressFromStringValue(exchangers[1]), kFee)
174174 fraction(getFrom2TradeWithoutFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6)), feeScale6)
175175 }
176176 else if ((exchangersType[1] == "flat"))
177177 then {
178178 let invariant = invariantCalc(dApp2TokenPay, dApp2TokenGet)
179179 let minAmountToReceive2 = args2[1]
180180 let invariantNew = invariantCalc((dApp2TokenPay + getFrom1TradeWithFee), (dApp2TokenGet - minAmountToReceive2))
181181 if ((invariantNew >= invariant))
182182 then minAmountToReceive2
183183 else throw("Flat contract: invariantNew < invariant")
184184 }
185185 else throw("Incorrect exchange type")
186186 }
187187 (getFrom2TradeWithFee >= minAmountToReceive)
188188 }
189189
190190
191191 @Callable(i)
192192 func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive) = valueOrElse(isActive(), {
193193 let $t074417515 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
194194 let pmtAmount = $t074417515._1
195195 let pmtAssetId = $t074417515._2
196196 if (!(checkPossibility(i.caller, pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
197197 then throw("Check transaction possibilty: declined")
198198 else if (if (!(isDefined(getString(oracle, (kPoolInOracle + exchangers[0])))))
199199 then true
200200 else !(isDefined(getString(oracle, (kPoolInOracle + exchangers[1])))))
201201 then throw("Pool is not in oracle")
202202 else {
203203 let routingSize = size(exchangers)
204204 func exchangeFold (accumulated,exchanger) = {
205205 let $t080298094 = accumulated
206206 let exchangeCounter = $t080298094._1
207207 let amountsWithFee = $t080298094._2
208208 let assetsIdSend = $t080298094._3
209209 let $t081078305 = if ((exchangeCounter == 0))
210210 then $Tuple2(pmtAssetId, pmtAmount)
211211 else $Tuple2(assetsIdSend, amountsWithFee)
212212 let pmtAssetIdRout = $t081078305._1
213213 let pmtAmountRout = $t081078305._2
214214 if (((if ((exchangeCounter >= 0))
215215 then (routingSize > exchangeCounter)
216216 else false) == true))
217217 then {
218218 let exchangerAddress = addressFromStringValue(exchanger)
219219 if ((exchangersType[exchangeCounter] == "cpmm"))
220220 then {
221- let inv = {
222- let @ = invoke(exchangerAddress, "callFunction", ["exchange", [toString(args1[exchangeCounter])]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
223- if ($isInstanceOf(@, "List[Any]"))
221+ let $t085528711 = {
222+ let @ = invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
223+ if ($isInstanceOf(@, "(Int, Int)"))
224224 then @
225- else throw(($getType(invoke(exchangerAddress, "callFunction", ["exchange", [toString(args1[exchangeCounter])]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])) + " couldn't be cast to List[Any]"))
225+ else throw("Couldn't cast Any to (Int, Int)")
226226 }
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+ }
229233 else throw("Strict value is not equal to itself.")
230234 }
231235 else if ((exchangersType[exchangeCounter] == "flat"))
232236 then {
233237 let inv = {
234238 let @ = invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
235239 if ($isInstanceOf(@, "List[Any]"))
236240 then @
237- else throw(($getType(invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])) + " couldn't be cast to List[Any]"))
241+ else throw("Couldn't cast Any to List[Any]")
238242 }
239243 if ((inv == inv))
240244 then $Tuple3((exchangeCounter + 1), inv[0], inv[1])
241245 else throw("Strict value is not equal to itself.")
242246 }
243247 else if ((exchangersType[exchangeCounter] == "curveMultyFlat"))
244248 then {
245249 let inv = {
246250 let @ = invoke(exchangerAddress, "exchange", [routingAssetsKeys[((exchangeCounter * 2) + 1)], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
247251 if ($isInstanceOf(@, "List[Any]"))
248252 then @
249- else throw(($getType(invoke(exchangerAddress, "exchange", [routingAssetsKeys[((exchangeCounter * 2) + 1)], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])) + " couldn't be cast to List[Any]"))
253+ else throw("Couldn't cast Any to List[Any]")
250254 }
251255 if ((inv == inv))
252256 then $Tuple3((exchangeCounter + 1), inv[0], inv[1])
253257 else throw("Strict value is not equal to itself.")
254258 }
255259 else throw("Incorrect exchange type")
256260 }
257261 else accumulated
258262 }
259263
260- let $t095819687 = {
264+ let $t095689674 = {
261265 let $l = exchangers
262266 let $s = size($l)
263267 let $acc0 = $Tuple3(0, 0, base58'')
264268 func $f0_1 ($a,$i) = if (($i >= $s))
265269 then $a
266270 else exchangeFold($a, $l[$i])
267271
268272 func $f0_2 ($a,$i) = if (($i >= $s))
269273 then $a
270274 else throw("List size exceeds 3")
271275
272276 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
273277 }
274- let exchangeCounter = $t095819687._1
275- let amountWithoutFee = $t095819687._2
276- let assetIdSend = $t095819687._3
278+ let exchangeCounter = $t095689674._1
279+ let amountWithoutFee = $t095689674._2
280+ let assetIdSend = $t095689674._3
277281 let amountWithFee = fraction(amountWithoutFee, (feeScale6 - routingFee), feeScale6)
278282 if (if ((exchangeCounter == routingSize))
279283 then (amountWithFee >= minAmountToReceive)
280284 else false)
281285 then [ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, (amountWithoutFee - amountWithFee), assetIdSend)]
282286 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
283287 }
284288 })
285289
286290
287291
288292 @Callable(i)
289293 func shutdown () = valueOrElse(isAdminCall(i), if (!(active))
290294 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
291295 else suspend("Paused by admin"))
292296
293297
294298
295299 @Callable(i)
296300 func activate () = valueOrElse(isAdminCall(i), if (active)
297301 then throwIsActive()
298302 else [BooleanEntry(kActive, true), DeleteEntry(kCause)])
299303
300304
301305 @Verifier(tx)
302306 func verify () = {
303307 let multiSignedByAdmins = {
304308 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
305309 then 1
306310 else 0
307311 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
308312 then 1
309313 else 0
310314 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
311315 then 1
312316 else 0
313317 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
314318 }
315319 match tx {
316320 case _ =>
317321 multiSignedByAdmins
318322 }
319323 }
320324

github/deemru/w8io/169f3d6 
177.53 ms