tx · 8BtWfTksDrcodFa3aCMbnt7DuXESFgbnX5Dk6jDrwevW 3MyVvNfXht9piazyf1e5BVFsqv1R7z5cWJL: -0.02000000 Waves 2022.06.06 17:31 [2084618] smart account 3MyVvNfXht9piazyf1e5BVFsqv1R7z5cWJL > SELF 0.00000000 Waves
{ "type": 13, "id": "8BtWfTksDrcodFa3aCMbnt7DuXESFgbnX5Dk6jDrwevW", "fee": 2000000, "feeAssetId": null, "timestamp": 1654525873518, "version": 1, "sender": "3MyVvNfXht9piazyf1e5BVFsqv1R7z5cWJL", "senderPublicKey": "DnPyGWCgpQChvoQrnXQRcC9FtN32mPGrcog2wcKHdkVn", "proofs": [ "3XmV6fjKG5wNtMZZYshJLrgH9dfUiZGDUFPTJRsqbbqGtpFVL8pkNYrRvNQQa3rrinFNBND3oS1L9v1gQZvdNDy8" ], "script": "base64:AAIFAAAAAAAAADUIAhIDCgEIEgASBAoCCAESBQoDCAgBEgQKAggIEgUKAwgIARIECgIICBIDCgEBEgASAwoBCAAAAB4AAAAACXNlcGFyYXRvcgIAAAACX18AAAAADmtleUVwb2NoTGVuZ3RoCQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAALZXBvY2hMZW5ndGgFAAAAA25pbAUAAAAJc2VwYXJhdG9yAAAAAA9rZXlDdXJyZW50RXBvY2gJAAS5AAAAAgkABEwAAAACAgAAAAIlcwkABEwAAAACAgAAAAxjdXJyZW50RXBvY2gFAAAAA25pbAUAAAAJc2VwYXJhdG9yAAAAAA5rZXlTdGFydEhlaWdodAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAAC3N0YXJ0SGVpZ2h0BQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAAia2V5Vm90aW5nRW1pc3Npb25DYW5kaWRhdGVDb250cmFjdAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAAH3ZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QFAAAAA25p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AAAgUAAAADbmlsBQAAAAR1bml0AAAAAWkBAAAAEm9uVmVyaWZpY2F0aW9uTG9zcwAAAAEAAAAHYXNzZXRJZAkABRQAAAACBQAAAANuaWwFAAAABHVuaXQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAA90YXJnZXRQdWJsaWNLZXkEAAAAByRtYXRjaDAJAQAAABZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAAAAAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAACcGsFAAAAByRtYXRjaDAFAAAAAnBrAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0CAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPdGFyZ2V0UHVibGljS2V5k2Xusw==", "chainId": 84, "height": 2084618, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AcP9fHThEBmPtsUuoQ7o4yrnxLXhSXkaAKGnc3jRNGvr Next: 2ckhnPmFDhBrmzLc95dfUtfFKT4RYizrSE15CyVDUmSu Diff:
Old | New | Differences | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | - | ||
6 | - | let maxShare = 100 | |
7 | 5 | ||
8 | 6 | let keyEpochLength = makeString(["%s", "epochLength"], separator) | |
9 | 7 | ||
16 | 14 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
17 | 15 | ||
18 | 16 | func keyInList (pool) = { | |
19 | - | let $ | |
20 | - | let amountAssetId = $ | |
21 | - | let priceAssetId = $ | |
17 | + | let $t0575615 = pool | |
18 | + | let amountAssetId = $t0575615._1 | |
19 | + | let priceAssetId = $t0575615._2 | |
22 | 20 | makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator) | |
23 | 21 | } | |
24 | 22 | ||
25 | 23 | ||
26 | - | func | |
24 | + | func keyUsed (address,epoch) = makeString(["%s%s%d", "used", toString(address), toString(epoch)], separator) | |
27 | 25 | ||
28 | 26 | ||
29 | - | func | |
30 | - | let $ | |
31 | - | let amountAssetId = $ | |
32 | - | let priceAssetId = $ | |
33 | - | makeString(["%s%s%s%s", " | |
27 | + | func keyVote (address,pool,epoch) = { | |
28 | + | let $t0889929 = pool | |
29 | + | let amountAssetId = $t0889929._1 | |
30 | + | let priceAssetId = $t0889929._2 | |
31 | + | makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], separator) | |
34 | 32 | } | |
35 | 33 | ||
36 | 34 | ||
37 | - | func keyVotingResult (pool) = { | |
38 | - | let $ | |
39 | - | let amountAssetId = $ | |
40 | - | let priceAssetId = $ | |
41 | - | makeString(["%s%s%s", "votingResult", amountAssetId, priceAssetId], separator) | |
35 | + | func keyVotingResult (pool,epoch) = { | |
36 | + | let $t011111151 = pool | |
37 | + | let amountAssetId = $t011111151._1 | |
38 | + | let priceAssetId = $t011111151._2 | |
39 | + | makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], separator) | |
42 | 40 | } | |
41 | + | ||
42 | + | ||
43 | + | func keyTotalVotes (epoch) = makeString(["%s%d", "totalVotes", toString(epoch)], separator) | |
43 | 44 | ||
44 | 45 | ||
45 | 46 | func getValueOrFail (address,key,type) = { | |
71 | 72 | } | |
72 | 73 | ||
73 | 74 | ||
74 | - | ||
75 | + | func poolToString (pool) = ((pool._1 + separator) + pool._2) | |
75 | 76 | ||
76 | - | func getVotesListName (pool) = { | |
77 | - | let $t021122152 = pool | |
78 | - | let amountAssetId = $t021122152._1 | |
79 | - | let priceAssetId = $t021122152._2 | |
80 | - | makeString(["%s%s__votes", amountAssetId, priceAssetId], separator) | |
77 | + | ||
78 | + | func stringToPool (str) = { | |
79 | + | let parts = split(str, separator) | |
80 | + | if ((size(parts) == 2)) | |
81 | + | then $Tuple2(parts[0], parts[1]) | |
82 | + | else throw("invalid pool string") | |
81 | 83 | } | |
82 | 84 | ||
83 | 85 | ||
84 | - | func keyListHead (listName) = makeString([("%s%s" + listName), "head"], separator) | |
86 | + | let poolsListName = "pools" | |
87 | + | ||
88 | + | func getVotesListName (pool) = { | |
89 | + | let $t022602300 = pool | |
90 | + | let amountAssetId = $t022602300._1 | |
91 | + | let priceAssetId = $t022602300._2 | |
92 | + | makeString(["votes", amountAssetId, priceAssetId], separator) | |
93 | + | } | |
85 | 94 | ||
86 | 95 | ||
87 | - | func keyListSize (listName) = makeString([("%s%s" + listName), "size"], separator) | |
96 | + | func keyListHead (listName) = { | |
97 | + | let meta = if ((listName == poolsListName)) | |
98 | + | then "%s%s" | |
99 | + | else "%s%s%s%s" | |
100 | + | makeString([meta, listName, "head"], separator) | |
101 | + | } | |
88 | 102 | ||
89 | 103 | ||
90 | - | func keyListPrev (listName,id) = makeString([("%s%s%s" + listName), id, "prev"], separator) | |
104 | + | func keyListSize (listName) = { | |
105 | + | let meta = if ((listName == poolsListName)) | |
106 | + | then "%s%s" | |
107 | + | else "%s%s%s%s" | |
108 | + | makeString([meta, listName, "size"], separator) | |
109 | + | } | |
91 | 110 | ||
92 | 111 | ||
93 | - | func keyListNext (listName,id) = makeString([("%s%s%s" + listName), id, "next"], separator) | |
112 | + | func keyListPrev (listName,id) = { | |
113 | + | let meta = if ((listName == poolsListName)) | |
114 | + | then "%s%s%s%s" | |
115 | + | else "%s%s%s%s%s" | |
116 | + | makeString([meta, listName, id, "prev"], separator) | |
117 | + | } | |
118 | + | ||
119 | + | ||
120 | + | func keyListNext (listName,id) = { | |
121 | + | let meta = if ((listName == poolsListName)) | |
122 | + | then "%s%s%s%s" | |
123 | + | else "%s%s%s%s%s" | |
124 | + | makeString([meta, listName, id, "next"], separator) | |
125 | + | } | |
94 | 126 | ||
95 | 127 | ||
96 | 128 | func containsNode (listName,id) = { | |
97 | - | let | |
98 | - | let | |
99 | - | let | |
100 | - | if (if ((id == | |
129 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
130 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
131 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
132 | + | if (if ((id == valueOrElse(headOrUnit, ""))) | |
101 | 133 | then true | |
102 | - | else ( | |
134 | + | else (prevOrUnit != unit)) | |
103 | 135 | then true | |
104 | - | else ( | |
136 | + | else (nextOrUnit != unit) | |
105 | 137 | } | |
106 | 138 | ||
107 | 139 | ||
108 | 140 | func insertNodeActions (listName,id) = { | |
109 | - | let | |
141 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
110 | 142 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
111 | 143 | let checkNode = if (!(containsNode(listName, id))) | |
112 | 144 | then true | |
113 | 145 | else throw("Node exists") | |
114 | 146 | if ((checkNode == checkNode)) | |
115 | - | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ( | |
116 | - | then [StringEntry(keyListNext(listName, id), value( | |
147 | + | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
148 | + | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
117 | 149 | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
118 | 150 | else throw("Strict value is not equal to itself.") | |
119 | 151 | } | |
120 | 152 | ||
121 | 153 | ||
122 | 154 | func deleteNodeActions (listName,id) = { | |
123 | - | let | |
155 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
124 | 156 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
125 | - | let | |
126 | - | let | |
127 | - | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ( | |
128 | - | then | |
157 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
158 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
159 | + | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
160 | + | then (nextOrUnit != unit) | |
129 | 161 | else false) | |
130 | - | then [StringEntry(keyListNext(listName, value( | |
131 | - | else if ( | |
132 | - | then [StringEntry(keyListHead(listName), value( | |
133 | - | else if ( | |
134 | - | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value( | |
135 | - | else if ((id == | |
162 | + | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
163 | + | else if ((nextOrUnit != unit)) | |
164 | + | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
165 | + | else if ((prevOrUnit != unit)) | |
166 | + | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
167 | + | else if ((id == valueOrElse(headOrUnit, ""))) | |
136 | 168 | then [DeleteEntry(keyListHead(listName))] | |
137 | 169 | else throw("Invalid node"))) | |
138 | 170 | } | |
253 | 285 | if ((checks == checks)) | |
254 | 286 | then { | |
255 | 287 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
256 | - | let inListActions = [BooleanEntry(keyInList(pool), true)] | |
288 | + | let inListActions = ([BooleanEntry(keyInList(pool), true)] ++ insertNodeActions(poolsListName, poolToString(pool))) | |
257 | 289 | let startHeightIsNotDefined = (getString(this, keyStartHeight) == unit) | |
258 | 290 | let startHeightActions = if (startHeightIsNotDefined) | |
259 | 291 | then [IntegerEntry(keyCurrentEpoch, 0), IntegerEntry(keyStartHeight, height)] | |
266 | 298 | ||
267 | 299 | ||
268 | 300 | @Callable(i) | |
269 | - | func vote (amountAssetId,priceAssetId, | |
301 | + | func vote (amountAssetId,priceAssetId,amount) = { | |
270 | 302 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
271 | 303 | let startHeight = getIntOrFail(this, keyStartHeight) | |
272 | 304 | let epochLength = getIntOrFail(this, keyEpochLength) | |
273 | 305 | let endHeight = (startHeight + epochLength) | |
274 | - | let shareUsed = valueOrElse(getInteger(this, keyShareUsed(i.caller)), 0) | |
275 | - | let poolVoteShare = valueOrElse(getInteger(this, keyVoteShare(i.caller, pool)), 0) | |
276 | - | let userMaxShare = (maxShare - shareUsed) | |
277 | - | let newShare = (poolVoteShare + share) | |
306 | + | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
307 | + | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
308 | + | let vote = valueOrElse(getInteger(this, keyVote(i.caller, pool, epoch)), 0) | |
309 | + | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
310 | + | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
278 | 311 | let gwxAmountAtEndTotal = { | |
279 | 312 | let @ = invoke(this, "getUserGwxAmountAtHeight", [toBase58String(i.caller.bytes), endHeight], nil) | |
280 | 313 | if ($isInstanceOf(@, "Int")) | |
281 | 314 | then @ | |
282 | 315 | else throw("Couldn't cast Any to Int") | |
283 | 316 | } | |
284 | - | let gwxAmountAtEnd = fraction(gwxAmountAtEndTotal, newShare, maxShare) | |
317 | + | let available = (gwxAmountAtEndTotal - used) | |
318 | + | let newVote = (vote + amount) | |
285 | 319 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
286 | 320 | then true | |
287 | 321 | else throw("invalid assets"), if ((endHeight > height)) | |
288 | 322 | then true | |
289 | - | else throw("invalid height"), if (( | |
323 | + | else throw("invalid height"), if ((gwxAmountAtEndTotal > 0)) | |
290 | 324 | then true | |
291 | - | else throw("you do not have gWX"), if (if (( | |
292 | - | then ( | |
325 | + | else throw("you do not have gWX"), if (if ((amount > 0)) | |
326 | + | then (available >= amount) | |
293 | 327 | else false) | |
294 | 328 | then true | |
295 | - | else throw("invalid | |
329 | + | else throw("invalid amount")] | |
296 | 330 | if ((checks == checks)) | |
297 | - | then $Tuple2([IntegerEntry(keyShareUsed(i.caller), (shareUsed + share)), IntegerEntry(keyVoteShare(i.caller, pool), newShare)], unit) | |
331 | + | then { | |
332 | + | let votesListName = getVotesListName(pool) | |
333 | + | let poolString = poolToString(pool) | |
334 | + | let votesListActions = if (containsNode(votesListName, poolString)) | |
335 | + | then nil | |
336 | + | else insertNodeActions(votesListName, poolString) | |
337 | + | $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), (used + amount)), IntegerEntry(keyVote(i.caller, pool, epoch), newVote), IntegerEntry(keyVotingResult(pool, epoch), (poolResult + amount)), IntegerEntry(keyTotalVotes(epoch), (totalVotes + amount))] ++ votesListActions), unit) | |
338 | + | } | |
298 | 339 | else throw("Strict value is not equal to itself.") | |
299 | 340 | } | |
300 | 341 | ||
306 | 347 | let startHeight = getIntOrFail(this, keyStartHeight) | |
307 | 348 | let epochLength = getIntOrFail(this, keyEpochLength) | |
308 | 349 | let endHeight = (startHeight + epochLength) | |
309 | - | let poolVoteShare = valueOrElse(getInteger(this, keyVoteShare(i.caller, pool)), 0) | |
310 | - | let shareUsed = valueOrElse(getInteger(this, keyShareUsed(i.caller)), 0) | |
350 | + | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
351 | + | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
352 | + | let vote = valueOrElse(getInteger(this, keyVote(i.caller, pool, epoch)), 0) | |
353 | + | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
354 | + | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
311 | 355 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
312 | 356 | then true | |
313 | 357 | else throw("invalid assets"), if ((endHeight > height)) | |
314 | 358 | then true | |
315 | - | else throw("invalid height"), if (( | |
359 | + | else throw("invalid height"), if ((vote > 0)) | |
316 | 360 | then true | |
317 | 361 | else throw("no vote")] | |
318 | 362 | if ((checks == checks)) | |
319 | - | then $Tuple2([IntegerEntry(keyShareUsed(i.caller), max([(shareUsed - poolVoteShare), 0])), DeleteEntry(keyVoteShare(i.caller, pool))], unit) | |
363 | + | then { | |
364 | + | let votesListName = getVotesListName(pool) | |
365 | + | let poolString = poolToString(pool) | |
366 | + | $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), max([(used - vote), 0])), DeleteEntry(keyVote(i.caller, pool, epoch)), IntegerEntry(keyVotingResult(pool, epoch), (poolResult - vote)), IntegerEntry(keyTotalVotes(epoch), (totalVotes - vote))] ++ deleteNodeActions(votesListName, poolString)), unit) | |
367 | + | } | |
320 | 368 | else throw("Strict value is not equal to itself.") | |
321 | 369 | } | |
322 | 370 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | - | ||
6 | - | let maxShare = 100 | |
7 | 5 | ||
8 | 6 | let keyEpochLength = makeString(["%s", "epochLength"], separator) | |
9 | 7 | ||
10 | 8 | let keyCurrentEpoch = makeString(["%s", "currentEpoch"], separator) | |
11 | 9 | ||
12 | 10 | let keyStartHeight = makeString(["%s", "startHeight"], separator) | |
13 | 11 | ||
14 | 12 | let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], separator) | |
15 | 13 | ||
16 | 14 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
17 | 15 | ||
18 | 16 | func keyInList (pool) = { | |
19 | - | let $ | |
20 | - | let amountAssetId = $ | |
21 | - | let priceAssetId = $ | |
17 | + | let $t0575615 = pool | |
18 | + | let amountAssetId = $t0575615._1 | |
19 | + | let priceAssetId = $t0575615._2 | |
22 | 20 | makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator) | |
23 | 21 | } | |
24 | 22 | ||
25 | 23 | ||
26 | - | func | |
24 | + | func keyUsed (address,epoch) = makeString(["%s%s%d", "used", toString(address), toString(epoch)], separator) | |
27 | 25 | ||
28 | 26 | ||
29 | - | func | |
30 | - | let $ | |
31 | - | let amountAssetId = $ | |
32 | - | let priceAssetId = $ | |
33 | - | makeString(["%s%s%s%s", " | |
27 | + | func keyVote (address,pool,epoch) = { | |
28 | + | let $t0889929 = pool | |
29 | + | let amountAssetId = $t0889929._1 | |
30 | + | let priceAssetId = $t0889929._2 | |
31 | + | makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], separator) | |
34 | 32 | } | |
35 | 33 | ||
36 | 34 | ||
37 | - | func keyVotingResult (pool) = { | |
38 | - | let $ | |
39 | - | let amountAssetId = $ | |
40 | - | let priceAssetId = $ | |
41 | - | makeString(["%s%s%s", "votingResult", amountAssetId, priceAssetId], separator) | |
35 | + | func keyVotingResult (pool,epoch) = { | |
36 | + | let $t011111151 = pool | |
37 | + | let amountAssetId = $t011111151._1 | |
38 | + | let priceAssetId = $t011111151._2 | |
39 | + | makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], separator) | |
42 | 40 | } | |
41 | + | ||
42 | + | ||
43 | + | func keyTotalVotes (epoch) = makeString(["%s%d", "totalVotes", toString(epoch)], separator) | |
43 | 44 | ||
44 | 45 | ||
45 | 46 | func getValueOrFail (address,key,type) = { | |
46 | 47 | let error = makeString(["mandatory ", toString(address), ".", key, " is not defined"], "") | |
47 | 48 | valueOrErrorMessage( match type { | |
48 | 49 | case str: String => | |
49 | 50 | getString(address, key) | |
50 | 51 | case int: Int => | |
51 | 52 | getInteger(address, key) | |
52 | 53 | case _ => | |
53 | 54 | throw("invalid entry type") | |
54 | 55 | }, error) | |
55 | 56 | } | |
56 | 57 | ||
57 | 58 | ||
58 | 59 | func getStrOrFail (address,key) = { | |
59 | 60 | let @ = getValueOrFail(address, key, "") | |
60 | 61 | if ($isInstanceOf(@, "String")) | |
61 | 62 | then @ | |
62 | 63 | else throw("Couldn't cast Int|String to String") | |
63 | 64 | } | |
64 | 65 | ||
65 | 66 | ||
66 | 67 | func getIntOrFail (address,key) = { | |
67 | 68 | let @ = getValueOrFail(address, key, 0) | |
68 | 69 | if ($isInstanceOf(@, "Int")) | |
69 | 70 | then @ | |
70 | 71 | else throw("Couldn't cast Int|String to Int") | |
71 | 72 | } | |
72 | 73 | ||
73 | 74 | ||
74 | - | ||
75 | + | func poolToString (pool) = ((pool._1 + separator) + pool._2) | |
75 | 76 | ||
76 | - | func getVotesListName (pool) = { | |
77 | - | let $t021122152 = pool | |
78 | - | let amountAssetId = $t021122152._1 | |
79 | - | let priceAssetId = $t021122152._2 | |
80 | - | makeString(["%s%s__votes", amountAssetId, priceAssetId], separator) | |
77 | + | ||
78 | + | func stringToPool (str) = { | |
79 | + | let parts = split(str, separator) | |
80 | + | if ((size(parts) == 2)) | |
81 | + | then $Tuple2(parts[0], parts[1]) | |
82 | + | else throw("invalid pool string") | |
81 | 83 | } | |
82 | 84 | ||
83 | 85 | ||
84 | - | func keyListHead (listName) = makeString([("%s%s" + listName), "head"], separator) | |
86 | + | let poolsListName = "pools" | |
87 | + | ||
88 | + | func getVotesListName (pool) = { | |
89 | + | let $t022602300 = pool | |
90 | + | let amountAssetId = $t022602300._1 | |
91 | + | let priceAssetId = $t022602300._2 | |
92 | + | makeString(["votes", amountAssetId, priceAssetId], separator) | |
93 | + | } | |
85 | 94 | ||
86 | 95 | ||
87 | - | func keyListSize (listName) = makeString([("%s%s" + listName), "size"], separator) | |
96 | + | func keyListHead (listName) = { | |
97 | + | let meta = if ((listName == poolsListName)) | |
98 | + | then "%s%s" | |
99 | + | else "%s%s%s%s" | |
100 | + | makeString([meta, listName, "head"], separator) | |
101 | + | } | |
88 | 102 | ||
89 | 103 | ||
90 | - | func keyListPrev (listName,id) = makeString([("%s%s%s" + listName), id, "prev"], separator) | |
104 | + | func keyListSize (listName) = { | |
105 | + | let meta = if ((listName == poolsListName)) | |
106 | + | then "%s%s" | |
107 | + | else "%s%s%s%s" | |
108 | + | makeString([meta, listName, "size"], separator) | |
109 | + | } | |
91 | 110 | ||
92 | 111 | ||
93 | - | func keyListNext (listName,id) = makeString([("%s%s%s" + listName), id, "next"], separator) | |
112 | + | func keyListPrev (listName,id) = { | |
113 | + | let meta = if ((listName == poolsListName)) | |
114 | + | then "%s%s%s%s" | |
115 | + | else "%s%s%s%s%s" | |
116 | + | makeString([meta, listName, id, "prev"], separator) | |
117 | + | } | |
118 | + | ||
119 | + | ||
120 | + | func keyListNext (listName,id) = { | |
121 | + | let meta = if ((listName == poolsListName)) | |
122 | + | then "%s%s%s%s" | |
123 | + | else "%s%s%s%s%s" | |
124 | + | makeString([meta, listName, id, "next"], separator) | |
125 | + | } | |
94 | 126 | ||
95 | 127 | ||
96 | 128 | func containsNode (listName,id) = { | |
97 | - | let | |
98 | - | let | |
99 | - | let | |
100 | - | if (if ((id == | |
129 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
130 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
131 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
132 | + | if (if ((id == valueOrElse(headOrUnit, ""))) | |
101 | 133 | then true | |
102 | - | else ( | |
134 | + | else (prevOrUnit != unit)) | |
103 | 135 | then true | |
104 | - | else ( | |
136 | + | else (nextOrUnit != unit) | |
105 | 137 | } | |
106 | 138 | ||
107 | 139 | ||
108 | 140 | func insertNodeActions (listName,id) = { | |
109 | - | let | |
141 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
110 | 142 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
111 | 143 | let checkNode = if (!(containsNode(listName, id))) | |
112 | 144 | then true | |
113 | 145 | else throw("Node exists") | |
114 | 146 | if ((checkNode == checkNode)) | |
115 | - | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ( | |
116 | - | then [StringEntry(keyListNext(listName, id), value( | |
147 | + | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
148 | + | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
117 | 149 | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
118 | 150 | else throw("Strict value is not equal to itself.") | |
119 | 151 | } | |
120 | 152 | ||
121 | 153 | ||
122 | 154 | func deleteNodeActions (listName,id) = { | |
123 | - | let | |
155 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
124 | 156 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
125 | - | let | |
126 | - | let | |
127 | - | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ( | |
128 | - | then | |
157 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
158 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
159 | + | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
160 | + | then (nextOrUnit != unit) | |
129 | 161 | else false) | |
130 | - | then [StringEntry(keyListNext(listName, value( | |
131 | - | else if ( | |
132 | - | then [StringEntry(keyListHead(listName), value( | |
133 | - | else if ( | |
134 | - | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value( | |
135 | - | else if ((id == | |
162 | + | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
163 | + | else if ((nextOrUnit != unit)) | |
164 | + | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
165 | + | else if ((prevOrUnit != unit)) | |
166 | + | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
167 | + | else if ((id == valueOrElse(headOrUnit, ""))) | |
136 | 168 | then [DeleteEntry(keyListHead(listName))] | |
137 | 169 | else throw("Invalid node"))) | |
138 | 170 | } | |
139 | 171 | ||
140 | 172 | ||
141 | 173 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
142 | 174 | ||
143 | 175 | ||
144 | 176 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
145 | 177 | ||
146 | 178 | ||
147 | 179 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
148 | 180 | case s: String => | |
149 | 181 | fromBase58String(s) | |
150 | 182 | case _: Unit => | |
151 | 183 | unit | |
152 | 184 | case _ => | |
153 | 185 | throw("Match error") | |
154 | 186 | } | |
155 | 187 | ||
156 | 188 | ||
157 | 189 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
158 | 190 | case s: String => | |
159 | 191 | fromBase58String(s) | |
160 | 192 | case _: Unit => | |
161 | 193 | unit | |
162 | 194 | case _ => | |
163 | 195 | throw("Match error") | |
164 | 196 | } | |
165 | 197 | ||
166 | 198 | ||
167 | 199 | func mustManager (i) = { | |
168 | 200 | let pd = throw("Permission denied") | |
169 | 201 | match managerPublicKeyOrUnit() { | |
170 | 202 | case pk: ByteVector => | |
171 | 203 | if ((i.callerPublicKey == pk)) | |
172 | 204 | then true | |
173 | 205 | else pd | |
174 | 206 | case _: Unit => | |
175 | 207 | if ((i.caller == this)) | |
176 | 208 | then true | |
177 | 209 | else pd | |
178 | 210 | case _ => | |
179 | 211 | throw("Match error") | |
180 | 212 | } | |
181 | 213 | } | |
182 | 214 | ||
183 | 215 | ||
184 | 216 | @Callable(i) | |
185 | 217 | func setManager (pendingManagerPublicKey) = { | |
186 | 218 | let checkCaller = mustManager(i) | |
187 | 219 | if ((checkCaller == checkCaller)) | |
188 | 220 | then { | |
189 | 221 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
190 | 222 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
191 | 223 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
192 | 224 | else throw("Strict value is not equal to itself.") | |
193 | 225 | } | |
194 | 226 | else throw("Strict value is not equal to itself.") | |
195 | 227 | } | |
196 | 228 | ||
197 | 229 | ||
198 | 230 | ||
199 | 231 | @Callable(i) | |
200 | 232 | func confirmManager () = { | |
201 | 233 | let pm = pendingManagerPublicKeyOrUnit() | |
202 | 234 | let hasPM = if (isDefined(pm)) | |
203 | 235 | then true | |
204 | 236 | else throw("No pending manager") | |
205 | 237 | if ((hasPM == hasPM)) | |
206 | 238 | then { | |
207 | 239 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
208 | 240 | then true | |
209 | 241 | else throw("You are not pending manager") | |
210 | 242 | if ((checkPM == checkPM)) | |
211 | 243 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
212 | 244 | else throw("Strict value is not equal to itself.") | |
213 | 245 | } | |
214 | 246 | else throw("Strict value is not equal to itself.") | |
215 | 247 | } | |
216 | 248 | ||
217 | 249 | ||
218 | 250 | ||
219 | 251 | @Callable(i) | |
220 | 252 | func getUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
221 | 253 | let boostingContractAddress = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyBoostingContract)), "invalid boosting contract address") | |
222 | 254 | $Tuple2(nil, { | |
223 | 255 | let @ = invoke(boostingContractAddress, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil) | |
224 | 256 | if ($isInstanceOf(@, "Int")) | |
225 | 257 | then @ | |
226 | 258 | else throw("Couldn't cast Any to Int") | |
227 | 259 | }) | |
228 | 260 | } | |
229 | 261 | ||
230 | 262 | ||
231 | 263 | ||
232 | 264 | @Callable(i) | |
233 | 265 | func constructor (votingEmissionCandidateContract,boostingContract,epochLength) = { | |
234 | 266 | let cheks = [mustManager(i), if ((addressFromString(votingEmissionCandidateContract) != unit)) | |
235 | 267 | then true | |
236 | 268 | else "invalid voting emission candidate contract address", if ((addressFromString(boostingContract) != unit)) | |
237 | 269 | then true | |
238 | 270 | else "invalid boosting contract address", if ((epochLength > 0)) | |
239 | 271 | then true | |
240 | 272 | else throw("invalid epoch length")] | |
241 | 273 | if ((cheks == cheks)) | |
242 | 274 | then $Tuple2([StringEntry(keyVotingEmissionCandidateContract, votingEmissionCandidateContract), StringEntry(keyBoostingContract, boostingContract), IntegerEntry(keyEpochLength, epochLength)], unit) | |
243 | 275 | else throw("Strict value is not equal to itself.") | |
244 | 276 | } | |
245 | 277 | ||
246 | 278 | ||
247 | 279 | ||
248 | 280 | @Callable(i) | |
249 | 281 | func create (amountAssetId,priceAssetId) = { | |
250 | 282 | let checks = [if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionCandidateContract), ""))) | |
251 | 283 | then true | |
252 | 284 | else mustManager(i)] | |
253 | 285 | if ((checks == checks)) | |
254 | 286 | then { | |
255 | 287 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
256 | - | let inListActions = [BooleanEntry(keyInList(pool), true)] | |
288 | + | let inListActions = ([BooleanEntry(keyInList(pool), true)] ++ insertNodeActions(poolsListName, poolToString(pool))) | |
257 | 289 | let startHeightIsNotDefined = (getString(this, keyStartHeight) == unit) | |
258 | 290 | let startHeightActions = if (startHeightIsNotDefined) | |
259 | 291 | then [IntegerEntry(keyCurrentEpoch, 0), IntegerEntry(keyStartHeight, height)] | |
260 | 292 | else nil | |
261 | 293 | $Tuple2((inListActions ++ startHeightActions), unit) | |
262 | 294 | } | |
263 | 295 | else throw("Strict value is not equal to itself.") | |
264 | 296 | } | |
265 | 297 | ||
266 | 298 | ||
267 | 299 | ||
268 | 300 | @Callable(i) | |
269 | - | func vote (amountAssetId,priceAssetId, | |
301 | + | func vote (amountAssetId,priceAssetId,amount) = { | |
270 | 302 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
271 | 303 | let startHeight = getIntOrFail(this, keyStartHeight) | |
272 | 304 | let epochLength = getIntOrFail(this, keyEpochLength) | |
273 | 305 | let endHeight = (startHeight + epochLength) | |
274 | - | let shareUsed = valueOrElse(getInteger(this, keyShareUsed(i.caller)), 0) | |
275 | - | let poolVoteShare = valueOrElse(getInteger(this, keyVoteShare(i.caller, pool)), 0) | |
276 | - | let userMaxShare = (maxShare - shareUsed) | |
277 | - | let newShare = (poolVoteShare + share) | |
306 | + | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
307 | + | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
308 | + | let vote = valueOrElse(getInteger(this, keyVote(i.caller, pool, epoch)), 0) | |
309 | + | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
310 | + | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
278 | 311 | let gwxAmountAtEndTotal = { | |
279 | 312 | let @ = invoke(this, "getUserGwxAmountAtHeight", [toBase58String(i.caller.bytes), endHeight], nil) | |
280 | 313 | if ($isInstanceOf(@, "Int")) | |
281 | 314 | then @ | |
282 | 315 | else throw("Couldn't cast Any to Int") | |
283 | 316 | } | |
284 | - | let gwxAmountAtEnd = fraction(gwxAmountAtEndTotal, newShare, maxShare) | |
317 | + | let available = (gwxAmountAtEndTotal - used) | |
318 | + | let newVote = (vote + amount) | |
285 | 319 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
286 | 320 | then true | |
287 | 321 | else throw("invalid assets"), if ((endHeight > height)) | |
288 | 322 | then true | |
289 | - | else throw("invalid height"), if (( | |
323 | + | else throw("invalid height"), if ((gwxAmountAtEndTotal > 0)) | |
290 | 324 | then true | |
291 | - | else throw("you do not have gWX"), if (if (( | |
292 | - | then ( | |
325 | + | else throw("you do not have gWX"), if (if ((amount > 0)) | |
326 | + | then (available >= amount) | |
293 | 327 | else false) | |
294 | 328 | then true | |
295 | - | else throw("invalid | |
329 | + | else throw("invalid amount")] | |
296 | 330 | if ((checks == checks)) | |
297 | - | then $Tuple2([IntegerEntry(keyShareUsed(i.caller), (shareUsed + share)), IntegerEntry(keyVoteShare(i.caller, pool), newShare)], unit) | |
331 | + | then { | |
332 | + | let votesListName = getVotesListName(pool) | |
333 | + | let poolString = poolToString(pool) | |
334 | + | let votesListActions = if (containsNode(votesListName, poolString)) | |
335 | + | then nil | |
336 | + | else insertNodeActions(votesListName, poolString) | |
337 | + | $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), (used + amount)), IntegerEntry(keyVote(i.caller, pool, epoch), newVote), IntegerEntry(keyVotingResult(pool, epoch), (poolResult + amount)), IntegerEntry(keyTotalVotes(epoch), (totalVotes + amount))] ++ votesListActions), unit) | |
338 | + | } | |
298 | 339 | else throw("Strict value is not equal to itself.") | |
299 | 340 | } | |
300 | 341 | ||
301 | 342 | ||
302 | 343 | ||
303 | 344 | @Callable(i) | |
304 | 345 | func cancelVote (amountAssetId,priceAssetId) = { | |
305 | 346 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
306 | 347 | let startHeight = getIntOrFail(this, keyStartHeight) | |
307 | 348 | let epochLength = getIntOrFail(this, keyEpochLength) | |
308 | 349 | let endHeight = (startHeight + epochLength) | |
309 | - | let poolVoteShare = valueOrElse(getInteger(this, keyVoteShare(i.caller, pool)), 0) | |
310 | - | let shareUsed = valueOrElse(getInteger(this, keyShareUsed(i.caller)), 0) | |
350 | + | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
351 | + | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
352 | + | let vote = valueOrElse(getInteger(this, keyVote(i.caller, pool, epoch)), 0) | |
353 | + | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
354 | + | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
311 | 355 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
312 | 356 | then true | |
313 | 357 | else throw("invalid assets"), if ((endHeight > height)) | |
314 | 358 | then true | |
315 | - | else throw("invalid height"), if (( | |
359 | + | else throw("invalid height"), if ((vote > 0)) | |
316 | 360 | then true | |
317 | 361 | else throw("no vote")] | |
318 | 362 | if ((checks == checks)) | |
319 | - | then $Tuple2([IntegerEntry(keyShareUsed(i.caller), max([(shareUsed - poolVoteShare), 0])), DeleteEntry(keyVoteShare(i.caller, pool))], unit) | |
363 | + | then { | |
364 | + | let votesListName = getVotesListName(pool) | |
365 | + | let poolString = poolToString(pool) | |
366 | + | $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), max([(used - vote), 0])), DeleteEntry(keyVote(i.caller, pool, epoch)), IntegerEntry(keyVotingResult(pool, epoch), (poolResult - vote)), IntegerEntry(keyTotalVotes(epoch), (totalVotes - vote))] ++ deleteNodeActions(votesListName, poolString)), unit) | |
367 | + | } | |
320 | 368 | else throw("Strict value is not equal to itself.") | |
321 | 369 | } | |
322 | 370 | ||
323 | 371 | ||
324 | 372 | ||
325 | 373 | @Callable(i) | |
326 | 374 | func setEpochLength (newEpochLength) = { | |
327 | 375 | let cheks = [mustManager(i), if ((newEpochLength > 0)) | |
328 | 376 | then true | |
329 | 377 | else throw("invalid epoch length")] | |
330 | 378 | if ((cheks == cheks)) | |
331 | 379 | then $Tuple2([IntegerEntry(keyEpochLength, newEpochLength)], unit) | |
332 | 380 | else throw("Strict value is not equal to itself.") | |
333 | 381 | } | |
334 | 382 | ||
335 | 383 | ||
336 | 384 | ||
337 | 385 | @Callable(i) | |
338 | 386 | func finalize () = $Tuple2(nil, unit) | |
339 | 387 | ||
340 | 388 | ||
341 | 389 | ||
342 | 390 | @Callable(i) | |
343 | 391 | func onVerificationLoss (assetId) = $Tuple2(nil, unit) | |
344 | 392 | ||
345 | 393 | ||
346 | 394 | @Verifier(tx) | |
347 | 395 | func verify () = { | |
348 | 396 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
349 | 397 | case pk: ByteVector => | |
350 | 398 | pk | |
351 | 399 | case _: Unit => | |
352 | 400 | tx.senderPublicKey | |
353 | 401 | case _ => | |
354 | 402 | throw("Match error") | |
355 | 403 | } | |
356 | 404 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
357 | 405 | } | |
358 | 406 |
github/deemru/w8io/169f3d6 76.26 ms ◑