tx · 3q7jAsWuBsuUJzicmoA7KZcxoK8HcXggrcpTnDppYZQt

3N6oQmUanp4TWuHnv5rma4WveVub63JRFB2:  -0.01100000 Waves

2024.08.31 12:34 [3262878] smart account 3N6oQmUanp4TWuHnv5rma4WveVub63JRFB2 > SELF 0.00000000 Waves

{ "type": 13, "id": "3q7jAsWuBsuUJzicmoA7KZcxoK8HcXggrcpTnDppYZQt", "fee": 1100000, "feeAssetId": null, "timestamp": 1725096906874, "version": 2, "chainId": 84, "sender": "3N6oQmUanp4TWuHnv5rma4WveVub63JRFB2", "senderPublicKey": "EM2pooK6eEzhzFXZFGd2phMRus6f1M5GxBsawNk9oi37", "proofs": [ "5G2L2UwQfp8dGFFRfujJEa17Wrv5C3hygSuGsALzwTsQAX9bzskmWG5jxPyXhr8wkj6orwr28SQoFEhAoTdCTTRm" ], "script": "base64:BgIbCAISBAoCCAESBAoCAQESBgoECAEBGBIDCgEBMwAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAFWRlZmF1bHRSZXN0QWRkcmVzc1N0cgQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAIjM1BRQ3V2RmJ2aDRMa1BVbnJuVTF6M2puYkExcDltM1dOaHYDCQAAAgEBVAUHJG1hdGNoMAIjM011bWtHR3p0Q0tBWHBXRHF4a2Rkb2ZxWFNVYnFRa3ZTSnkJAAIBAg1Vbmtub3duIGNoYWluAANTRVACAl9fAAVNVUxUNgDAhD0ABU1VTFQ4AIDC1y8BD2dldFN0cmluZ09yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZmluZWQFA25pbAIAAQxnZXRJbnRPckVsc2UCA2tleQpkZWZhdWx0VmF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WxUeElkCQDcBAEJAJsDAQUFdGl0bGUFDHByb3Bvc2FsVGltZQUPdm90aW5nU3RhcnRUaW1lBQ12b3RpbmdFbmRUaW1lBQ5xdW9ydW1JbkdhY3JlcwUKb3B0aW9uc1N0cgUDbmlsBQxwcm9wb3NhbFR4SWQBaQEMY2FuY2VsVm90aW5nAQpwcm9wb3NhbElkAwkBAiE9AggFAWkGY2FsbGVyBQR0aGlzCQACAQIObm90IGF1dGhvcml6ZWQEC2N1cnJlbnREYXRhCQEPZ2V0U3RyaW5nT3JGYWlsAgUEdGhpcwkBGWtleVByb3Bvc2FsU3RhdHVzRGF0YUJ5SWQBBQpwcm9wb3NhbElkBAt1cGRhdGVkRGF0YQkArAICCQCsAgIJAK8CAgULY3VycmVudERhdGEJAQV2YWx1ZQEJALcJAgULY3VycmVudERhdGEFA1NFUAUDU0VQAgR0cnVlCQCUCgIJAMwIAgkBC1N0cmluZ0VudHJ5AgkBGWtleVByb3Bvc2FsU3RhdHVzRGF0YUJ5SWQBBQpwcm9wb3NhbElkBQt1cGRhdGVkRGF0YQUDbmlsBQR1bml0ALZzKtk=", "height": 3262878, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H9FyRuu64kqrFWz1Dqp5a8g6tSUQPF8W3FG7nHi51rsn Next: HdrudhNgHpFRYXSbMwKgoapzBm9o99PjSeQZb4QChkVS Diff:
OldNewDifferences
6060
6161
6262 func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr)
63-
64-
65-func getVotingPower (userAddrStrOrEmpty) = {
66- let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
67- func adder (acc,item) = (acc + parseIntValue(item))
68-
69- let totalPower = {
70- let $l = props
71- let $s = size($l)
72- let $acc0 = 0
73- func $f0_1 ($a,$i) = if (($i >= $s))
74- then $a
75- else adder($a, $l[$i])
76-
77- func $f0_2 ($a,$i) = if (($i >= $s))
78- then $a
79- else throw("List size exceeds 6")
80-
81- $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
82- }
83- let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
84-[totalPower, usersPower]
85- }
8663
8764
8865 func getVerboseVotingPower (userAddrStrOrEmpty) = {
313290 else if ((1 >= size(optionsList)))
314291 then throw("Too few choices to vote")
315292 else {
316- let eff = getVotingPower("")
293+ let eff = getVerboseVotingPower("")
317294 let gAcresTotal = ((eff[IdxEffTotal] * MULT8) + eff[idxEffAcresTotal])
318295 let quorum = getIntOrElse(keyQuorumRequiredPercent(), DEFAULTQUORUM)
319296 let quorumInGacres = fraction(quorum, gAcresTotal, MULT6)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let chain = take(drop(this.bytes, 1), 1)
55
66 let defaultRestAddressStr = match chain {
77 case _ =>
88 if ((base58'2W' == $match0))
99 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
1010 else if ((base58'2T' == $match0))
1111 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
1212 else throw("Unknown chain")
1313 }
1414
1515 let SEP = "__"
1616
1717 let MULT6 = 1000000
1818
1919 let MULT8 = 100000000
2020
2121 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
2222
2323
2424 func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal)
2525
2626
2727 let IdxCfgStakingDapp = 1
2828
2929 let IdxCfgAcresDapp = 8
3030
3131 func keyRestCfg () = "%s__restConfig"
3232
3333
3434 func keyRestAddress () = "%s__restAddr"
3535
3636
3737 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
3838
3939
4040 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
4141
4242
4343 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
4444
4545 let restCfg = readRestCfgOrFail(restContract)
4646
4747 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
4848
4949 let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
5050
5151 let IdxEffTotal = 0
5252
5353 let IdxEffUser = 1
5454
5555 let idxEffAcresTotal = 2
5656
5757 let idxEffAcresUser = 3
5858
5959 func keyResProportions () = "resTypesProportions"
6060
6161
6262 func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr)
63-
64-
65-func getVotingPower (userAddrStrOrEmpty) = {
66- let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
67- func adder (acc,item) = (acc + parseIntValue(item))
68-
69- let totalPower = {
70- let $l = props
71- let $s = size($l)
72- let $acc0 = 0
73- func $f0_1 ($a,$i) = if (($i >= $s))
74- then $a
75- else adder($a, $l[$i])
76-
77- func $f0_2 ($a,$i) = if (($i >= $s))
78- then $a
79- else throw("List size exceeds 6")
80-
81- $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
82- }
83- let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
84-[totalPower, usersPower]
85- }
8663
8764
8865 func getVerboseVotingPower (userAddrStrOrEmpty) = {
8966 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
9067 func adder (acc,item) = (acc + parseIntValue(item))
9168
9269 let totalPieces = {
9370 let $l = props
9471 let $s = size($l)
9572 let $acc0 = 0
9673 func $f0_1 ($a,$i) = if (($i >= $s))
9774 then $a
9875 else adder($a, $l[$i])
9976
10077 func $f0_2 ($a,$i) = if (($i >= $s))
10178 then $a
10279 else throw("List size exceeds 6")
10380
10481 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
10582 }
10683 let userPieces = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
10784 let totalAcres = valueOrElse(getInteger(acresContract, "acresStakedAmountTotal"), 0)
10885 let userAcres = valueOrElse(getInteger(acresContract, ("acresStakedAmountByUser_" + userAddrStrOrEmpty)), 0)
10986 [totalPieces, userPieces, totalAcres, userAcres]
11087 }
11188
11289
11390 func keyUserGwlReleaseTime (userAddr) = ("%s%s__userGwlReleaseTime__" + userAddr)
11491
11592
11693 let LISTSEP = ":"
11794
11895 let DEFAULTQUORUM = 500000
11996
12097 let MAXTITLE = 250
12198
12299 let MAXVOTINGTIME = 1209600000
123100
124101 let DEFAULTFIRSTPROPOSAL = 1
125102
126103 let govIdxStart = 4
127104
128105 let govIdxEnd = 5
129106
130107 let govIdxQuorum = 6
131108
132109 let govIdxOptions = 7
133110
134111 let govStatusIdxTotalVotes = 4
135112
136113 let govStatusIdxIsCanceled = 5
137114
138115 func keyQuorumRequiredPercent () = "%s__quorumRequired"
139116
140117
141118 func keyLastProposalId () = "%s__proposalId"
142119
143120
144121 func keyFirstProposalId () = "%s__firstProposalId"
145122
146123
147124 func keyProposalStatusDataById (proposalId) = ("%s%d__proposalStatusData__" + toString(proposalId))
148125
149126
150127 func keyProposalDataById (proposalId) = ("%s%d__proposalData__" + toString(proposalId))
151128
152129
153130 func keyProposalVotesByIdAndOption (proposalId,opt) = makeString(["%s%d%d", "votesByOpt", toString(proposalId), toString(opt)], SEP)
154131
155132
156133 func keyProposalVotesByIdAndUser (proposalId,userAddr) = makeString(["%s%d%s", "votesByUser", toString(proposalId), userAddr], SEP)
157134
158135
159136 func keyProposalChoiceByIdAndUser (proposalId,userAddr) = makeString(["%s%d%s", "optionByUser", toString(proposalId), userAddr], SEP)
160137
161138
162139 func keyNumUniqueVotersByProposalId (proposalId) = ("%s%d__numVoters__" + toString(proposalId))
163140
164141
165142 func keyStatsAverUniqueVoters () = "%s%s%s__stats__avg__uniqueVoters"
166143
167144
168145 func keyStatsAverGwlVoted () = "%s%s%s__stats__avg__gwlVoted"
169146
170147
171148 func statusData (isVotingValid,winOption,winOptionVotes,totalVotes,canceledByTeam) = makeString(["%b%d%d%d%b", toString(isVotingValid), toString(winOption), toString(winOptionVotes), toString(totalVotes), toString(canceledByTeam)], SEP)
172149
173150
174151 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)
175152
176153
177154 func calcWinOption (proposalId,optionsList,isPrevOptional,oldChoice,optionalTotalOld,newChoice,newTotalByNewChoice) = {
178155 func findBest (acc,elem) = {
179156 let idx = value(indexOf(optionsList, elem))
180157 let val = if (isPrevOptional)
181158 then if ((idx == newChoice))
182159 then newTotalByNewChoice
183160 else getIntOrElse(keyProposalVotesByIdAndOption(proposalId, idx), 0)
184161 else if ((idx == value(oldChoice)))
185162 then optionalTotalOld
186163 else if ((idx == newChoice))
187164 then newTotalByNewChoice
188165 else getIntOrElse(keyProposalVotesByIdAndOption(proposalId, idx), 0)
189166 if ((acc._2 > val))
190167 then acc
191168 else $Tuple2(idx, val)
192169 }
193170
194171 let $l = optionsList
195172 let $s = size($l)
196173 let $acc0 = $Tuple2(0, 0)
197174 func $f0_1 ($a,$i) = if (($i >= $s))
198175 then $a
199176 else findBest($a, $l[$i])
200177
201178 func $f0_2 ($a,$i) = if (($i >= $s))
202179 then $a
203180 else throw("List size exceeds 10")
204181
205182 $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)
206183 }
207184
208185
209186 func updateStatusData (isCanceledStr,isValid,newWinOpt,newTotalVotes) = makeString(["%b%d%d%d%b", toString(isValid), toString(newWinOpt._1), toString(newWinOpt._2), toString(newTotalVotes), isCanceledStr], SEP)
210187
211188
212189 @Callable(i)
213190 func constructorV1 (restAddr,quorumReqPerc) = if ((i.caller != this))
214191 then throw("Permission denied")
215192 else [StringEntry(keyRestAddress(), restAddr), IntegerEntry(keyQuorumRequiredPercent(), quorumReqPerc)]
216193
217194
218195
219196 @Callable(i)
220197 func castVote (proposalId,choice) = {
221198 let userAddressStr = toString(i.caller)
222199 let dynamicData = split(getStringOrFail(this, keyProposalStatusDataById(proposalId)), SEP)
223200 if ((dynamicData[govStatusIdxIsCanceled] == "true"))
224201 then throw("Voting is canceled by team")
225202 else {
226203 let propData = split_4C(getStringOrFail(this, keyProposalDataById(proposalId)), SEP)
227204 let start = parseIntValue(propData[govIdxStart])
228205 let end = parseIntValue(propData[govIdxEnd])
229206 let now = lastBlock.timestamp
230207 if ((start > now))
231208 then throw("Voting not started yet")
232209 else if ((now >= end))
233210 then throw("Voting already finished")
234211 else {
235212 let availableOptions = split(propData[govIdxOptions], LISTSEP)
236213 let numOptions = size(availableOptions)
237214 if ((1 >= numOptions))
238215 then throw("Too few choices to vote")
239216 else if ((choice >= numOptions))
240217 then throw(("Unknown choice! Must be 0.." + toString((numOptions - 1))))
241218 else {
242219 let eff = getVerboseVotingPower(userAddressStr)
243220 let gwlAmt = ((eff[IdxEffUser] * MULT8) + eff[idxEffAcresUser])
244221 if ((0 >= gwlAmt))
245222 then throw("You need staked lands or ACRES to vote")
246223 else {
247224 let oldChoice = getInteger(keyProposalChoiceByIdAndUser(proposalId, userAddressStr))
248225 let oldUserVotes = if (!(isDefined(oldChoice)))
249226 then 0
250227 else getIntOrElse(keyProposalVotesByIdAndUser(proposalId, userAddressStr), 0)
251228 let oldTotalByOldChoice = if (isDefined(oldChoice))
252229 then getIntOrElse(keyProposalVotesByIdAndOption(proposalId, value(oldChoice)), 0)
253230 else 0
254231 let oldTotalByNewChoice = getIntOrElse(keyProposalVotesByIdAndOption(proposalId, choice), 0)
255232 let oldTotal = parseIntValue(dynamicData[govStatusIdxTotalVotes])
256233 let newTotalByOldChoice = if (!(isDefined(oldChoice)))
257234 then 0
258235 else ((oldTotalByOldChoice - oldUserVotes) + (if ((value(oldChoice) == choice))
259236 then gwlAmt
260237 else 0))
261238 let newTotalByNewChoice = if (if (isDefined(oldChoice))
262239 then (value(oldChoice) == choice)
263240 else false)
264241 then newTotalByOldChoice
265242 else (oldTotalByNewChoice + gwlAmt)
266243 let newTotal = ((oldTotal - oldUserVotes) + gwlAmt)
267244 let isQuorumReached = (newTotal >= parseIntValue(propData[govIdxQuorum]))
268245 let numVotersByProposalId = getIntOrElse(keyNumUniqueVotersByProposalId(proposalId), 0)
269246 let oldAverUniqueVoters6 = getIntOrElse(keyStatsAverUniqueVoters(), 0)
270247 let numProposals = ((getIntegerValue(keyLastProposalId()) - valueOrElse(getInteger(keyFirstProposalId()), DEFAULTFIRSTPROPOSAL)) + 1)
271248 let uniqueDiff = if ((oldUserVotes == 0))
272249 then 1
273250 else 0
274251 let newAverUniqueVoters6 = (oldAverUniqueVoters6 + fraction(uniqueDiff, MULT6, numProposals))
275252 let oldAverGwl = getIntOrElse(keyStatsAverGwlVoted(), 0)
276253 let newAverGwl = (oldAverGwl + ((gwlAmt - oldUserVotes) / numProposals))
277254 let isPrevOptional = if (!(isDefined(oldChoice)))
278255 then true
279256 else (value(oldChoice) == choice)
280257 let optionalTotalOld = if (isPrevOptional)
281258 then nil
282259 else [IntegerEntry(keyProposalVotesByIdAndOption(proposalId, value(oldChoice)), newTotalByOldChoice)]
283260 let winOpt = calcWinOption(proposalId, availableOptions, isPrevOptional, oldChoice, newTotalByOldChoice, choice, newTotalByNewChoice)
284261 let releaseTime = max([end, getIntOrElse(keyUserGwlReleaseTime(userAddressStr), 0)])
285262 $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)
286263 }
287264 }
288265 }
289266 }
290267 }
291268
292269
293270
294271 @Callable(i)
295272 func initiateVoting (title,votingStartTime,votingEndTime,optionsList) = if ((i.caller != this))
296273 then throw("Permission denied")
297274 else if ((size(i.payments) != 0))
298275 then throw("governance doesn't require any payments")
299276 else {
300277 let proposalTxId = toBase58String(i.transactionId)
301278 if ((title == ""))
302279 then throw("Title is empty")
303280 else if ((size(title) > MAXTITLE))
304281 then throw("Too long title")
305282 else {
306283 let proposalTime = lastBlock.timestamp
307284 if ((proposalTime > votingStartTime))
308285 then throw(((("votingStartTime=" + toString(votingStartTime)) + " < proposalTime=") + toString(proposalTime)))
309286 else if ((votingStartTime > votingEndTime))
310287 then throw(((("votingEndTime=" + toString(votingEndTime)) + " < votingStartTime=") + toString(votingStartTime)))
311288 else if (((votingEndTime - votingStartTime) > MAXVOTINGTIME))
312289 then throw(((("Voting period exceeds max: " + toString((votingEndTime - votingStartTime))) + " > ") + toString(MAXVOTINGTIME)))
313290 else if ((1 >= size(optionsList)))
314291 then throw("Too few choices to vote")
315292 else {
316- let eff = getVotingPower("")
293+ let eff = getVerboseVotingPower("")
317294 let gAcresTotal = ((eff[IdxEffTotal] * MULT8) + eff[idxEffAcresTotal])
318295 let quorum = getIntOrElse(keyQuorumRequiredPercent(), DEFAULTQUORUM)
319296 let quorumInGacres = fraction(quorum, gAcresTotal, MULT6)
320297 let proposalId = (getIntOrElse(keyLastProposalId(), 0) + 1)
321298 let optionsStr = makeString(optionsList, LISTSEP)
322299 $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)
323300 }
324301 }
325302 }
326303
327304
328305
329306 @Callable(i)
330307 func cancelVoting (proposalId) = if ((i.caller != this))
331308 then throw("not authorized")
332309 else {
333310 let currentData = getStringOrFail(this, keyProposalStatusDataById(proposalId))
334311 let updatedData = ((take(currentData, value(lastIndexOf(currentData, SEP))) + SEP) + "true")
335312 $Tuple2([StringEntry(keyProposalStatusDataById(proposalId), updatedData)], unit)
336313 }
337314
338315

github/deemru/w8io/169f3d6 
74.06 ms