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