tx · 6ns16zc2oV6tZmFcecEgr1SGDDVHsnGMQkGmyd5VN8s1 3N9Zi6AcWcGbM23jQJ4fnzFsoHoTsxYDznr: -0.02300000 Waves 2023.08.08 13:09 [2701487] smart account 3N9Zi6AcWcGbM23jQJ4fnzFsoHoTsxYDznr > SELF 0.00000000 Waves
{ "type": 13, "id": "6ns16zc2oV6tZmFcecEgr1SGDDVHsnGMQkGmyd5VN8s1", "fee": 2300000, "feeAssetId": null, "timestamp": 1691489372065, "version": 2, "chainId": 84, "sender": "3N9Zi6AcWcGbM23jQJ4fnzFsoHoTsxYDznr", "senderPublicKey": "GFbasS3jufhZkK4xR7tdTjjnP8K33KvJFEDHRtxXDkaJ", "proofs": [ "4NWj1bkVm39nPMXPqLj1VnraqDVGUEnDEak9Yk5WBSaDA41kE9w3yCcGCxMGzxMNE7ZE85YUF5MqzDDoWAenv9Ng" ], "script": "base64:BgLcFggCEgQKAggBEgcKBQgICAgBEgQKAggIEgUKAwgIARIECgIICBIDCgEBEgMKAQESBAoCCAgSBAoCCAQSABIDCgEBEgASBAoCCAgSBAoCCAgSBAoCCAgSABIECgIICBIDCgEIIglzZXBhcmF0b3IiDnBvb2xXZWlnaHRNdWx0Ig9tYXhEZXB0aERlZmF1bHQiFmZpbmFsaXphdGlvblN0YWdlVG90YWwiF2ZpbmFsaXphdGlvblN0YWdlU2hhcmVzIg5rZXlFcG9jaExlbmd0aCIRa2V5RXBvY2hMZW5ndGhOZXciFWtleUVwb2NoTGVuZ3RoQnlFcG9jaCIFZXBvY2giD2tleUN1cnJlbnRFcG9jaCILa2V5TWF4RGVwdGgiImtleVZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QiHWtleVZvdGluZ0VtaXNzaW9uUmF0ZUNvbnRyYWN0IhJrZXlGYWN0b3J5Q29udHJhY3QiE2tleUJvb3N0aW5nQ29udHJhY3QiEmtleVN0YWtpbmdDb250cmFjdCIUa2V5RmluYWxpemF0aW9uU3RhZ2UiC2tleU5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kU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmJhARJnZXRMb2NrZWRHd3hBbW91bnQBAVEEAmJlCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAKYIAQUBUQkBAVIBAhRpbnZhbGlkIHVzZXIgYWRkcmVzcwQBaQkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQFqAAAEAmN5BAFZCQCaCAIFBHRoaXMJAQFFAgUCYmUFAWkDCQABAgUBWQIEVW5pdAAAAwkAAQIFAVkCA0ludAQCY3oFAVkFAmN6CQACAQILTWF0Y2ggZXJyb3IJAJQKAgUDbmlsBQJjeQECY0EBAmNCAAQCY0MEAVkJAQJhWAADCQABAgUBWQIKQnl0ZVZlY3RvcgQCYmIFAVkFAmJiAwkAAQIFAVkCBFVuaXQIBQJjQQ9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCY0EJYm9keUJ5dGVzCQCRAwIIBQJjQQZwcm9vZnMAAAUCY0Ntk8qj", "height": 2701487, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 94HVsJkbLicKfLdmmJfpec8W4jF7rhZB8N47ygiVJP1c Next: ESoR3fWFb3L35anCfXfGXEMRi1MkvxzTcf679ZB24ixh 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 | - | ||
191 | 184 | let poolsListName = "pools" | |
192 | 185 | ||
193 | 186 | func getVotesListName (pool) = { | |
194 | - | let $ | |
195 | - | let amountAssetId = $ | |
196 | - | let priceAssetId = $ | |
187 | + | let $t058195859 = pool | |
188 | + | let amountAssetId = $t058195859._1 | |
189 | + | let priceAssetId = $t058195859._2 | |
197 | 190 | makeString(["votes", amountAssetId, priceAssetId], separator) | |
198 | 191 | } | |
199 | 192 | ||
504 | 497 | if ((checkTargetEpoch == checkTargetEpoch)) | |
505 | 498 | then { | |
506 | 499 | let pool = stringToPool(poolStr) | |
507 | - | let $ | |
508 | - | let amountAssetId = $ | |
509 | - | let priceAssetId = $ | |
500 | + | let $t01786217902 = pool | |
501 | + | let amountAssetId = $t01786217902._1 | |
502 | + | let priceAssetId = $t01786217902._2 | |
510 | 503 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
511 | 504 | let gwxAmountAtEndTotal = { | |
512 | 505 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeight], nil) | |
565 | 558 | if ((checkTargetEpoch == checkTargetEpoch)) | |
566 | 559 | then { | |
567 | 560 | let pool = stringToPool(poolStr) | |
568 | - | let $ | |
569 | - | let amountAssetId = $ | |
570 | - | let priceAssetId = $ | |
561 | + | let $t02025920299 = pool | |
562 | + | let amountAssetId = $t02025920299._1 | |
563 | + | let priceAssetId = $t02025920299._2 | |
571 | 564 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
572 | 565 | let lpAssetId = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
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 | - | } | |
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 | + | } | |
603 | 584 | else throw("Strict value is not equal to itself.") | |
604 | 585 | } | |
605 | 586 | else throw("Strict value is not equal to itself.") | |
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 _ => | |
852 | 827 | } | |
853 | 828 | ||
854 | 829 | ||
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 | + | ||
855 | 847 | @Verifier(tx) | |
856 | 848 | func verify () = { | |
857 | 849 | 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 | - | ||
191 | 184 | let poolsListName = "pools" | |
192 | 185 | ||
193 | 186 | func getVotesListName (pool) = { | |
194 | - | let $ | |
195 | - | let amountAssetId = $ | |
196 | - | let priceAssetId = $ | |
187 | + | let $t058195859 = pool | |
188 | + | let amountAssetId = $t058195859._1 | |
189 | + | let priceAssetId = $t058195859._2 | |
197 | 190 | makeString(["votes", amountAssetId, priceAssetId], separator) | |
198 | 191 | } | |
199 | 192 | ||
200 | 193 | ||
201 | 194 | func keyListHead (listName) = { | |
202 | 195 | let meta = if ((listName == poolsListName)) | |
203 | 196 | then "%s%s" | |
204 | 197 | else "%s%s%s%s" | |
205 | 198 | makeString([meta, listName, "head"], separator) | |
206 | 199 | } | |
207 | 200 | ||
208 | 201 | ||
209 | 202 | func keyListSize (listName) = { | |
210 | 203 | let meta = if ((listName == poolsListName)) | |
211 | 204 | then "%s%s" | |
212 | 205 | else "%s%s%s%s" | |
213 | 206 | makeString([meta, listName, "size"], separator) | |
214 | 207 | } | |
215 | 208 | ||
216 | 209 | ||
217 | 210 | func keyListPrev (listName,id) = { | |
218 | 211 | let meta = if ((listName == poolsListName)) | |
219 | 212 | then "%s%s%s%s" | |
220 | 213 | else "%s%s%s%s%s" | |
221 | 214 | makeString([meta, listName, id, "prev"], separator) | |
222 | 215 | } | |
223 | 216 | ||
224 | 217 | ||
225 | 218 | func keyListNext (listName,id) = { | |
226 | 219 | let meta = if ((listName == poolsListName)) | |
227 | 220 | then "%s%s%s%s" | |
228 | 221 | else "%s%s%s%s%s" | |
229 | 222 | makeString([meta, listName, id, "next"], separator) | |
230 | 223 | } | |
231 | 224 | ||
232 | 225 | ||
233 | 226 | func containsNode (listName,id) = { | |
234 | 227 | let headOrUnit = getString(this, keyListHead(listName)) | |
235 | 228 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
236 | 229 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
237 | 230 | if (if ((id == valueOrElse(headOrUnit, ""))) | |
238 | 231 | then true | |
239 | 232 | else (prevOrUnit != unit)) | |
240 | 233 | then true | |
241 | 234 | else (nextOrUnit != unit) | |
242 | 235 | } | |
243 | 236 | ||
244 | 237 | ||
245 | 238 | func insertNodeActions (listName,id) = { | |
246 | 239 | let headOrUnit = getString(this, keyListHead(listName)) | |
247 | 240 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
248 | 241 | let checkNode = if (!(containsNode(listName, id))) | |
249 | 242 | then true | |
250 | 243 | else throwErr("Node exists") | |
251 | 244 | if ((checkNode == checkNode)) | |
252 | 245 | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
253 | 246 | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
254 | 247 | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
255 | 248 | else throw("Strict value is not equal to itself.") | |
256 | 249 | } | |
257 | 250 | ||
258 | 251 | ||
259 | 252 | func deleteNodeActions (listName,id) = { | |
260 | 253 | let headOrUnit = getString(this, keyListHead(listName)) | |
261 | 254 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
262 | 255 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
263 | 256 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
264 | 257 | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
265 | 258 | then (nextOrUnit != unit) | |
266 | 259 | else false) | |
267 | 260 | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
268 | 261 | else if ((nextOrUnit != unit)) | |
269 | 262 | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
270 | 263 | else if ((prevOrUnit != unit)) | |
271 | 264 | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
272 | 265 | else if ((id == valueOrElse(headOrUnit, ""))) | |
273 | 266 | then [DeleteEntry(keyListHead(listName))] | |
274 | 267 | else throwErr(((("invalid node: " + listName) + ".") + id)))) | |
275 | 268 | } | |
276 | 269 | ||
277 | 270 | ||
278 | 271 | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
279 | 272 | ||
280 | 273 | ||
281 | 274 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
282 | 275 | ||
283 | 276 | ||
284 | 277 | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
285 | 278 | case s: String => | |
286 | 279 | addressFromStringValue(s) | |
287 | 280 | case _ => | |
288 | 281 | this | |
289 | 282 | } | |
290 | 283 | ||
291 | 284 | ||
292 | 285 | func managerPublicKeyOrUnit () = { | |
293 | 286 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
294 | 287 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
295 | 288 | case s: String => | |
296 | 289 | fromBase58String(s) | |
297 | 290 | case _: Unit => | |
298 | 291 | unit | |
299 | 292 | case _ => | |
300 | 293 | throw("Match error") | |
301 | 294 | } | |
302 | 295 | } | |
303 | 296 | ||
304 | 297 | ||
305 | 298 | func isManager (i) = match managerPublicKeyOrUnit() { | |
306 | 299 | case pk: ByteVector => | |
307 | 300 | (i.callerPublicKey == pk) | |
308 | 301 | case _: Unit => | |
309 | 302 | (i.caller == this) | |
310 | 303 | case _ => | |
311 | 304 | throw("Match error") | |
312 | 305 | } | |
313 | 306 | ||
314 | 307 | ||
315 | 308 | func mustManager (i) = if (isManager(i)) | |
316 | 309 | then true | |
317 | 310 | else throw("permission denied") | |
318 | 311 | ||
319 | 312 | ||
320 | 313 | func mustThis (i) = if ((i.caller == this)) | |
321 | 314 | then true | |
322 | 315 | else throw("permission denied") | |
323 | 316 | ||
324 | 317 | ||
325 | 318 | @Callable(i) | |
326 | 319 | func getUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
327 | 320 | let boostingContractAddress = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyBoostingContract)), wrapErr("invalid boosting contract address")) | |
328 | 321 | $Tuple2(nil, { | |
329 | 322 | let @ = invoke(boostingContractAddress, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil) | |
330 | 323 | if ($isInstanceOf(@, "Int")) | |
331 | 324 | then @ | |
332 | 325 | else throw(($getType(@) + " couldn't be cast to Int")) | |
333 | 326 | }) | |
334 | 327 | } | |
335 | 328 | ||
336 | 329 | ||
337 | 330 | ||
338 | 331 | @Callable(i) | |
339 | 332 | func constructor (factoryContract,votingEmissionCandidateContract,boostingContract,stakingContract,epochLength) = { | |
340 | 333 | let checks = [mustManager(i), if ((addressFromString(factoryContract) != unit)) | |
341 | 334 | then true | |
342 | 335 | else "invalid factory contract address", if ((addressFromString(votingEmissionCandidateContract) != unit)) | |
343 | 336 | then true | |
344 | 337 | else "invalid voting emission candidate contract address", if ((addressFromString(boostingContract) != unit)) | |
345 | 338 | then true | |
346 | 339 | else "invalid boosting contract address", if ((addressFromString(stakingContract) != unit)) | |
347 | 340 | then true | |
348 | 341 | else "invalid staking contract address", if ((epochLength > 0)) | |
349 | 342 | then true | |
350 | 343 | else throwErr("invalid epoch length")] | |
351 | 344 | if ((checks == checks)) | |
352 | 345 | then $Tuple2([StringEntry(keyFactoryContract, factoryContract), StringEntry(keyVotingEmissionCandidateContract, votingEmissionCandidateContract), StringEntry(keyBoostingContract, boostingContract), StringEntry(keyStakingContract, stakingContract), IntegerEntry(keyEpochLength, epochLength)], unit) | |
353 | 346 | else throw("Strict value is not equal to itself.") | |
354 | 347 | } | |
355 | 348 | ||
356 | 349 | ||
357 | 350 | ||
358 | 351 | @Callable(i) | |
359 | 352 | func create (amountAssetId,priceAssetId) = { | |
360 | 353 | let checks = [if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionCandidateContract), ""))) | |
361 | 354 | then true | |
362 | 355 | else mustManager(i)] | |
363 | 356 | if ((checks == checks)) | |
364 | 357 | then { | |
365 | 358 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
366 | 359 | let inListActions = ([BooleanEntry(keyInList(pool), true)] ++ insertNodeActions(poolsListName, poolToString(pool))) | |
367 | 360 | let currentEpochIsNotDefined = (getInteger(this, keyCurrentEpoch) == unit) | |
368 | 361 | let startHeightActions = if (currentEpochIsNotDefined) | |
369 | 362 | then { | |
370 | 363 | let epoch = 0 | |
371 | 364 | [IntegerEntry(keyCurrentEpoch, epoch), IntegerEntry(keyStartHeightByEpoch(epoch), height), IntegerEntry(keyStartHeight, height), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, height)] | |
372 | 365 | } | |
373 | 366 | else nil | |
374 | 367 | $Tuple2((inListActions ++ startHeightActions), unit) | |
375 | 368 | } | |
376 | 369 | else throw("Strict value is not equal to itself.") | |
377 | 370 | } | |
378 | 371 | ||
379 | 372 | ||
380 | 373 | ||
381 | 374 | @Callable(i) | |
382 | 375 | func vote (amountAssetId,priceAssetId,amount) = { | |
383 | 376 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
384 | 377 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
385 | 378 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
386 | 379 | let epochLength = getIntOrFail(this, keyEpochLength) | |
387 | 380 | let endHeight = (startHeight + epochLength) | |
388 | 381 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
389 | 382 | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
390 | 383 | let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0) | |
391 | 384 | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
392 | 385 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
393 | 386 | let gwxAmountAtEndTotal = { | |
394 | 387 | let @ = invoke(this, "getUserGwxAmountAtHeight", [toBase58String(i.caller.bytes), endHeight], nil) | |
395 | 388 | if ($isInstanceOf(@, "Int")) | |
396 | 389 | then @ | |
397 | 390 | else throw(($getType(@) + " couldn't be cast to Int")) | |
398 | 391 | } | |
399 | 392 | let available = (gwxAmountAtEndTotal - used) | |
400 | 393 | let newVote = (vote + amount) | |
401 | 394 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
402 | 395 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
403 | 396 | then true | |
404 | 397 | else throwErr("invalid assets"), if ((endHeight > height)) | |
405 | 398 | then true | |
406 | 399 | else throwErr("invalid height"), if ((finalizationStageOrUnit == unit)) | |
407 | 400 | then true | |
408 | 401 | else throwErr("finalization in progress"), if ((gwxAmountAtEndTotal > 0)) | |
409 | 402 | then true | |
410 | 403 | else throwErr("you do not have gWX"), if (if ((amount > 0)) | |
411 | 404 | then (available >= amount) | |
412 | 405 | else false) | |
413 | 406 | then true | |
414 | 407 | else throwErr("invalid amount"), if (wxEmission) | |
415 | 408 | then true | |
416 | 409 | else throwErr("pool hasn't WX_EMISSION label")] | |
417 | 410 | if ((checks == checks)) | |
418 | 411 | then { | |
419 | 412 | let votesListName = getVotesListName(pool) | |
420 | 413 | let userAddressStr = toString(i.caller) | |
421 | 414 | let votesListActions = if (containsNode(votesListName, userAddressStr)) | |
422 | 415 | then nil | |
423 | 416 | else insertNodeActions(votesListName, userAddressStr) | |
424 | 417 | $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 | 418 | } | |
426 | 419 | else throw("Strict value is not equal to itself.") | |
427 | 420 | } | |
428 | 421 | ||
429 | 422 | ||
430 | 423 | ||
431 | 424 | @Callable(i) | |
432 | 425 | func cancelVote (amountAssetId,priceAssetId) = { | |
433 | 426 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
434 | 427 | let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0) | |
435 | 428 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
436 | 429 | let epochLength = getIntOrFail(this, keyEpochLength) | |
437 | 430 | let endHeight = (startHeight + epochLength) | |
438 | 431 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
439 | 432 | let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0) | |
440 | 433 | let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0) | |
441 | 434 | let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0) | |
442 | 435 | let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0) | |
443 | 436 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
444 | 437 | then true | |
445 | 438 | else throwErr("invalid assets"), if ((endHeight > height)) | |
446 | 439 | then true | |
447 | 440 | else throwErr("invalid height"), if ((finalizationStageOrUnit == unit)) | |
448 | 441 | then true | |
449 | 442 | else throwErr("finalization in progress"), if ((vote > 0)) | |
450 | 443 | then true | |
451 | 444 | else throwErr("no vote")] | |
452 | 445 | if ((checks == checks)) | |
453 | 446 | then { | |
454 | 447 | let votesListName = getVotesListName(pool) | |
455 | 448 | let userAddressStr = toString(i.caller) | |
456 | 449 | $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 | 450 | } | |
458 | 451 | else throw("Strict value is not equal to itself.") | |
459 | 452 | } | |
460 | 453 | ||
461 | 454 | ||
462 | 455 | ||
463 | 456 | @Callable(i) | |
464 | 457 | func setEpochLength (newEpochLength) = { | |
465 | 458 | let checks = [mustManager(i), if ((newEpochLength > 0)) | |
466 | 459 | then true | |
467 | 460 | else throwErr("invalid epoch length")] | |
468 | 461 | if ((checks == checks)) | |
469 | 462 | then $Tuple2([IntegerEntry(keyEpochLengthNew, newEpochLength)], unit) | |
470 | 463 | else throw("Strict value is not equal to itself.") | |
471 | 464 | } | |
472 | 465 | ||
473 | 466 | ||
474 | 467 | ||
475 | 468 | @Callable(i) | |
476 | 469 | func setMaxDepth (newMaxDepth) = { | |
477 | 470 | let checks = [mustManager(i), if ((newMaxDepth > 0)) | |
478 | 471 | then true | |
479 | 472 | else throwErr("invalid max depth")] | |
480 | 473 | if ((checks == checks)) | |
481 | 474 | then $Tuple2([IntegerEntry(keyMaxDepth, newMaxDepth)], unit) | |
482 | 475 | else throw("Strict value is not equal to itself.") | |
483 | 476 | } | |
484 | 477 | ||
485 | 478 | ||
486 | 479 | ||
487 | 480 | @Callable(i) | |
488 | 481 | func processVoteINTERNAL (poolStr,userAddressStr) = { | |
489 | 482 | let checkCaller = mustThis(i) | |
490 | 483 | if ((checkCaller == checkCaller)) | |
491 | 484 | then { | |
492 | 485 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr(("processVoteINTERNAL: invalid user address " + userAddressStr))) | |
493 | 486 | let epoch = getIntOrFail(this, keyCurrentEpoch) | |
494 | 487 | let epochPrevious = (epoch - 1) | |
495 | 488 | let epochLength = getIntOrFail(this, keyEpochLength) | |
496 | 489 | let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch)) | |
497 | 490 | let endHeight = (startHeight + epochLength) | |
498 | 491 | let startHeightPrevious = getIntOrFail(this, keyStartHeightByEpoch(epochPrevious)) | |
499 | 492 | let epochLengthPrevious = getIntOrFail(this, keyEpochLengthByEpoch(epochPrevious)) | |
500 | 493 | let endHeightPrevious = (startHeightPrevious + epochLengthPrevious) | |
501 | 494 | let checkTargetEpoch = if ((epochPrevious >= 0)) | |
502 | 495 | then true | |
503 | 496 | else throwErr("processVoteINTERNAL: invalid previous epoch") | |
504 | 497 | if ((checkTargetEpoch == checkTargetEpoch)) | |
505 | 498 | then { | |
506 | 499 | let pool = stringToPool(poolStr) | |
507 | - | let $ | |
508 | - | let amountAssetId = $ | |
509 | - | let priceAssetId = $ | |
500 | + | let $t01786217902 = pool | |
501 | + | let amountAssetId = $t01786217902._1 | |
502 | + | let priceAssetId = $t01786217902._2 | |
510 | 503 | let wxEmission = checkWxEmissionPoolLabel(pool) | |
511 | 504 | let gwxAmountAtEndTotal = { | |
512 | 505 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeight], nil) | |
513 | 506 | if ($isInstanceOf(@, "Int")) | |
514 | 507 | then @ | |
515 | 508 | else throw(($getType(@) + " couldn't be cast to Int")) | |
516 | 509 | } | |
517 | 510 | let gwxAmountAtEndTotalPrevious = { | |
518 | 511 | let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeightPrevious], nil) | |
519 | 512 | if ($isInstanceOf(@, "Int")) | |
520 | 513 | then @ | |
521 | 514 | else throw(($getType(@) + " couldn't be cast to Int")) | |
522 | 515 | } | |
523 | 516 | let totalVotes = valueOrElse(getInteger(keyTotalVotes(epoch)), 0) | |
524 | 517 | let votingResult = valueOrElse(getInteger(keyVotingResult(pool, epoch)), 0) | |
525 | 518 | let votePrevious = valueOrErrorMessage(getInteger(keyVote(pool, userAddress, epochPrevious)), wrapErr((((("processVoteINTERNAL " + poolStr) + " ") + userAddressStr) + ": no previous vote"))) | |
526 | 519 | let used = valueOrElse(getInteger(this, keyUsed(userAddress, epoch)), 0) | |
527 | 520 | let lpAssetIdStr = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
528 | 521 | let votingResultStakedPrevious = valueOrElse(getInteger(keyVotingResultStaked(lpAssetIdStr, epochPrevious)), 0) | |
529 | 522 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
530 | 523 | let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(lpAssetIdStr, userAddressStr)), 0) | |
531 | 524 | let votingResultStakedActions = if ((stakedByUser == 0)) | |
532 | 525 | then nil | |
533 | 526 | else [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, epochPrevious), (votingResultStakedPrevious + votePrevious))] | |
534 | 527 | let newVote = if ((gwxAmountAtEndTotalPrevious > 0)) | |
535 | 528 | then fraction(votePrevious, gwxAmountAtEndTotal, gwxAmountAtEndTotalPrevious) | |
536 | 529 | else 0 | |
537 | 530 | let actions = if (if ((newVote > 0)) | |
538 | 531 | then wxEmission | |
539 | 532 | else false) | |
540 | 533 | 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 | 534 | else deleteNodeActions(getVotesListName(pool), userAddressStr) | |
542 | 535 | $Tuple2((actions ++ votingResultStakedActions), unit) | |
543 | 536 | } | |
544 | 537 | else throw("Strict value is not equal to itself.") | |
545 | 538 | } | |
546 | 539 | else throw("Strict value is not equal to itself.") | |
547 | 540 | } | |
548 | 541 | ||
549 | 542 | ||
550 | 543 | ||
551 | 544 | @Callable(i) | |
552 | 545 | func processPoolINTERNAL (poolStr,force) = { | |
553 | 546 | let checkCaller = mustThis(i) | |
554 | 547 | if ((checkCaller == checkCaller)) | |
555 | 548 | then { | |
556 | 549 | let targetEpoch = { | |
557 | 550 | let currentEpoch = getIntOrFail(this, keyCurrentEpoch) | |
558 | 551 | if (force) | |
559 | 552 | then currentEpoch | |
560 | 553 | else (currentEpoch - 1) | |
561 | 554 | } | |
562 | 555 | let checkTargetEpoch = if ((targetEpoch >= 0)) | |
563 | 556 | then true | |
564 | 557 | else throwErr("processPoolINTERNAL: invalid target epoch") | |
565 | 558 | if ((checkTargetEpoch == checkTargetEpoch)) | |
566 | 559 | then { | |
567 | 560 | let pool = stringToPool(poolStr) | |
568 | - | let $ | |
569 | - | let amountAssetId = $ | |
570 | - | let priceAssetId = $ | |
561 | + | let $t02025920299 = pool | |
562 | + | let amountAssetId = $t02025920299._1 | |
563 | + | let priceAssetId = $t02025920299._2 | |
571 | 564 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract)) | |
572 | 565 | let lpAssetId = getLpAssetByPoolAssets(amountAssetId, priceAssetId) | |
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 | - | } | |
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 | + | } | |
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 | 732 | let votingEmissionRateContract = addressFromStringValue(getStringValue(this, keyVotingEmissionRateContract)) | |
758 | 733 | let result = { | |
759 | 734 | let @ = invoke(this, "finalizeHelper", nil, nil) | |
760 | 735 | if ($isInstanceOf(@, "Boolean")) | |
761 | 736 | then @ | |
762 | 737 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
763 | 738 | } | |
764 | 739 | if ((result == result)) | |
765 | 740 | then if (!(result)) | |
766 | 741 | then if ((counter == 0)) | |
767 | 742 | then throwErr("Current voting is not over yet") | |
768 | 743 | else { | |
769 | 744 | let inv = invoke(votingEmissionRateContract, "finalize", nil, nil) | |
770 | 745 | if ((inv == inv)) | |
771 | 746 | then $Tuple2(nil, unit) | |
772 | 747 | else throw("Strict value is not equal to itself.") | |
773 | 748 | } | |
774 | 749 | else { | |
775 | 750 | let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault) | |
776 | 751 | if ((maxDepth > counter)) | |
777 | 752 | then { | |
778 | 753 | let inv = invoke(this, "finalizeWrapper", [(counter + 1)], nil) | |
779 | 754 | if ((inv == inv)) | |
780 | 755 | then $Tuple2(nil, unit) | |
781 | 756 | else throw("Strict value is not equal to itself.") | |
782 | 757 | } | |
783 | 758 | else $Tuple2(nil, unit) | |
784 | 759 | } | |
785 | 760 | else throw("Strict value is not equal to itself.") | |
786 | 761 | } | |
787 | 762 | ||
788 | 763 | ||
789 | 764 | ||
790 | 765 | @Callable(i) | |
791 | 766 | func finalize () = { | |
792 | 767 | let inv = invoke(this, "finalizeWrapper", [0], nil) | |
793 | 768 | if ((inv == inv)) | |
794 | 769 | then $Tuple2(nil, unit) | |
795 | 770 | else throw("Strict value is not equal to itself.") | |
796 | 771 | } | |
797 | 772 | ||
798 | 773 | ||
799 | 774 | ||
800 | 775 | @Callable(i) | |
801 | 776 | func containsNodeREADONLY (listName,id) = $Tuple2(nil, containsNode(listName, id)) | |
802 | 777 | ||
803 | 778 | ||
804 | 779 | ||
805 | 780 | @Callable(i) | |
806 | 781 | func insertNode (listName,id) = { | |
807 | 782 | let checkCaller = mustManager(i) | |
808 | 783 | if ((checkCaller == checkCaller)) | |
809 | 784 | then $Tuple2(insertNodeActions(listName, id), unit) | |
810 | 785 | else throw("Strict value is not equal to itself.") | |
811 | 786 | } | |
812 | 787 | ||
813 | 788 | ||
814 | 789 | ||
815 | 790 | @Callable(i) | |
816 | 791 | func deleteNode (listName,id) = { | |
817 | 792 | let checkCaller = mustManager(i) | |
818 | 793 | if ((checkCaller == checkCaller)) | |
819 | 794 | then $Tuple2(deleteNodeActions(listName, id), unit) | |
820 | 795 | else throw("Strict value is not equal to itself.") | |
821 | 796 | } | |
822 | 797 | ||
823 | 798 | ||
824 | 799 | ||
825 | 800 | @Callable(i) | |
826 | 801 | func isFinalizationInProgress () = { | |
827 | 802 | let finalizationStageOrUnit = getInteger(this, keyFinalizationStage) | |
828 | 803 | let finalizationInProgress = (finalizationStageOrUnit != unit) | |
829 | 804 | $Tuple2(nil, finalizationInProgress) | |
830 | 805 | } | |
831 | 806 | ||
832 | 807 | ||
833 | 808 | ||
834 | 809 | @Callable(i) | |
835 | 810 | func deletePool (amountAssetId,priceAssetId) = { | |
836 | 811 | let checkCaller = if (if ((i.caller == factoryContract)) | |
837 | 812 | then true | |
838 | 813 | else mustManager(i)) | |
839 | 814 | then true | |
840 | 815 | else throwErr("Permission denied") | |
841 | 816 | if ((checkCaller == checkCaller)) | |
842 | 817 | then { | |
843 | 818 | let listName = "pools" | |
844 | 819 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
845 | 820 | let id = makeString([amountAssetId, priceAssetId], separator) | |
846 | 821 | let actions = if (containsNode(listName, id)) | |
847 | 822 | then deleteNodeActions(listName, id) | |
848 | 823 | else nil | |
849 | 824 | ([DeleteEntry(keyInList(pool))] ++ actions) | |
850 | 825 | } | |
851 | 826 | else throw("Strict value is not equal to itself.") | |
852 | 827 | } | |
853 | 828 | ||
854 | 829 | ||
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 | + | ||
855 | 847 | @Verifier(tx) | |
856 | 848 | func verify () = { | |
857 | 849 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
858 | 850 | case pk: ByteVector => | |
859 | 851 | pk | |
860 | 852 | case _: Unit => | |
861 | 853 | tx.senderPublicKey | |
862 | 854 | case _ => | |
863 | 855 | throw("Match error") | |
864 | 856 | } | |
865 | 857 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
866 | 858 | } | |
867 | 859 |
github/deemru/w8io/169f3d6 111.30 ms ◑