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