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