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