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