tx · 49c3vZz6BgY45jsxTz3UmuMteDRpr6f5GLGZkBzxynQ4 3N9Zi6AcWcGbM23jQJ4fnzFsoHoTsxYDznr: -0.02200000 Waves 2023.06.01 12:22 [2603411] smart account 3N9Zi6AcWcGbM23jQJ4fnzFsoHoTsxYDznr > SELF 0.00000000 Waves
{ "type": 13, "id": "49c3vZz6BgY45jsxTz3UmuMteDRpr6f5GLGZkBzxynQ4", "fee": 2200000, "feeAssetId": null, "timestamp": 1685611396932, "version": 2, "chainId": 84, "sender": "3N9Zi6AcWcGbM23jQJ4fnzFsoHoTsxYDznr", "senderPublicKey": "GFbasS3jufhZkK4xR7tdTjjnP8K33KvJFEDHRtxXDkaJ", "proofs": [ "1AsWcJEP4mFLzvQ4gYUd2FfH3GjPvbrFLR1m3XnLBD69vMmkS4kGiHx6FbHKv4XbWfhgXgQhnDZ9xyyW1RpqjrS" ], "script": "base64:BgKpFggCEgQKAggBEgcKBQgICAgBEgQKAggIEgUKAwgIARIECgIICBIDCgEBEgMKAQESBAoCCAgSBAoCCAQSABIDCgEBEgASBAoCCAgSBAoCCAgSBAoCCAgiCXNlcGFyYXRvciIOcG9vbFdlaWdodE11bHQiD21heERlcHRoRGVmYXVsdCIWZmluYWxpemF0aW9uU3RhZ2VUb3RhbCIXZmluYWxpemF0aW9uU3RhZ2VTaGFyZXMiDmtleUVwb2NoTGVuZ3RoIhFrZXlFcG9jaExlbmd0aE5ldyIVa2V5RXBvY2hMZW5ndGhCeUVwb2NoIgVlcG9jaCIPa2V5Q3VycmVudEVwb2NoIgtrZXlNYXhEZXB0aCIia2V5Vm90aW5nRW1pc3Npb25DYW5kaWRhdGVDb250cmFjdCISa2V5RmFjdG9yeUNvbnRyYWN0IhNrZXlCb29zdGluZ0NvbnRyYWN0IhJrZXlTdGFraW5nQ29udHJhY3QiFGtleUZpbmFsaXphdGlvblN0YWdlIgtrZXlOZXh0UG9vbCILa2V5TmV4dFVzZXIiDmtleVN0YXJ0SGVpZ2h0IhFrZXlD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Complexity": 0 } View: original | compacted Prev: Eoz4Z5PLKEWMFDfk3qhyAAGGH2R9woswAGDDgd32o3sz Next: 5kgukao7QtUdYscifwwMwk49TTcjoykra9FMENNFcinL Diff:
Old | New | Differences | |
---|---|---|---|
23 | 23 | let keyMaxDepth = makeString(["%s", "maxDepth"], separator) | |
24 | 24 | ||
25 | 25 | let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], separator) | |
26 | - | ||
27 | - | let keyVotingEmissionRateContract = makeString(["%s", "votingEmissionRateContract"], separator) | |
28 | 26 | ||
29 | 27 | let keyFactoryContract = makeString(["%s", "factoryContract"], separator) | |
30 | 28 | ||
53 | 51 | ||
54 | 52 | ||
55 | 53 | func keyInList (pool) = { | |
56 | - | let $ | |
57 | - | let amountAssetId = $ | |
58 | - | let priceAssetId = $ | |
54 | + | let $t016931733 = pool | |
55 | + | let amountAssetId = $t016931733._1 | |
56 | + | let priceAssetId = $t016931733._2 | |
59 | 57 | makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator) | |
60 | 58 | } | |
61 | 59 | ||
64 | 62 | ||
65 | 63 | ||
66 | 64 | func keyVote (pool,address,epoch) = { | |
67 | - | let $ | |
68 | - | let amountAssetId = $ | |
69 | - | let priceAssetId = $ | |
65 | + | let $t020072047 = pool | |
66 | + | let amountAssetId = $t020072047._1 | |
67 | + | let priceAssetId = $t020072047._2 | |
70 | 68 | makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], separator) | |
71 | 69 | } | |
72 | 70 | ||
73 | 71 | ||
74 | 72 | func keyVotingResult (pool,epoch) = { | |
75 | - | let $ | |
76 | - | let amountAssetId = $ | |
77 | - | let priceAssetId = $ | |
73 | + | let $t022292269 = pool | |
74 | + | let amountAssetId = $t022292269._1 | |
75 | + | let priceAssetId = $t022292269._2 | |
78 | 76 | makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], separator) | |
79 | 77 | } | |
80 | 78 | ||
83 | 81 | ||
84 | 82 | ||
85 | 83 | func keyPoolShare (pool,epoch) = { | |
86 | - | let $ | |
87 | - | let amountAssetId = $ | |
88 | - | let priceAssetId = $ | |
84 | + | let $t025902630 = pool | |
85 | + | let amountAssetId = $t025902630._1 | |
86 | + | let priceAssetId = $t025902630._2 | |
89 | 87 | makeString(["%s%s%s%d", "poolShare", amountAssetId, priceAssetId, toString(epoch)], separator) | |
90 | 88 | } | |
91 | 89 | ||
171 | 169 | ||
172 | 170 | ||
173 | 171 | func checkWxEmissionPoolLabel (pool) = { | |
174 | - | let $ | |
175 | - | let amountAssetId = $ | |
176 | - | let priceAssetId = $ | |
172 | + | let $t054705510 = pool | |
173 | + | let amountAssetId = $t054705510._1 | |
174 | + | let priceAssetId = $t054705510._2 | |
177 | 175 | let @ = invoke(factoryContract, "checkWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil) | |
178 | 176 | if ($isInstanceOf(@, "Boolean")) | |
179 | 177 | then @ | |
191 | 189 | let poolsListName = "pools" | |
192 | 190 | ||
193 | 191 | func getVotesListName (pool) = { | |
194 | - | let $ | |
195 | - | let amountAssetId = $ | |
196 | - | let priceAssetId = $ | |
192 | + | let $t059275967 = pool | |
193 | + | let amountAssetId = $t059275967._1 | |
194 | + | let priceAssetId = $t059275967._2 | |
197 | 195 | makeString(["votes", amountAssetId, priceAssetId], separator) | |
198 | 196 | } | |
199 | 197 | ||
504 | 502 | if ((checkTargetEpoch == checkTargetEpoch)) | |
505 | 503 | then { | |
506 | 504 | let pool = stringToPool(poolStr) | |
507 | - | let $ | |
508 | - | let amountAssetId = $ | |
509 | - | let priceAssetId = $ | |
505 | + | let $t01797018010 = pool | |
506 | + | let amountAssetId = $t01797018010._1 | |
507 | + | let priceAssetId = $t01797018010._2 | |
510 | 508 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
511 | 509 | let gwxAmountAtEndTotal = { | |
512 | 510 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeight], nil) | |
565 | 563 | if ((checkTargetEpoch == checkTargetEpoch)) | |
566 | 564 | then { | |
567 | 565 | let pool = stringToPool(poolStr) | |
568 | - | let $ | |
569 | - | let amountAssetId = $ | |
570 | - | let priceAssetId = $ | |
566 | + | let $t02036720407 = pool | |
567 | + | let amountAssetId = $t02036720407._1 | |
568 | + | let priceAssetId = $t02036720407._2 | |
571 | 569 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
572 | 570 | let lpAssetId = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
573 | 571 | let r = { | |
754 | 752 | ||
755 | 753 | @Callable(i) | |
756 | 754 | func finalizeWrapper (counter) = { | |
757 | - | let votingEmissionRateContract = addressFromStringValue(getStringValue(this, keyVotingEmissionRateContract)) | |
758 | 755 | let result = { | |
759 | 756 | let @ = invoke(this, "finalizeHelper", nil, nil) | |
760 | 757 | if ($isInstanceOf(@, "Boolean")) | |
765 | 762 | then if (!(result)) | |
766 | 763 | then if ((counter == 0)) | |
767 | 764 | then throwErr("Current voting is not over yet") | |
768 | - | else { | |
769 | - | let inv = invoke(votingEmissionRateContract, "finalize", nil, nil) | |
770 | - | if ((inv == inv)) | |
771 | - | then $Tuple2(nil, unit) | |
772 | - | else throw("Strict value is not equal to itself.") | |
773 | - | } | |
765 | + | else $Tuple2(nil, unit) | |
774 | 766 | else { | |
775 | 767 | let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault) | |
776 | 768 | if ((maxDepth > counter)) | |
821 | 813 | } | |
822 | 814 | ||
823 | 815 | ||
824 | - | ||
825 | - | @Callable(i) | |
826 | - | func isFinalizationInProgress () = { | |
827 | - | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
828 | - | let finalizationInProgress = (finalizationStageOrUnit != unit) | |
829 | - | $Tuple2(nil, finalizationInProgress) | |
830 | - | } | |
831 | - | ||
832 | - | ||
833 | 816 | @Verifier(tx) | |
834 | 817 | func verify () = { | |
835 | 818 | let targetPublicKey = match managerPublicKeyOrUnit() { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let poolWeightMult = 100000000 | |
7 | 7 | ||
8 | 8 | let maxDepthDefault = 10 | |
9 | 9 | ||
10 | 10 | let finalizationStageTotal = 0 | |
11 | 11 | ||
12 | 12 | let finalizationStageShares = 1 | |
13 | 13 | ||
14 | 14 | let keyEpochLength = makeString(["%s", "epochLength"], separator) | |
15 | 15 | ||
16 | 16 | let keyEpochLengthNew = makeString(["%s%s", "epochLength__new"], separator) | |
17 | 17 | ||
18 | 18 | func keyEpochLengthByEpoch (epoch) = makeString(["%s%d", "epochLength", toString(epoch)], separator) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | let keyCurrentEpoch = makeString(["%s", "currentEpoch"], separator) | |
22 | 22 | ||
23 | 23 | let keyMaxDepth = makeString(["%s", "maxDepth"], separator) | |
24 | 24 | ||
25 | 25 | let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], separator) | |
26 | - | ||
27 | - | let keyVotingEmissionRateContract = makeString(["%s", "votingEmissionRateContract"], separator) | |
28 | 26 | ||
29 | 27 | let keyFactoryContract = makeString(["%s", "factoryContract"], separator) | |
30 | 28 | ||
31 | 29 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
32 | 30 | ||
33 | 31 | let keyStakingContract = makeString(["%s", "stakingContract"], separator) | |
34 | 32 | ||
35 | 33 | let keyFinalizationStage = makeString(["%s", "finalizationStage"], separator) | |
36 | 34 | ||
37 | 35 | let keyNextPool = makeString(["%s", "nextPool"], separator) | |
38 | 36 | ||
39 | 37 | let keyNextUser = makeString(["%s", "nextUser"], separator) | |
40 | 38 | ||
41 | 39 | let keyStartHeight = makeString(["%s", "startHeight"], separator) | |
42 | 40 | ||
43 | 41 | let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], separator) | |
44 | 42 | ||
45 | 43 | let keyStartHeightUi = makeString(["%s", "startHeightUi"], separator) | |
46 | 44 | ||
47 | 45 | let keyFinalizationShouldBeForced = makeString(["%s", "force"], separator) | |
48 | 46 | ||
49 | 47 | func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], separator) | |
50 | 48 | ||
51 | 49 | ||
52 | 50 | func keyFinalized (epoch) = makeString(["%s%d", "finalized", toString(epoch)], separator) | |
53 | 51 | ||
54 | 52 | ||
55 | 53 | func keyInList (pool) = { | |
56 | - | let $ | |
57 | - | let amountAssetId = $ | |
58 | - | let priceAssetId = $ | |
54 | + | let $t016931733 = pool | |
55 | + | let amountAssetId = $t016931733._1 | |
56 | + | let priceAssetId = $t016931733._2 | |
59 | 57 | makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator) | |
60 | 58 | } | |
61 | 59 | ||
62 | 60 | ||
63 | 61 | func keyUsed (address,epoch) = makeString(["%s%s%d", "used", toString(address), toString(epoch)], separator) | |
64 | 62 | ||
65 | 63 | ||
66 | 64 | func keyVote (pool,address,epoch) = { | |
67 | - | let $ | |
68 | - | let amountAssetId = $ | |
69 | - | let priceAssetId = $ | |
65 | + | let $t020072047 = pool | |
66 | + | let amountAssetId = $t020072047._1 | |
67 | + | let priceAssetId = $t020072047._2 | |
70 | 68 | makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], separator) | |
71 | 69 | } | |
72 | 70 | ||
73 | 71 | ||
74 | 72 | func keyVotingResult (pool,epoch) = { | |
75 | - | let $ | |
76 | - | let amountAssetId = $ | |
77 | - | let priceAssetId = $ | |
73 | + | let $t022292269 = pool | |
74 | + | let amountAssetId = $t022292269._1 | |
75 | + | let priceAssetId = $t022292269._2 | |
78 | 76 | makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], separator) | |
79 | 77 | } | |
80 | 78 | ||
81 | 79 | ||
82 | 80 | func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], separator) | |
83 | 81 | ||
84 | 82 | ||
85 | 83 | func keyPoolShare (pool,epoch) = { | |
86 | - | let $ | |
87 | - | let amountAssetId = $ | |
88 | - | let priceAssetId = $ | |
84 | + | let $t025902630 = pool | |
85 | + | let amountAssetId = $t025902630._1 | |
86 | + | let priceAssetId = $t025902630._2 | |
89 | 87 | makeString(["%s%s%s%d", "poolShare", amountAssetId, priceAssetId, toString(epoch)], separator) | |
90 | 88 | } | |
91 | 89 | ||
92 | 90 | ||
93 | 91 | func keyTotalVotes (epoch) = makeString(["%s%d", "totalVotes", toString(epoch)], separator) | |
94 | 92 | ||
95 | 93 | ||
96 | 94 | func keyStakedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], separator) | |
97 | 95 | ||
98 | 96 | ||
99 | 97 | func wrapErr (msg) = makeString(["voting_emission.ride:", msg], " ") | |
100 | 98 | ||
101 | 99 | ||
102 | 100 | func throwErr (msg) = throw(wrapErr(msg)) | |
103 | 101 | ||
104 | 102 | ||
105 | 103 | func getValueOrFail (address,key,type) = { | |
106 | 104 | let error = wrapErr(makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
107 | 105 | valueOrErrorMessage( match type { | |
108 | 106 | case str: String => | |
109 | 107 | getString(address, key) | |
110 | 108 | case int: Int => | |
111 | 109 | getInteger(address, key) | |
112 | 110 | case _ => | |
113 | 111 | throwErr("invalid entry type") | |
114 | 112 | }, error) | |
115 | 113 | } | |
116 | 114 | ||
117 | 115 | ||
118 | 116 | func getStrOrFail (address,key) = { | |
119 | 117 | let @ = getValueOrFail(address, key, "") | |
120 | 118 | if ($isInstanceOf(@, "String")) | |
121 | 119 | then @ | |
122 | 120 | else throw(($getType(@) + " couldn't be cast to String")) | |
123 | 121 | } | |
124 | 122 | ||
125 | 123 | ||
126 | 124 | func getIntOrFail (address,key) = { | |
127 | 125 | let @ = getValueOrFail(address, key, 0) | |
128 | 126 | if ($isInstanceOf(@, "Int")) | |
129 | 127 | then @ | |
130 | 128 | else throw(($getType(@) + " couldn't be cast to Int")) | |
131 | 129 | } | |
132 | 130 | ||
133 | 131 | ||
134 | 132 | func poolToString (pool) = ((pool._1 + separator) + pool._2) | |
135 | 133 | ||
136 | 134 | ||
137 | 135 | func stringToPool (str) = { | |
138 | 136 | let parts = split(str, separator) | |
139 | 137 | if ((size(parts) == 2)) | |
140 | 138 | then $Tuple2(parts[0], parts[1]) | |
141 | 139 | else throwErr("invalid pool string") | |
142 | 140 | } | |
143 | 141 | ||
144 | 142 | ||
145 | 143 | let factoryContract = addressFromStringValue(getStrOrFail(this, keyFactoryContract)) | |
146 | 144 | ||
147 | 145 | let IdxFactoryCfgGwxRewardDapp = 10 | |
148 | 146 | ||
149 | 147 | func keyFactoryCfg () = "%s__factoryConfig" | |
150 | 148 | ||
151 | 149 | ||
152 | 150 | func readFactoryCfgOrFail (factory) = split(getStrOrFail(factory, keyFactoryCfg()), separator) | |
153 | 151 | ||
154 | 152 | ||
155 | 153 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
156 | 154 | ||
157 | 155 | ||
158 | 156 | func getLpAssetByPoolAssets (amountAssetId,priceAssetId) = { | |
159 | 157 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
160 | 158 | ||
161 | 159 | func keyMappingPoolAssetsToPoolContractAddress (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + toString(internalAmountAssetIdStr)) + "__") + toString(internalPriceAssetIdStr)) + "__mappings__poolAssets2PoolContract") | |
162 | 160 | ||
163 | 161 | func keyMappingPoolContractToLPAsset (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
164 | 162 | ||
165 | 163 | let amountAssetInternalId = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amountAssetId)) | |
166 | 164 | let priceAssetInternalId = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAssetId)) | |
167 | 165 | let poolContractAddress = getStrOrFail(factoryContract, keyMappingPoolAssetsToPoolContractAddress(amountAssetInternalId, priceAssetInternalId)) | |
168 | 166 | let lpAssetId = getStrOrFail(factoryContract, keyMappingPoolContractToLPAsset(poolContractAddress)) | |
169 | 167 | lpAssetId | |
170 | 168 | } | |
171 | 169 | ||
172 | 170 | ||
173 | 171 | func checkWxEmissionPoolLabel (pool) = { | |
174 | - | let $ | |
175 | - | let amountAssetId = $ | |
176 | - | let priceAssetId = $ | |
172 | + | let $t054705510 = pool | |
173 | + | let amountAssetId = $t054705510._1 | |
174 | + | let priceAssetId = $t054705510._2 | |
177 | 175 | let @ = invoke(factoryContract, "checkWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil) | |
178 | 176 | if ($isInstanceOf(@, "Boolean")) | |
179 | 177 | then @ | |
180 | 178 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
181 | 179 | } | |
182 | 180 | ||
183 | 181 | ||
184 | 182 | func gwxRewardDeposit () = { | |
185 | 183 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
186 | 184 | let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg) | |
187 | 185 | invoke(gwxRewardsContract, "deposit", nil, nil) | |
188 | 186 | } | |
189 | 187 | ||
190 | 188 | ||
191 | 189 | let poolsListName = "pools" | |
192 | 190 | ||
193 | 191 | func getVotesListName (pool) = { | |
194 | - | let $ | |
195 | - | let amountAssetId = $ | |
196 | - | let priceAssetId = $ | |
192 | + | let $t059275967 = pool | |
193 | + | let amountAssetId = $t059275967._1 | |
194 | + | let priceAssetId = $t059275967._2 | |
197 | 195 | makeString(["votes", amountAssetId, priceAssetId], separator) | |
198 | 196 | } | |
199 | 197 | ||
200 | 198 | ||
201 | 199 | func keyListHead (listName) = { | |
202 | 200 | let meta = if ((listName == poolsListName)) | |
203 | 201 | then "%s%s" | |
204 | 202 | else "%s%s%s%s" | |
205 | 203 | makeString([meta, listName, "head"], separator) | |
206 | 204 | } | |
207 | 205 | ||
208 | 206 | ||
209 | 207 | func keyListSize (listName) = { | |
210 | 208 | let meta = if ((listName == poolsListName)) | |
211 | 209 | then "%s%s" | |
212 | 210 | else "%s%s%s%s" | |
213 | 211 | makeString([meta, listName, "size"], separator) | |
214 | 212 | } | |
215 | 213 | ||
216 | 214 | ||
217 | 215 | func keyListPrev (listName,id) = { | |
218 | 216 | let meta = if ((listName == poolsListName)) | |
219 | 217 | then "%s%s%s%s" | |
220 | 218 | else "%s%s%s%s%s" | |
221 | 219 | makeString([meta, listName, id, "prev"], separator) | |
222 | 220 | } | |
223 | 221 | ||
224 | 222 | ||
225 | 223 | func keyListNext (listName,id) = { | |
226 | 224 | let meta = if ((listName == poolsListName)) | |
227 | 225 | then "%s%s%s%s" | |
228 | 226 | else "%s%s%s%s%s" | |
229 | 227 | makeString([meta, listName, id, "next"], separator) | |
230 | 228 | } | |
231 | 229 | ||
232 | 230 | ||
233 | 231 | func containsNode (listName,id) = { | |
234 | 232 | let headOrUnit = getString(this, keyListHead(listName)) | |
235 | 233 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
236 | 234 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
237 | 235 | if (if ((id == valueOrElse(headOrUnit, ""))) | |
238 | 236 | then true | |
239 | 237 | else (prevOrUnit != unit)) | |
240 | 238 | then true | |
241 | 239 | else (nextOrUnit != unit) | |
242 | 240 | } | |
243 | 241 | ||
244 | 242 | ||
245 | 243 | func insertNodeActions (listName,id) = { | |
246 | 244 | let headOrUnit = getString(this, keyListHead(listName)) | |
247 | 245 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
248 | 246 | let checkNode = if (!(containsNode(listName, id))) | |
249 | 247 | then true | |
250 | 248 | else throwErr("Node exists") | |
251 | 249 | if ((checkNode == checkNode)) | |
252 | 250 | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
253 | 251 | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
254 | 252 | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
255 | 253 | else throw("Strict value is not equal to itself.") | |
256 | 254 | } | |
257 | 255 | ||
258 | 256 | ||
259 | 257 | func deleteNodeActions (listName,id) = { | |
260 | 258 | let headOrUnit = getString(this, keyListHead(listName)) | |
261 | 259 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
262 | 260 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
263 | 261 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
264 | 262 | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
265 | 263 | then (nextOrUnit != unit) | |
266 | 264 | else false) | |
267 | 265 | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
268 | 266 | else if ((nextOrUnit != unit)) | |
269 | 267 | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
270 | 268 | else if ((prevOrUnit != unit)) | |
271 | 269 | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
272 | 270 | else if ((id == valueOrElse(headOrUnit, ""))) | |
273 | 271 | then [DeleteEntry(keyListHead(listName))] | |
274 | 272 | else throwErr(((("invalid node: " + listName) + ".") + id)))) | |
275 | 273 | } | |
276 | 274 | ||
277 | 275 | ||
278 | 276 | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
279 | 277 | ||
280 | 278 | ||
281 | 279 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
282 | 280 | ||
283 | 281 | ||
284 | 282 | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
285 | 283 | case s: String => | |
286 | 284 | addressFromStringValue(s) | |
287 | 285 | case _ => | |
288 | 286 | this | |
289 | 287 | } | |
290 | 288 | ||
291 | 289 | ||
292 | 290 | func managerPublicKeyOrUnit () = { | |
293 | 291 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
294 | 292 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
295 | 293 | case s: String => | |
296 | 294 | fromBase58String(s) | |
297 | 295 | case _: Unit => | |
298 | 296 | unit | |
299 | 297 | case _ => | |
300 | 298 | throw("Match error") | |
301 | 299 | } | |
302 | 300 | } | |
303 | 301 | ||
304 | 302 | ||
305 | 303 | func isManager (i) = match managerPublicKeyOrUnit() { | |
306 | 304 | case pk: ByteVector => | |
307 | 305 | (i.callerPublicKey == pk) | |
308 | 306 | case _: Unit => | |
309 | 307 | (i.caller == this) | |
310 | 308 | case _ => | |
311 | 309 | throw("Match error") | |
312 | 310 | } | |
313 | 311 | ||
314 | 312 | ||
315 | 313 | func mustManager (i) = if (isManager(i)) | |
316 | 314 | then true | |
317 | 315 | else throw("permission denied") | |
318 | 316 | ||
319 | 317 | ||
320 | 318 | func mustThis (i) = if ((i.caller == this)) | |
321 | 319 | then true | |
322 | 320 | else throw("permission denied") | |
323 | 321 | ||
324 | 322 | ||
325 | 323 | @Callable(i) | |
326 | 324 | func getUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
327 | 325 | let boostingContractAddress = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyBoostingContract)), wrapErr("invalid boosting contract address")) | |
328 | 326 | $Tuple2(nil, { | |
329 | 327 | let @ = invoke(boostingContractAddress, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil) | |
330 | 328 | if ($isInstanceOf(@, "Int")) | |
331 | 329 | then @ | |
332 | 330 | else throw(($getType(@) + " couldn't be cast to Int")) | |
333 | 331 | }) | |
334 | 332 | } | |
335 | 333 | ||
336 | 334 | ||
337 | 335 | ||
338 | 336 | @Callable(i) | |
339 | 337 | func constructor (factoryContract,votingEmissionCandidateContract,boostingContract,stakingContract,epochLength) = { | |
340 | 338 | let checks = [mustManager(i), if ((addressFromString(factoryContract) != unit)) | |
341 | 339 | then true | |
342 | 340 | else "invalid factory contract address", if ((addressFromString(votingEmissionCandidateContract) != unit)) | |
343 | 341 | then true | |
344 | 342 | else "invalid voting emission candidate contract address", if ((addressFromString(boostingContract) != unit)) | |
345 | 343 | then true | |
346 | 344 | else "invalid boosting contract address", if ((addressFromString(stakingContract) != unit)) | |
347 | 345 | then true | |
348 | 346 | else "invalid staking contract address", if ((epochLength > 0)) | |
349 | 347 | then true | |
350 | 348 | else throwErr("invalid epoch length")] | |
351 | 349 | if ((checks == checks)) | |
352 | 350 | then $Tuple2([StringEntry(keyFactoryContract, factoryContract), StringEntry(keyVotingEmissionCandidateContract, votingEmissionCandidateContract), StringEntry(keyBoostingContract, boostingContract), StringEntry(keyStakingContract, stakingContract), IntegerEntry(keyEpochLength, epochLength)], unit) | |
353 | 351 | else throw("Strict value is not equal to itself.") | |
354 | 352 | } | |
355 | 353 | ||
356 | 354 | ||
357 | 355 | ||
358 | 356 | @Callable(i) | |
359 | 357 | func create (amountAssetId,priceAssetId) = { | |
360 | 358 | let checks = [if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionCandidateContract), ""))) | |
361 | 359 | then true | |
362 | 360 | else mustManager(i)] | |
363 | 361 | if ((checks == checks)) | |
364 | 362 | then { | |
365 | 363 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
366 | 364 | let inListActions = ([BooleanEntry(keyInList(pool), true)] ++ insertNodeActions(poolsListName, poolToString(pool))) | |
367 | 365 | let currentEpochIsNotDefined = (getInteger(this, keyCurrentEpoch) == unit) | |
368 | 366 | let startHeightActions = if (currentEpochIsNotDefined) | |
369 | 367 | then { | |
370 | 368 | let epoch = 0 | |
371 | 369 | [IntegerEntry(keyCurrentEpoch, epoch), IntegerEntry(keyStartHeightByEpoch(epoch), height), IntegerEntry(keyStartHeight, height), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, height)] | |
372 | 370 | } | |
373 | 371 | else nil | |
374 | 372 | $Tuple2((inListActions ++ startHeightActions), unit) | |
375 | 373 | } | |
376 | 374 | else throw("Strict value is not equal to itself.") | |
377 | 375 | } | |
378 | 376 | ||
379 | 377 | ||
380 | 378 | ||
381 | 379 | @Callable(i) | |
382 | 380 | func vote (amountAssetId,priceAssetId,amount) = { | |
383 | 381 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
384 | 382 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
385 | 383 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
386 | 384 | let epochLength = getIntOrFail(this, keyEpochLength) | |
387 | 385 | let endHeight = (startHeight + epochLength) | |
388 | 386 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
389 | 387 | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
390 | 388 | let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0) | |
391 | 389 | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
392 | 390 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
393 | 391 | let gwxAmountAtEndTotal = { | |
394 | 392 | let @ = invoke(this, "getUserGwxAmountAtHeight", [toBase58String(i.caller.bytes), endHeight], nil) | |
395 | 393 | if ($isInstanceOf(@, "Int")) | |
396 | 394 | then @ | |
397 | 395 | else throw(($getType(@) + " couldn't be cast to Int")) | |
398 | 396 | } | |
399 | 397 | let available = (gwxAmountAtEndTotal - used) | |
400 | 398 | let newVote = (vote + amount) | |
401 | 399 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
402 | 400 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
403 | 401 | then true | |
404 | 402 | else throwErr("invalid assets"), if ((endHeight > height)) | |
405 | 403 | then true | |
406 | 404 | else throwErr("invalid height"), if ((finalizationStageOrUnit == unit)) | |
407 | 405 | then true | |
408 | 406 | else throwErr("finalization in progress"), if ((gwxAmountAtEndTotal > 0)) | |
409 | 407 | then true | |
410 | 408 | else throwErr("you do not have gWX"), if (if ((amount > 0)) | |
411 | 409 | then (available >= amount) | |
412 | 410 | else false) | |
413 | 411 | then true | |
414 | 412 | else throwErr("invalid amount"), if (wxEmission) | |
415 | 413 | then true | |
416 | 414 | else throwErr("pool hasn't WX_EMISSION label")] | |
417 | 415 | if ((checks == checks)) | |
418 | 416 | then { | |
419 | 417 | let votesListName = getVotesListName(pool) | |
420 | 418 | let userAddressStr = toString(i.caller) | |
421 | 419 | let votesListActions = if (containsNode(votesListName, userAddressStr)) | |
422 | 420 | then nil | |
423 | 421 | else insertNodeActions(votesListName, userAddressStr) | |
424 | 422 | $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), (used + amount)), IntegerEntry(keyVote(pool, i.caller, epoch), newVote), IntegerEntry(keyVotingResult(pool, epoch), (poolResult + amount)), IntegerEntry(keyTotalVotes(epoch), (totalVotes + amount))] ++ votesListActions), unit) | |
425 | 423 | } | |
426 | 424 | else throw("Strict value is not equal to itself.") | |
427 | 425 | } | |
428 | 426 | ||
429 | 427 | ||
430 | 428 | ||
431 | 429 | @Callable(i) | |
432 | 430 | func cancelVote (amountAssetId,priceAssetId) = { | |
433 | 431 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
434 | 432 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
435 | 433 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
436 | 434 | let epochLength = getIntOrFail(this, keyEpochLength) | |
437 | 435 | let endHeight = (startHeight + epochLength) | |
438 | 436 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
439 | 437 | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
440 | 438 | let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0) | |
441 | 439 | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
442 | 440 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
443 | 441 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
444 | 442 | then true | |
445 | 443 | else throwErr("invalid assets"), if ((endHeight > height)) | |
446 | 444 | then true | |
447 | 445 | else throwErr("invalid height"), if ((finalizationStageOrUnit == unit)) | |
448 | 446 | then true | |
449 | 447 | else throwErr("finalization in progress"), if ((vote > 0)) | |
450 | 448 | then true | |
451 | 449 | else throwErr("no vote")] | |
452 | 450 | if ((checks == checks)) | |
453 | 451 | then { | |
454 | 452 | let votesListName = getVotesListName(pool) | |
455 | 453 | let userAddressStr = toString(i.caller) | |
456 | 454 | $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), max([(used - vote), 0])), DeleteEntry(keyVote(pool, i.caller, epoch)), IntegerEntry(keyVotingResult(pool, epoch), (poolResult - vote)), IntegerEntry(keyTotalVotes(epoch), (totalVotes - vote))] ++ deleteNodeActions(votesListName, userAddressStr)), unit) | |
457 | 455 | } | |
458 | 456 | else throw("Strict value is not equal to itself.") | |
459 | 457 | } | |
460 | 458 | ||
461 | 459 | ||
462 | 460 | ||
463 | 461 | @Callable(i) | |
464 | 462 | func setEpochLength (newEpochLength) = { | |
465 | 463 | let checks = [mustManager(i), if ((newEpochLength > 0)) | |
466 | 464 | then true | |
467 | 465 | else throwErr("invalid epoch length")] | |
468 | 466 | if ((checks == checks)) | |
469 | 467 | then $Tuple2([IntegerEntry(keyEpochLengthNew, newEpochLength)], unit) | |
470 | 468 | else throw("Strict value is not equal to itself.") | |
471 | 469 | } | |
472 | 470 | ||
473 | 471 | ||
474 | 472 | ||
475 | 473 | @Callable(i) | |
476 | 474 | func setMaxDepth (newMaxDepth) = { | |
477 | 475 | let checks = [mustManager(i), if ((newMaxDepth > 0)) | |
478 | 476 | then true | |
479 | 477 | else throwErr("invalid max depth")] | |
480 | 478 | if ((checks == checks)) | |
481 | 479 | then $Tuple2([IntegerEntry(keyMaxDepth, newMaxDepth)], unit) | |
482 | 480 | else throw("Strict value is not equal to itself.") | |
483 | 481 | } | |
484 | 482 | ||
485 | 483 | ||
486 | 484 | ||
487 | 485 | @Callable(i) | |
488 | 486 | func processVoteINTERNAL (poolStr,userAddressStr) = { | |
489 | 487 | let checkCaller = mustThis(i) | |
490 | 488 | if ((checkCaller == checkCaller)) | |
491 | 489 | then { | |
492 | 490 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr(("processVoteINTERNAL: invalid user address " + userAddressStr))) | |
493 | 491 | let epoch = getIntOrFail(this, keyCurrentEpoch) | |
494 | 492 | let epochPrevious = (epoch - 1) | |
495 | 493 | let epochLength = getIntOrFail(this, keyEpochLength) | |
496 | 494 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
497 | 495 | let endHeight = (startHeight + epochLength) | |
498 | 496 | let startHeightPrevious = getIntOrFail(this, keyStartHeightByEpoch(epochPrevious)) | |
499 | 497 | let epochLengthPrevious = getIntOrFail(this, keyEpochLengthByEpoch(epochPrevious)) | |
500 | 498 | let endHeightPrevious = (startHeightPrevious + epochLengthPrevious) | |
501 | 499 | let checkTargetEpoch = if ((epochPrevious >= 0)) | |
502 | 500 | then true | |
503 | 501 | else throwErr("processVoteINTERNAL: invalid previous epoch") | |
504 | 502 | if ((checkTargetEpoch == checkTargetEpoch)) | |
505 | 503 | then { | |
506 | 504 | let pool = stringToPool(poolStr) | |
507 | - | let $ | |
508 | - | let amountAssetId = $ | |
509 | - | let priceAssetId = $ | |
505 | + | let $t01797018010 = pool | |
506 | + | let amountAssetId = $t01797018010._1 | |
507 | + | let priceAssetId = $t01797018010._2 | |
510 | 508 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
511 | 509 | let gwxAmountAtEndTotal = { | |
512 | 510 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeight], nil) | |
513 | 511 | if ($isInstanceOf(@, "Int")) | |
514 | 512 | then @ | |
515 | 513 | else throw(($getType(@) + " couldn't be cast to Int")) | |
516 | 514 | } | |
517 | 515 | let gwxAmountAtEndTotalPrevious = { | |
518 | 516 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeightPrevious], nil) | |
519 | 517 | if ($isInstanceOf(@, "Int")) | |
520 | 518 | then @ | |
521 | 519 | else throw(($getType(@) + " couldn't be cast to Int")) | |
522 | 520 | } | |
523 | 521 | let totalVotes = valueOrElse(getInteger(keyTotalVotes(epoch)), 0) | |
524 | 522 | let votingResult = valueOrElse(getInteger(keyVotingResult(pool, epoch)), 0) | |
525 | 523 | let votePrevious = valueOrErrorMessage(getInteger(keyVote(pool, userAddress, epochPrevious)), wrapErr((((("processVoteINTERNAL " + poolStr) + " ") + userAddressStr) + ": no previous vote"))) | |
526 | 524 | let used = valueOrElse(getInteger(this, keyUsed(userAddress, epoch)), 0) | |
527 | 525 | let lpAssetIdStr = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
528 | 526 | let votingResultStakedPrevious = valueOrElse(getInteger(keyVotingResultStaked(lpAssetIdStr, epochPrevious)), 0) | |
529 | 527 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
530 | 528 | let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(lpAssetIdStr, userAddressStr)), 0) | |
531 | 529 | let votingResultStakedActions = if ((stakedByUser == 0)) | |
532 | 530 | then nil | |
533 | 531 | else [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, epochPrevious), (votingResultStakedPrevious + votePrevious))] | |
534 | 532 | let newVote = if ((gwxAmountAtEndTotalPrevious > 0)) | |
535 | 533 | then fraction(votePrevious, gwxAmountAtEndTotal, gwxAmountAtEndTotalPrevious) | |
536 | 534 | else 0 | |
537 | 535 | let actions = if (if ((newVote > 0)) | |
538 | 536 | then wxEmission | |
539 | 537 | else false) | |
540 | 538 | then [IntegerEntry(keyVote(pool, userAddress, epoch), newVote), IntegerEntry(keyTotalVotes(epoch), (totalVotes + newVote)), IntegerEntry(keyVotingResult(pool, epoch), (votingResult + newVote)), IntegerEntry(keyUsed(userAddress, epoch), (used + newVote))] | |
541 | 539 | else deleteNodeActions(getVotesListName(pool), userAddressStr) | |
542 | 540 | $Tuple2((actions ++ votingResultStakedActions), unit) | |
543 | 541 | } | |
544 | 542 | else throw("Strict value is not equal to itself.") | |
545 | 543 | } | |
546 | 544 | else throw("Strict value is not equal to itself.") | |
547 | 545 | } | |
548 | 546 | ||
549 | 547 | ||
550 | 548 | ||
551 | 549 | @Callable(i) | |
552 | 550 | func processPoolINTERNAL (poolStr,force) = { | |
553 | 551 | let checkCaller = mustThis(i) | |
554 | 552 | if ((checkCaller == checkCaller)) | |
555 | 553 | then { | |
556 | 554 | let targetEpoch = { | |
557 | 555 | let currentEpoch = getIntOrFail(this, keyCurrentEpoch) | |
558 | 556 | if (force) | |
559 | 557 | then currentEpoch | |
560 | 558 | else (currentEpoch - 1) | |
561 | 559 | } | |
562 | 560 | let checkTargetEpoch = if ((targetEpoch >= 0)) | |
563 | 561 | then true | |
564 | 562 | else throwErr("processPoolINTERNAL: invalid target epoch") | |
565 | 563 | if ((checkTargetEpoch == checkTargetEpoch)) | |
566 | 564 | then { | |
567 | 565 | let pool = stringToPool(poolStr) | |
568 | - | let $ | |
569 | - | let amountAssetId = $ | |
570 | - | let priceAssetId = $ | |
566 | + | let $t02036720407 = pool | |
567 | + | let amountAssetId = $t02036720407._1 | |
568 | + | let priceAssetId = $t02036720407._2 | |
571 | 569 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
572 | 570 | let lpAssetId = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
573 | 571 | let r = { | |
574 | 572 | let @ = invoke(stakingContract, "usersListTraversal", [lpAssetId], nil) | |
575 | 573 | if ($isInstanceOf(@, "Boolean")) | |
576 | 574 | then @ | |
577 | 575 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
578 | 576 | } | |
579 | 577 | if ((r == r)) | |
580 | 578 | then if (r) | |
581 | 579 | then $Tuple2(nil, true) | |
582 | 580 | else { | |
583 | 581 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
584 | 582 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(targetEpoch)), 0) | |
585 | 583 | let votingResult = valueOrElse(getInteger(this, keyVotingResult(pool, targetEpoch)), 0) | |
586 | 584 | let share = if (if ((totalVotes == 0)) | |
587 | 585 | then true | |
588 | 586 | else !(wxEmission)) | |
589 | 587 | then 0 | |
590 | 588 | else fraction(votingResult, poolWeightMult, totalVotes) | |
591 | 589 | let modifyWeightInv = invoke(factoryContract, "modifyWeight", [lpAssetId, share], nil) | |
592 | 590 | if ((modifyWeightInv == modifyWeightInv)) | |
593 | 591 | then { | |
594 | 592 | let poolsListActions = if (if (wxEmission) | |
595 | 593 | then true | |
596 | 594 | else force) | |
597 | 595 | then nil | |
598 | 596 | else ([DeleteEntry(keyInList(pool))] ++ deleteNodeActions(poolsListName, poolStr)) | |
599 | 597 | $Tuple2(([IntegerEntry(keyPoolShare(pool, targetEpoch), share)] ++ poolsListActions), false) | |
600 | 598 | } | |
601 | 599 | else throw("Strict value is not equal to itself.") | |
602 | 600 | } | |
603 | 601 | else throw("Strict value is not equal to itself.") | |
604 | 602 | } | |
605 | 603 | else throw("Strict value is not equal to itself.") | |
606 | 604 | } | |
607 | 605 | else throw("Strict value is not equal to itself.") | |
608 | 606 | } | |
609 | 607 | ||
610 | 608 | ||
611 | 609 | ||
612 | 610 | @Callable(i) | |
613 | 611 | func finalizeHelper () = { | |
614 | 612 | let force = valueOrElse(getBoolean(keyFinalizationShouldBeForced), false) | |
615 | 613 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
616 | 614 | let previousEpoch = (epoch - 1) | |
617 | 615 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
618 | 616 | let epochLength = getIntOrFail(this, keyEpochLength) | |
619 | 617 | let endHeight = (startHeight + epochLength) | |
620 | 618 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
621 | 619 | if (if (if ((height >= endHeight)) | |
622 | 620 | then (finalizationStageOrUnit == unit) | |
623 | 621 | else false) | |
624 | 622 | then !(force) | |
625 | 623 | else false) | |
626 | 624 | then { | |
627 | 625 | let newEpoch = (epoch + 1) | |
628 | 626 | let newEpochLengthOption = getInteger(this, keyEpochLengthNew) | |
629 | 627 | let newEpochLengthActions = match newEpochLengthOption { | |
630 | 628 | case newEpochLength: Int => | |
631 | 629 | [IntegerEntry(keyEpochLength, newEpochLength), DeleteEntry(keyEpochLengthNew)] | |
632 | 630 | case _: Unit => | |
633 | 631 | nil | |
634 | 632 | case _ => | |
635 | 633 | throw("Match error") | |
636 | 634 | } | |
637 | 635 | $Tuple2(([IntegerEntry(keyStartHeightByEpoch(newEpoch), height), IntegerEntry(keyStartHeight, height), IntegerEntry(keyCurrentEpoch, newEpoch), IntegerEntry(keyFinalizationStage, finalizationStageTotal), IntegerEntry(keyEpochLengthByEpoch(epoch), epochLength)] ++ newEpochLengthActions), true) | |
638 | 636 | } | |
639 | 637 | else if (if (force) | |
640 | 638 | then (finalizationStageOrUnit == unit) | |
641 | 639 | else false) | |
642 | 640 | then $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares)], true) | |
643 | 641 | else if ((finalizationStageOrUnit == unit)) | |
644 | 642 | then $Tuple2(nil, false) | |
645 | 643 | else if ((finalizationStageOrUnit == finalizationStageTotal)) | |
646 | 644 | then { | |
647 | 645 | let poolOrUnit = getString(keyNextPool) | |
648 | 646 | let userOrUnit = getString(keyNextUser) | |
649 | 647 | match poolOrUnit { | |
650 | 648 | case _: Unit => | |
651 | 649 | match getString(keyListHead(poolsListName)) { | |
652 | 650 | case _: Unit => | |
653 | 651 | $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares), DeleteEntry(keyNextPool), DeleteEntry(keyNextUser)], true) | |
654 | 652 | case poolsHeadStr: String => | |
655 | 653 | $Tuple2([StringEntry(keyNextPool, poolsHeadStr)], true) | |
656 | 654 | case _ => | |
657 | 655 | throw("Match error") | |
658 | 656 | } | |
659 | 657 | case poolStr: String => | |
660 | 658 | let pool = stringToPool(poolStr) | |
661 | 659 | let nextUserOrUnit = match userOrUnit { | |
662 | 660 | case _: Unit => | |
663 | 661 | getString(keyListHead(getVotesListName(pool))) | |
664 | 662 | case user: String => | |
665 | 663 | let next = getString(keyListNext(getVotesListName(pool), user)) | |
666 | 664 | if ((next == next)) | |
667 | 665 | then { | |
668 | 666 | let processVoteInv = invoke(this, "processVoteINTERNAL", [poolStr, user], nil) | |
669 | 667 | if ((processVoteInv == processVoteInv)) | |
670 | 668 | then next | |
671 | 669 | else throw("Strict value is not equal to itself.") | |
672 | 670 | } | |
673 | 671 | else throw("Strict value is not equal to itself.") | |
674 | 672 | case _ => | |
675 | 673 | throw("Match error") | |
676 | 674 | } | |
677 | 675 | match nextUserOrUnit { | |
678 | 676 | case _: Unit => | |
679 | 677 | let nextPoolOrUnit = getString(keyListNext(poolsListName, poolStr)) | |
680 | 678 | match nextPoolOrUnit { | |
681 | 679 | case _: Unit => | |
682 | 680 | $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares), DeleteEntry(keyNextPool), DeleteEntry(keyNextUser)], true) | |
683 | 681 | case s: String => | |
684 | 682 | $Tuple2([StringEntry(keyNextPool, s), DeleteEntry(keyNextUser)], true) | |
685 | 683 | case _ => | |
686 | 684 | throw("Match error") | |
687 | 685 | } | |
688 | 686 | case nextUser: String => | |
689 | 687 | $Tuple2([StringEntry(keyNextUser, nextUser)], true) | |
690 | 688 | case _ => | |
691 | 689 | throw("Match error") | |
692 | 690 | } | |
693 | 691 | case _ => | |
694 | 692 | throw("Match error") | |
695 | 693 | } | |
696 | 694 | } | |
697 | 695 | else if ((finalizationStageOrUnit == finalizationStageShares)) | |
698 | 696 | then { | |
699 | 697 | let poolOrUnit = getString(keyNextPool) | |
700 | 698 | match poolOrUnit { | |
701 | 699 | case _: Unit => | |
702 | 700 | match getString(keyListHead(poolsListName)) { | |
703 | 701 | case _: Unit => | |
704 | 702 | let actions = if (force) | |
705 | 703 | then [DeleteEntry(keyFinalizationStage), DeleteEntry(keyFinalizationShouldBeForced)] | |
706 | 704 | else [DeleteEntry(keyFinalizationStage), BooleanEntry(keyFinalized(previousEpoch), true), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, startHeight)] | |
707 | 705 | let gwxRewardDepositInv = gwxRewardDeposit() | |
708 | 706 | if ((gwxRewardDepositInv == gwxRewardDepositInv)) | |
709 | 707 | then $Tuple2(actions, true) | |
710 | 708 | else throw("Strict value is not equal to itself.") | |
711 | 709 | case nextPoolStr: String => | |
712 | 710 | $Tuple2([StringEntry(keyNextPool, nextPoolStr)], true) | |
713 | 711 | case _ => | |
714 | 712 | throw("Match error") | |
715 | 713 | } | |
716 | 714 | case poolStr: String => | |
717 | 715 | let nextPoolOrUnit = getString(keyListNext(poolsListName, poolStr)) | |
718 | 716 | if ((nextPoolOrUnit == nextPoolOrUnit)) | |
719 | 717 | then { | |
720 | 718 | let r = { | |
721 | 719 | let @ = invoke(this, "processPoolINTERNAL", [poolStr, force], nil) | |
722 | 720 | if ($isInstanceOf(@, "Boolean")) | |
723 | 721 | then @ | |
724 | 722 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
725 | 723 | } | |
726 | 724 | if ((r == r)) | |
727 | 725 | then if (r) | |
728 | 726 | then $Tuple2(nil, true) | |
729 | 727 | else match nextPoolOrUnit { | |
730 | 728 | case _: Unit => | |
731 | 729 | let actions = if (force) | |
732 | 730 | then [DeleteEntry(keyFinalizationStage), DeleteEntry(keyFinalizationShouldBeForced), DeleteEntry(keyNextPool)] | |
733 | 731 | else [DeleteEntry(keyFinalizationStage), BooleanEntry(keyFinalized(previousEpoch), true), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, startHeight), DeleteEntry(keyNextPool)] | |
734 | 732 | let gwxRewardDepositInv = gwxRewardDeposit() | |
735 | 733 | if ((gwxRewardDepositInv == gwxRewardDepositInv)) | |
736 | 734 | then $Tuple2(actions, true) | |
737 | 735 | else throw("Strict value is not equal to itself.") | |
738 | 736 | case nextPoolStr: String => | |
739 | 737 | $Tuple2([StringEntry(keyNextPool, nextPoolStr)], true) | |
740 | 738 | case _ => | |
741 | 739 | throw("Match error") | |
742 | 740 | } | |
743 | 741 | else throw("Strict value is not equal to itself.") | |
744 | 742 | } | |
745 | 743 | else throw("Strict value is not equal to itself.") | |
746 | 744 | case _ => | |
747 | 745 | throw("Match error") | |
748 | 746 | } | |
749 | 747 | } | |
750 | 748 | else throwErr("finalization is broken") | |
751 | 749 | } | |
752 | 750 | ||
753 | 751 | ||
754 | 752 | ||
755 | 753 | @Callable(i) | |
756 | 754 | func finalizeWrapper (counter) = { | |
757 | - | let votingEmissionRateContract = addressFromStringValue(getStringValue(this, keyVotingEmissionRateContract)) | |
758 | 755 | let result = { | |
759 | 756 | let @ = invoke(this, "finalizeHelper", nil, nil) | |
760 | 757 | if ($isInstanceOf(@, "Boolean")) | |
761 | 758 | then @ | |
762 | 759 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
763 | 760 | } | |
764 | 761 | if ((result == result)) | |
765 | 762 | then if (!(result)) | |
766 | 763 | then if ((counter == 0)) | |
767 | 764 | then throwErr("Current voting is not over yet") | |
768 | - | else { | |
769 | - | let inv = invoke(votingEmissionRateContract, "finalize", nil, nil) | |
770 | - | if ((inv == inv)) | |
771 | - | then $Tuple2(nil, unit) | |
772 | - | else throw("Strict value is not equal to itself.") | |
773 | - | } | |
765 | + | else $Tuple2(nil, unit) | |
774 | 766 | else { | |
775 | 767 | let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault) | |
776 | 768 | if ((maxDepth > counter)) | |
777 | 769 | then { | |
778 | 770 | let inv = invoke(this, "finalizeWrapper", [(counter + 1)], nil) | |
779 | 771 | if ((inv == inv)) | |
780 | 772 | then $Tuple2(nil, unit) | |
781 | 773 | else throw("Strict value is not equal to itself.") | |
782 | 774 | } | |
783 | 775 | else $Tuple2(nil, unit) | |
784 | 776 | } | |
785 | 777 | else throw("Strict value is not equal to itself.") | |
786 | 778 | } | |
787 | 779 | ||
788 | 780 | ||
789 | 781 | ||
790 | 782 | @Callable(i) | |
791 | 783 | func finalize () = { | |
792 | 784 | let inv = invoke(this, "finalizeWrapper", [0], nil) | |
793 | 785 | if ((inv == inv)) | |
794 | 786 | then $Tuple2(nil, unit) | |
795 | 787 | else throw("Strict value is not equal to itself.") | |
796 | 788 | } | |
797 | 789 | ||
798 | 790 | ||
799 | 791 | ||
800 | 792 | @Callable(i) | |
801 | 793 | func containsNodeREADONLY (listName,id) = $Tuple2(nil, containsNode(listName, id)) | |
802 | 794 | ||
803 | 795 | ||
804 | 796 | ||
805 | 797 | @Callable(i) | |
806 | 798 | func insertNode (listName,id) = { | |
807 | 799 | let checkCaller = mustManager(i) | |
808 | 800 | if ((checkCaller == checkCaller)) | |
809 | 801 | then $Tuple2(insertNodeActions(listName, id), unit) | |
810 | 802 | else throw("Strict value is not equal to itself.") | |
811 | 803 | } | |
812 | 804 | ||
813 | 805 | ||
814 | 806 | ||
815 | 807 | @Callable(i) | |
816 | 808 | func deleteNode (listName,id) = { | |
817 | 809 | let checkCaller = mustManager(i) | |
818 | 810 | if ((checkCaller == checkCaller)) | |
819 | 811 | then $Tuple2(deleteNodeActions(listName, id), unit) | |
820 | 812 | else throw("Strict value is not equal to itself.") | |
821 | 813 | } | |
822 | 814 | ||
823 | 815 | ||
824 | - | ||
825 | - | @Callable(i) | |
826 | - | func isFinalizationInProgress () = { | |
827 | - | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
828 | - | let finalizationInProgress = (finalizationStageOrUnit != unit) | |
829 | - | $Tuple2(nil, finalizationInProgress) | |
830 | - | } | |
831 | - | ||
832 | - | ||
833 | 816 | @Verifier(tx) | |
834 | 817 | func verify () = { | |
835 | 818 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
836 | 819 | case pk: ByteVector => | |
837 | 820 | pk | |
838 | 821 | case _: Unit => | |
839 | 822 | tx.senderPublicKey | |
840 | 823 | case _ => | |
841 | 824 | throw("Match error") | |
842 | 825 | } | |
843 | 826 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
844 | 827 | } | |
845 | 828 |
github/deemru/w8io/026f985 99.51 ms ◑