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