tx · 6sZEEaSg9e389m4azP6dugxRbKbPV1vYgw5e5vTySxUU

3MtsXxXqERvHEmkPiiuBESuixd9Y8qAU1PC:  -0.14000000 Waves

2022.12.23 11:52 [2372710] smart account 3MtsXxXqERvHEmkPiiuBESuixd9Y8qAU1PC > SELF 0.00000000 Waves

{ "type": 13, "id": "6sZEEaSg9e389m4azP6dugxRbKbPV1vYgw5e5vTySxUU", "fee": 14000000, "feeAssetId": null, "timestamp": 1671785587342, "version": 2, "chainId": 84, "sender": "3MtsXxXqERvHEmkPiiuBESuixd9Y8qAU1PC", "senderPublicKey": "EBCSQaTtuxQBJyc62F142LxJ3hpQtCwuZ2z9kkoe6Vvt", "proofs": [ "3Kn8ennM59M4kFUyU7rJt6esfuNjoCiQ31MtnGaH3PkUkUcxpC9KYefwCkdAf1m7AemLSvvuRpUasR5ZnSoYR1Uy", "4suLUgmARFHqXXCw2Jy76HHZ8XQSTniV6U844CecccCqMqsVrHRqVcRwg89oreLUACnSFC6hccp4cy3wh4Pk946A" ], "script": "base64:BgIbCAISABIECgIICBIFCgMBBAESBAoCAQgSABIAQAAGb3JhY2xlCQEHQWRkcmVzcwEBGgFUSBOXDMDTM8wlMoC2KfenZGiAq+PMe0uZAAd2ZXJzaW9uAgUxLjAuMAAIa1ZlcnNpb24CB3ZlcnNpb24AB2tBY3RpdmUCBmFjdGl2ZQALa0FjdGl2ZUdsb2ICFGFjdGl2ZV9hbGxfY29udHJhY3RzAA9rTnVtYmVyT2ZWb3RpbmcCFHZvdGluZ19hY3RpdmVfbnVtYmVyAA1rSGVpZ2h0T2ZQb29sAg5fZmluaXNoX2hlaWdodAADa05vAg9fdG90YWxfdm90ZXNfbm8ABGtZZXMCEF90b3RhbF92b3Rlc195ZXMAB2tOb1VzZXICCF92b3RlX25vAAhrWWVzVXNlcgIJX3ZvdGVfeWVzAA9rU3RhdHVzT2ZWb3RpbmcCB19zdGF0dXMAD2tBbW91bnRPZlZvdGluZwIOdm90aW5nX2lkX2xhc3QAE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c2UCCQCdCAIFBHRoaXMFBmtDYXVzZQIadGhlIGNhdXNlIHdhc24ndCBzcGVjaWZpZWQJAQdzdXNwZW5kAQIPUGF1c2VkIGJ5IGFkbWluAWkBCGFjdGl2YXRlAAkBC3ZhbHVlT3JFbHNlAgkBC2lzQWRtaW5DYWxsAQUBaQMFBmFjdGl2ZQkAAgECFkRBcHAgaXMgYWxyZWFkeSBhY3RpdmUJAMwIAgkBDEJvb2xlYW5FbnRyeQIFB2tBY3RpdmUGCQDMCAIJAQtEZWxldGVFbnRyeQEFBmtDYXVzZQUDbmlsAQJ0eAEGdmVyaWZ5AAQSYWRtaW5QdWJLZXkxU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkxAAEAAAQSYWRtaW5QdWJLZXkyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQUMYWRtaW5QdWJLZXkyAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUMYWRtaW5QdWJLZXkzAAEAAAkAZwIJAGQCCQBkAgUSYWRtaW5QdWJLZXkxU2lnbmVkBRJhZG1pblB1YktleTJTaWduZWQFEmFkbWluUHViS2V5M1NpZ25lZAACEmDe9Q==", "height": 2372710, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6HkGmmPw3FwSkeHnydmjHJJJK8nDxjMrReZEuRyctjMG Next: 5mkHELsuHKqFZfKRjrRVr3JwnaueT4Jxi1bZRsSLUx1b Diff:
OldNewDifferences
3434 let kCause = "shutdown_cause"
3535
3636 let kCancelCause = "_cancel_cause"
37+
38+let kUserTotalSWOP = "_SWOP_amount"
3739
3840 let kUserTotalGSWOP = "_GSwop_amount"
3941
245247
246248 @Callable(i)
247249 func initVotingForNewPool (assetA,assetB) = valueOrElse(isActive(), {
248- let $t070647139 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
249- let pmtAmount = $t070647139._1
250- let pmtAssetId = $t070647139._2
251- let $t071447243 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB))
252- let poolAssetIdA = $t071447243._1
253- let poolAssetIdB = $t071447243._2
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
254256 let unactiveVote = getUnactiveVotingPool()
255257 let newNumberOfVoting = getActiveVotingPoolAmount()
256258 let isPoolExists = isLastActivePoolExists(assetA, assetB)
257- let $t074137491 = getAssetInfo(poolAssetIdA)
258- let pmtStrAssetIdA = $t074137491._1
259- let pmtAssetNameA = $t074137491._2
260- let pmtDecimalsA = $t074137491._3
261- let $t074967574 = getAssetInfo(poolAssetIdB)
262- let pmtStrAssetIdB = $t074967574._1
263- let pmtAssetNameB = $t074967574._2
264- let pmtDecimalsB = $t074967574._3
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
265267 if ((poolAssetIdA == poolAssetIdB))
266268 then throw("Assets must be different")
267269 else if (isPoolExists)
296298 let currentHeight = height
297299 let poolInitHeight = valueOrErrorMessage(getIntegerValue(this, (toString(voting) + kHeightOfPool)), "Empty pool height")
298300 let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + kStatusOfVoting)), true)
299- let userSWOPinGovernance = valueOrElse(getInteger(govAddress, (toString(i.caller) + kUserTotalGSWOP)), 0)
301+ let userSWOPinGovernance = valueOrElse(getInteger(govAddress, (toString(i.caller) + kUserTotalSWOP)), 0)
302+ let userGSWOPinGovernance = valueOrElse(getInteger(govAddress, (toString(i.caller) + kUserTotalGSWOP)), userSWOPinGovernance)
300303 let totalVoteUser = if (yesOrNo)
301304 then (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kNoUser)), 0) + voteAmt)
302305 else (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kYesUser)), 0) + voteAmt)
308311 then throw("This voting was expired")
309312 else if ((0 > voteAmt))
310313 then throw("The number of votes must be positive")
311- else if ((totalVoteUser > userSWOPinGovernance))
312- then throw((((toString(this) + " has ") + toString(userSWOPinGovernance)) + " SWOP in governance."))
314+ else if ((totalVoteUser > userGSWOPinGovernance))
315+ then throw((((toString(i.caller) + " has ") + toString(userGSWOPinGovernance)) + " GSWOP in governance."))
313316 else if (yesOrNo)
314317 then {
315318 let oldVoteUser = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kYesUser)), 0)
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"
37+
38+let kUserTotalSWOP = "_SWOP_amount"
3739
3840 let kUserTotalGSWOP = "_GSwop_amount"
3941
4042 let kName = "_asset_name"
4143
4244 let votingId = "_voting"
4345
4446 let activeVoteFirst = "voting_active_cell_1"
4547
4648 let activeVoteSecond = "voting_active_cell_2"
4749
4850 let activeVoteThird = "voting_active_cell_3"
4951
5052 let kAdminPubKey1 = "admin_pub_1"
5153
5254 let kAdminPubKey2 = "admin_pub_2"
5355
5456 let kAdminPubKey3 = "admin_pub_3"
5557
5658 let kMoneyBoxAddress = "money_box_address"
5759
5860 let kGovAddress = "governance_address"
5961
6062 let kFarmingAddr = "farming_address"
6163
6264 let kUSDNAssetId = "usdn_asset_id"
6365
6466 let kSWOPid = "SWOP_id"
6567
6668 let numberOfVoting = getIntegerValue(this, kNumberOfVoting)
6769
6870 let amountOfVoting = getIntegerValue(this, kAmountOfVoting)
6971
7072 let firstActiveVote = valueOrElse(getString(this, activeVoteFirst), "")
7173
7274 let secondActiveVote = valueOrElse(getString(this, activeVoteSecond), "")
7375
7476 let thirdActiveVote = valueOrElse(getString(this, activeVoteThird), "")
7577
7678 let active = getBooleanValue(this, kActive)
7779
7880 let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true)
7981
8082 let comissionForInitalizationOfVoting = 1000000000
8183
8284 let maxAmountOfVoting = 3
8385
8486 let maxDayOfVoting = 7
8587
8688 let votingPeriodLength = (1443 * maxDayOfVoting)
8789
8890 func getBase58FromOracle (key) = match getString(oracle, key) {
8991 case string: String =>
9092 fromBase58String(string)
9193 case nothing =>
9294 throw((key + "is empty"))
9395 }
9496
9597
9698 let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
9799
98100 let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
99101
100102 let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
101103
102104 let govAddress = Address(getBase58FromOracle(kGovAddress))
103105
104106 let farmingAddr = Address(getBase58FromOracle(kFarmingAddr))
105107
106108 let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress))
107109
108110 let USDN = getBase58FromOracle(kUSDNAssetId)
109111
110112 let SWOP = fromBase58String(getStringValue(farmingAddr, kSWOPid))
111113
112114 func isActive () = if (if (active)
113115 then activeGlob
114116 else false)
115117 then unit
116118 else throw("DApp is inactive at this moment")
117119
118120
119121 func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))
120122 then unit
121123 else throw("Only admin can call this function")
122124
123125
124126 func getAssetInfo (assetId) = match assetId {
125127 case id: ByteVector =>
126128 if (isDefined(assetInfo(id)))
127129 then {
128130 let stringId = toBase58String(id)
129131 let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist"))
130132 $Tuple3(stringId, info.name, info.decimals)
131133 }
132134 else throw("Asset is not defined")
133135 case waves: Unit =>
134136 $Tuple3("WAVES", "WAVES", 8)
135137 case _ =>
136138 throw("Match error")
137139 }
138140
139141
140142 func isActivePoolExists (pools,assetA,assetB) = {
141143 let poolsData = split(pools, "_")
142144 let isPoolDefine = isDefined(getInteger(this, pools))
143145 if (if (isPoolDefine)
144146 then (pools != "")
145147 else false)
146148 then {
147149 let voting = poolsData[2]
148150 let newPools = (((((assetA + "_") + assetB) + "_") + voting) + votingId)
149151 let isNewPoolDefine = isDefined(getInteger(this, newPools))
150152 let heightOfVoting = valueOrElse(getInteger(this, (voting + kHeightOfPool)), 0)
151153 let statusOfVoting = valueOrElse(getBoolean(this, (voting + kStatusOfVoting)), true)
152154 if (isNewPoolDefine)
153155 then if ((heightOfVoting > height))
154156 then if (statusOfVoting)
155157 then true
156158 else false
157159 else false
158160 else false
159161 }
160162 else false
161163 }
162164
163165
164166 func isUnactivePoolExists (poolsState) = {
165167 let pools = valueOrElse(getString(this, poolsState), "")
166168 let poolsData = split(pools, "_")
167169 let isPoolDefine = isDefined(getInteger(this, pools))
168170 if (if (isPoolDefine)
169171 then (pools != "")
170172 else false)
171173 then {
172174 let voting = poolsData[2]
173175 let heightOfVoting = valueOrElse(getInteger(this, (voting + kHeightOfPool)), 0)
174176 let statusOfVoting = valueOrElse(getBoolean(this, (voting + kStatusOfVoting)), true)
175177 if ((heightOfVoting > height))
176178 then if (statusOfVoting)
177179 then ""
178180 else poolsState
179181 else poolsState
180182 }
181183 else poolsState
182184 }
183185
184186
185187 func isLastActivePoolExists (assetA,assetB) = if (if (isActivePoolExists(firstActiveVote, assetA, assetB))
186188 then true
187189 else isActivePoolExists(secondActiveVote, assetA, assetB))
188190 then true
189191 else isActivePoolExists(thirdActiveVote, assetA, assetB)
190192
191193
192194 func getActivePool (voting) = {
193195 let heightOfVoting = valueOrElse(getInteger(this, (toString(voting) + kHeightOfPool)), 0)
194196 let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + kStatusOfVoting)), true)
195197 let currentHeight = height
196198 if ((0 > voting))
197199 then 0
198200 else if (!(statusOfVoting))
199201 then 0
200202 else if ((heightOfVoting > currentHeight))
201203 then 1
202204 else 0
203205 }
204206
205207
206208 func getActiveVotingPoolAmount () = ((getActivePool(valueOrElse(getInteger(this, firstActiveVote), -1)) + getActivePool(valueOrElse(getInteger(this, secondActiveVote), -1))) + getActivePool(valueOrElse(getInteger(this, thirdActiveVote), -1)))
207209
208210
209211 func getUnactiveVotingPool () = if ((isUnactivePoolExists(activeVoteFirst) != ""))
210212 then activeVoteFirst
211213 else if ((isUnactivePoolExists(activeVoteSecond) != ""))
212214 then activeVoteSecond
213215 else if ((isUnactivePoolExists(activeVoteThird) != ""))
214216 then activeVoteThird
215217 else ""
216218
217219
218220 func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES"))
219221 then unit
220222 else fromBase58String(assetStr)
221223
222224
223225 func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddress, (toString(user) + kUserTotalGSWOP)), 0) > 0))
224226 then true
225227 else false
226228
227229
228230 func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)]
229231
230232
231233 @Callable(i)
232234 func init () = if ((i.caller != this))
233235 then throw("Only the DApp itself can call this function")
234236 else if (isDefined(getBoolean(this, kActive)))
235237 then throw("DApp is already active")
236238 else {
237239 let initNumberOfVoting = 0
238240 let initAmountOfVoting = 0
239241 let initKeyActive = true
240242 let activeInit = ""
241243 [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)]
242244 }
243245
244246
245247
246248 @Callable(i)
247249 func initVotingForNewPool (assetA,assetB) = valueOrElse(isActive(), {
248- let $t070647139 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
249- let pmtAmount = $t070647139._1
250- let pmtAssetId = $t070647139._2
251- let $t071447243 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB))
252- let poolAssetIdA = $t071447243._1
253- let poolAssetIdB = $t071447243._2
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
254256 let unactiveVote = getUnactiveVotingPool()
255257 let newNumberOfVoting = getActiveVotingPoolAmount()
256258 let isPoolExists = isLastActivePoolExists(assetA, assetB)
257- let $t074137491 = getAssetInfo(poolAssetIdA)
258- let pmtStrAssetIdA = $t074137491._1
259- let pmtAssetNameA = $t074137491._2
260- let pmtDecimalsA = $t074137491._3
261- let $t074967574 = getAssetInfo(poolAssetIdB)
262- let pmtStrAssetIdB = $t074967574._1
263- let pmtAssetNameB = $t074967574._2
264- let pmtDecimalsB = $t074967574._3
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
265267 if ((poolAssetIdA == poolAssetIdB))
266268 then throw("Assets must be different")
267269 else if (isPoolExists)
268270 then throw("This pool already exists")
269271 else if ((size(i.payments) != 1))
270272 then throw("One attached asset expected")
271273 else if ((pmtAssetId != SWOP))
272274 then throw("You must use a SWOP token")
273275 else if (if ((assetA == ""))
274276 then true
275277 else (assetB == ""))
276278 then throw("Assets can't be empty")
277279 else if ((pmtAmount != comissionForInitalizationOfVoting))
278280 then throw("You need to attach 10 SWOP tokens")
279281 else if (!(if (if ((poolAssetIdB == USDN))
280282 then true
281283 else (poolAssetIdB == unit))
282284 then true
283285 else (poolAssetIdB == SWOP)))
284286 then throw("assetB must be USDN, WAVES or SWOP")
285287 else if (if (((newNumberOfVoting + 1) > maxAmountOfVoting))
286288 then true
287289 else (unactiveVote == ""))
288290 then throw(("Too many votings. Maximum quantity: " + toString(maxAmountOfVoting)))
289291 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)]
290292 })
291293
292294
293295
294296 @Callable(i)
295297 func voteForPool (voting,yesOrNo,voteAmt) = valueOrElse(isActive(), {
296298 let currentHeight = height
297299 let poolInitHeight = valueOrErrorMessage(getIntegerValue(this, (toString(voting) + kHeightOfPool)), "Empty pool height")
298300 let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + kStatusOfVoting)), true)
299- let userSWOPinGovernance = valueOrElse(getInteger(govAddress, (toString(i.caller) + kUserTotalGSWOP)), 0)
301+ let userSWOPinGovernance = valueOrElse(getInteger(govAddress, (toString(i.caller) + kUserTotalSWOP)), 0)
302+ let userGSWOPinGovernance = valueOrElse(getInteger(govAddress, (toString(i.caller) + kUserTotalGSWOP)), userSWOPinGovernance)
300303 let totalVoteUser = if (yesOrNo)
301304 then (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kNoUser)), 0) + voteAmt)
302305 else (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kYesUser)), 0) + voteAmt)
303306 if (!(isCallerInGovernance(i.caller)))
304307 then throw("This address has 0 SWOP in Governance dApp")
305308 else if (!(statusOfVoting))
306309 then throw("This voting was canceled")
307310 else if ((currentHeight > poolInitHeight))
308311 then throw("This voting was expired")
309312 else if ((0 > voteAmt))
310313 then throw("The number of votes must be positive")
311- else if ((totalVoteUser > userSWOPinGovernance))
312- then throw((((toString(this) + " has ") + toString(userSWOPinGovernance)) + " SWOP in governance."))
314+ else if ((totalVoteUser > userGSWOPinGovernance))
315+ then throw((((toString(i.caller) + " has ") + toString(userGSWOPinGovernance)) + " GSWOP in governance."))
313316 else if (yesOrNo)
314317 then {
315318 let oldVoteUser = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kYesUser)), 0)
316319 let newVote = ((valueOrElse(getInteger(this, (toString(voting) + kYes)), 0) - oldVoteUser) + voteAmt)
317320 [IntegerEntry((toString(voting) + kYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + kYesUser), voteAmt)]
318321 }
319322 else {
320323 let oldVoteUser = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + kNoUser)), 0)
321324 let newVote = ((valueOrElse(getInteger(this, (toString(voting) + kNo)), 0) - oldVoteUser) + voteAmt)
322325 [IntegerEntry((toString(voting) + kNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + kNoUser), voteAmt)]
323326 }
324327 })
325328
326329
327330
328331 @Callable(i)
329332 func cancelVoting (voting,cause) = valueOrElse(isAdminCall(i), {
330333 let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + kStatusOfVoting)), true)
331334 if (!(statusOfVoting))
332335 then throw((("Voting " + toString(voting)) + " has already been stopped"))
333336 else [IntegerEntry(kNumberOfVoting, (numberOfVoting - 1)), BooleanEntry((toString(voting) + kStatusOfVoting), false), StringEntry((toString(voting) + kCancelCause), cause)]
334337 })
335338
336339
337340
338341 @Callable(i)
339342 func shutdown () = valueOrElse(isAdminCall(i), if (!(active))
340343 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
341344 else suspend("Paused by admin"))
342345
343346
344347
345348 @Callable(i)
346349 func activate () = valueOrElse(isAdminCall(i), if (active)
347350 then throw("DApp is already active")
348351 else [BooleanEntry(kActive, true), DeleteEntry(kCause)])
349352
350353
351354 @Verifier(tx)
352355 func verify () = {
353356 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
354357 then 1
355358 else 0
356359 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
357360 then 1
358361 else 0
359362 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
360363 then 1
361364 else 0
362365 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
363366 }
364367

github/deemru/w8io/026f985 
77.21 ms