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