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