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