tx · 4143eFgP3jkCfZ5wMJFHanTcR1H5ymyoRibdGtpXcTJs 3N3gSFrTwgiLAFZHMuJrEttht1nPhnkpvjs: -0.01700000 Waves 2022.11.22 14:54 [2328286] smart account 3N3gSFrTwgiLAFZHMuJrEttht1nPhnkpvjs > SELF 0.00000000 Waves
{ "type": 13, "id": "4143eFgP3jkCfZ5wMJFHanTcR1H5ymyoRibdGtpXcTJs", "fee": 1700000, "feeAssetId": null, "timestamp": 1669118035757, "version": 2, "chainId": 84, "sender": "3N3gSFrTwgiLAFZHMuJrEttht1nPhnkpvjs", "senderPublicKey": "5mttAQ8x5ig98rgbv6rZmwXQ2pAYSwgCkQPSVBcr7BVp", "proofs": [ "24j5dkdH7QZE3iJL7YvoXmVKd98e9hd1gs4TjnGMjyjCPm77Lgn2ezEZ9E9wz57BhnxnfNqVpXRN9uThMvqNzbWo" ], "script": "base64:BgImCAISBAoCAQESBwoFCAgBARgSBwoFCAgBARgSAwoBARIDCgEBEgBVAAtyZXZpc2lvbk51bQIAAANTRVACAl9fAAdMSVNUU0VQAgE6AA1ERUZBVUxUUVVPUlVNAKDCHgAKVVJMUEFUVEVSTgIaaHR0cHM6Ly9mb3J1bS5uZXV0cmluby5hdC8ACE1BWFRJVExFAKABAAZNQVhVUkwA+gEADU1BWFZPVElOR1RJTUUAgJDkwAQABU1VTFQ2AMCEPQAOREVGQVVMVFBBWU1FTlQAgJTr3AMAFERFRkFVTFRDUkVBVElPTkdOU0JUAICU69wDAApQQVNUTUFSR0lOAIC6twMADEZVVFVSRU1BUkdJTgDAy8kCABJnb3ZJZHhQcm9wb3NhbFR4SWQAAQAKZ292SWR4VHlwZQACAAxnb3ZJZHhBdXRob3IAAwAJZ292SWR4VXJsAAQAC2dvdklkeFRpdGxlAAUAEmdvdklkeENyZWF0aW9uVGltZQAGAAtnb3ZJZHhTdGFydAAHAAlnb3ZJZHhFbmQACAALZ292SWR4VHhJZHMACQAMZ292SWR4UXVvcnVtAAoADWdvdklkeE9wdGl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ECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASABMAFAQHdmVyc2lvbgkAZAIJAQxnZXRJbnRPckVsc2UCCQEUa2V5TGFzdFVwZGF0ZVZlcnNpb24AAAAAAQkAlAoCCQDMCAIJAQtEZWxldGVFbnRyeQEJARJrZXlBcHBseUluUHJvZ3Jlc3MACQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEUa2V5TGFzdFVwZGF0ZVZlcnNpb24ABQd2ZXJzaW9uCQDMCAIJAQtTdHJpbmdFbnRyeQIJARlrZXlQcm9wb3NhbFN0YXR1c0RhdGFCeUlkAQUKcHJvcG9zYWxJZAkBEXN0YXR1c0FwcGx5U2NyaXB0AQULZHluYW1pY0RhdGEJAMwIAgkBEEV4ZWN1dGlvbkhpc3RvcnkDBQd2ZXJzaW9uCQCRAwIFCHByb3BEYXRhBQtnb3ZJZHhUaXRsZQkAkQMCBQhwcm9wRGF0YQUJZ292SWR4VXJsBQNuaWwFB2lnbm9yZWQA1j7zRw==", "height": 2328286, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2LXEu9BDz44fN8TGA2hGjt6ZrTX2YHP3RWvkShvMvGXX Next: CMCQseThWrf5ma1kFxZLiGmdmSeJAtf9FvsshJbegvwe Diff:
Old | New | Differences | |
---|---|---|---|
415 | 415 | @Callable(i) | |
416 | 416 | func initiateIdeaVoting (forumLink,title,votingStartTime,votingEndTime,optionsList) = if ((size(i.payments) != 1)) | |
417 | 417 | then throw("Exactly one payment required") | |
418 | - | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "IDEA", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", nil, optionsList) | |
418 | + | else if ((size(optionsList) != 2)) | |
419 | + | then throw("Exactly 2 option ['NO', 'YES'] are expected") | |
420 | + | else if ((optionsList[0] != "NO")) | |
421 | + | then throw("Option NO should be the first") | |
422 | + | else if ((optionsList[1] != "YES")) | |
423 | + | then throw("Option YES should be the second") | |
424 | + | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "IDEA", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", nil, optionsList) | |
419 | 425 | ||
420 | 426 | ||
421 | 427 | ||
424 | 430 | then throw("Exactly one payment required") | |
425 | 431 | else if ((1 > size(txList))) | |
426 | 432 | then throw("Transactions list is empty") | |
427 | - | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "UPDATE", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", txList, ["NO", "YES"]) | |
433 | + | else if ((i.caller != this)) | |
434 | + | then throw("not authorized") | |
435 | + | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "UPDATE", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", txList, ["NO", "YES"]) | |
428 | 436 | ||
429 | 437 | ||
430 | 438 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let revisionNum = "" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let LISTSEP = ":" | |
9 | 9 | ||
10 | 10 | let DEFAULTQUORUM = 500000 | |
11 | 11 | ||
12 | 12 | let URLPATTERN = "https://forum.neutrino.at/" | |
13 | 13 | ||
14 | 14 | let MAXTITLE = 160 | |
15 | 15 | ||
16 | 16 | let MAXURL = 250 | |
17 | 17 | ||
18 | 18 | let MAXVOTINGTIME = 1209600000 | |
19 | 19 | ||
20 | 20 | let MULT6 = 1000000 | |
21 | 21 | ||
22 | 22 | let DEFAULTPAYMENT = 1000000000 | |
23 | 23 | ||
24 | 24 | let DEFAULTCREATIONGNSBT = 1000000000 | |
25 | 25 | ||
26 | 26 | let PASTMARGIN = 7200000 | |
27 | 27 | ||
28 | 28 | let FUTUREMARGIN = 5400000 | |
29 | 29 | ||
30 | 30 | let govIdxProposalTxId = 1 | |
31 | 31 | ||
32 | 32 | let govIdxType = 2 | |
33 | 33 | ||
34 | 34 | let govIdxAuthor = 3 | |
35 | 35 | ||
36 | 36 | let govIdxUrl = 4 | |
37 | 37 | ||
38 | 38 | let govIdxTitle = 5 | |
39 | 39 | ||
40 | 40 | let govIdxCreationTime = 6 | |
41 | 41 | ||
42 | 42 | let govIdxStart = 7 | |
43 | 43 | ||
44 | 44 | let govIdxEnd = 8 | |
45 | 45 | ||
46 | 46 | let govIdxTxIds = 9 | |
47 | 47 | ||
48 | 48 | let govIdxQuorum = 10 | |
49 | 49 | ||
50 | 50 | let govIdxOptions = 11 | |
51 | 51 | ||
52 | 52 | let govStatusIdxIsValid = 1 | |
53 | 53 | ||
54 | 54 | let govStatusIdxWinOpt = 2 | |
55 | 55 | ||
56 | 56 | let govStatusIdxWinVotes = 3 | |
57 | 57 | ||
58 | 58 | let govStatusIdxTotalVotes = 4 | |
59 | 59 | ||
60 | 60 | let govStatusIdxScApplied = 5 | |
61 | 61 | ||
62 | 62 | let govStatusIdxScTime = 6 | |
63 | 63 | ||
64 | 64 | let govStatusIdxIsCanceled = 7 | |
65 | 65 | ||
66 | 66 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | let IdxControlCfgNeutrinoDapp = 1 | |
73 | 73 | ||
74 | 74 | let IdxControlCfgAuctionDapp = 2 | |
75 | 75 | ||
76 | 76 | let IdxControlCfgRpdDapp = 3 | |
77 | 77 | ||
78 | 78 | let IdxControlCfgMathDapp = 4 | |
79 | 79 | ||
80 | 80 | let IdxControlCfgLiquidationDapp = 5 | |
81 | 81 | ||
82 | 82 | let IdxControlCfgRestDapp = 6 | |
83 | 83 | ||
84 | 84 | let IdxControlCfgNodeRegistryDapp = 7 | |
85 | 85 | ||
86 | 86 | let IdxControlCfgNsbtStakingDapp = 8 | |
87 | 87 | ||
88 | 88 | let IdxControlCfgMediatorDapp = 9 | |
89 | 89 | ||
90 | 90 | let IdxControlCfgSurfStakingDapp = 10 | |
91 | 91 | ||
92 | 92 | let IdxControlCfgGnsbtControllerDapp = 11 | |
93 | 93 | ||
94 | 94 | let IdxControlCfgRestV2Dapp = 12 | |
95 | 95 | ||
96 | 96 | let IdxControlCfgGovernanceDapp = 13 | |
97 | 97 | ||
98 | 98 | func keyControlAddress () = "%s%s__config__controlAddress" | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func keyControlCfg () = "%s__controlConfig" | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3P5Bfd58PPfNvBM2Hy8QfbcDqMeNtzg7KfP")) | |
111 | 111 | ||
112 | 112 | let controlCfg = readControlCfgOrFail(controlContract) | |
113 | 113 | ||
114 | 114 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
115 | 115 | ||
116 | 116 | let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp) | |
117 | 117 | ||
118 | 118 | func keyQuorumRequiredPercent () = "%s__quorumRequired" | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func keyPaymentRequired () = "%s__paymentRequired" | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func keyGnsbtRequired () = "%s__gNsbtRequired" | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func keyLastProposalId () = "%s__proposalId" | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func keyLastUpdateVersion () = "%s__updateVersion" | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func keyProposalStatusDataById (proposalId) = ("%s%d__proposalStatusData__" + toString(proposalId)) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func keyProposalDataById (proposalId) = ("%s%d__proposalData__" + toString(proposalId)) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func keyProposalVotesByIdAndOption (proposalId,opt) = makeString(["%s%d%d", "votesByOpt", toString(proposalId), toString(opt)], SEP) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func keyProposalVotesByIdAndUser (proposalId,userAddr) = makeString(["%s%d%s", "votesByUser", toString(proposalId), userAddr], SEP) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func keyProposalChoiceByIdAndUser (proposalId,userAddr) = makeString(["%s%d%s", "optionByUser", toString(proposalId), userAddr], SEP) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func keyApplyInProgress () = "%s__applyInProgress" | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func keyProposalIdByUrl (forumLink) = ("%s%s__proposalIdByUrl__" + toBase64String(toBytes(forumLink))) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func keyNumUniqueVotersByProposalId (proposalId) = ("%s%d__numVoters__" + toString(proposalId)) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func keyStatsAverUniqueVoters () = "%s%s%s__stats__avg__uniqueVoters" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func keyStatsAverGnsbtVoted () = "%s%s%s__stats__avg__gnsbtVoted" | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func keyStatsUniqueAuthors () = "%s%s__stats__uniqueAuthors" | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func keyNumProposalsByAuthor (addressStr) = ("%s%s__numProposalsByAuthor__" + addressStr) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func keyApplyHistory (timestamp) = ("%s%d__applyHistory__" + toString(timestamp)) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func asAnyList (v) = match v { | |
173 | 173 | case l: List[Any] => | |
174 | 174 | l | |
175 | 175 | case _ => | |
176 | 176 | throw("fail to cast into List[Any]") | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func asInt (v) = match v { | |
181 | 181 | case i: Int => | |
182 | 182 | i | |
183 | 183 | case _ => | |
184 | 184 | throw("fail to cast into Int") | |
185 | 185 | } | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func statusData (isVotingValid,winOption,winOptionVotes,totalVotes,areScriptsApplied,scriptsTimestamp,canceledByTeam) = makeString(["%b%d%d%d%b%d%b", toString(isVotingValid), toString(winOption), toString(winOptionVotes), toString(totalVotes), toString(areScriptsApplied), toString(scriptsTimestamp), toString(canceledByTeam)], SEP) | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | func proposalData (proposalTxId,type,author,forumLink,title,proposalTime,votingStartTime,votingEndTime,txIds,quorumInGnsbt,options) = makeString(["%s%s%s%s%s%d%d%d%s%d%s", proposalTxId, type, author, forumLink, title, toString(proposalTime), toString(votingStartTime), toString(votingEndTime), txIds, toString(quorumInGnsbt), options], SEP) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func checkTxList (txList) = if ((size(txList) > 20)) | |
195 | 195 | then throw(("Too many transactions: " + toString(size(txList)))) | |
196 | 196 | else { | |
197 | 197 | func combiner (acc,tx) = if ((size(fromBase58String(tx)) != 32)) | |
198 | 198 | then throw(("Wrong txId: " + tx)) | |
199 | 199 | else if ((acc == "")) | |
200 | 200 | then tx | |
201 | 201 | else ((acc + LISTSEP) + tx) | |
202 | 202 | ||
203 | 203 | let $l = txList | |
204 | 204 | let $s = size($l) | |
205 | 205 | let $acc0 = "" | |
206 | 206 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
207 | 207 | then $a | |
208 | 208 | else combiner($a, $l[$i]) | |
209 | 209 | ||
210 | 210 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
211 | 211 | then $a | |
212 | 212 | else throw("List size exceeds 20") | |
213 | 213 | ||
214 | 214 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
215 | 215 | } | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | let IdxEffTotal = 0 | |
219 | 219 | ||
220 | 220 | let IdxEffUser = 1 | |
221 | 221 | ||
222 | 222 | func getEffectiveGnsbt (userAddrStrOrEmpty) = { | |
223 | 223 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddrStrOrEmpty, 0, 0], nil)) | |
224 | 224 | let nsbtData = asAnyList(gnsbtData[2]) | |
225 | 225 | let userFromNsbt = asInt(nsbtData[2]) | |
226 | 226 | let totalFromNsbt = asInt(nsbtData[3]) | |
227 | 227 | let userMatureFromSurf = asInt(gnsbtData[9]) | |
228 | 228 | let totalMatureFromSurf = asInt(gnsbtData[6]) | |
229 | 229 | [(totalFromNsbt + totalMatureFromSurf), (userFromNsbt + userMatureFromSurf)] | |
230 | 230 | } | |
231 | 231 | ||
232 | 232 | ||
233 | 233 | func initiateVoting (payment,proposalTxId,type,author,forumLink,title,votingStartTime,votingEndTime,status,txList,optionsList) = if ((payment.assetId != unit)) | |
234 | 234 | then throw("Allowed WAVES payment only!") | |
235 | 235 | else { | |
236 | 236 | let pmtReq = getIntOrElse(keyPaymentRequired(), DEFAULTPAYMENT) | |
237 | 237 | if ((pmtReq > payment.amount)) | |
238 | 238 | then throw(("Payment attached should be at least " + toString(pmtReq))) | |
239 | 239 | else if ((value(indexOf(forumLink, URLPATTERN)) != 0)) | |
240 | 240 | then throw("Invalid url") | |
241 | 241 | else if ((size(forumLink) > MAXURL)) | |
242 | 242 | then throw("Url too long!") | |
243 | 243 | else { | |
244 | 244 | let registeredId = getInteger(keyProposalIdByUrl(forumLink)) | |
245 | 245 | if (isDefined(registeredId)) | |
246 | 246 | then throw(("Voting with such forum link is already registered by id=" + toString(value(registeredId)))) | |
247 | 247 | else if ((title == "")) | |
248 | 248 | then throw("Title is empty") | |
249 | 249 | else if ((size(title) > MAXTITLE)) | |
250 | 250 | then throw("Too long title") | |
251 | 251 | else { | |
252 | 252 | let proposalTime = lastBlock.timestamp | |
253 | 253 | if ((proposalTime > votingStartTime)) | |
254 | 254 | then throw(((("votingStartTime=" + toString(votingStartTime)) + " < proposalTime=") + toString(proposalTime))) | |
255 | 255 | else if ((votingStartTime > votingEndTime)) | |
256 | 256 | then throw(((("votingEndTime=" + toString(votingEndTime)) + " < votingStartTime=") + toString(votingStartTime))) | |
257 | 257 | else if (((votingEndTime - votingStartTime) > MAXVOTINGTIME)) | |
258 | 258 | then throw(((("Voting period exceeds max: " + toString((votingEndTime - votingStartTime))) + " > ") + toString(MAXVOTINGTIME))) | |
259 | 259 | else { | |
260 | 260 | let txIds = if ((type == "IDEA")) | |
261 | 261 | then "" | |
262 | 262 | else checkTxList(txList) | |
263 | 263 | if ((1 >= size(optionsList))) | |
264 | 264 | then throw("Too few choices to vote") | |
265 | 265 | else { | |
266 | 266 | let eff = getEffectiveGnsbt(author) | |
267 | 267 | let gnsbtTotal = eff[IdxEffTotal] | |
268 | 268 | let gNsbtUser = eff[IdxEffUser] | |
269 | 269 | let gnsbtReq = getIntOrElse(keyGnsbtRequired(), DEFAULTCREATIONGNSBT) | |
270 | 270 | if ((gnsbtReq > gNsbtUser)) | |
271 | 271 | then throw((("You need at least " + toString(gnsbtReq)) + " gNsbt to create voting")) | |
272 | 272 | else { | |
273 | 273 | let amountLeased = invoke(neutrinoContract, "acceptWaves", nil, [payment]) | |
274 | 274 | if ((amountLeased == amountLeased)) | |
275 | 275 | then { | |
276 | 276 | let quorum = getIntOrElse(keyQuorumRequiredPercent(), DEFAULTQUORUM) | |
277 | 277 | let quorumInGnsbt = fraction(quorum, gnsbtTotal, MULT6) | |
278 | 278 | let proposalId = (getIntOrElse(keyLastProposalId(), 0) + 1) | |
279 | 279 | let numProposalsByAuthor = (getIntOrElse(keyNumProposalsByAuthor(author), 0) + 1) | |
280 | 280 | let uniqAuthors = (getIntOrElse(keyStatsUniqueAuthors(), 0) + (if ((numProposalsByAuthor == 1)) | |
281 | 281 | then 1 | |
282 | 282 | else 0)) | |
283 | 283 | let optionsStr = makeString(optionsList, LISTSEP) | |
284 | 284 | $Tuple2([IntegerEntry(keyLastProposalId(), proposalId), IntegerEntry(keyProposalIdByUrl(forumLink), proposalId), StringEntry(keyProposalStatusDataById(proposalId), statusData(false, 0, 0, 0, false, 0, false)), StringEntry(keyProposalDataById(proposalId), proposalData(proposalTxId, type, author, forumLink, title, proposalTime, votingStartTime, votingEndTime, txIds, quorumInGnsbt, optionsStr)), IntegerEntry(keyNumProposalsByAuthor(author), numProposalsByAuthor), IntegerEntry(keyStatsUniqueAuthors(), uniqAuthors)], proposalTxId) | |
285 | 285 | } | |
286 | 286 | else throw("Strict value is not equal to itself.") | |
287 | 287 | } | |
288 | 288 | } | |
289 | 289 | } | |
290 | 290 | } | |
291 | 291 | } | |
292 | 292 | } | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | func calcWinOption (proposalId,optionsList,isPrevOptional,oldChoice,optionalTotalOld,newChoice,newTotalByNewChoice) = { | |
296 | 296 | func findBest (acc,elem) = { | |
297 | 297 | let idx = value(indexOf(optionsList, elem)) | |
298 | 298 | let val = if (isPrevOptional) | |
299 | 299 | then if ((idx == newChoice)) | |
300 | 300 | then newTotalByNewChoice | |
301 | 301 | else getIntOrElse(keyProposalVotesByIdAndOption(proposalId, idx), 0) | |
302 | 302 | else if ((idx == value(oldChoice))) | |
303 | 303 | then optionalTotalOld | |
304 | 304 | else if ((idx == newChoice)) | |
305 | 305 | then newTotalByNewChoice | |
306 | 306 | else getIntOrElse(keyProposalVotesByIdAndOption(proposalId, idx), 0) | |
307 | 307 | if ((acc._2 > val)) | |
308 | 308 | then acc | |
309 | 309 | else $Tuple2(idx, val) | |
310 | 310 | } | |
311 | 311 | ||
312 | 312 | let $l = optionsList | |
313 | 313 | let $s = size($l) | |
314 | 314 | let $acc0 = $Tuple2(0, 0) | |
315 | 315 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
316 | 316 | then $a | |
317 | 317 | else findBest($a, $l[$i]) | |
318 | 318 | ||
319 | 319 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
320 | 320 | then $a | |
321 | 321 | else throw("List size exceeds 10") | |
322 | 322 | ||
323 | 323 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
324 | 324 | } | |
325 | 325 | ||
326 | 326 | ||
327 | 327 | func updateStatusData (oldData,isValid,newWinOpt,newTotalVotes) = makeString(["%b%d%d%d%b%d%b", toString(isValid), toString(newWinOpt._1), toString(newWinOpt._2), toString(newTotalVotes), oldData[govStatusIdxScApplied], oldData[govStatusIdxScTime], oldData[govStatusIdxIsCanceled]], SEP) | |
328 | 328 | ||
329 | 329 | ||
330 | 330 | func statusApplyScript (oldData) = makeString(["%b%d%d%d%b%d%b", oldData[govStatusIdxIsValid], oldData[govStatusIdxWinOpt], oldData[govStatusIdxWinVotes], oldData[govStatusIdxTotalVotes], "true", oldData[govStatusIdxScTime], oldData[govStatusIdxIsCanceled]], SEP) | |
331 | 331 | ||
332 | 332 | ||
333 | 333 | func ExecutionHistory (proposalId,title,url) = { | |
334 | 334 | let gnsbtTotal = getEffectiveGnsbt("")[IdxEffTotal] | |
335 | 335 | let turnout = 500000 | |
336 | 336 | StringEntry(keyApplyHistory(lastBlock.timestamp), makeString(["%d%d%d%s%s", toString(proposalId), toString(gnsbtTotal), toString(turnout), title, url], SEP)) | |
337 | 337 | } | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | @Callable(i) | |
341 | 341 | func castVote (proposalId,choice) = { | |
342 | 342 | let userAddressStr = toString(i.caller) | |
343 | 343 | let dynamicData = split(getStringOrFail(this, keyProposalStatusDataById(proposalId)), SEP) | |
344 | 344 | if ((dynamicData[govStatusIdxIsCanceled] == "true")) | |
345 | 345 | then throw("Voting is canceled by team") | |
346 | 346 | else { | |
347 | 347 | let propData = split(getStringOrFail(this, keyProposalDataById(proposalId)), SEP) | |
348 | 348 | let start = parseIntValue(propData[govIdxStart]) | |
349 | 349 | let end = parseIntValue(propData[govIdxEnd]) | |
350 | 350 | let now = lastBlock.timestamp | |
351 | 351 | if ((start > now)) | |
352 | 352 | then throw("Voting not started yet") | |
353 | 353 | else if ((now >= end)) | |
354 | 354 | then throw("Voting already finished") | |
355 | 355 | else { | |
356 | 356 | let availableOptions = split(propData[govIdxOptions], LISTSEP) | |
357 | 357 | let numOptions = size(availableOptions) | |
358 | 358 | if ((1 >= numOptions)) | |
359 | 359 | then throw("Too few choices to vote") | |
360 | 360 | else if ((choice >= numOptions)) | |
361 | 361 | then throw(("Unknown choice! Must be 0.." + toString((numOptions - 1)))) | |
362 | 362 | else { | |
363 | 363 | let eff = getEffectiveGnsbt(userAddressStr) | |
364 | 364 | let gnsbtAmt = eff[IdxEffUser] | |
365 | 365 | if ((0 >= gnsbtAmt)) | |
366 | 366 | then throw("no gnsbt to vote") | |
367 | 367 | else { | |
368 | 368 | let gnsbtTotal = eff[IdxEffTotal] | |
369 | 369 | let oldChoice = getInteger(keyProposalChoiceByIdAndUser(proposalId, userAddressStr)) | |
370 | 370 | let oldUserVotes = if (!(isDefined(oldChoice))) | |
371 | 371 | then 0 | |
372 | 372 | else getIntOrElse(keyProposalVotesByIdAndUser(proposalId, userAddressStr), 0) | |
373 | 373 | let oldTotalByOldChoice = if (isDefined(oldChoice)) | |
374 | 374 | then getIntOrElse(keyProposalVotesByIdAndOption(proposalId, value(oldChoice)), 0) | |
375 | 375 | else 0 | |
376 | 376 | let oldTotalByNewChoice = getIntOrElse(keyProposalVotesByIdAndOption(proposalId, choice), 0) | |
377 | 377 | let oldTotal = parseIntValue(dynamicData[govStatusIdxTotalVotes]) | |
378 | 378 | let newTotalByOldChoice = if (!(isDefined(oldChoice))) | |
379 | 379 | then 0 | |
380 | 380 | else ((oldTotalByOldChoice - oldUserVotes) + (if ((value(oldChoice) == choice)) | |
381 | 381 | then gnsbtAmt | |
382 | 382 | else 0)) | |
383 | 383 | let newTotalByNewChoice = if (if (isDefined(oldChoice)) | |
384 | 384 | then (value(oldChoice) == choice) | |
385 | 385 | else false) | |
386 | 386 | then newTotalByOldChoice | |
387 | 387 | else (oldTotalByNewChoice + gnsbtAmt) | |
388 | 388 | let newTotal = ((oldTotal - oldUserVotes) + gnsbtAmt) | |
389 | 389 | let isQuorumReached = (newTotal >= parseIntValue(propData[govIdxQuorum])) | |
390 | 390 | let numVotersByProposalId = getIntOrElse(keyNumUniqueVotersByProposalId(proposalId), 0) | |
391 | 391 | let oldAverUniqueVoters6 = getIntOrElse(keyStatsAverUniqueVoters(), 0) | |
392 | 392 | let numProposals = getIntegerValue(keyLastProposalId()) | |
393 | 393 | let uniqueDiff = if ((oldUserVotes == 0)) | |
394 | 394 | then 1 | |
395 | 395 | else 0 | |
396 | 396 | let newAverUniqueVoters6 = (oldAverUniqueVoters6 + fraction(uniqueDiff, MULT6, numProposals)) | |
397 | 397 | let oldAverGnsbt = getIntOrElse(keyStatsAverGnsbtVoted(), 0) | |
398 | 398 | let newAverGnsbt = (oldAverGnsbt + ((gnsbtAmt - oldUserVotes) / numProposals)) | |
399 | 399 | let isPrevOptional = if (!(isDefined(oldChoice))) | |
400 | 400 | then true | |
401 | 401 | else (value(oldChoice) == choice) | |
402 | 402 | let optionalTotalOld = if (isPrevOptional) | |
403 | 403 | then nil | |
404 | 404 | else [IntegerEntry(keyProposalVotesByIdAndOption(proposalId, value(oldChoice)), newTotalByOldChoice)] | |
405 | 405 | let winOpt = calcWinOption(proposalId, availableOptions, isPrevOptional, oldChoice, newTotalByOldChoice, choice, newTotalByNewChoice) | |
406 | 406 | $Tuple2(([IntegerEntry(keyProposalChoiceByIdAndUser(proposalId, userAddressStr), choice), IntegerEntry(keyProposalVotesByIdAndUser(proposalId, userAddressStr), gnsbtAmt), IntegerEntry(keyProposalVotesByIdAndOption(proposalId, choice), newTotalByNewChoice), IntegerEntry(keyNumUniqueVotersByProposalId(proposalId), (numVotersByProposalId + uniqueDiff)), IntegerEntry(keyStatsAverUniqueVoters(), newAverUniqueVoters6), IntegerEntry(keyStatsAverGnsbtVoted(), newAverGnsbt), StringEntry(keyProposalStatusDataById(proposalId), updateStatusData(dynamicData, isQuorumReached, winOpt, newTotal))] ++ optionalTotalOld), unit) | |
407 | 407 | } | |
408 | 408 | } | |
409 | 409 | } | |
410 | 410 | } | |
411 | 411 | } | |
412 | 412 | ||
413 | 413 | ||
414 | 414 | ||
415 | 415 | @Callable(i) | |
416 | 416 | func initiateIdeaVoting (forumLink,title,votingStartTime,votingEndTime,optionsList) = if ((size(i.payments) != 1)) | |
417 | 417 | then throw("Exactly one payment required") | |
418 | - | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "IDEA", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", nil, optionsList) | |
418 | + | else if ((size(optionsList) != 2)) | |
419 | + | then throw("Exactly 2 option ['NO', 'YES'] are expected") | |
420 | + | else if ((optionsList[0] != "NO")) | |
421 | + | then throw("Option NO should be the first") | |
422 | + | else if ((optionsList[1] != "YES")) | |
423 | + | then throw("Option YES should be the second") | |
424 | + | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "IDEA", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", nil, optionsList) | |
419 | 425 | ||
420 | 426 | ||
421 | 427 | ||
422 | 428 | @Callable(i) | |
423 | 429 | func initiateUpdateVoting (forumLink,title,votingStartTime,votingEndTime,txList) = if ((size(i.payments) != 1)) | |
424 | 430 | then throw("Exactly one payment required") | |
425 | 431 | else if ((1 > size(txList))) | |
426 | 432 | then throw("Transactions list is empty") | |
427 | - | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "UPDATE", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", txList, ["NO", "YES"]) | |
433 | + | else if ((i.caller != this)) | |
434 | + | then throw("not authorized") | |
435 | + | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "UPDATE", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", txList, ["NO", "YES"]) | |
428 | 436 | ||
429 | 437 | ||
430 | 438 | ||
431 | 439 | @Callable(i) | |
432 | 440 | func cancelVoting (proposalId) = if ((i.caller != this)) | |
433 | 441 | then throw("not authorized") | |
434 | 442 | else { | |
435 | 443 | let currentData = getStringOrFail(this, keyProposalStatusDataById(proposalId)) | |
436 | 444 | let updatedData = ((take(currentData, value(lastIndexOf(currentData, SEP))) + SEP) + "true") | |
437 | 445 | $Tuple2([StringEntry(keyProposalStatusDataById(proposalId), updatedData)], unit) | |
438 | 446 | } | |
439 | 447 | ||
440 | 448 | ||
441 | 449 | ||
442 | 450 | @Callable(i) | |
443 | 451 | func applyUpdate (proposalId) = { | |
444 | 452 | let propData = split(getStringOrFail(this, keyProposalDataById(proposalId)), SEP) | |
445 | 453 | let end = parseIntValue(propData[govIdxEnd]) | |
446 | 454 | let now = lastBlock.timestamp | |
447 | 455 | if ((end > now)) | |
448 | 456 | then throw("Voting is not finished yet") | |
449 | 457 | else if (("UPDATE" != propData[govIdxType])) | |
450 | 458 | then throw("Only UPDATE type can be applied") | |
451 | 459 | else { | |
452 | 460 | let dynamicData = split(getStringOrFail(this, keyProposalStatusDataById(proposalId)), SEP) | |
453 | 461 | if ((dynamicData[govStatusIdxIsCanceled] == "true")) | |
454 | 462 | then throw("Voting is canceled") | |
455 | 463 | else if ((dynamicData[govStatusIdxIsValid] != "true")) | |
456 | 464 | then throw("Voting status invalid") | |
457 | 465 | else if ((dynamicData[govStatusIdxWinOpt] != "1")) | |
458 | 466 | then throw("Winner is 'NO' - nothing to apply") | |
459 | 467 | else if ((dynamicData[govStatusIdxScApplied] == "true")) | |
460 | 468 | then throw("Scripts are already applied") | |
461 | 469 | else { | |
462 | 470 | let scriptTime = parseIntValue(dynamicData[govStatusIdxScTime]) | |
463 | 471 | if (((now - PASTMARGIN) > scriptTime)) | |
464 | 472 | then throw((("Scripts timestamp=" + toString(scriptTime)) + " is too far in the past, max 2 hrs allowed")) | |
465 | 473 | else if ((scriptTime > (now + FUTUREMARGIN))) | |
466 | 474 | then throw((("Scripts timestamp=" + toString(scriptTime)) + " is too far in the future, max 1.5 hrs allowed")) | |
467 | 475 | else { | |
468 | 476 | let inProgressId = getIntOrElse(keyApplyInProgress(), -1) | |
469 | 477 | if ((inProgressId != -1)) | |
470 | 478 | then throw((("proposalId=" + toString(inProgressId)) + " is already being applied. Finish it first!")) | |
471 | 479 | else { | |
472 | 480 | let shutdown = invoke(controlContract, "callEmergencyShutdown", ["Applying Governance UPDATE"], nil) | |
473 | 481 | if ((shutdown == shutdown)) | |
474 | 482 | then $Tuple2([IntegerEntry(keyApplyInProgress(), proposalId)], unit) | |
475 | 483 | else throw("Strict value is not equal to itself.") | |
476 | 484 | } | |
477 | 485 | } | |
478 | 486 | } | |
479 | 487 | } | |
480 | 488 | } | |
481 | 489 | ||
482 | 490 | ||
483 | 491 | ||
484 | 492 | @Callable(i) | |
485 | 493 | func finishApply () = { | |
486 | 494 | let proposalId = valueOrErrorMessage(getInteger(keyApplyInProgress()), "No apply in progress, nothing to finish") | |
487 | 495 | let propData = split(getStringOrFail(this, keyProposalDataById(proposalId)), SEP) | |
488 | 496 | let txList = split(propData[govIdxTxIds], LISTSEP) | |
489 | 497 | let dynamicData = split(getStringOrFail(this, keyProposalStatusDataById(proposalId)), SEP) | |
490 | 498 | if ((dynamicData[govStatusIdxScApplied] == "true")) | |
491 | 499 | then throw("Scripts are already applied") | |
492 | 500 | else { | |
493 | 501 | func checker (acc,tx) = if (!(isDefined(transactionHeightById(fromBase58String(tx))))) | |
494 | 502 | then throw(("NOT applied txId: " + tx)) | |
495 | 503 | else unit | |
496 | 504 | ||
497 | 505 | let ignored = { | |
498 | 506 | let $l = txList | |
499 | 507 | let $s = size($l) | |
500 | 508 | let $acc0 = unit | |
501 | 509 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
502 | 510 | then $a | |
503 | 511 | else checker($a, $l[$i]) | |
504 | 512 | ||
505 | 513 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
506 | 514 | then $a | |
507 | 515 | else throw("List size exceeds 20") | |
508 | 516 | ||
509 | 517 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
510 | 518 | } | |
511 | 519 | let version = (getIntOrElse(keyLastUpdateVersion(), 0) + 1) | |
512 | 520 | $Tuple2([DeleteEntry(keyApplyInProgress()), IntegerEntry(keyLastUpdateVersion(), version), StringEntry(keyProposalStatusDataById(proposalId), statusApplyScript(dynamicData)), ExecutionHistory(version, propData[govIdxTitle], propData[govIdxUrl])], ignored) | |
513 | 521 | } | |
514 | 522 | } | |
515 | 523 | ||
516 | 524 |
github/deemru/w8io/169f3d6 58.13 ms ◑