tx · 6imck4H5RfKX67iLDPaZjv3FZ1bRGeCMXMzCReSVKTBR 3N8DijjUMpYq512vvE9GHnCTUBUd4AZwhH6: -0.01400000 Waves 2021.04.30 01:54 [1504361] smart account 3N8DijjUMpYq512vvE9GHnCTUBUd4AZwhH6 > SELF 0.00000000 Waves
{ "type": 13, "id": "6imck4H5RfKX67iLDPaZjv3FZ1bRGeCMXMzCReSVKTBR", "fee": 1400000, "feeAssetId": null, "timestamp": 1619736915142, "version": 2, "chainId": 84, "sender": "3N8DijjUMpYq512vvE9GHnCTUBUd4AZwhH6", "senderPublicKey": "75SuvmjmHX6J7smVGHvWY6acr5mqyRQCYpFxeFQh8Cy3", "proofs": [ "5raKvUnDNKw7PA3YUTYMyCSk93RT5zZQyfCmU6xq7t4peumMsqKWVUEDqm6c5mJabKzMPdc4odsamkTf3FGvwSVA" ], "script": "base64:AAIEAAAAAAAAABsIAhIAEgQKAggIEgUKAwEEARIECgIBCBIAEgAAAAAvAAAAAAd2ZXJzaW9uAgAAAAUxLjAuMAAAAAAKa2V5VmVyc2lvbgIAAAAHdmVyc2lvbgAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAAEWtleU51bWJlck9mVm90aW5nAgAAAA1udW1iZXJfdm90aW5nAAAAAA9rZXlIZWlnaHRPZlBvb2wCAAAAB19oZWlnaHQAAAAABWtleU5vAgAAAANfbm8AAAAABmtleVllcwIAAAAEX3llcwAAAAARa2V5U3RhdHVzT2ZWb3RpbmcCAAAAB19zdGF0dXMAAAAAEWtleUFtb3VudE9mVm90aW5nAgAAAA1hbW91bnRfdm90aW5nAAAAABRrZXlNYXhBbW91bnRPZlZvdGluZwIAAAARbWF4X2Ftb3VudF92b3RpbmcAAAAAEWtleU1heERheU9mVm90aW5nAgAAAA5tYXhfZGF5X3ZvdGluZwAAAAANa2V5Q29tbWlzc2lvbgIAAAAKY29tbWlzc2lvbgAAAAAba2V5Q29tbWlzc2lvblNjYWxlRGVsaW1pdGVyAgAAABpjb21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YWRtaW5QdWJLZXkzCQAETAAAAAIFAAAAFGFkbWluUHViS2V5U3RhcnRTdG9wBQAAAANuaWwIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQkAAAIAAAABAgAAACFPbmx5IGFkbWluIGNhbiBjYWxsIHRoaXMgZnVuY3Rpb24JAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAIFAAAACWtleUFjdGl2ZQYJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAIa2V5Q2F1c2UFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5J9bfHA==", "height": 1504361, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5abWW81zzRrwztTyheDPkTAgxAFYZTFuB16nKw2wW6HE Next: BxEhqXQ36Gt7tm2izbJwR6Pzfoac9cWaWKyForDSQb4q Diff:
Old | New | Differences | |
---|---|---|---|
206 | 206 | let currentHeight = height | |
207 | 207 | let poolInitHeight = valueOrErrorMessage(getIntegerValue(this, (toString(voting) + keyHeightOfPool)), "Empty pool height") | |
208 | 208 | let userSWOPinGovernance = valueOrElse(getInteger(govAddr, (toString(i.caller) + kUserTotalSWOP)), 0) | |
209 | - | let totalVoteUser = ((valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyYes)), 0) + valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyNo)), 0)) + voteAmt) | |
210 | 209 | if (!(isCallerInGovernance(i.caller))) | |
211 | 210 | then throw("This address has 0 SWOP in Governance dApp") | |
212 | 211 | else if ((currentHeight > poolInitHeight)) | |
213 | 212 | then [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1))] | |
214 | 213 | else if ((0 > voteAmt)) | |
215 | 214 | then throw("The number of votes must be positive") | |
216 | - | else if (( | |
215 | + | else if ((voting > userSWOPinGovernance)) | |
217 | 216 | then throw((((toString(this) + " has ") + toString(userSWOPinGovernance)) + " SWOP in governance.")) | |
218 | 217 | else if (yesOrNo) | |
219 | 218 | then { |
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 = "number_voting" | |
11 | 11 | ||
12 | 12 | let keyHeightOfPool = "_height" | |
13 | 13 | ||
14 | 14 | let keyNo = "_no" | |
15 | 15 | ||
16 | 16 | let keyYes = "_yes" | |
17 | 17 | ||
18 | 18 | let keyStatusOfVoting = "_status" | |
19 | 19 | ||
20 | 20 | let keyAmountOfVoting = "amount_voting" | |
21 | 21 | ||
22 | 22 | let keyMaxAmountOfVoting = "max_amount_voting" | |
23 | 23 | ||
24 | 24 | let keyMaxDayOfVoting = "max_day_voting" | |
25 | 25 | ||
26 | 26 | let keyCommission = "commission" | |
27 | 27 | ||
28 | 28 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
29 | 29 | ||
30 | 30 | let keyCause = "shutdown_cause" | |
31 | 31 | ||
32 | 32 | let keyCancelCause = "_cancel_cause" | |
33 | 33 | ||
34 | 34 | let kUserTotalSWOP = "_SWOP_amount" | |
35 | 35 | ||
36 | 36 | let kName = "_name" | |
37 | 37 | ||
38 | 38 | let votingId = "_votingId" | |
39 | 39 | ||
40 | 40 | let periodOfVoting = "period_voting" | |
41 | 41 | ||
42 | 42 | let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
43 | 43 | ||
44 | 44 | let adminPubKey2 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
45 | 45 | ||
46 | 46 | let adminPubKey3 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
47 | 47 | ||
48 | 48 | let adminPubKeyStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
49 | 49 | ||
50 | 50 | let walletAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
51 | 51 | ||
52 | 52 | let govAddr = Address(base58'3MzJZEn6jzxCPaHEfkrXd7FhbjTyVjdRPLS') | |
53 | 53 | ||
54 | 54 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
55 | 55 | ||
56 | 56 | let SWOP = base58'2HAJrwa8q4SxBx9cHYaBTQdBjdk5wwqdof7ccpAx2uhZ' | |
57 | 57 | ||
58 | 58 | let isActive = getBooleanValue(this, keyActive) | |
59 | 59 | ||
60 | 60 | let numberOfVoting = getIntegerValue(this, keyNumberOfVoting) | |
61 | 61 | ||
62 | 62 | let amountOfVoting = getIntegerValue(this, keyAmountOfVoting) | |
63 | 63 | ||
64 | 64 | let comissionForInitalizationOfVoting = 1000000000 | |
65 | 65 | ||
66 | 66 | let scaleValue3 = 1000 | |
67 | 67 | ||
68 | 68 | let scaleValue8 = 100000000 | |
69 | 69 | ||
70 | 70 | let slippageToleranceDelimiter = 1000 | |
71 | 71 | ||
72 | 72 | let scaleValue8Digits = 8 | |
73 | 73 | ||
74 | 74 | let maxAmountOfVoting = 5 | |
75 | 75 | ||
76 | 76 | let maxDayOfVoting = 5 | |
77 | 77 | ||
78 | 78 | let fiveDays = 5 | |
79 | 79 | ||
80 | 80 | func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES")) | |
81 | 81 | then unit | |
82 | 82 | else fromBase58String(assetStr) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getAssetInfo (assetId) = match assetId { | |
86 | 86 | case id: ByteVector => | |
87 | 87 | if (isDefined(assetInfo(id))) | |
88 | 88 | then { | |
89 | 89 | let stringId = toBase58String(id) | |
90 | 90 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
91 | 91 | $Tuple3(stringId, info.name, info.decimals) | |
92 | 92 | } | |
93 | 93 | else throw("Asset is not define") | |
94 | 94 | case waves: Unit => | |
95 | 95 | $Tuple3("WAVES", "WAVES", 8) | |
96 | 96 | case _ => | |
97 | 97 | throw("Match error") | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func isActivePoolExists (pools) = isDefined(getInteger(this, pools)) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func isLastFivePoolExists (amountOfVoting,assetA,assetB) = if (if (if (if (isActivePoolExists((((((assetA + "_") + assetB) + "_") + toString((amountOfVoting - 1))) + votingId))) | |
105 | 105 | then true | |
106 | 106 | else isActivePoolExists((((((assetA + "_") + assetB) + "_") + toString((amountOfVoting - 2))) + votingId))) | |
107 | 107 | then true | |
108 | 108 | else isActivePoolExists((((((assetA + "_") + assetB) + "_") + toString((amountOfVoting - 3))) + votingId))) | |
109 | 109 | then true | |
110 | 110 | else isActivePoolExists((((((assetA + "_") + assetB) + "_") + toString((amountOfVoting - 4))) + votingId))) | |
111 | 111 | then true | |
112 | 112 | else isActivePoolExists((((((assetA + "_") + assetB) + "_") + toString((amountOfVoting - 5))) + votingId)) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddr, (toString(user) + kUserTotalSWOP)), 0) > 0)) | |
116 | 116 | then true | |
117 | 117 | else false | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func getActivePool (voting) = { | |
121 | 121 | let heightOfVoting = valueOrElse(getInteger(this, (toString(voting) + keyHeightOfPool)), 0) | |
122 | 122 | let statusOfVoting = valueOrElse(getBoolean(this, (toString(voting) + keyStatusOfVoting)), true) | |
123 | 123 | let currentHeight = height | |
124 | 124 | if ((0 > voting)) | |
125 | 125 | then 0 | |
126 | 126 | else if (!(statusOfVoting)) | |
127 | 127 | then 0 | |
128 | 128 | else if ((heightOfVoting > currentHeight)) | |
129 | 129 | then 1 | |
130 | 130 | else 0 | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func getActiveVotingPoolAmount (voting) = ((((getActivePool((voting - 1)) + getActivePool((voting - 2))) + getActivePool((voting - 3))) + getActivePool((voting - 4))) + getActivePool((voting - 5))) | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | 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")) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | @Callable(i) | |
144 | 144 | func init () = if ((i.caller != this)) | |
145 | 145 | then throw("Only the DApp itself can call this function") | |
146 | 146 | else if (isDefined(getBoolean(this, keyActive))) | |
147 | 147 | then throw("DApp is already active") | |
148 | 148 | else { | |
149 | 149 | let initNumberOfVoting = 0 | |
150 | 150 | let initAmountOfVoting = 0 | |
151 | 151 | let initKeyActive = true | |
152 | 152 | [StringEntry(keyVersion, version), BooleanEntry(keyActive, initKeyActive), IntegerEntry(keyNumberOfVoting, initNumberOfVoting), IntegerEntry(keyAmountOfVoting, initAmountOfVoting), IntegerEntry(keyMaxAmountOfVoting, maxAmountOfVoting), IntegerEntry(keyMaxDayOfVoting, maxDayOfVoting)] | |
153 | 153 | } | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | ||
157 | 157 | @Callable(i) | |
158 | 158 | func initVotingForNewPool (assetA,assetB) = { | |
159 | 159 | let $t048944969 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
160 | 160 | let pmtAmount = $t048944969._1 | |
161 | 161 | let pmtAssetId = $t048944969._2 | |
162 | 162 | let $t049745073 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB)) | |
163 | 163 | let poolAssetIdA = $t049745073._1 | |
164 | 164 | let poolAssetIdB = $t049745073._2 | |
165 | 165 | let newNumberOfVoting = getActiveVotingPoolAmount(amountOfVoting) | |
166 | 166 | let isPoolExists = isLastFivePoolExists(amountOfVoting, assetA, assetB) | |
167 | 167 | let $t052245302 = getAssetInfo(poolAssetIdA) | |
168 | 168 | let pmtStrAssetIdA = $t052245302._1 | |
169 | 169 | let pmtAssetNameA = $t052245302._2 | |
170 | 170 | let pmtDecimalsA = $t052245302._3 | |
171 | 171 | let $t053075385 = getAssetInfo(poolAssetIdB) | |
172 | 172 | let pmtStrAssetIdB = $t053075385._1 | |
173 | 173 | let pmtAssetNameB = $t053075385._2 | |
174 | 174 | let pmtDecimalsB = $t053075385._3 | |
175 | 175 | if (!(isActive)) | |
176 | 176 | then throw("DApp is inactive at this moment") | |
177 | 177 | else if ((poolAssetIdA == poolAssetIdB)) | |
178 | 178 | then throw("Assets must be different") | |
179 | 179 | else if (((newNumberOfVoting + 1) >= maxAmountOfVoting)) | |
180 | 180 | then throw(("Too many votes. Maximum quantity: " + toString(maxAmountOfVoting))) | |
181 | 181 | else if ((size(i.payments) != 1)) | |
182 | 182 | then throw("One attached assets expected") | |
183 | 183 | else if (isPoolExists) | |
184 | 184 | then throw("This pool already exists") | |
185 | 185 | else if ((pmtAssetId != SWOP)) | |
186 | 186 | then throw("You must use a SWOP token") | |
187 | 187 | else if (if ((assetA == "")) | |
188 | 188 | then true | |
189 | 189 | else (assetB == "")) | |
190 | 190 | then throw("Assets can't be empty") | |
191 | 191 | else if ((pmtAmount != comissionForInitalizationOfVoting)) | |
192 | 192 | then throw("You need to attach 10 SWOP tokens") | |
193 | 193 | else if (!(if (if ((poolAssetIdB == USDN)) | |
194 | 194 | then true | |
195 | 195 | else (poolAssetIdA == unit)) | |
196 | 196 | then true | |
197 | 197 | else (poolAssetIdA == SWOP))) | |
198 | 198 | then throw("One of the assets must be USDN, WAVES, SWOP") | |
199 | 199 | else [IntegerEntry((((((assetA + "_") + assetB) + "_") + toString(amountOfVoting)) + votingId), amountOfVoting), IntegerEntry((toString(amountOfVoting) + keyHeightOfPool), (height + fiveDays)), BooleanEntry((toString(amountOfVoting) + keyStatusOfVoting), true), IntegerEntry(keyAmountOfVoting, (amountOfVoting + 1)), IntegerEntry(keyNumberOfVoting, (newNumberOfVoting + 1)), StringEntry((assetA + kName), pmtAssetNameA), StringEntry((assetB + kName), pmtAssetNameB), ScriptTransfer(walletAddress, pmtAmount, pmtAssetId)] | |
200 | 200 | } | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | ||
204 | 204 | @Callable(i) | |
205 | 205 | func voteForPool (voting,yesOrNo,voteAmt) = { | |
206 | 206 | let currentHeight = height | |
207 | 207 | let poolInitHeight = valueOrErrorMessage(getIntegerValue(this, (toString(voting) + keyHeightOfPool)), "Empty pool height") | |
208 | 208 | let userSWOPinGovernance = valueOrElse(getInteger(govAddr, (toString(i.caller) + kUserTotalSWOP)), 0) | |
209 | - | let totalVoteUser = ((valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyYes)), 0) + valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyNo)), 0)) + voteAmt) | |
210 | 209 | if (!(isCallerInGovernance(i.caller))) | |
211 | 210 | then throw("This address has 0 SWOP in Governance dApp") | |
212 | 211 | else if ((currentHeight > poolInitHeight)) | |
213 | 212 | then [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1))] | |
214 | 213 | else if ((0 > voteAmt)) | |
215 | 214 | then throw("The number of votes must be positive") | |
216 | - | else if (( | |
215 | + | else if ((voting > userSWOPinGovernance)) | |
217 | 216 | then throw((((toString(this) + " has ") + toString(userSWOPinGovernance)) + " SWOP in governance.")) | |
218 | 217 | else if (yesOrNo) | |
219 | 218 | then { | |
220 | 219 | let oldVoteUser = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyYes)), 0) | |
221 | 220 | let newVote = ((valueOrElse(getInteger(this, (toString(voting) + keyYes)), 0) - oldVoteUser) + voteAmt) | |
222 | 221 | [IntegerEntry((toString(voting) + keyYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYes), voteAmt)] | |
223 | 222 | } | |
224 | 223 | else { | |
225 | 224 | let oldVoteUser = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyNo)), 0) | |
226 | 225 | let newVote = ((valueOrElse(getInteger(this, (toString(voting) + keyNo)), 0) - oldVoteUser) + voteAmt) | |
227 | 226 | [IntegerEntry((toString(voting) + keyNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNo), voteAmt)] | |
228 | 227 | } | |
229 | 228 | } | |
230 | 229 | ||
231 | 230 | ||
232 | 231 | ||
233 | 232 | @Callable(i) | |
234 | 233 | func cancellationVoting (voting,cause) = if (!(isActive)) | |
235 | 234 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
236 | 235 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
237 | 236 | then throw("Only admin can call this function") | |
238 | 237 | else [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1)), BooleanEntry((toString(voting) + keyStatusOfVoting), false), StringEntry((toString(voting) + keyCancelCause), cause)] | |
239 | 238 | ||
240 | 239 | ||
241 | 240 | ||
242 | 241 | @Callable(i) | |
243 | 242 | func shutdown () = if (!(isActive)) | |
244 | 243 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
245 | 244 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
246 | 245 | then throw("Only admin can call this function") | |
247 | 246 | else suspend("Paused by admin") | |
248 | 247 | ||
249 | 248 | ||
250 | 249 | ||
251 | 250 | @Callable(i) | |
252 | 251 | func activate () = if (isActive) | |
253 | 252 | then throw("DApp is already active") | |
254 | 253 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
255 | 254 | then throw("Only admin can call this function") | |
256 | 255 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
257 | 256 | ||
258 | 257 | ||
259 | 258 | @Verifier(tx) | |
260 | 259 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
261 | 260 |
github/deemru/w8io/026f985 38.96 ms ◑