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