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