tx · H9FyRuu64kqrFWz1Dqp5a8g6tSUQPF8W3FG7nHi51rsn

3N6oQmUanp4TWuHnv5rma4WveVub63JRFB2:  -0.01100000 Waves

2024.08.31 00:03 [3262134] smart account 3N6oQmUanp4TWuHnv5rma4WveVub63JRFB2 > SELF 0.00000000 Waves

{ "type": 13, "id": "H9FyRuu64kqrFWz1Dqp5a8g6tSUQPF8W3FG7nHi51rsn", "fee": 1100000, "feeAssetId": null, "timestamp": 1725051836185, "version": 2, "chainId": 84, "sender": "3N6oQmUanp4TWuHnv5rma4WveVub63JRFB2", "senderPublicKey": "EM2pooK6eEzhzFXZFGd2phMRus6f1M5GxBsawNk9oi37", "proofs": [ "5wrEeefmy2rd4Z1rWsPVyLvGsr8Ettw6znQwJ9ZZ4DuaATbUUHjLRxNq9f4itsksQUrxmnr5CLh4DGDsFQwLcYsu" ], "script": "base64:BgIbCAISBAoCCAESBAoCAQESBgoECAEBGBIDCgEBNAAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAFWRlZmF1bHRSZXN0QWRkcmVzc1N0cgQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAIjM1BRQ3V2RmJ2aDRMa1BVbnJuVTF6M2puYkExcDltM1dOaHYDCQAAAgEBVAUHJG1hdGNoMAIjM011bWtHR3p0Q0tBWHBXRHF4a2Rkb2ZxWFNVYnFRa3ZTSnkJAAIBAg1Vbmtub3duIGNoYWluAANTRVACAl9fAAVNVUxUNgDAhD0ABU1VTFQ4AIDC1y8BD2dldFN0cmluZ09yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZmluZWQFA25pbAIAAQxnZXRJbnRPckVsc2UCA2tleQpkZWZ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YXRhQnlJZAEFCnByb3Bvc2FsSWQEC3VwZGF0ZWREYXRhCQCsAgIJAKwCAgkArwICBQtjdXJyZW50RGF0YQkBBXZhbHVlAQkAtwkCBQtjdXJyZW50RGF0YQUDU0VQBQNTRVACBHRydWUJAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCCQEZa2V5UHJvcG9zYWxTdGF0dXNEYXRhQnlJZAEFCnByb3Bvc2FsSWQFC3VwZGF0ZWREYXRhBQNuaWwFBHVuaXQASF+uaQ==", "height": 3262134, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EUCX7npdJ4Hc5d4Xqb12hE33xXdUyev2LfL986YWLjtZ Next: 3q7jAsWuBsuUJzicmoA7KZcxoK8HcXggrcpTnDppYZQt Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func keyUserGwlReleaseTime (userAddr) = ("%s%s__userGwlReleaseTime__" + userAddr)
5-
6-
74 let chain = take(drop(this.bytes, 1), 1)
85
96 let defaultRestAddressStr = match chain {
1916
2017 let MULT6 = 1000000
2118
19+let MULT8 = 100000000
20+
2221 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
2322
2423
2625
2726
2827 let IdxCfgStakingDapp = 1
28+
29+let IdxCfgAcresDapp = 8
2930
3031 func keyRestCfg () = "%s__restConfig"
3132
4546
4647 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
4748
49+let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
50+
4851 let IdxEffTotal = 0
4952
5053 let IdxEffUser = 1
54+
55+let idxEffAcresTotal = 2
56+
57+let idxEffAcresUser = 3
5158
5259 func keyResProportions () = "resTypesProportions"
5360
7683 let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
7784 [totalPower, usersPower]
7885 }
86+
87+
88+func getVerboseVotingPower (userAddrStrOrEmpty) = {
89+ let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
90+ func adder (acc,item) = (acc + parseIntValue(item))
91+
92+ let totalPieces = {
93+ let $l = props
94+ let $s = size($l)
95+ let $acc0 = 0
96+ func $f0_1 ($a,$i) = if (($i >= $s))
97+ then $a
98+ else adder($a, $l[$i])
99+
100+ func $f0_2 ($a,$i) = if (($i >= $s))
101+ then $a
102+ else throw("List size exceeds 6")
103+
104+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
105+ }
106+ let userPieces = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
107+ let totalAcres = valueOrElse(getInteger(acresContract, "acresStakedAmountTotal"), 0)
108+ let userAcres = valueOrElse(getInteger(acresContract, ("acresStakedAmountByUser_" + userAddrStrOrEmpty)), 0)
109+[totalPieces, userPieces, totalAcres, userAcres]
110+ }
111+
112+
113+func keyUserGwlReleaseTime (userAddr) = ("%s%s__userGwlReleaseTime__" + userAddr)
79114
80115
81116 let LISTSEP = ":"
204239 else if ((choice >= numOptions))
205240 then throw(("Unknown choice! Must be 0.." + toString((numOptions - 1))))
206241 else {
207- let eff = getVotingPower(userAddressStr)
208- let gwlAmt = eff[IdxEffUser]
242+ let eff = getVerboseVotingPower(userAddressStr)
243+ let gwlAmt = ((eff[IdxEffUser] * MULT8) + eff[idxEffAcresUser])
209244 if ((0 >= gwlAmt))
210- then throw("You need staked lands to vote")
245+ then throw("You need staked lands or ACRES to vote")
211246 else {
212- let gwlTotal = eff[IdxEffTotal]
213247 let oldChoice = getInteger(keyProposalChoiceByIdAndUser(proposalId, userAddressStr))
214248 let oldUserVotes = if (!(isDefined(oldChoice)))
215249 then 0
280314 then throw("Too few choices to vote")
281315 else {
282316 let eff = getVotingPower("")
283- let gPiecesTotal = eff[IdxEffTotal]
317+ let gAcresTotal = ((eff[IdxEffTotal] * MULT8) + eff[idxEffAcresTotal])
284318 let quorum = getIntOrElse(keyQuorumRequiredPercent(), DEFAULTQUORUM)
285- let quorumInGpieces = fraction(quorum, gPiecesTotal, MULT6)
319+ let quorumInGacres = fraction(quorum, gAcresTotal, MULT6)
286320 let proposalId = (getIntOrElse(keyLastProposalId(), 0) + 1)
287321 let optionsStr = makeString(optionsList, LISTSEP)
288- $Tuple2([IntegerEntry(keyLastProposalId(), proposalId), StringEntry(keyProposalStatusDataById(proposalId), statusData(false, 0, 0, 0, false)), StringEntry(keyProposalDataById(proposalId), proposalData(proposalTxId, toBase16String(toBytes(title)), proposalTime, votingStartTime, votingEndTime, quorumInGpieces, optionsStr))], proposalTxId)
322+ $Tuple2([IntegerEntry(keyLastProposalId(), proposalId), StringEntry(keyProposalStatusDataById(proposalId), statusData(false, 0, 0, 0, false)), StringEntry(keyProposalDataById(proposalId), proposalData(proposalTxId, toBase16String(toBytes(title)), proposalTime, votingStartTime, votingEndTime, quorumInGacres, optionsStr))], proposalTxId)
289323 }
290324 }
291325 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func keyUserGwlReleaseTime (userAddr) = ("%s%s__userGwlReleaseTime__" + userAddr)
5-
6-
74 let chain = take(drop(this.bytes, 1), 1)
85
96 let defaultRestAddressStr = match chain {
107 case _ =>
118 if ((base58'2W' == $match0))
129 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
1310 else if ((base58'2T' == $match0))
1411 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
1512 else throw("Unknown chain")
1613 }
1714
1815 let SEP = "__"
1916
2017 let MULT6 = 1000000
2118
19+let MULT8 = 100000000
20+
2221 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
2322
2423
2524 func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal)
2625
2726
2827 let IdxCfgStakingDapp = 1
28+
29+let IdxCfgAcresDapp = 8
2930
3031 func keyRestCfg () = "%s__restConfig"
3132
3233
3334 func keyRestAddress () = "%s__restAddr"
3435
3536
3637 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
3738
3839
3940 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
4041
4142
4243 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
4344
4445 let restCfg = readRestCfgOrFail(restContract)
4546
4647 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
4748
49+let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
50+
4851 let IdxEffTotal = 0
4952
5053 let IdxEffUser = 1
54+
55+let idxEffAcresTotal = 2
56+
57+let idxEffAcresUser = 3
5158
5259 func keyResProportions () = "resTypesProportions"
5360
5461
5562 func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr)
5663
5764
5865 func getVotingPower (userAddrStrOrEmpty) = {
5966 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
6067 func adder (acc,item) = (acc + parseIntValue(item))
6168
6269 let totalPower = {
6370 let $l = props
6471 let $s = size($l)
6572 let $acc0 = 0
6673 func $f0_1 ($a,$i) = if (($i >= $s))
6774 then $a
6875 else adder($a, $l[$i])
6976
7077 func $f0_2 ($a,$i) = if (($i >= $s))
7178 then $a
7279 else throw("List size exceeds 6")
7380
7481 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
7582 }
7683 let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
7784 [totalPower, usersPower]
7885 }
86+
87+
88+func getVerboseVotingPower (userAddrStrOrEmpty) = {
89+ let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
90+ func adder (acc,item) = (acc + parseIntValue(item))
91+
92+ let totalPieces = {
93+ let $l = props
94+ let $s = size($l)
95+ let $acc0 = 0
96+ func $f0_1 ($a,$i) = if (($i >= $s))
97+ then $a
98+ else adder($a, $l[$i])
99+
100+ func $f0_2 ($a,$i) = if (($i >= $s))
101+ then $a
102+ else throw("List size exceeds 6")
103+
104+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
105+ }
106+ let userPieces = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
107+ let totalAcres = valueOrElse(getInteger(acresContract, "acresStakedAmountTotal"), 0)
108+ let userAcres = valueOrElse(getInteger(acresContract, ("acresStakedAmountByUser_" + userAddrStrOrEmpty)), 0)
109+[totalPieces, userPieces, totalAcres, userAcres]
110+ }
111+
112+
113+func keyUserGwlReleaseTime (userAddr) = ("%s%s__userGwlReleaseTime__" + userAddr)
79114
80115
81116 let LISTSEP = ":"
82117
83118 let DEFAULTQUORUM = 500000
84119
85120 let MAXTITLE = 250
86121
87122 let MAXVOTINGTIME = 1209600000
88123
89124 let DEFAULTFIRSTPROPOSAL = 1
90125
91126 let govIdxStart = 4
92127
93128 let govIdxEnd = 5
94129
95130 let govIdxQuorum = 6
96131
97132 let govIdxOptions = 7
98133
99134 let govStatusIdxTotalVotes = 4
100135
101136 let govStatusIdxIsCanceled = 5
102137
103138 func keyQuorumRequiredPercent () = "%s__quorumRequired"
104139
105140
106141 func keyLastProposalId () = "%s__proposalId"
107142
108143
109144 func keyFirstProposalId () = "%s__firstProposalId"
110145
111146
112147 func keyProposalStatusDataById (proposalId) = ("%s%d__proposalStatusData__" + toString(proposalId))
113148
114149
115150 func keyProposalDataById (proposalId) = ("%s%d__proposalData__" + toString(proposalId))
116151
117152
118153 func keyProposalVotesByIdAndOption (proposalId,opt) = makeString(["%s%d%d", "votesByOpt", toString(proposalId), toString(opt)], SEP)
119154
120155
121156 func keyProposalVotesByIdAndUser (proposalId,userAddr) = makeString(["%s%d%s", "votesByUser", toString(proposalId), userAddr], SEP)
122157
123158
124159 func keyProposalChoiceByIdAndUser (proposalId,userAddr) = makeString(["%s%d%s", "optionByUser", toString(proposalId), userAddr], SEP)
125160
126161
127162 func keyNumUniqueVotersByProposalId (proposalId) = ("%s%d__numVoters__" + toString(proposalId))
128163
129164
130165 func keyStatsAverUniqueVoters () = "%s%s%s__stats__avg__uniqueVoters"
131166
132167
133168 func keyStatsAverGwlVoted () = "%s%s%s__stats__avg__gwlVoted"
134169
135170
136171 func statusData (isVotingValid,winOption,winOptionVotes,totalVotes,canceledByTeam) = makeString(["%b%d%d%d%b", toString(isVotingValid), toString(winOption), toString(winOptionVotes), toString(totalVotes), toString(canceledByTeam)], SEP)
137172
138173
139174 func proposalData (proposalTxId,title,proposalTime,votingStartTime,votingEndTime,quorumInGwl,options) = makeString_2C(["%s%s%d%d%d%d%s", proposalTxId, title, toString(proposalTime), toString(votingStartTime), toString(votingEndTime), toString(quorumInGwl), options], SEP)
140175
141176
142177 func calcWinOption (proposalId,optionsList,isPrevOptional,oldChoice,optionalTotalOld,newChoice,newTotalByNewChoice) = {
143178 func findBest (acc,elem) = {
144179 let idx = value(indexOf(optionsList, elem))
145180 let val = if (isPrevOptional)
146181 then if ((idx == newChoice))
147182 then newTotalByNewChoice
148183 else getIntOrElse(keyProposalVotesByIdAndOption(proposalId, idx), 0)
149184 else if ((idx == value(oldChoice)))
150185 then optionalTotalOld
151186 else if ((idx == newChoice))
152187 then newTotalByNewChoice
153188 else getIntOrElse(keyProposalVotesByIdAndOption(proposalId, idx), 0)
154189 if ((acc._2 > val))
155190 then acc
156191 else $Tuple2(idx, val)
157192 }
158193
159194 let $l = optionsList
160195 let $s = size($l)
161196 let $acc0 = $Tuple2(0, 0)
162197 func $f0_1 ($a,$i) = if (($i >= $s))
163198 then $a
164199 else findBest($a, $l[$i])
165200
166201 func $f0_2 ($a,$i) = if (($i >= $s))
167202 then $a
168203 else throw("List size exceeds 10")
169204
170205 $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)
171206 }
172207
173208
174209 func updateStatusData (isCanceledStr,isValid,newWinOpt,newTotalVotes) = makeString(["%b%d%d%d%b", toString(isValid), toString(newWinOpt._1), toString(newWinOpt._2), toString(newTotalVotes), isCanceledStr], SEP)
175210
176211
177212 @Callable(i)
178213 func constructorV1 (restAddr,quorumReqPerc) = if ((i.caller != this))
179214 then throw("Permission denied")
180215 else [StringEntry(keyRestAddress(), restAddr), IntegerEntry(keyQuorumRequiredPercent(), quorumReqPerc)]
181216
182217
183218
184219 @Callable(i)
185220 func castVote (proposalId,choice) = {
186221 let userAddressStr = toString(i.caller)
187222 let dynamicData = split(getStringOrFail(this, keyProposalStatusDataById(proposalId)), SEP)
188223 if ((dynamicData[govStatusIdxIsCanceled] == "true"))
189224 then throw("Voting is canceled by team")
190225 else {
191226 let propData = split_4C(getStringOrFail(this, keyProposalDataById(proposalId)), SEP)
192227 let start = parseIntValue(propData[govIdxStart])
193228 let end = parseIntValue(propData[govIdxEnd])
194229 let now = lastBlock.timestamp
195230 if ((start > now))
196231 then throw("Voting not started yet")
197232 else if ((now >= end))
198233 then throw("Voting already finished")
199234 else {
200235 let availableOptions = split(propData[govIdxOptions], LISTSEP)
201236 let numOptions = size(availableOptions)
202237 if ((1 >= numOptions))
203238 then throw("Too few choices to vote")
204239 else if ((choice >= numOptions))
205240 then throw(("Unknown choice! Must be 0.." + toString((numOptions - 1))))
206241 else {
207- let eff = getVotingPower(userAddressStr)
208- let gwlAmt = eff[IdxEffUser]
242+ let eff = getVerboseVotingPower(userAddressStr)
243+ let gwlAmt = ((eff[IdxEffUser] * MULT8) + eff[idxEffAcresUser])
209244 if ((0 >= gwlAmt))
210- then throw("You need staked lands to vote")
245+ then throw("You need staked lands or ACRES to vote")
211246 else {
212- let gwlTotal = eff[IdxEffTotal]
213247 let oldChoice = getInteger(keyProposalChoiceByIdAndUser(proposalId, userAddressStr))
214248 let oldUserVotes = if (!(isDefined(oldChoice)))
215249 then 0
216250 else getIntOrElse(keyProposalVotesByIdAndUser(proposalId, userAddressStr), 0)
217251 let oldTotalByOldChoice = if (isDefined(oldChoice))
218252 then getIntOrElse(keyProposalVotesByIdAndOption(proposalId, value(oldChoice)), 0)
219253 else 0
220254 let oldTotalByNewChoice = getIntOrElse(keyProposalVotesByIdAndOption(proposalId, choice), 0)
221255 let oldTotal = parseIntValue(dynamicData[govStatusIdxTotalVotes])
222256 let newTotalByOldChoice = if (!(isDefined(oldChoice)))
223257 then 0
224258 else ((oldTotalByOldChoice - oldUserVotes) + (if ((value(oldChoice) == choice))
225259 then gwlAmt
226260 else 0))
227261 let newTotalByNewChoice = if (if (isDefined(oldChoice))
228262 then (value(oldChoice) == choice)
229263 else false)
230264 then newTotalByOldChoice
231265 else (oldTotalByNewChoice + gwlAmt)
232266 let newTotal = ((oldTotal - oldUserVotes) + gwlAmt)
233267 let isQuorumReached = (newTotal >= parseIntValue(propData[govIdxQuorum]))
234268 let numVotersByProposalId = getIntOrElse(keyNumUniqueVotersByProposalId(proposalId), 0)
235269 let oldAverUniqueVoters6 = getIntOrElse(keyStatsAverUniqueVoters(), 0)
236270 let numProposals = ((getIntegerValue(keyLastProposalId()) - valueOrElse(getInteger(keyFirstProposalId()), DEFAULTFIRSTPROPOSAL)) + 1)
237271 let uniqueDiff = if ((oldUserVotes == 0))
238272 then 1
239273 else 0
240274 let newAverUniqueVoters6 = (oldAverUniqueVoters6 + fraction(uniqueDiff, MULT6, numProposals))
241275 let oldAverGwl = getIntOrElse(keyStatsAverGwlVoted(), 0)
242276 let newAverGwl = (oldAverGwl + ((gwlAmt - oldUserVotes) / numProposals))
243277 let isPrevOptional = if (!(isDefined(oldChoice)))
244278 then true
245279 else (value(oldChoice) == choice)
246280 let optionalTotalOld = if (isPrevOptional)
247281 then nil
248282 else [IntegerEntry(keyProposalVotesByIdAndOption(proposalId, value(oldChoice)), newTotalByOldChoice)]
249283 let winOpt = calcWinOption(proposalId, availableOptions, isPrevOptional, oldChoice, newTotalByOldChoice, choice, newTotalByNewChoice)
250284 let releaseTime = max([end, getIntOrElse(keyUserGwlReleaseTime(userAddressStr), 0)])
251285 $Tuple2(([IntegerEntry(keyProposalChoiceByIdAndUser(proposalId, userAddressStr), choice), IntegerEntry(keyProposalVotesByIdAndUser(proposalId, userAddressStr), gwlAmt), IntegerEntry(keyProposalVotesByIdAndOption(proposalId, choice), newTotalByNewChoice), IntegerEntry(keyNumUniqueVotersByProposalId(proposalId), (numVotersByProposalId + uniqueDiff)), IntegerEntry(keyUserGwlReleaseTime(userAddressStr), releaseTime), IntegerEntry(keyStatsAverUniqueVoters(), newAverUniqueVoters6), IntegerEntry(keyStatsAverGwlVoted(), newAverGwl), StringEntry(keyProposalStatusDataById(proposalId), updateStatusData(dynamicData[govStatusIdxIsCanceled], isQuorumReached, winOpt, newTotal))] ++ optionalTotalOld), unit)
252286 }
253287 }
254288 }
255289 }
256290 }
257291
258292
259293
260294 @Callable(i)
261295 func initiateVoting (title,votingStartTime,votingEndTime,optionsList) = if ((i.caller != this))
262296 then throw("Permission denied")
263297 else if ((size(i.payments) != 0))
264298 then throw("governance doesn't require any payments")
265299 else {
266300 let proposalTxId = toBase58String(i.transactionId)
267301 if ((title == ""))
268302 then throw("Title is empty")
269303 else if ((size(title) > MAXTITLE))
270304 then throw("Too long title")
271305 else {
272306 let proposalTime = lastBlock.timestamp
273307 if ((proposalTime > votingStartTime))
274308 then throw(((("votingStartTime=" + toString(votingStartTime)) + " < proposalTime=") + toString(proposalTime)))
275309 else if ((votingStartTime > votingEndTime))
276310 then throw(((("votingEndTime=" + toString(votingEndTime)) + " < votingStartTime=") + toString(votingStartTime)))
277311 else if (((votingEndTime - votingStartTime) > MAXVOTINGTIME))
278312 then throw(((("Voting period exceeds max: " + toString((votingEndTime - votingStartTime))) + " > ") + toString(MAXVOTINGTIME)))
279313 else if ((1 >= size(optionsList)))
280314 then throw("Too few choices to vote")
281315 else {
282316 let eff = getVotingPower("")
283- let gPiecesTotal = eff[IdxEffTotal]
317+ let gAcresTotal = ((eff[IdxEffTotal] * MULT8) + eff[idxEffAcresTotal])
284318 let quorum = getIntOrElse(keyQuorumRequiredPercent(), DEFAULTQUORUM)
285- let quorumInGpieces = fraction(quorum, gPiecesTotal, MULT6)
319+ let quorumInGacres = fraction(quorum, gAcresTotal, MULT6)
286320 let proposalId = (getIntOrElse(keyLastProposalId(), 0) + 1)
287321 let optionsStr = makeString(optionsList, LISTSEP)
288- $Tuple2([IntegerEntry(keyLastProposalId(), proposalId), StringEntry(keyProposalStatusDataById(proposalId), statusData(false, 0, 0, 0, false)), StringEntry(keyProposalDataById(proposalId), proposalData(proposalTxId, toBase16String(toBytes(title)), proposalTime, votingStartTime, votingEndTime, quorumInGpieces, optionsStr))], proposalTxId)
322+ $Tuple2([IntegerEntry(keyLastProposalId(), proposalId), StringEntry(keyProposalStatusDataById(proposalId), statusData(false, 0, 0, 0, false)), StringEntry(keyProposalDataById(proposalId), proposalData(proposalTxId, toBase16String(toBytes(title)), proposalTime, votingStartTime, votingEndTime, quorumInGacres, optionsStr))], proposalTxId)
289323 }
290324 }
291325 }
292326
293327
294328
295329 @Callable(i)
296330 func cancelVoting (proposalId) = if ((i.caller != this))
297331 then throw("not authorized")
298332 else {
299333 let currentData = getStringOrFail(this, keyProposalStatusDataById(proposalId))
300334 let updatedData = ((take(currentData, value(lastIndexOf(currentData, SEP))) + SEP) + "true")
301335 $Tuple2([StringEntry(keyProposalStatusDataById(proposalId), updatedData)], unit)
302336 }
303337
304338

github/deemru/w8io/169f3d6 
46.57 ms