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