tx · DRUUeS9QLg3cxzH43fsXcm2idvT8HjppMLmTnvRf95f1 3Mzgi6deFV8CyF2nqbWSBkqba5JaD42EXyb: -0.01400000 Waves 2021.12.17 13:33 [1838139] smart account 3Mzgi6deFV8CyF2nqbWSBkqba5JaD42EXyb > SELF 0.00000000 Waves
{ "type": 13, "id": "DRUUeS9QLg3cxzH43fsXcm2idvT8HjppMLmTnvRf95f1", "fee": 1400000, "feeAssetId": null, "timestamp": 1639737231373, "version": 2, "chainId": 84, "sender": "3Mzgi6deFV8CyF2nqbWSBkqba5JaD42EXyb", "senderPublicKey": "61fhePmC5L8iWserAMXoPAZbv24cAo6eyvnyYpoLpZJy", "proofs": [ "27rHXyseGJEYV7VbCjBExrbeyryNr11iA53DZ2jwsu6XL73veqreDRqkxpyFWJxHEb3jd7srCF2qh41b2JqnLcPR", "2VwTuwZhS8vhPtdEiuaHgZferrV2mTFakBmBFi8iDU4KJBJx3x3LqyaCiuUT6HiRqE3eun98mNfa9pjYcDeZntF6" ], "script": "base64:AAIEAAAAAAAACSkIAhIAEgQKAggIEgUKAwEEARIECgIBCBIAEgAaDQoCYTESB3ZlcnNpb24aEAoCYTISCmtleVZlcnNpb24aDwoCYTMSCWtleUFjdGl2ZRoXCgJhNBIRa2V5TnVtYmVyT2ZWb3RpbmcaFQoCYTUSD2tleUhlaWdodE9mUG9vbBoLCgJhNhIFa2V5Tm8aDAoCYTcSBmtleVllcxoPCgJhOBIJa2V5Tm9Vc2VyGhAKAmE5EgprZXlZZXNVc2VyGhcKAmIxEhFrZXlTdGF0dXNPZlZvdGluZxoXCgJiMhIRa2V5QW1vdW50T2ZWb3RpbmcaGgoCYjMSFGtleU1heEFtb3VudE9mVm90aW5nGhcKAmI0EhFrZXlNYXhEYXlPZlZvdGluZxoTCgJiNRINa2V5Q29tbWlzc2lvbhohCgJiNhIba2V5Q29tbWlzc2lvblNjYWxlRGVsaW1pdGVyGg4KAmI3EghrZXlDYXVzZRoUCgJiOBIOa2V5Q2FuY2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AAtEZWxldGVFbnRyeQAAAAEFAAAAAmI3BQAAAANuaWwAAAABAAAAAnR4AQAAAAJtMQAAAAAEAAAAAm0yAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmM3AAAAAAAAAAABAAAAAAAAAAAABAAAAAJtMwMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABBQAAAAJjOAAAAAAAAAAAAQAAAAAAAAAAAAQAAAACbTQDCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgUAAAACYzkAAAAAAAAAAAEAAAAAAAAAAAAJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAAm0yBQAAAAJtMwUAAAACbTQAAAAAAAAAAAJFbjEM", "height": 1838139, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BfKn8B4KMUtL3SC4vrDqCu58c7uPjZfwZVbcp1V5WNLW Next: 8cLZS1aK9wGLuHuKbco6wsmruncR3Jxrkg3SjMz9nhNW Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "1.0.0" | |
5 | 5 | ||
6 | 6 | let keyVersion = "version" | |
7 | 7 | ||
8 | 8 | let keyActive = "active" | |
9 | 9 | ||
10 | 10 | let keyNumberOfVoting = "voting_active_number" | |
11 | 11 | ||
12 | 12 | let keyHeightOfPool = "_finish_height" | |
13 | 13 | ||
14 | 14 | let keyNo = "_total_votes_no" | |
15 | 15 | ||
16 | 16 | let keyYes = "_total_votes_yes" | |
17 | 17 | ||
18 | 18 | let keyNoUser = "_vote_no" | |
19 | 19 | ||
20 | 20 | let keyYesUser = "_vote_yes" | |
21 | 21 | ||
22 | 22 | let keyStatusOfVoting = "_status" | |
23 | 23 | ||
24 | 24 | let keyAmountOfVoting = "voting_id_last" | |
25 | 25 | ||
26 | 26 | let keyMaxAmountOfVoting = "max_amount_voting" | |
27 | 27 | ||
28 | 28 | let keyMaxDayOfVoting = "max_day_voting" | |
29 | 29 | ||
30 | 30 | let keyCommission = "commission" | |
31 | 31 | ||
32 | 32 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
33 | 33 | ||
34 | 34 | let keyCause = "shutdown_cause" | |
35 | 35 | ||
36 | 36 | let keyCancelCause = "_cancel_cause" | |
37 | 37 | ||
38 | 38 | let kUserTotalSWOP = "_SWOP_amount" | |
39 | 39 | ||
40 | 40 | let kName = "_asset_name" | |
41 | 41 | ||
42 | 42 | let votingId = "_voting" | |
43 | 43 | ||
44 | 44 | let periodOfVoting = "period_voting" | |
45 | 45 | ||
46 | 46 | let activeVoteFirst = "voting_active_cell_1" | |
47 | 47 | ||
48 | 48 | let activeVoteSecond = "voting_active_cell_2" | |
49 | 49 | ||
50 | 50 | let activeVoteThird = "voting_active_cell_3" | |
51 | 51 | ||
52 | 52 | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' | |
53 | 53 | ||
54 | 54 | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' | |
55 | 55 | ||
56 | 56 | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' | |
57 | 57 | ||
58 | 58 | let adminPubKeyStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
59 | 59 | ||
60 | 60 | let walletAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
61 | 61 | ||
62 | 62 | let govAddr = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') | |
63 | 63 | ||
64 | 64 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
65 | 65 | ||
66 | 66 | let SWOP = base58'2HAJrwa8q4SxBx9cHYaBTQdBjdk5wwqdof7ccpAx2uhZ' | |
67 | 67 | ||
68 | 68 | let EGG = base58'4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8' | |
69 | 69 | ||
70 | 70 | let isActive = getBooleanValue(this, keyActive) | |
71 | 71 | ||
72 | 72 | let numberOfVoting = getIntegerValue(this, keyNumberOfVoting) | |
73 | 73 | ||
74 | 74 | let amountOfVoting = getIntegerValue(this, keyAmountOfVoting) | |
75 | 75 | ||
76 | 76 | let firstActiveVote = valueOrElse(getString(this, activeVoteFirst), "") | |
77 | 77 | ||
78 | 78 | let secondActiveVote = valueOrElse(getString(this, activeVoteSecond), "") | |
79 | 79 | ||
80 | 80 | let thirdActiveVote = valueOrElse(getString(this, activeVoteThird), "") | |
81 | 81 | ||
82 | 82 | let comissionForInitalizationOfVoting = 1000000000 | |
83 | 83 | ||
84 | 84 | let scaleValue3 = 1000 | |
85 | 85 | ||
86 | 86 | let scaleValue8 = 100000000 | |
87 | 87 | ||
88 | 88 | let slippageToleranceDelimiter = 1000 | |
89 | 89 | ||
90 | 90 | let scaleValue8Digits = 8 | |
91 | 91 | ||
92 | 92 | let maxAmountOfVoting = 3 | |
93 | 93 | ||
94 | 94 | let maxDayOfVoting = 7 | |
95 | 95 | ||
96 | 96 | let votingPeriodLength = (1443 * maxDayOfVoting) | |
97 | 97 | ||
98 | 98 | func getAssetInfo (assetId) = match assetId { | |
99 | 99 | case id: ByteVector => | |
100 | 100 | if (isDefined(assetInfo(id))) | |
101 | 101 | then { | |
102 | 102 | let stringId = toBase58String(id) | |
103 | 103 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
104 | 104 | $Tuple3(stringId, info.name, info.decimals) | |
105 | 105 | } | |
106 | 106 | else throw("Asset is not defined") | |
107 | 107 | case waves: Unit => | |
108 | 108 | $Tuple3("WAVES", "WAVES", 8) | |
109 | 109 | case _ => | |
110 | 110 | throw("Match error") | |
111 | 111 | } | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func isActivePoolExists (pools,assetA,assetB) = { | |
115 | 115 | let poolsData = split(pools, "_") | |
116 | 116 | let isPoolDefine = isDefined(getInteger(this, pools)) | |
117 | 117 | if (if (isPoolDefine) | |
118 | 118 | then (pools != "") | |
119 | 119 | else false) | |
120 | 120 | then { | |
121 | 121 | let voting = poolsData[2] | |
122 | 122 | let newPools = (((((assetA + "_") + assetB) + "_") + voting) + votingId) | |
123 | 123 | let isNewPoolDefine = isDefined(getInteger(this, newPools)) | |
124 | 124 | let heightOfVoting = valueOrElse(getInteger(this, (voting + keyHeightOfPool)), 0) | |
125 | 125 | let statusOfVoting = valueOrElse(getBoolean(this, (voting + keyStatusOfVoting)), true) | |
126 | 126 | if (isNewPoolDefine) | |
127 | 127 | then if ((heightOfVoting > height)) | |
128 | 128 | then if (statusOfVoting) | |
129 | 129 | then true | |
130 | 130 | else false | |
131 | 131 | else false | |
132 | 132 | else false | |
133 | 133 | } | |
134 | 134 | else false | |
135 | 135 | } | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func isUnactivePoolExists (poolsState) = { | |
139 | 139 | let pools = valueOrElse(getString(this, poolsState), "") | |
140 | 140 | let poolsData = split(pools, "_") | |
141 | 141 | let isPoolDefine = isDefined(getInteger(this, pools)) | |
142 | 142 | if (if (isPoolDefine) | |
143 | 143 | then (pools != "") | |
144 | 144 | else false) | |
145 | 145 | then { | |
146 | 146 | let voting = poolsData[2] | |
147 | 147 | let heightOfVoting = valueOrElse(getInteger(this, (voting + keyHeightOfPool)), 0) | |
148 | 148 | let statusOfVoting = valueOrElse(getBoolean(this, (voting + keyStatusOfVoting)), true) | |
149 | 149 | if ((heightOfVoting > height)) | |
150 | 150 | then if (statusOfVoting) | |
151 | 151 | then "" | |
152 | 152 | else poolsState | |
153 | 153 | else poolsState | |
154 | 154 | } | |
155 | 155 | else poolsState | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func isLastActivePoolExists (assetA,assetB) = if (if (isActivePoolExists(firstActiveVote, assetA, assetB)) | |
160 | 160 | then true | |
161 | 161 | else isActivePoolExists(secondActiveVote, assetA, assetB)) | |
162 | 162 | then true | |
163 | 163 | else isActivePoolExists(thirdActiveVote, assetA, assetB) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func getActivePool (voting) = { | |
167 | 167 | let heightOfVoting = valueOrElse(getInteger(this, (toString(voting) + keyHeightOfPool)), 0) | |
168 | 168 | let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + keyStatusOfVoting)), true) | |
169 | 169 | let currentHeight = height | |
170 | 170 | if ((0 > voting)) | |
171 | 171 | then 0 | |
172 | 172 | else if (!(statusOfVoting)) | |
173 | 173 | then 0 | |
174 | 174 | else if ((heightOfVoting > currentHeight)) | |
175 | 175 | then 1 | |
176 | 176 | else 0 | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func getActiveVotingPoolAmount () = ((getActivePool(valueOrElse(getInteger(this, firstActiveVote), -1)) + getActivePool(valueOrElse(getInteger(this, secondActiveVote), -1))) + getActivePool(valueOrElse(getInteger(this, thirdActiveVote), -1))) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func getUnactiveVotingPool () = if ((isUnactivePoolExists(activeVoteFirst) != "")) | |
184 | 184 | then activeVoteFirst | |
185 | 185 | else if ((isUnactivePoolExists(activeVoteSecond) != "")) | |
186 | 186 | then activeVoteSecond | |
187 | 187 | else if ((isUnactivePoolExists(activeVoteThird) != "")) | |
188 | 188 | then activeVoteThird | |
189 | 189 | else "" | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES")) | |
193 | 193 | then unit | |
194 | 194 | else fromBase58String(assetStr) | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddr, (toString(user) + kUserTotalSWOP)), 0) > 0)) | |
198 | 198 | then true | |
199 | 199 | else false | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func throwInsufficientAvailableBalance (amount,assetName) = throw(((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking.") + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | @Callable(i) | |
209 | 209 | func init () = if ((i.caller != this)) | |
210 | 210 | then throw("Only the DApp itself can call this function") | |
211 | 211 | else if (isDefined(getBoolean(this, keyActive))) | |
212 | 212 | then throw("DApp is already active") | |
213 | 213 | else { | |
214 | 214 | let initNumberOfVoting = 0 | |
215 | 215 | let initAmountOfVoting = 0 | |
216 | 216 | let initKeyActive = true | |
217 | 217 | let activeInit = "" | |
218 | 218 | [StringEntry(keyVersion, version), BooleanEntry(keyActive, initKeyActive), IntegerEntry(keyNumberOfVoting, initNumberOfVoting), IntegerEntry(keyAmountOfVoting, initAmountOfVoting), IntegerEntry(keyMaxAmountOfVoting, maxAmountOfVoting), IntegerEntry(keyMaxDayOfVoting, maxDayOfVoting), StringEntry(activeVoteFirst, activeInit), StringEntry(activeVoteSecond, activeInit), StringEntry(activeVoteThird, activeInit)] | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Callable(i) | |
224 | 224 | func initVotingForNewPool (assetA,assetB) = { | |
225 | 225 | let $t069076982 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
226 | 226 | let pmtAmount = $t069076982._1 | |
227 | 227 | let pmtAssetId = $t069076982._2 | |
228 | 228 | let $t069877086 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB)) | |
229 | 229 | let poolAssetIdA = $t069877086._1 | |
230 | 230 | let poolAssetIdB = $t069877086._2 | |
231 | 231 | let unactiveVote = getUnactiveVotingPool() | |
232 | 232 | let newNumberOfVoting = getActiveVotingPoolAmount() | |
233 | 233 | let isPoolExists = isLastActivePoolExists(assetA, assetB) | |
234 | 234 | let $t072567334 = getAssetInfo(poolAssetIdA) | |
235 | 235 | let pmtStrAssetIdA = $t072567334._1 | |
236 | 236 | let pmtAssetNameA = $t072567334._2 | |
237 | 237 | let pmtDecimalsA = $t072567334._3 | |
238 | 238 | let $t073397417 = getAssetInfo(poolAssetIdB) | |
239 | 239 | let pmtStrAssetIdB = $t073397417._1 | |
240 | 240 | let pmtAssetNameB = $t073397417._2 | |
241 | 241 | let pmtDecimalsB = $t073397417._3 | |
242 | 242 | if (!(isActive)) | |
243 | 243 | then throw("DApp is inactive at this moment") | |
244 | 244 | else if ((poolAssetIdA == poolAssetIdB)) | |
245 | 245 | then throw("Assets must be different") | |
246 | 246 | else if (isPoolExists) | |
247 | 247 | then throw("This pool already exists") | |
248 | 248 | else if (if (((newNumberOfVoting + 1) > maxAmountOfVoting)) | |
249 | 249 | then true | |
250 | 250 | else (unactiveVote == "")) | |
251 | 251 | then throw(("Too many votings. Maximum quantity: " + toString(maxAmountOfVoting))) | |
252 | 252 | else if ((size(i.payments) != 1)) | |
253 | 253 | then throw("One attached asset expected") | |
254 | 254 | else if ((pmtAssetId != SWOP)) | |
255 | 255 | then throw("You must use a SWOP token") | |
256 | 256 | else if (if ((assetA == "")) | |
257 | 257 | then true | |
258 | 258 | else (assetB == "")) | |
259 | 259 | then throw("Assets can't be empty") | |
260 | 260 | else if ((pmtAmount != comissionForInitalizationOfVoting)) | |
261 | 261 | then throw("You need to attach 10 SWOP tokens") | |
262 | 262 | else if (!(if (if (if ((poolAssetIdB == USDN)) | |
263 | 263 | then true | |
264 | 264 | else (poolAssetIdB == unit)) | |
265 | 265 | then true | |
266 | 266 | else (poolAssetIdB == SWOP)) | |
267 | 267 | then true | |
268 | 268 | else (poolAssetIdB == EGG))) | |
269 | 269 | then throw("assetB must be USDN, WAVES or SWOP") | |
270 | 270 | else [IntegerEntry((((((assetA + "_") + assetB) + "_") + toString(amountOfVoting)) + votingId), amountOfVoting), IntegerEntry((toString(amountOfVoting) + keyHeightOfPool), (height + votingPeriodLength)), BooleanEntry((toString(amountOfVoting) + keyStatusOfVoting), true), IntegerEntry(keyAmountOfVoting, (amountOfVoting + 1)), IntegerEntry(keyNumberOfVoting, (newNumberOfVoting + 1)), StringEntry((assetA + kName), pmtAssetNameA), StringEntry((assetB + kName), pmtAssetNameB), StringEntry(unactiveVote, (((((assetA + "_") + assetB) + "_") + toString(amountOfVoting)) + votingId)), ScriptTransfer(walletAddress, pmtAmount, pmtAssetId)] | |
271 | 271 | } | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | ||
275 | 275 | @Callable(i) | |
276 | 276 | func voteForPool (voting,yesOrNo,voteAmt) = { | |
277 | 277 | let currentHeight = height | |
278 | 278 | let poolInitHeight = valueOrErrorMessage(getIntegerValue(this, (toString(voting) + keyHeightOfPool)), "Empty pool height") | |
279 | 279 | let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + keyStatusOfVoting)), true) | |
280 | 280 | let userSWOPinGovernance = valueOrElse(getInteger(govAddr, (toString(i.caller) + kUserTotalSWOP)), 0) | |
281 | 281 | let totalVoteUser = if (yesOrNo) | |
282 | 282 | then (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyNoUser)), 0) + voteAmt) | |
283 | 283 | else (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyYesUser)), 0) + voteAmt) | |
284 | 284 | if (!(isCallerInGovernance(i.caller))) | |
285 | 285 | then throw("This address has 0 SWOP in Governance dApp") | |
286 | 286 | else if (!(statusOfVoting)) | |
287 | 287 | then throw("This voting was canceled") | |
288 | 288 | else if ((currentHeight > poolInitHeight)) | |
289 | 289 | then throw("This voting was expired") | |
290 | 290 | else if ((0 > voteAmt)) | |
291 | 291 | then throw("The number of votes must be positive") | |
292 | 292 | else if ((totalVoteUser > userSWOPinGovernance)) | |
293 | 293 | then throw((((toString(this) + " has ") + toString(userSWOPinGovernance)) + " SWOP in governance.")) | |
294 | 294 | else if (yesOrNo) | |
295 | 295 | then { | |
296 | 296 | let oldVoteUser = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyYesUser)), 0) | |
297 | 297 | let newVote = ((valueOrElse(getInteger(this, (toString(voting) + keyYes)), 0) - oldVoteUser) + voteAmt) | |
298 | 298 | [IntegerEntry((toString(voting) + keyYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYesUser), voteAmt)] | |
299 | 299 | } | |
300 | 300 | else { | |
301 | 301 | let oldVoteUser = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyNoUser)), 0) | |
302 | 302 | let newVote = ((valueOrElse(getInteger(this, (toString(voting) + keyNo)), 0) - oldVoteUser) + voteAmt) | |
303 | 303 | [IntegerEntry((toString(voting) + keyNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNoUser), voteAmt)] | |
304 | 304 | } | |
305 | 305 | } | |
306 | 306 | ||
307 | 307 | ||
308 | 308 | ||
309 | 309 | @Callable(i) | |
310 | 310 | func cancelVoting (voting,cause) = { | |
311 | 311 | let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + keyStatusOfVoting)), true) | |
312 | 312 | if (!(isActive)) | |
313 | 313 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
314 | 314 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
315 | 315 | then throw("Only admin can call this function") | |
316 | 316 | else if (!(statusOfVoting)) | |
317 | 317 | then throw((("Voting " + toString(voting)) + " has already been stopped")) | |
318 | 318 | else [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1)), BooleanEntry((toString(voting) + keyStatusOfVoting), false), StringEntry((toString(voting) + keyCancelCause), cause)] | |
319 | 319 | } | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | ||
323 | 323 | @Callable(i) | |
324 | 324 | func shutdown () = if (!(isActive)) | |
325 | 325 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
326 | 326 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
327 | 327 | then throw("Only admin can call this function") | |
328 | 328 | else suspend("Paused by admin") | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | ||
332 | 332 | @Callable(i) | |
333 | 333 | func activate () = if (isActive) | |
334 | 334 | then throw("DApp is already active") | |
335 | 335 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
336 | 336 | then throw("Only admin can call this function") | |
337 | 337 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | @Verifier(tx) | |
341 | 341 | func verify () = { | |
342 | 342 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
343 | 343 | then 1 | |
344 | 344 | else 0 | |
345 | 345 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
346 | 346 | then 1 | |
347 | 347 | else 0 | |
348 | 348 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
349 | 349 | then 1 | |
350 | 350 | else 0 | |
351 | 351 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
352 | 352 | } | |
353 | 353 |
github/deemru/w8io/169f3d6 87.43 ms ◑