tx · BvTcyVAv1fY7gxFWJkKXdQhA68stt2JqjJdvMd2FmwjQ 3N8DijjUMpYq512vvE9GHnCTUBUd4AZwhH6: -0.01400000 Waves 2021.04.23 13:21 [1494952] smart account 3N8DijjUMpYq512vvE9GHnCTUBUd4AZwhH6 > SELF 0.00000000 Waves
{ "type": 13, "id": "BvTcyVAv1fY7gxFWJkKXdQhA68stt2JqjJdvMd2FmwjQ", "fee": 1400000, "feeAssetId": null, "timestamp": 1619173280026, "version": 2, "chainId": 84, "sender": "3N8DijjUMpYq512vvE9GHnCTUBUd4AZwhH6", "senderPublicKey": "75SuvmjmHX6J7smVGHvWY6acr5mqyRQCYpFxeFQh8Cy3", "proofs": [ "Rmzs7ocecLDDALiK3BDTAQddN23ZfWrgBxrWiVkfsbPXGrW6h8epnkG4LXJvHV8fCddQRf1vqBgrBejKnkaBamj" ], "script": "base64:AAIEAAAAAAAAABsIAhIAEgQKAggIEgUKAwEEARIECgIBCBIAEgAAAAAnAAAAAAd2ZXJzaW9uAgAAAAUxLjAuMAAAAAAKa2V5VmVyc2lvbgIAAAAHdmVyc2lvbgAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAAEWtleU51bWJlck9mVm90aW5nAgAAAA1udW1iZXJfdm90aW5nAAAAAA9rZXlIZWlnaHRPZlBvb2wCAAAAB19oZWlnaHQAAAAABWtleU5vAgAAAANfbm8AAAAABmtleVllcwIAAAAEX3llcwAAAAARa2V5U3RhdHVzT2ZWb3RpbmcCAAAAB19zdGF0dXMAAAAAEWtleUFtb3VudE9mVm90aW5nAgAAAA1hbW91bnRfdm90aW5nAAAAAA1rZXlDb21taXNzaW9uAgAAAApjb21taXNzaW9uAAAAABtrZXlDb21taXNzaW9uU2NhbGVEZWxpbWl0ZXICAAAAGmNvbW1pc3Npb25fc2NhbGVfZGVsaW1pdGVyAAAAAAhrZXlDYXVzZQIAAAAOc2h1dGRvd25fY2F1c2UAAAAADmtleUNhbmNlbENhdXNlAgAAAA1fY2FuY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AgaXMgYWxyZWFkeSBhY3RpdmUDCQEAAAABIQAAAAEJAQAAAA9jb250YWluc0VsZW1lbnQAAAACCQAETAAAAAIFAAAADGFkbWluUHViS2V5MQkABEwAAAACBQAAAAxhZG1pblB1YktleTIJAARMAAAAAgUAAAAMYWRtaW5QdWJLZXkzCQAETAAAAAIFAAAAFGFkbWluUHViS2V5U3RhcnRTdG9wBQAAAANuaWwIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQkAAAIAAAABAgAAACFPbmx5IGFkbWluIGNhbiBjYWxsIHRoaXMgZnVuY3Rpb24JAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAIFAAAACWtleUFjdGl2ZQYJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAIa2V5Q2F1c2UFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5BKAmKw==", "height": 1494952, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BqwA3gysyomn4rrLYkCKid1C7X3JRkcMrqhYBsRYFNBh Next: 47eDZUkAiuNcLSwkTddofjDPmwtya4arDEvXTdARE7pX Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | ||
30 | 30 | let kUserTotalSWOP = "_SWOP_amount" | |
31 | 31 | ||
32 | + | let kName = "_name" | |
33 | + | ||
34 | + | let votingId = "_votingId" | |
35 | + | ||
36 | + | let periodOfVoting = "period_voting" | |
37 | + | ||
38 | + | let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
39 | + | ||
40 | + | let adminPubKey2 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
41 | + | ||
42 | + | let adminPubKey3 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
43 | + | ||
44 | + | let adminPubKeyStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
45 | + | ||
46 | + | let walletAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
47 | + | ||
48 | + | let govAddr = Address(base58'3MzJZEn6jzxCPaHEfkrXd7FhbjTyVjdRPLS') | |
49 | + | ||
50 | + | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
51 | + | ||
52 | + | let SWOP = base58'2HAJrwa8q4SxBx9cHYaBTQdBjdk5wwqdof7ccpAx2uhZ' | |
53 | + | ||
32 | 54 | let isActive = getBooleanValue(this, keyActive) | |
33 | 55 | ||
34 | 56 | let numberOfVoting = getIntegerValue(this, keyNumberOfVoting) | |
54 | 76 | else fromBase58String(assetStr) | |
55 | 77 | ||
56 | 78 | ||
79 | + | func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddr, (toString(user) + kUserTotalSWOP)), 0) > 0)) | |
80 | + | then true | |
81 | + | else false | |
82 | + | ||
83 | + | ||
57 | 84 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
58 | 85 | ||
59 | 86 | ||
61 | 88 | ||
62 | 89 | ||
63 | 90 | @Callable(i) | |
64 | - | func init () = { | |
65 | - | let initNumberOfVoting = 0 | |
66 | - | let initAmountOfVoting = 0 | |
67 | - | let initKeyActive = true | |
91 | + | func init () = if ((i.caller != this)) | |
92 | + | then throw("Only the DApp itself can call this function") | |
93 | + | else if (isDefined(getBoolean(this, keyActive))) | |
94 | + | then throw("DApp is already active") | |
95 | + | else { | |
96 | + | let initNumberOfVoting = 0 | |
97 | + | let initAmountOfVoting = 0 | |
98 | + | let initKeyActive = true | |
68 | 99 | [StringEntry(keyVersion, version), BooleanEntry(keyActive, initKeyActive), IntegerEntry(keyNumberOfVoting, initNumberOfVoting), IntegerEntry(keyAmountOfVoting, initAmountOfVoting)] | |
100 | + | } | |
101 | + | ||
102 | + | ||
103 | + | ||
104 | + | @Callable(i) | |
105 | + | func initVotingForNewPool (assetA,assetB) = { | |
106 | + | let $t028752950 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
107 | + | let pmtAmount = $t028752950._1 | |
108 | + | let pmtAssetId = $t028752950._2 | |
109 | + | let $t029553061 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB)) | |
110 | + | let poolAssetIdA = $t029553061._1 | |
111 | + | let poolAssetIdB = $t029553061._2 | |
112 | + | if (!(isActive)) | |
113 | + | then throw("DApp is inactive at this moment") | |
114 | + | else if ((poolAssetIdA == poolAssetIdB)) | |
115 | + | then throw("Assets must be different") | |
116 | + | else if ((pmtAssetId != SWOP)) | |
117 | + | then throw("You must use a SWOP token") | |
118 | + | else if ((pmtAmount != comissionForInitalizationOfVoting)) | |
119 | + | then throw("You need to attach 10 SWOP tokens") | |
120 | + | else if ((numberOfVoting > maxAmountOfVoting)) | |
121 | + | then throw(("Too many votes. Maximum quantity -" + toString(maxAmountOfVoting))) | |
122 | + | else if (!(if (if (if (if (if ((poolAssetIdA == USDN)) | |
123 | + | then true | |
124 | + | else (poolAssetIdB == USDN)) | |
125 | + | then true | |
126 | + | else (poolAssetIdA == unit)) | |
127 | + | then true | |
128 | + | else (poolAssetIdB == unit)) | |
129 | + | then true | |
130 | + | else (poolAssetIdA == SWOP)) | |
131 | + | then true | |
132 | + | else (poolAssetIdB == SWOP))) | |
133 | + | then throw("One of the assets must be USDN, WAVES, SWOP") | |
134 | + | 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, (numberOfVoting + 1)), StringEntry((assetA + kName), assetA), StringEntry((assetB + kName), assetB), ScriptTransfer(walletAddress, pmtAmount, pmtAssetId)] | |
69 | 135 | } | |
70 | 136 | ||
71 | 137 | ||
72 | 138 | ||
73 | 139 | @Callable(i) | |
74 | - | func initVotingForNewPool (assetA,assetB) = { | |
75 | - | let $t029433042 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB)) | |
76 | - | let poolAssetIdA = $t029433042._1 | |
77 | - | let poolAssetIdB = $t029433042._2 | |
78 | - | if (!(isActive)) | |
79 | - | then throw("DApp is inactive at this moment") | |
80 | - | else if ((poolAssetIdA == poolAssetIdB)) | |
81 | - | then throw("Assets must be different") | |
82 | - | else if ((numberOfVoting > maxAmountOfVoting)) | |
83 | - | then throw(("Too many votes. Maximum quantity -" + toString(maxAmountOfVoting))) | |
84 | - | else [IntegerEntry(((((assetA + "_") + assetB) + "_") + toString(amountOfVoting)), amountOfVoting), IntegerEntry((toString(amountOfVoting) + keyHeightOfPool), (height + fiveDays)), BooleanEntry((toString(amountOfVoting) + keyStatusOfVoting), true), IntegerEntry(keyAmountOfVoting, (amountOfVoting + 1)), IntegerEntry(keyNumberOfVoting, (numberOfVoting + 1))] | |
140 | + | func voteForPool (voting,yesOrNo,voteAmt) = { | |
141 | + | let currentHeight = height | |
142 | + | let poolInitHeight = valueOrErrorMessage(getIntegerValue(this, (toString(voting) + keyHeightOfPool)), "Empty pool height") | |
143 | + | let userSWOPinGovernance = valueOrElse(getInteger(govAddr, (toString(i.caller) + kUserTotalSWOP)), 0) | |
144 | + | if (!(isCallerInGovernance(i.caller))) | |
145 | + | then throw("This address has 0 SWOP in Governance dApp") | |
146 | + | else if ((currentHeight > poolInitHeight)) | |
147 | + | then [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1))] | |
148 | + | else if ((1 > voteAmt)) | |
149 | + | then throw("The number of votes must be positive") | |
150 | + | else if ((voteAmt > userSWOPinGovernance)) | |
151 | + | then throw((((toString(this) + " has ") + toString(userSWOPinGovernance)) + " SWOP in governance.")) | |
152 | + | else if (yesOrNo) | |
153 | + | then { | |
154 | + | let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyYes)), 0) + voteAmt) | |
155 | + | let newVoteUser = (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyYes)), 0) + voteAmt) | |
156 | + | [IntegerEntry((toString(voting) + keyYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYes), newVoteUser)] | |
157 | + | } | |
158 | + | else { | |
159 | + | let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyNo)), 0) + voteAmt) | |
160 | + | let newVoteUser = (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyNo)), 0) + voteAmt) | |
161 | + | [IntegerEntry((toString(voting) + keyNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNo), newVoteUser)] | |
162 | + | } | |
85 | 163 | } | |
86 | 164 | ||
87 | 165 | ||
88 | 166 | ||
89 | 167 | @Callable(i) | |
90 | - | func voteForPool (voting,yesOrNo,voteAmt) = if (yesOrNo) | |
91 | - | then { | |
92 | - | let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyYes)), 0) + voteAmt) | |
93 | - | [IntegerEntry((toString(voting) + keyYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYes), voteAmt)] | |
94 | - | } | |
95 | - | else { | |
96 | - | let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyNo)), 0) + voteAmt) | |
97 | - | [IntegerEntry((toString(voting) + keyNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNo), voteAmt)] | |
98 | - | } | |
99 | - | ||
100 | - | ||
101 | - | ||
102 | - | @Callable(i) | |
103 | - | func cancellationVoting (voting,cause) = [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1)), BooleanEntry((toString(voting) + keyStatusOfVoting), false), StringEntry((toString(voting) + keyCancelCause), cause)] | |
168 | + | func cancellationVoting (voting,cause) = if (!(isActive)) | |
169 | + | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
170 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
171 | + | then throw("Only admin can call this function") | |
172 | + | else [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1)), BooleanEntry((toString(voting) + keyStatusOfVoting), false), StringEntry((toString(voting) + keyCancelCause), cause)] | |
104 | 173 | ||
105 | 174 | ||
106 | 175 | ||
107 | 176 | @Callable(i) | |
108 | 177 | func shutdown () = if (!(isActive)) | |
109 | 178 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
110 | - | else suspend("Paused by admin") | |
179 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
180 | + | then throw("Only admin can call this function") | |
181 | + | else suspend("Paused by admin") | |
111 | 182 | ||
112 | 183 | ||
113 | 184 | ||
114 | 185 | @Callable(i) | |
115 | 186 | func activate () = if (isActive) | |
116 | 187 | then throw("DApp is already active") | |
117 | - | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
188 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
189 | + | then throw("Only admin can call this function") | |
190 | + | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
118 | 191 | ||
119 | 192 | ||
120 | 193 | @Verifier(tx) | |
121 | - | func verify () = | |
194 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
122 | 195 |
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 keyCommission = "commission" | |
23 | 23 | ||
24 | 24 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
25 | 25 | ||
26 | 26 | let keyCause = "shutdown_cause" | |
27 | 27 | ||
28 | 28 | let keyCancelCause = "_cancel_cause" | |
29 | 29 | ||
30 | 30 | let kUserTotalSWOP = "_SWOP_amount" | |
31 | 31 | ||
32 | + | let kName = "_name" | |
33 | + | ||
34 | + | let votingId = "_votingId" | |
35 | + | ||
36 | + | let periodOfVoting = "period_voting" | |
37 | + | ||
38 | + | let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
39 | + | ||
40 | + | let adminPubKey2 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
41 | + | ||
42 | + | let adminPubKey3 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
43 | + | ||
44 | + | let adminPubKeyStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
45 | + | ||
46 | + | let walletAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
47 | + | ||
48 | + | let govAddr = Address(base58'3MzJZEn6jzxCPaHEfkrXd7FhbjTyVjdRPLS') | |
49 | + | ||
50 | + | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
51 | + | ||
52 | + | let SWOP = base58'2HAJrwa8q4SxBx9cHYaBTQdBjdk5wwqdof7ccpAx2uhZ' | |
53 | + | ||
32 | 54 | let isActive = getBooleanValue(this, keyActive) | |
33 | 55 | ||
34 | 56 | let numberOfVoting = getIntegerValue(this, keyNumberOfVoting) | |
35 | 57 | ||
36 | 58 | let amountOfVoting = getIntegerValue(this, keyAmountOfVoting) | |
37 | 59 | ||
38 | 60 | let comissionForInitalizationOfVoting = 1000000000 | |
39 | 61 | ||
40 | 62 | let scaleValue3 = 1000 | |
41 | 63 | ||
42 | 64 | let scaleValue8 = 100000000 | |
43 | 65 | ||
44 | 66 | let slippageToleranceDelimiter = 1000 | |
45 | 67 | ||
46 | 68 | let scaleValue8Digits = 8 | |
47 | 69 | ||
48 | 70 | let maxAmountOfVoting = 5 | |
49 | 71 | ||
50 | 72 | let fiveDays = (1440 * 5) | |
51 | 73 | ||
52 | 74 | func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES")) | |
53 | 75 | then unit | |
54 | 76 | else fromBase58String(assetStr) | |
55 | 77 | ||
56 | 78 | ||
79 | + | func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddr, (toString(user) + kUserTotalSWOP)), 0) > 0)) | |
80 | + | then true | |
81 | + | else false | |
82 | + | ||
83 | + | ||
57 | 84 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
58 | 85 | ||
59 | 86 | ||
60 | 87 | 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")) | |
61 | 88 | ||
62 | 89 | ||
63 | 90 | @Callable(i) | |
64 | - | func init () = { | |
65 | - | let initNumberOfVoting = 0 | |
66 | - | let initAmountOfVoting = 0 | |
67 | - | let initKeyActive = true | |
91 | + | func init () = if ((i.caller != this)) | |
92 | + | then throw("Only the DApp itself can call this function") | |
93 | + | else if (isDefined(getBoolean(this, keyActive))) | |
94 | + | then throw("DApp is already active") | |
95 | + | else { | |
96 | + | let initNumberOfVoting = 0 | |
97 | + | let initAmountOfVoting = 0 | |
98 | + | let initKeyActive = true | |
68 | 99 | [StringEntry(keyVersion, version), BooleanEntry(keyActive, initKeyActive), IntegerEntry(keyNumberOfVoting, initNumberOfVoting), IntegerEntry(keyAmountOfVoting, initAmountOfVoting)] | |
100 | + | } | |
101 | + | ||
102 | + | ||
103 | + | ||
104 | + | @Callable(i) | |
105 | + | func initVotingForNewPool (assetA,assetB) = { | |
106 | + | let $t028752950 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
107 | + | let pmtAmount = $t028752950._1 | |
108 | + | let pmtAssetId = $t028752950._2 | |
109 | + | let $t029553061 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB)) | |
110 | + | let poolAssetIdA = $t029553061._1 | |
111 | + | let poolAssetIdB = $t029553061._2 | |
112 | + | if (!(isActive)) | |
113 | + | then throw("DApp is inactive at this moment") | |
114 | + | else if ((poolAssetIdA == poolAssetIdB)) | |
115 | + | then throw("Assets must be different") | |
116 | + | else if ((pmtAssetId != SWOP)) | |
117 | + | then throw("You must use a SWOP token") | |
118 | + | else if ((pmtAmount != comissionForInitalizationOfVoting)) | |
119 | + | then throw("You need to attach 10 SWOP tokens") | |
120 | + | else if ((numberOfVoting > maxAmountOfVoting)) | |
121 | + | then throw(("Too many votes. Maximum quantity -" + toString(maxAmountOfVoting))) | |
122 | + | else if (!(if (if (if (if (if ((poolAssetIdA == USDN)) | |
123 | + | then true | |
124 | + | else (poolAssetIdB == USDN)) | |
125 | + | then true | |
126 | + | else (poolAssetIdA == unit)) | |
127 | + | then true | |
128 | + | else (poolAssetIdB == unit)) | |
129 | + | then true | |
130 | + | else (poolAssetIdA == SWOP)) | |
131 | + | then true | |
132 | + | else (poolAssetIdB == SWOP))) | |
133 | + | then throw("One of the assets must be USDN, WAVES, SWOP") | |
134 | + | 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, (numberOfVoting + 1)), StringEntry((assetA + kName), assetA), StringEntry((assetB + kName), assetB), ScriptTransfer(walletAddress, pmtAmount, pmtAssetId)] | |
69 | 135 | } | |
70 | 136 | ||
71 | 137 | ||
72 | 138 | ||
73 | 139 | @Callable(i) | |
74 | - | func initVotingForNewPool (assetA,assetB) = { | |
75 | - | let $t029433042 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB)) | |
76 | - | let poolAssetIdA = $t029433042._1 | |
77 | - | let poolAssetIdB = $t029433042._2 | |
78 | - | if (!(isActive)) | |
79 | - | then throw("DApp is inactive at this moment") | |
80 | - | else if ((poolAssetIdA == poolAssetIdB)) | |
81 | - | then throw("Assets must be different") | |
82 | - | else if ((numberOfVoting > maxAmountOfVoting)) | |
83 | - | then throw(("Too many votes. Maximum quantity -" + toString(maxAmountOfVoting))) | |
84 | - | else [IntegerEntry(((((assetA + "_") + assetB) + "_") + toString(amountOfVoting)), amountOfVoting), IntegerEntry((toString(amountOfVoting) + keyHeightOfPool), (height + fiveDays)), BooleanEntry((toString(amountOfVoting) + keyStatusOfVoting), true), IntegerEntry(keyAmountOfVoting, (amountOfVoting + 1)), IntegerEntry(keyNumberOfVoting, (numberOfVoting + 1))] | |
140 | + | func voteForPool (voting,yesOrNo,voteAmt) = { | |
141 | + | let currentHeight = height | |
142 | + | let poolInitHeight = valueOrErrorMessage(getIntegerValue(this, (toString(voting) + keyHeightOfPool)), "Empty pool height") | |
143 | + | let userSWOPinGovernance = valueOrElse(getInteger(govAddr, (toString(i.caller) + kUserTotalSWOP)), 0) | |
144 | + | if (!(isCallerInGovernance(i.caller))) | |
145 | + | then throw("This address has 0 SWOP in Governance dApp") | |
146 | + | else if ((currentHeight > poolInitHeight)) | |
147 | + | then [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1))] | |
148 | + | else if ((1 > voteAmt)) | |
149 | + | then throw("The number of votes must be positive") | |
150 | + | else if ((voteAmt > userSWOPinGovernance)) | |
151 | + | then throw((((toString(this) + " has ") + toString(userSWOPinGovernance)) + " SWOP in governance.")) | |
152 | + | else if (yesOrNo) | |
153 | + | then { | |
154 | + | let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyYes)), 0) + voteAmt) | |
155 | + | let newVoteUser = (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyYes)), 0) + voteAmt) | |
156 | + | [IntegerEntry((toString(voting) + keyYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYes), newVoteUser)] | |
157 | + | } | |
158 | + | else { | |
159 | + | let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyNo)), 0) + voteAmt) | |
160 | + | let newVoteUser = (valueOrElse(getInteger(this, (((toString(i.caller) + "_") + toString(voting)) + keyNo)), 0) + voteAmt) | |
161 | + | [IntegerEntry((toString(voting) + keyNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNo), newVoteUser)] | |
162 | + | } | |
85 | 163 | } | |
86 | 164 | ||
87 | 165 | ||
88 | 166 | ||
89 | 167 | @Callable(i) | |
90 | - | func voteForPool (voting,yesOrNo,voteAmt) = if (yesOrNo) | |
91 | - | then { | |
92 | - | let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyYes)), 0) + voteAmt) | |
93 | - | [IntegerEntry((toString(voting) + keyYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYes), voteAmt)] | |
94 | - | } | |
95 | - | else { | |
96 | - | let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyNo)), 0) + voteAmt) | |
97 | - | [IntegerEntry((toString(voting) + keyNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNo), voteAmt)] | |
98 | - | } | |
99 | - | ||
100 | - | ||
101 | - | ||
102 | - | @Callable(i) | |
103 | - | func cancellationVoting (voting,cause) = [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1)), BooleanEntry((toString(voting) + keyStatusOfVoting), false), StringEntry((toString(voting) + keyCancelCause), cause)] | |
168 | + | func cancellationVoting (voting,cause) = if (!(isActive)) | |
169 | + | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
170 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
171 | + | then throw("Only admin can call this function") | |
172 | + | else [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1)), BooleanEntry((toString(voting) + keyStatusOfVoting), false), StringEntry((toString(voting) + keyCancelCause), cause)] | |
104 | 173 | ||
105 | 174 | ||
106 | 175 | ||
107 | 176 | @Callable(i) | |
108 | 177 | func shutdown () = if (!(isActive)) | |
109 | 178 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
110 | - | else suspend("Paused by admin") | |
179 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
180 | + | then throw("Only admin can call this function") | |
181 | + | else suspend("Paused by admin") | |
111 | 182 | ||
112 | 183 | ||
113 | 184 | ||
114 | 185 | @Callable(i) | |
115 | 186 | func activate () = if (isActive) | |
116 | 187 | then throw("DApp is already active") | |
117 | - | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
188 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
189 | + | then throw("Only admin can call this function") | |
190 | + | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
118 | 191 | ||
119 | 192 | ||
120 | 193 | @Verifier(tx) | |
121 | - | func verify () = | |
194 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
122 | 195 |
github/deemru/w8io/026f985 75.46 ms ◑