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