tx · 5mkHELsuHKqFZfKRjrRVr3JwnaueT4Jxi1bZRsSLUx1b

3MtsXxXqERvHEmkPiiuBESuixd9Y8qAU1PC:  -0.14000000 Waves

2022.12.23 12:46 [2372765] smart account 3MtsXxXqERvHEmkPiiuBESuixd9Y8qAU1PC > SELF 0.00000000 Waves

{ "type": 13, "id": "5mkHELsuHKqFZfKRjrRVr3JwnaueT4Jxi1bZRsSLUx1b", "fee": 14000000, "feeAssetId": null, "timestamp": 1671788781592, "version": 2, "chainId": 84, "sender": "3MtsXxXqERvHEmkPiiuBESuixd9Y8qAU1PC", "senderPublicKey": "EBCSQaTtuxQBJyc62F142LxJ3hpQtCwuZ2z9kkoe6Vvt", "proofs": [ "5w5n1WyrcvVJoSKNGpRwp5djCtMqo7BqDEM5LSto1XPUKZoymUGxGiVq472SZK3j9QqgHFNkb1h8jFp1yZvDFyCY", "44FEBTu1CoFA3aFtpU41h31T6NrF2rb4ZLgRy25EoYT1fagDuymbaskNNtrWTNbeTQLjEJPKXZmJWVYLFjCqy4eK" ], "script": "base64:BgIbCAISABIECgIICBIFCgMBBAESBAoCAQgSABIAQAAGb3JhY2xlCQEHQWRkcmVzcwEBGgFUSBOXDMDTM8wlMoC2KfenZGiAq+PMe0uZAAd2ZXJzaW9uAgUxLjAuMAAIa1ZlcnNpb24CB3ZlcnNpb24AB2tBY3RpdmUCBmFjdGl2ZQALa0FjdGl2ZUdsb2ICFGFjdGl2ZV9hbGxfY29udHJhY3RzAA9rTnVtYmVyT2ZWb3RpbmcCFHZvdGluZ19hY3RpdmVfbnVtYmVyAA1rSGVpZ2h0T2ZQb29sAg5fZmluaXNoX2hlaWdodAADa05vAg9fdG90YWxfdm90ZXNfbm8ABGtZZXMCEF90b3RhbF92b3Rlc195ZXMAB2tOb1VzZXICCF92b3RlX25vAAhrWWVzVXNlcgIJX3ZvdGVfeWVzAA9rU3RhdHVzT2ZWb3RpbmcCB19zdGF0dXMAD2tBbW91bnRPZlZvdGluZwIOdm90aW5nX2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YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUGa0NhdXNlAhp0aGUgY2F1c2Ugd2Fzbid0IHNwZWNpZmllZAkBB3N1c3BlbmQBAg9QYXVzZWQgYnkgYWRtaW4BaQEIYWN0aXZhdGUACQELdmFsdWVPckVsc2UCCQELaXNBZG1pbkNhbGwBBQFpAwUGYWN0aXZlCQACAQIWREFwcCBpcyBhbHJlYWR5IGFjdGl2ZQkAzAgCCQEMQm9vbGVhbkVudHJ5AgUHa0FjdGl2ZQYJAMwIAgkBC0RlbGV0ZUVudHJ5AQUGa0NhdXNlBQNuaWwBAnR4AQZ2ZXJpZnkABBJhZG1pblB1YktleTFTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQxhZG1pblB1YktleTEAAQAABBJhZG1pblB1YktleTJTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQxhZG1pblB1YktleTIAAQAABBJhZG1pblB1YktleTNTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAALuhcWB", "height": 2372765, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6sZEEaSg9e389m4azP6dugxRbKbPV1vYgw5e5vTySxUU Next: 6skSUNiJzPyEGrp1AEGHhZFgSGStU9Wj3CP1CXrvoWwA Diff:
OldNewDifferences
222222 else fromBase58String(assetStr)
223223
224224
225-func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddress, (toString(user) + kUserTotalGSWOP)), 0) > 0))
225+func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddress, (toString(user) + kUserTotalSWOP)), 0) > 0))
226226 then true
227227 else false
228228
247247
248248 @Callable(i)
249249 func initVotingForNewPool (assetA,assetB) = valueOrElse(isActive(), {
250- let $t071007175 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
251- let pmtAmount = $t071007175._1
252- let pmtAssetId = $t071007175._2
253- let $t071807279 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB))
254- let poolAssetIdA = $t071807279._1
255- let poolAssetIdB = $t071807279._2
250+ let $t070997174 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
251+ let pmtAmount = $t070997174._1
252+ let pmtAssetId = $t070997174._2
253+ let $t071797278 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB))
254+ let poolAssetIdA = $t071797278._1
255+ let poolAssetIdB = $t071797278._2
256256 let unactiveVote = getUnactiveVotingPool()
257257 let newNumberOfVoting = getActiveVotingPoolAmount()
258258 let isPoolExists = isLastActivePoolExists(assetA, assetB)
259- let $t074497527 = getAssetInfo(poolAssetIdA)
260- let pmtStrAssetIdA = $t074497527._1
261- let pmtAssetNameA = $t074497527._2
262- let pmtDecimalsA = $t074497527._3
263- let $t075327610 = getAssetInfo(poolAssetIdB)
264- let pmtStrAssetIdB = $t075327610._1
265- let pmtAssetNameB = $t075327610._2
266- let pmtDecimalsB = $t075327610._3
259+ let $t074487526 = getAssetInfo(poolAssetIdA)
260+ let pmtStrAssetIdA = $t074487526._1
261+ let pmtAssetNameA = $t074487526._2
262+ let pmtDecimalsA = $t074487526._3
263+ let $t075317609 = getAssetInfo(poolAssetIdB)
264+ let pmtStrAssetIdB = $t075317609._1
265+ let pmtAssetNameB = $t075317609._2
266+ let pmtDecimalsB = $t075317609._3
267267 if ((poolAssetIdA == poolAssetIdB))
268268 then throw("Assets must be different")
269269 else if (isPoolExists)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz')
55
66 let version = "1.0.0"
77
88 let kVersion = "version"
99
1010 let kActive = "active"
1111
1212 let kActiveGlob = "active_all_contracts"
1313
1414 let kNumberOfVoting = "voting_active_number"
1515
1616 let kHeightOfPool = "_finish_height"
1717
1818 let kNo = "_total_votes_no"
1919
2020 let kYes = "_total_votes_yes"
2121
2222 let kNoUser = "_vote_no"
2323
2424 let kYesUser = "_vote_yes"
2525
2626 let kStatusOfVoting = "_status"
2727
2828 let kAmountOfVoting = "voting_id_last"
2929
3030 let kMaxAmountOfVoting = "max_amount_voting"
3131
3232 let kMaxDayOfVoting = "max_day_voting"
3333
3434 let kCause = "shutdown_cause"
3535
3636 let kCancelCause = "_cancel_cause"
3737
3838 let kUserTotalSWOP = "_SWOP_amount"
3939
4040 let kUserTotalGSWOP = "_GSwop_amount"
4141
4242 let kName = "_asset_name"
4343
4444 let votingId = "_voting"
4545
4646 let activeVoteFirst = "voting_active_cell_1"
4747
4848 let activeVoteSecond = "voting_active_cell_2"
4949
5050 let activeVoteThird = "voting_active_cell_3"
5151
5252 let kAdminPubKey1 = "admin_pub_1"
5353
5454 let kAdminPubKey2 = "admin_pub_2"
5555
5656 let kAdminPubKey3 = "admin_pub_3"
5757
5858 let kMoneyBoxAddress = "money_box_address"
5959
6060 let kGovAddress = "governance_address"
6161
6262 let kFarmingAddr = "farming_address"
6363
6464 let kUSDNAssetId = "usdn_asset_id"
6565
6666 let kSWOPid = "SWOP_id"
6767
6868 let numberOfVoting = getIntegerValue(this, kNumberOfVoting)
6969
7070 let amountOfVoting = getIntegerValue(this, kAmountOfVoting)
7171
7272 let firstActiveVote = valueOrElse(getString(this, activeVoteFirst), "")
7373
7474 let secondActiveVote = valueOrElse(getString(this, activeVoteSecond), "")
7575
7676 let thirdActiveVote = valueOrElse(getString(this, activeVoteThird), "")
7777
7878 let active = getBooleanValue(this, kActive)
7979
8080 let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true)
8181
8282 let comissionForInitalizationOfVoting = 1000000000
8383
8484 let maxAmountOfVoting = 3
8585
8686 let maxDayOfVoting = 7
8787
8888 let votingPeriodLength = (1443 * maxDayOfVoting)
8989
9090 func getBase58FromOracle (key) = match getString(oracle, key) {
9191 case string: String =>
9292 fromBase58String(string)
9393 case nothing =>
9494 throw((key + "is empty"))
9595 }
9696
9797
9898 let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
9999
100100 let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
101101
102102 let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
103103
104104 let govAddress = Address(getBase58FromOracle(kGovAddress))
105105
106106 let farmingAddr = Address(getBase58FromOracle(kFarmingAddr))
107107
108108 let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress))
109109
110110 let USDN = getBase58FromOracle(kUSDNAssetId)
111111
112112 let SWOP = fromBase58String(getStringValue(farmingAddr, kSWOPid))
113113
114114 func isActive () = if (if (active)
115115 then activeGlob
116116 else false)
117117 then unit
118118 else throw("DApp is inactive at this moment")
119119
120120
121121 func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))
122122 then unit
123123 else throw("Only admin can call this function")
124124
125125
126126 func getAssetInfo (assetId) = match assetId {
127127 case id: ByteVector =>
128128 if (isDefined(assetInfo(id)))
129129 then {
130130 let stringId = toBase58String(id)
131131 let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist"))
132132 $Tuple3(stringId, info.name, info.decimals)
133133 }
134134 else throw("Asset is not defined")
135135 case waves: Unit =>
136136 $Tuple3("WAVES", "WAVES", 8)
137137 case _ =>
138138 throw("Match error")
139139 }
140140
141141
142142 func isActivePoolExists (pools,assetA,assetB) = {
143143 let poolsData = split(pools, "_")
144144 let isPoolDefine = isDefined(getInteger(this, pools))
145145 if (if (isPoolDefine)
146146 then (pools != "")
147147 else false)
148148 then {
149149 let voting = poolsData[2]
150150 let newPools = (((((assetA + "_") + assetB) + "_") + voting) + votingId)
151151 let isNewPoolDefine = isDefined(getInteger(this, newPools))
152152 let heightOfVoting = valueOrElse(getInteger(this, (voting + kHeightOfPool)), 0)
153153 let statusOfVoting = valueOrElse(getBoolean(this, (voting + kStatusOfVoting)), true)
154154 if (isNewPoolDefine)
155155 then if ((heightOfVoting > height))
156156 then if (statusOfVoting)
157157 then true
158158 else false
159159 else false
160160 else false
161161 }
162162 else false
163163 }
164164
165165
166166 func isUnactivePoolExists (poolsState) = {
167167 let pools = valueOrElse(getString(this, poolsState), "")
168168 let poolsData = split(pools, "_")
169169 let isPoolDefine = isDefined(getInteger(this, pools))
170170 if (if (isPoolDefine)
171171 then (pools != "")
172172 else false)
173173 then {
174174 let voting = poolsData[2]
175175 let heightOfVoting = valueOrElse(getInteger(this, (voting + kHeightOfPool)), 0)
176176 let statusOfVoting = valueOrElse(getBoolean(this, (voting + kStatusOfVoting)), true)
177177 if ((heightOfVoting > height))
178178 then if (statusOfVoting)
179179 then ""
180180 else poolsState
181181 else poolsState
182182 }
183183 else poolsState
184184 }
185185
186186
187187 func isLastActivePoolExists (assetA,assetB) = if (if (isActivePoolExists(firstActiveVote, assetA, assetB))
188188 then true
189189 else isActivePoolExists(secondActiveVote, assetA, assetB))
190190 then true
191191 else isActivePoolExists(thirdActiveVote, assetA, assetB)
192192
193193
194194 func getActivePool (voting) = {
195195 let heightOfVoting = valueOrElse(getInteger(this, (toString(voting) + kHeightOfPool)), 0)
196196 let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + kStatusOfVoting)), true)
197197 let currentHeight = height
198198 if ((0 > voting))
199199 then 0
200200 else if (!(statusOfVoting))
201201 then 0
202202 else if ((heightOfVoting > currentHeight))
203203 then 1
204204 else 0
205205 }
206206
207207
208208 func getActiveVotingPoolAmount () = ((getActivePool(valueOrElse(getInteger(this, firstActiveVote), -1)) + getActivePool(valueOrElse(getInteger(this, secondActiveVote), -1))) + getActivePool(valueOrElse(getInteger(this, thirdActiveVote), -1)))
209209
210210
211211 func getUnactiveVotingPool () = if ((isUnactivePoolExists(activeVoteFirst) != ""))
212212 then activeVoteFirst
213213 else if ((isUnactivePoolExists(activeVoteSecond) != ""))
214214 then activeVoteSecond
215215 else if ((isUnactivePoolExists(activeVoteThird) != ""))
216216 then activeVoteThird
217217 else ""
218218
219219
220220 func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES"))
221221 then unit
222222 else fromBase58String(assetStr)
223223
224224
225-func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddress, (toString(user) + kUserTotalGSWOP)), 0) > 0))
225+func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddress, (toString(user) + kUserTotalSWOP)), 0) > 0))
226226 then true
227227 else false
228228
229229
230230 func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)]
231231
232232
233233 @Callable(i)
234234 func init () = if ((i.caller != this))
235235 then throw("Only the DApp itself can call this function")
236236 else if (isDefined(getBoolean(this, kActive)))
237237 then throw("DApp is already active")
238238 else {
239239 let initNumberOfVoting = 0
240240 let initAmountOfVoting = 0
241241 let initKeyActive = true
242242 let activeInit = ""
243243 [StringEntry(kVersion, version), BooleanEntry(kActive, initKeyActive), IntegerEntry(kNumberOfVoting, initNumberOfVoting), IntegerEntry(kAmountOfVoting, initAmountOfVoting), IntegerEntry(kMaxAmountOfVoting, maxAmountOfVoting), IntegerEntry(kMaxDayOfVoting, maxDayOfVoting), StringEntry(activeVoteFirst, activeInit), StringEntry(activeVoteSecond, activeInit), StringEntry(activeVoteThird, activeInit)]
244244 }
245245
246246
247247
248248 @Callable(i)
249249 func initVotingForNewPool (assetA,assetB) = valueOrElse(isActive(), {
250- let $t071007175 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
251- let pmtAmount = $t071007175._1
252- let pmtAssetId = $t071007175._2
253- let $t071807279 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB))
254- let poolAssetIdA = $t071807279._1
255- let poolAssetIdB = $t071807279._2
250+ let $t070997174 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
251+ let pmtAmount = $t070997174._1
252+ let pmtAssetId = $t070997174._2
253+ let $t071797278 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB))
254+ let poolAssetIdA = $t071797278._1
255+ let poolAssetIdB = $t071797278._2
256256 let unactiveVote = getUnactiveVotingPool()
257257 let newNumberOfVoting = getActiveVotingPoolAmount()
258258 let isPoolExists = isLastActivePoolExists(assetA, assetB)
259- let $t074497527 = getAssetInfo(poolAssetIdA)
260- let pmtStrAssetIdA = $t074497527._1
261- let pmtAssetNameA = $t074497527._2
262- let pmtDecimalsA = $t074497527._3
263- let $t075327610 = getAssetInfo(poolAssetIdB)
264- let pmtStrAssetIdB = $t075327610._1
265- let pmtAssetNameB = $t075327610._2
266- let pmtDecimalsB = $t075327610._3
259+ let $t074487526 = getAssetInfo(poolAssetIdA)
260+ let pmtStrAssetIdA = $t074487526._1
261+ let pmtAssetNameA = $t074487526._2
262+ let pmtDecimalsA = $t074487526._3
263+ let $t075317609 = getAssetInfo(poolAssetIdB)
264+ let pmtStrAssetIdB = $t075317609._1
265+ let pmtAssetNameB = $t075317609._2
266+ let pmtDecimalsB = $t075317609._3
267267 if ((poolAssetIdA == poolAssetIdB))
268268 then throw("Assets must be different")
269269 else if (isPoolExists)
270270 then throw("This pool already exists")
271271 else if ((size(i.payments) != 1))
272272 then throw("One attached asset expected")
273273 else if ((pmtAssetId != SWOP))
274274 then throw("You must use a SWOP token")
275275 else if (if ((assetA == ""))
276276 then true
277277 else (assetB == ""))
278278 then throw("Assets can't be empty")
279279 else if ((pmtAmount != comissionForInitalizationOfVoting))
280280 then throw("You need to attach 10 SWOP tokens")
281281 else if (!(if (if ((poolAssetIdB == USDN))
282282 then true
283283 else (poolAssetIdB == unit))
284284 then true
285285 else (poolAssetIdB == SWOP)))
286286 then throw("assetB must be USDN, WAVES or SWOP")
287287 else if (if (((newNumberOfVoting + 1) > maxAmountOfVoting))
288288 then true
289289 else (unactiveVote == ""))
290290 then throw(("Too many votings. Maximum quantity: " + toString(maxAmountOfVoting)))
291291 else [IntegerEntry((((((assetA + "_") + assetB) + "_") + toString(amountOfVoting)) + votingId), amountOfVoting), IntegerEntry((toString(amountOfVoting) + kHeightOfPool), (height + votingPeriodLength)), BooleanEntry((toString(amountOfVoting) + kStatusOfVoting), true), IntegerEntry(kAmountOfVoting, (amountOfVoting + 1)), IntegerEntry(kNumberOfVoting, (newNumberOfVoting + 1)), StringEntry((assetA + kName), pmtAssetNameA), StringEntry((assetB + kName), pmtAssetNameB), StringEntry(unactiveVote, (((((assetA + "_") + assetB) + "_") + toString(amountOfVoting)) + votingId)), ScriptTransfer(moneyBoxAddress, pmtAmount, pmtAssetId)]
292292 })
293293
294294
295295
296296 @Callable(i)
297297 func voteForPool (voting,yesOrNo,voteAmt) = valueOrElse(isActive(), {
298298 let currentHeight = height
299299 let poolInitHeight = valueOrErrorMessage(getIntegerValue(this, (toString(voting) + kHeightOfPool)), "Empty pool height")
300300 let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + kStatusOfVoting)), true)
301301 let userSWOPinGovernance = valueOrElse(getInteger(govAddress, (toString(i.caller) + kUserTotalSWOP)), 0)
302302 let userGSWOPinGovernance = valueOrElse(getInteger(govAddress, (toString(i.caller) + kUserTotalGSWOP)), userSWOPinGovernance)
303303 let totalVoteUser = if (yesOrNo)
304304 then (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kNoUser)), 0) + voteAmt)
305305 else (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kYesUser)), 0) + voteAmt)
306306 if (!(isCallerInGovernance(i.caller)))
307307 then throw("This address has 0 SWOP in Governance dApp")
308308 else if (!(statusOfVoting))
309309 then throw("This voting was canceled")
310310 else if ((currentHeight > poolInitHeight))
311311 then throw("This voting was expired")
312312 else if ((0 > voteAmt))
313313 then throw("The number of votes must be positive")
314314 else if ((totalVoteUser > userGSWOPinGovernance))
315315 then throw((((toString(i.caller) + " has ") + toString(userGSWOPinGovernance)) + " GSWOP in governance."))
316316 else if (yesOrNo)
317317 then {
318318 let oldVoteUser = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kYesUser)), 0)
319319 let newVote = ((valueOrElse(getInteger(this, (toString(voting) + kYes)), 0) - oldVoteUser) + voteAmt)
320320 [IntegerEntry((toString(voting) + kYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + kYesUser), voteAmt)]
321321 }
322322 else {
323323 let oldVoteUser = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kNoUser)), 0)
324324 let newVote = ((valueOrElse(getInteger(this, (toString(voting) + kNo)), 0) - oldVoteUser) + voteAmt)
325325 [IntegerEntry((toString(voting) + kNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + kNoUser), voteAmt)]
326326 }
327327 })
328328
329329
330330
331331 @Callable(i)
332332 func cancelVoting (voting,cause) = valueOrElse(isAdminCall(i), {
333333 let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + kStatusOfVoting)), true)
334334 if (!(statusOfVoting))
335335 then throw((("Voting " + toString(voting)) + " has already been stopped"))
336336 else [IntegerEntry(kNumberOfVoting, (numberOfVoting - 1)), BooleanEntry((toString(voting) + kStatusOfVoting), false), StringEntry((toString(voting) + kCancelCause), cause)]
337337 })
338338
339339
340340
341341 @Callable(i)
342342 func shutdown () = valueOrElse(isAdminCall(i), if (!(active))
343343 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
344344 else suspend("Paused by admin"))
345345
346346
347347
348348 @Callable(i)
349349 func activate () = valueOrElse(isAdminCall(i), if (active)
350350 then throw("DApp is already active")
351351 else [BooleanEntry(kActive, true), DeleteEntry(kCause)])
352352
353353
354354 @Verifier(tx)
355355 func verify () = {
356356 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
357357 then 1
358358 else 0
359359 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
360360 then 1
361361 else 0
362362 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
363363 then 1
364364 else 0
365365 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
366366 }
367367

github/deemru/w8io/026f985 
92.66 ms