tx · CMCQseThWrf5ma1kFxZLiGmdmSeJAtf9FvsshJbegvwe 3N3gSFrTwgiLAFZHMuJrEttht1nPhnkpvjs: -0.01700000 Waves 2022.11.24 14:43 [2331129] smart account 3N3gSFrTwgiLAFZHMuJrEttht1nPhnkpvjs > SELF 0.00000000 Waves
{ "type": 13, "id": "CMCQseThWrf5ma1kFxZLiGmdmSeJAtf9FvsshJbegvwe", "fee": 1700000, "feeAssetId": null, "timestamp": 1669290207509, "version": 2, "chainId": 84, "sender": "3N3gSFrTwgiLAFZHMuJrEttht1nPhnkpvjs", "senderPublicKey": "5mttAQ8x5ig98rgbv6rZmwXQ2pAYSwgCkQPSVBcr7BVp", "proofs": [ "24AeVgjjidZ1sEd5w9Qxjd8dg65MeUpzW8gZRAv2TDd4rTEipctAvmjtuPXtbpCLnhinK7EaJ4Suptszj5TfMHJn" ], "script": "base64:BgIuCAISBgoECAEBARIECgIBARIHCgUICAEBGBIHCgUICAEBGBIDCgEBEgMKAQESAFUAC3JldmlzaW9uTnVtAgAAA1NFUAICX18AB0xJU1RTRVACAToADURFRkFVTFRRVU9SVU0AoMIeAApVUkxQQVRURVJOAhpodHRwczovL2ZvcnVtLm5ldXRyaW5vLmF0LwAITUFYVElUTEUAoAEABk1BWFVSTAD6AQANTUFYVk9USU5HVElNRQCAkOTABAAFTVVMVDYAwIQ9AA5ERUZBVUxUUEFZTUVOVACAlOvcAwAUREVGQVVMVENSRUFUSU9OR05TQlQAgJTr3AMAClBBU1RNQVJHSU4AgLq3AwAMRlVUVVJFTUFSR0lOAMDLyQIAEmdvdklkeFByb3Bvc2FsVHhJZAABAApnb3ZJZHhUeXBlAAIADGdvdklkeEF1dGhvcgADAAlnb3ZJZHhVcmwABAALZ292SWR4VGl0bGUABQASZ292SWR4Q3JlYXRpb25UaW1lAAYAC2dvdklkeFN0YXJ0AAcACWdvdklkeEVuZAAIAAtnb3ZJZHhUeElkcwAJAAxnb3ZJZHhRdW9ydW0ACgANZ292SWR4T3B0aW9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N1dGlvbkhpc3RvcnkDBQd2ZXJzaW9uCQCRAwIFCHByb3BEYXRhBQtnb3ZJZHhUaXRsZQkAkQMCBQhwcm9wRGF0YQUJZ292SWR4VXJsBQNuaWwFB2lnbm9yZWQAFx3mRg==", "height": 2331129, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4143eFgP3jkCfZ5wMJFHanTcR1H5ymyoRibdGtpXcTJs Next: 8xrWaRC9k2KAeGEBtUmfT1AhnrpSR59BDpXhkXVf5Zzf Diff:
Old | New | Differences | |
---|---|---|---|
338 | 338 | ||
339 | 339 | ||
340 | 340 | @Callable(i) | |
341 | + | func constructor (controlAddr,gNsbtReqToInit,wavesReqToInit,quorumReqPerc) = if ((i.caller != this)) | |
342 | + | then throw("Permission denied") | |
343 | + | else [StringEntry(keyControlAddress(), controlAddr), IntegerEntry(keyGnsbtRequired(), gNsbtReqToInit), IntegerEntry(keyPaymentRequired(), wavesReqToInit), IntegerEntry(keyQuorumRequiredPercent(), quorumReqPerc)] | |
344 | + | ||
345 | + | ||
346 | + | ||
347 | + | @Callable(i) | |
341 | 348 | func castVote (proposalId,choice) = { | |
342 | 349 | let userAddressStr = toString(i.caller) | |
343 | 350 | let dynamicData = split(getStringOrFail(this, keyProposalStatusDataById(proposalId)), SEP) |
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 | + | func constructor (controlAddr,gNsbtReqToInit,wavesReqToInit,quorumReqPerc) = if ((i.caller != this)) | |
342 | + | then throw("Permission denied") | |
343 | + | else [StringEntry(keyControlAddress(), controlAddr), IntegerEntry(keyGnsbtRequired(), gNsbtReqToInit), IntegerEntry(keyPaymentRequired(), wavesReqToInit), IntegerEntry(keyQuorumRequiredPercent(), quorumReqPerc)] | |
344 | + | ||
345 | + | ||
346 | + | ||
347 | + | @Callable(i) | |
341 | 348 | func castVote (proposalId,choice) = { | |
342 | 349 | let userAddressStr = toString(i.caller) | |
343 | 350 | let dynamicData = split(getStringOrFail(this, keyProposalStatusDataById(proposalId)), SEP) | |
344 | 351 | if ((dynamicData[govStatusIdxIsCanceled] == "true")) | |
345 | 352 | then throw("Voting is canceled by team") | |
346 | 353 | else { | |
347 | 354 | let propData = split(getStringOrFail(this, keyProposalDataById(proposalId)), SEP) | |
348 | 355 | let start = parseIntValue(propData[govIdxStart]) | |
349 | 356 | let end = parseIntValue(propData[govIdxEnd]) | |
350 | 357 | let now = lastBlock.timestamp | |
351 | 358 | if ((start > now)) | |
352 | 359 | then throw("Voting not started yet") | |
353 | 360 | else if ((now >= end)) | |
354 | 361 | then throw("Voting already finished") | |
355 | 362 | else { | |
356 | 363 | let availableOptions = split(propData[govIdxOptions], LISTSEP) | |
357 | 364 | let numOptions = size(availableOptions) | |
358 | 365 | if ((1 >= numOptions)) | |
359 | 366 | then throw("Too few choices to vote") | |
360 | 367 | else if ((choice >= numOptions)) | |
361 | 368 | then throw(("Unknown choice! Must be 0.." + toString((numOptions - 1)))) | |
362 | 369 | else { | |
363 | 370 | let eff = getEffectiveGnsbt(userAddressStr) | |
364 | 371 | let gnsbtAmt = eff[IdxEffUser] | |
365 | 372 | if ((0 >= gnsbtAmt)) | |
366 | 373 | then throw("no gnsbt to vote") | |
367 | 374 | else { | |
368 | 375 | let gnsbtTotal = eff[IdxEffTotal] | |
369 | 376 | let oldChoice = getInteger(keyProposalChoiceByIdAndUser(proposalId, userAddressStr)) | |
370 | 377 | let oldUserVotes = if (!(isDefined(oldChoice))) | |
371 | 378 | then 0 | |
372 | 379 | else getIntOrElse(keyProposalVotesByIdAndUser(proposalId, userAddressStr), 0) | |
373 | 380 | let oldTotalByOldChoice = if (isDefined(oldChoice)) | |
374 | 381 | then getIntOrElse(keyProposalVotesByIdAndOption(proposalId, value(oldChoice)), 0) | |
375 | 382 | else 0 | |
376 | 383 | let oldTotalByNewChoice = getIntOrElse(keyProposalVotesByIdAndOption(proposalId, choice), 0) | |
377 | 384 | let oldTotal = parseIntValue(dynamicData[govStatusIdxTotalVotes]) | |
378 | 385 | let newTotalByOldChoice = if (!(isDefined(oldChoice))) | |
379 | 386 | then 0 | |
380 | 387 | else ((oldTotalByOldChoice - oldUserVotes) + (if ((value(oldChoice) == choice)) | |
381 | 388 | then gnsbtAmt | |
382 | 389 | else 0)) | |
383 | 390 | let newTotalByNewChoice = if (if (isDefined(oldChoice)) | |
384 | 391 | then (value(oldChoice) == choice) | |
385 | 392 | else false) | |
386 | 393 | then newTotalByOldChoice | |
387 | 394 | else (oldTotalByNewChoice + gnsbtAmt) | |
388 | 395 | let newTotal = ((oldTotal - oldUserVotes) + gnsbtAmt) | |
389 | 396 | let isQuorumReached = (newTotal >= parseIntValue(propData[govIdxQuorum])) | |
390 | 397 | let numVotersByProposalId = getIntOrElse(keyNumUniqueVotersByProposalId(proposalId), 0) | |
391 | 398 | let oldAverUniqueVoters6 = getIntOrElse(keyStatsAverUniqueVoters(), 0) | |
392 | 399 | let numProposals = getIntegerValue(keyLastProposalId()) | |
393 | 400 | let uniqueDiff = if ((oldUserVotes == 0)) | |
394 | 401 | then 1 | |
395 | 402 | else 0 | |
396 | 403 | let newAverUniqueVoters6 = (oldAverUniqueVoters6 + fraction(uniqueDiff, MULT6, numProposals)) | |
397 | 404 | let oldAverGnsbt = getIntOrElse(keyStatsAverGnsbtVoted(), 0) | |
398 | 405 | let newAverGnsbt = (oldAverGnsbt + ((gnsbtAmt - oldUserVotes) / numProposals)) | |
399 | 406 | let isPrevOptional = if (!(isDefined(oldChoice))) | |
400 | 407 | then true | |
401 | 408 | else (value(oldChoice) == choice) | |
402 | 409 | let optionalTotalOld = if (isPrevOptional) | |
403 | 410 | then nil | |
404 | 411 | else [IntegerEntry(keyProposalVotesByIdAndOption(proposalId, value(oldChoice)), newTotalByOldChoice)] | |
405 | 412 | let winOpt = calcWinOption(proposalId, availableOptions, isPrevOptional, oldChoice, newTotalByOldChoice, choice, newTotalByNewChoice) | |
406 | 413 | $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 | 414 | } | |
408 | 415 | } | |
409 | 416 | } | |
410 | 417 | } | |
411 | 418 | } | |
412 | 419 | ||
413 | 420 | ||
414 | 421 | ||
415 | 422 | @Callable(i) | |
416 | 423 | func initiateIdeaVoting (forumLink,title,votingStartTime,votingEndTime,optionsList) = if ((size(i.payments) != 1)) | |
417 | 424 | then throw("Exactly one payment required") | |
418 | 425 | else if ((size(optionsList) != 2)) | |
419 | 426 | then throw("Exactly 2 option ['NO', 'YES'] are expected") | |
420 | 427 | else if ((optionsList[0] != "NO")) | |
421 | 428 | then throw("Option NO should be the first") | |
422 | 429 | else if ((optionsList[1] != "YES")) | |
423 | 430 | then throw("Option YES should be the second") | |
424 | 431 | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "IDEA", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", nil, optionsList) | |
425 | 432 | ||
426 | 433 | ||
427 | 434 | ||
428 | 435 | @Callable(i) | |
429 | 436 | func initiateUpdateVoting (forumLink,title,votingStartTime,votingEndTime,txList) = if ((size(i.payments) != 1)) | |
430 | 437 | then throw("Exactly one payment required") | |
431 | 438 | else if ((1 > size(txList))) | |
432 | 439 | then throw("Transactions list is empty") | |
433 | 440 | else if ((i.caller != this)) | |
434 | 441 | then throw("not authorized") | |
435 | 442 | else initiateVoting(value(i.payments[0]), toBase58String(i.transactionId), "UPDATE", toString(i.caller), forumLink, title, votingStartTime, votingEndTime, "PENDING", txList, ["NO", "YES"]) | |
436 | 443 | ||
437 | 444 | ||
438 | 445 | ||
439 | 446 | @Callable(i) | |
440 | 447 | func cancelVoting (proposalId) = if ((i.caller != this)) | |
441 | 448 | then throw("not authorized") | |
442 | 449 | else { | |
443 | 450 | let currentData = getStringOrFail(this, keyProposalStatusDataById(proposalId)) | |
444 | 451 | let updatedData = ((take(currentData, value(lastIndexOf(currentData, SEP))) + SEP) + "true") | |
445 | 452 | $Tuple2([StringEntry(keyProposalStatusDataById(proposalId), updatedData)], unit) | |
446 | 453 | } | |
447 | 454 | ||
448 | 455 | ||
449 | 456 | ||
450 | 457 | @Callable(i) | |
451 | 458 | func applyUpdate (proposalId) = { | |
452 | 459 | let propData = split(getStringOrFail(this, keyProposalDataById(proposalId)), SEP) | |
453 | 460 | let end = parseIntValue(propData[govIdxEnd]) | |
454 | 461 | let now = lastBlock.timestamp | |
455 | 462 | if ((end > now)) | |
456 | 463 | then throw("Voting is not finished yet") | |
457 | 464 | else if (("UPDATE" != propData[govIdxType])) | |
458 | 465 | then throw("Only UPDATE type can be applied") | |
459 | 466 | else { | |
460 | 467 | let dynamicData = split(getStringOrFail(this, keyProposalStatusDataById(proposalId)), SEP) | |
461 | 468 | if ((dynamicData[govStatusIdxIsCanceled] == "true")) | |
462 | 469 | then throw("Voting is canceled") | |
463 | 470 | else if ((dynamicData[govStatusIdxIsValid] != "true")) | |
464 | 471 | then throw("Voting status invalid") | |
465 | 472 | else if ((dynamicData[govStatusIdxWinOpt] != "1")) | |
466 | 473 | then throw("Winner is 'NO' - nothing to apply") | |
467 | 474 | else if ((dynamicData[govStatusIdxScApplied] == "true")) | |
468 | 475 | then throw("Scripts are already applied") | |
469 | 476 | else { | |
470 | 477 | let scriptTime = parseIntValue(dynamicData[govStatusIdxScTime]) | |
471 | 478 | if (((now - PASTMARGIN) > scriptTime)) | |
472 | 479 | then throw((("Scripts timestamp=" + toString(scriptTime)) + " is too far in the past, max 2 hrs allowed")) | |
473 | 480 | else if ((scriptTime > (now + FUTUREMARGIN))) | |
474 | 481 | then throw((("Scripts timestamp=" + toString(scriptTime)) + " is too far in the future, max 1.5 hrs allowed")) | |
475 | 482 | else { | |
476 | 483 | let inProgressId = getIntOrElse(keyApplyInProgress(), -1) | |
477 | 484 | if ((inProgressId != -1)) | |
478 | 485 | then throw((("proposalId=" + toString(inProgressId)) + " is already being applied. Finish it first!")) | |
479 | 486 | else { | |
480 | 487 | let shutdown = invoke(controlContract, "callEmergencyShutdown", ["Applying Governance UPDATE"], nil) | |
481 | 488 | if ((shutdown == shutdown)) | |
482 | 489 | then $Tuple2([IntegerEntry(keyApplyInProgress(), proposalId)], unit) | |
483 | 490 | else throw("Strict value is not equal to itself.") | |
484 | 491 | } | |
485 | 492 | } | |
486 | 493 | } | |
487 | 494 | } | |
488 | 495 | } | |
489 | 496 | ||
490 | 497 | ||
491 | 498 | ||
492 | 499 | @Callable(i) | |
493 | 500 | func finishApply () = { | |
494 | 501 | let proposalId = valueOrErrorMessage(getInteger(keyApplyInProgress()), "No apply in progress, nothing to finish") | |
495 | 502 | let propData = split(getStringOrFail(this, keyProposalDataById(proposalId)), SEP) | |
496 | 503 | let txList = split(propData[govIdxTxIds], LISTSEP) | |
497 | 504 | let dynamicData = split(getStringOrFail(this, keyProposalStatusDataById(proposalId)), SEP) | |
498 | 505 | if ((dynamicData[govStatusIdxScApplied] == "true")) | |
499 | 506 | then throw("Scripts are already applied") | |
500 | 507 | else { | |
501 | 508 | func checker (acc,tx) = if (!(isDefined(transactionHeightById(fromBase58String(tx))))) | |
502 | 509 | then throw(("NOT applied txId: " + tx)) | |
503 | 510 | else unit | |
504 | 511 | ||
505 | 512 | let ignored = { | |
506 | 513 | let $l = txList | |
507 | 514 | let $s = size($l) | |
508 | 515 | let $acc0 = unit | |
509 | 516 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
510 | 517 | then $a | |
511 | 518 | else checker($a, $l[$i]) | |
512 | 519 | ||
513 | 520 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
514 | 521 | then $a | |
515 | 522 | else throw("List size exceeds 20") | |
516 | 523 | ||
517 | 524 | $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) | |
518 | 525 | } | |
519 | 526 | let version = (getIntOrElse(keyLastUpdateVersion(), 0) + 1) | |
520 | 527 | $Tuple2([DeleteEntry(keyApplyInProgress()), IntegerEntry(keyLastUpdateVersion(), version), StringEntry(keyProposalStatusDataById(proposalId), statusApplyScript(dynamicData)), ExecutionHistory(version, propData[govIdxTitle], propData[govIdxUrl])], ignored) | |
521 | 528 | } | |
522 | 529 | } | |
523 | 530 | ||
524 | 531 |
github/deemru/w8io/169f3d6 86.62 ms ◑