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