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