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