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