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