tx · 3Adz2Z3Gx2wiayttL1ZbLMg9FNLVhfsZuk637xtAiAjq 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz: -0.02200000 Waves 2023.01.10 13:35 [2398735] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves
{ "type": 13, "id": "3Adz2Z3Gx2wiayttL1ZbLMg9FNLVhfsZuk637xtAiAjq", "fee": 2200000, "feeAssetId": null, "timestamp": 1673346963370, "version": 1, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "3YLUa5J2eU9nbnxXCnqPm6SYGgpLx3v8Qtz88wGENZDXzY4xFz1YDyZTCNZKuJSnYFnNW9t85gTF3zjVbaer2CXW" ], "script": "base64:BgL1HggCEgMKAQgSAwoBCBIDCgEIEgASABIECgIIARIDCgEIEgQKAggIEgYKBAEYCBgSBAoCGAgSBAoCCAgSAwoBCBIECgIICCIGU0NBTEU4IgVNVUxUOCIHU0NBTEUxOCIGTVVMVDE4IgNTRVAiDlBPT0xXRUlHSFRNVUxUIgp6ZXJvQmlnSW50IglvbmVCaWdJbnQiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgVhc0ludCIGdmFsSW50Ighhc1N0cmluZyIGdmFsU3RyIgxhc0J5dGVWZWN0b3IiBnZhbEJpbiIPZ2V0U3RyaW5nT3JGYWlsIgdhZGRyZXNzIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIMZ2V0SW50T3JaZXJvIg9nZXRJbnRPckRlZmF1bHQiCmRlZmF1bHRWYWwiDGdldEludE9yRmFpbCIZZ2V0QmlnSW50RnJvbVN0cmluZ09yWmVybyIcZ2V0QmlnSW50RnJvbVN0cmluZ09yRGVmYXVsdCIBcyIFdG9YMTgiB29yaWdWYWwiDW9yaWdTY2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BHRoaXMJAQJhcwIFAmF5BQJhQQQCY0EJAQF2AgUCYVUJAQFaAQUCYXkEAmNhCAkBAmJRBAUCYXkFAmFBBQJjQQAAAl8xBAJjQgkAuAICBQJjYQUCY3oEAmNDAwkAvwICBQJjQgUBZwkA/AcEBQR0aGlzAg9jbGFpbVd4SU5URVJOQUwJAMwIAgUCYXkJAMwIAgUCYUEFA25pbAUDbmlsBQR1bml0AwkAAAIFAmNDBQJjQwQCZHAJAKIIAQkBAmJlAgUCYmEFAmFBBAJkbgUCZHADCQABAgUCZG4CBFVuaXQJAJQKAgkAzAgCCQELRGVsZXRlRW50cnkBCQECYVgBBQJheQUDbmlsBwMJAAECBQJkbgIGU3RyaW5nBAJkcQUCZG4JAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCCQECYVgBBQJheQUCZHEFA25pbAYJAAIBAgtNYXRjaCBlcnJvcgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECC01hdGNoIGVycm9yCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmNoAQ5vbk1vZGlmeVdlaWdodAICYXECYnQDCQECIT0CCAUCY2gGY2FsbGVyBQJhVQkAAgECEnBlcm1pc3Npb25zIGRlbmllZAQCZHIJAQJicwMFAmFxBQJidAAABAJicQgFAmRyAl8xBAJiUwgFAmRyAl8yBAJiVAgFAmRyAl8zBQJiUwECZHMBAmR0AAQCZHUEAWsJAQJjZAADCQABAgUBawIKQnl0ZVZlY3RvcgQCY2oFAWsFAmNqAwkAAQIFAWsCBFVuaXQIBQJkcw9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZHMJYm9keUJ5dGVzCQCRAwIIBQJkcwZwcm9vZnMAAAUCZHUKmMew", "chainId": 84, "height": 2398735, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 87aS6GpgyBQVTPRGk5LL7ZKpzG3Fzov9mSvDpFp4kwcU Next: EfzYkYm6CCLU4X7x256TKkBDXcJa3b18LCMDbuuEtYVu Diff:
Old | New | Differences | |
---|---|---|---|
572 | 572 | let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0]) | |
573 | 573 | let minRewardPart = availableToClaim | |
574 | 574 | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
575 | - | let totalReward = (minRewardPart + boostRewardPart) | |
576 | 575 | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
577 | 576 | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
578 | 577 | if ((emitBoost == emitBoost)) | |
581 | 580 | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
582 | 581 | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
583 | 582 | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
584 | - | ||
583 | + | [StringEntry(claimedByUserKEY, toString(claimedByUserValue)), StringEntry(claimedByUserMinRewardKEY, toString(claimedByUserMinRewardPlusPart)), StringEntry(claimedByUserBoostRewardKEY, toString(claimedByUserBoostRewardPlusBoostRewardPart)), StringEntry(claimedTotalKEY, toString(claimedTotalPlusAvailableToClaim)), ScriptTransfer(userAddress, toInt(minRewardPart), wxAssetId), ScriptTransfer(userAddress, toInt(boostRewardPart), wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, toInt(availableToClaim), i.transactionId)] | |
585 | 584 | } | |
586 | 585 | else throw("Strict value is not equal to itself.") | |
587 | 586 | } | |
643 | 642 | else (height - emissionStartBlock) | |
644 | 643 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
645 | 644 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
646 | - | let $ | |
647 | - | let wxToClaimUserNew = $ | |
648 | - | let integralSTATE = $ | |
649 | - | let debug = $ | |
645 | + | let $t02635726469 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
646 | + | let wxToClaimUserNew = $t02635726469._1 | |
647 | + | let integralSTATE = $t02635726469._2 | |
648 | + | let debug = $t02635726469._3 | |
650 | 649 | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
651 | 650 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
652 | 651 | let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0]) | |
655 | 654 | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
656 | 655 | let totalReward = (minRewardPart + boostRewardPart) | |
657 | 656 | $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP)) | |
658 | - | } | |
659 | - | ||
660 | - | ||
661 | - | ||
662 | - | @Callable(i) | |
663 | - | func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = { | |
664 | - | let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0) | |
665 | - | $Tuple2(nil, stakedByUser) | |
666 | 657 | } | |
667 | 658 | ||
668 | 659 | ||
721 | 712 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
722 | 713 | then throw("permissions denied") | |
723 | 714 | else { | |
724 | - | let $ | |
725 | - | let wxPerLpIntegralNew = $ | |
726 | - | let poolIntegralSTATE = $ | |
727 | - | let poolDEBUG = $ | |
715 | + | let $t02876928879 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
716 | + | let wxPerLpIntegralNew = $t02876928879._1 | |
717 | + | let poolIntegralSTATE = $t02876928879._2 | |
718 | + | let poolDEBUG = $t02876928879._3 | |
728 | 719 | poolIntegralSTATE | |
729 | 720 | } | |
730 | 721 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let SCALE18 = 18 | |
9 | 9 | ||
10 | 10 | let MULT18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let SEP = "__" | |
13 | 13 | ||
14 | 14 | let POOLWEIGHTMULT = MULT8 | |
15 | 15 | ||
16 | 16 | let zeroBigInt = toBigInt(0) | |
17 | 17 | ||
18 | 18 | let oneBigInt = toBigInt(1) | |
19 | 19 | ||
20 | 20 | func asAnyList (val) = match val { | |
21 | 21 | case valAnyLyst: List[Any] => | |
22 | 22 | valAnyLyst | |
23 | 23 | case _ => | |
24 | 24 | throw("fail to cast into List[Any]") | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func asInt (val) = match val { | |
29 | 29 | case valInt: Int => | |
30 | 30 | valInt | |
31 | 31 | case _ => | |
32 | 32 | throw("fail to cast into Int") | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func asString (val) = match val { | |
37 | 37 | case valStr: String => | |
38 | 38 | valStr | |
39 | 39 | case _ => | |
40 | 40 | throw("fail to cast into Int") | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func asByteVector (val) = match val { | |
45 | 45 | case valBin: ByteVector => | |
46 | 46 | valBin | |
47 | 47 | case _ => | |
48 | 48 | throw("fail to cast into Int") | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined")) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0"))) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) { | |
71 | 71 | case s: String => | |
72 | 72 | value(parseBigInt(s)) | |
73 | 73 | case _: Unit => | |
74 | 74 | defaultVal | |
75 | 75 | case _ => | |
76 | 76 | throw("Match error") | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | let IdxFactoryCfgStakingDapp = 1 | |
93 | 93 | ||
94 | 94 | let IdxFactoryCfgBoostingDapp = 2 | |
95 | 95 | ||
96 | 96 | let IdxFactoryCfgIdoDapp = 3 | |
97 | 97 | ||
98 | 98 | let IdxFactoryCfgTeamDapp = 4 | |
99 | 99 | ||
100 | 100 | let IdxFactoryCfgEmissionDapp = 5 | |
101 | 101 | ||
102 | 102 | let IdxFactoryCfgRestDapp = 6 | |
103 | 103 | ||
104 | 104 | let IdxFactoryCfgSlippageDapp = 7 | |
105 | 105 | ||
106 | 106 | func keyFactoryCfg () = "%s__factoryConfig" | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr" | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func keyAddonAddr () = "%s__addonAddr" | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func keyFactoryLpList () = "%s__lpTokensList" | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP) | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP) | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP) | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP) | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP) | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP) | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP) | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP) | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP) | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP) | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | let factoryAddress = getStringOrFail(this, keyFactoryAddress()) | |
233 | 233 | ||
234 | 234 | let factoryContract = addressFromStringValue(factoryAddress) | |
235 | 235 | ||
236 | 236 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
237 | 237 | ||
238 | 238 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
239 | 239 | ||
240 | 240 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
241 | 241 | ||
242 | 242 | func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP) | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP) | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP) | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP) | |
252 | 252 | ||
253 | 253 | ||
254 | 254 | func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP) | |
255 | 255 | ||
256 | 256 | ||
257 | 257 | func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP) | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func containsNode (listName,id) = { | |
261 | 261 | let headOrUnit = getString(this, keyListHead(listName)) | |
262 | 262 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
263 | 263 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
264 | 264 | if (if ((id == valueOrElse(headOrUnit, ""))) | |
265 | 265 | then true | |
266 | 266 | else (prevOrUnit != unit)) | |
267 | 267 | then true | |
268 | 268 | else (nextOrUnit != unit) | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func insertNodeActions (listName,id) = { | |
273 | 273 | let headOrUnit = getString(this, keyListHead(listName)) | |
274 | 274 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
275 | 275 | let checkNode = if (!(containsNode(listName, id))) | |
276 | 276 | then true | |
277 | 277 | else throw("Node exists") | |
278 | 278 | if ((checkNode == checkNode)) | |
279 | 279 | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
280 | 280 | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
281 | 281 | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
282 | 282 | else throw("Strict value is not equal to itself.") | |
283 | 283 | } | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func deleteNodeActions (listName,id) = { | |
287 | 287 | let headOrUnit = getString(this, keyListHead(listName)) | |
288 | 288 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
289 | 289 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
290 | 290 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
291 | 291 | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
292 | 292 | then (nextOrUnit != unit) | |
293 | 293 | else false) | |
294 | 294 | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
295 | 295 | else if ((nextOrUnit != unit)) | |
296 | 296 | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
297 | 297 | else if ((prevOrUnit != unit)) | |
298 | 298 | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
299 | 299 | else if ((id == valueOrElse(headOrUnit, ""))) | |
300 | 300 | then [DeleteEntry(keyListHead(listName))] | |
301 | 301 | else throw(((("invalid node: " + listName) + ".") + id)))) | |
302 | 302 | } | |
303 | 303 | ||
304 | 304 | ||
305 | 305 | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt)) | |
306 | 306 | then (stakedByUser > zeroBigInt) | |
307 | 307 | else false) | |
308 | 308 | then zeroBigInt | |
309 | 309 | else if ((stakedByUser == zeroBigInt)) | |
310 | 310 | then wxPerLpIntegralNew | |
311 | 311 | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt)) | |
312 | 312 | then (stakedByUser > zeroBigInt) | |
313 | 313 | else false) | |
314 | 314 | then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY))) | |
315 | 315 | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
316 | 316 | ||
317 | 317 | ||
318 | 318 | func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = { | |
319 | 319 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
320 | 320 | let stakedTotal = toBigInt(readStaked(stakedTotalKEY)) | |
321 | 321 | let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt)) | |
322 | 322 | then oneBigInt | |
323 | 323 | else stakedTotal | |
324 | 324 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
325 | 325 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
326 | 326 | let MULT3 = 1000 | |
327 | 327 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3) | |
328 | 328 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
329 | 329 | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
330 | 330 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
331 | 331 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
332 | 332 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
333 | 333 | let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY) | |
334 | 334 | let wxPerLpOrZeroX3 = 0 | |
335 | 335 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
336 | 336 | let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0)) | |
337 | 337 | then toBigInt(wxPerLpOrZeroX3) | |
338 | 338 | else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal) | |
339 | 339 | let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount)) | |
340 | 340 | let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt)) | |
341 | 341 | then oneBigInt | |
342 | 342 | else stakedTotalNew | |
343 | 343 | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh))) | |
344 | 344 | let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew) | |
345 | 345 | let wxPerLpIntegralLastUpdHeightNew = height | |
346 | 346 | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
347 | 347 | $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug) | |
348 | 348 | } | |
349 | 349 | ||
350 | 350 | ||
351 | 351 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
352 | 352 | let $t01427414396 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
353 | 353 | let wxPerLpIntegralNew = $t01427414396._1 | |
354 | 354 | let poolIntegralSTATE = $t01427414396._2 | |
355 | 355 | let poolDEBUG = $t01427414396._3 | |
356 | 356 | let MULT3 = 1000 | |
357 | 357 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
358 | 358 | let stakedByUser = readStaked(stakedByUserKEY) | |
359 | 359 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
360 | 360 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
361 | 361 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
362 | 362 | let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY) | |
363 | 363 | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
364 | 364 | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
365 | 365 | let MULT11 = (MULT8 * MULT3) | |
366 | 366 | let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt]) | |
367 | 367 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
368 | 368 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
369 | 369 | let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
370 | 370 | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug) | |
371 | 371 | } | |
372 | 372 | ||
373 | 373 | ||
374 | 374 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
375 | 375 | case s: String => | |
376 | 376 | fromBase58String(s) | |
377 | 377 | case _: Unit => | |
378 | 378 | unit | |
379 | 379 | case _ => | |
380 | 380 | throw("Match error") | |
381 | 381 | } | |
382 | 382 | ||
383 | 383 | ||
384 | 384 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
385 | 385 | case s: String => | |
386 | 386 | fromBase58String(s) | |
387 | 387 | case _: Unit => | |
388 | 388 | unit | |
389 | 389 | case _ => | |
390 | 390 | throw("Match error") | |
391 | 391 | } | |
392 | 392 | ||
393 | 393 | ||
394 | 394 | let permissionDeniedError = throw("Permission denied") | |
395 | 395 | ||
396 | 396 | func mustThis (i) = if ((i.caller == this)) | |
397 | 397 | then true | |
398 | 398 | else permissionDeniedError | |
399 | 399 | ||
400 | 400 | ||
401 | 401 | func mustManager (i) = match managerPublicKeyOrUnit() { | |
402 | 402 | case pk: ByteVector => | |
403 | 403 | if ((i.callerPublicKey == pk)) | |
404 | 404 | then true | |
405 | 405 | else permissionDeniedError | |
406 | 406 | case _: Unit => | |
407 | 407 | if ((i.caller == this)) | |
408 | 408 | then true | |
409 | 409 | else permissionDeniedError | |
410 | 410 | case _ => | |
411 | 411 | throw("Match error") | |
412 | 412 | } | |
413 | 413 | ||
414 | 414 | ||
415 | 415 | @Callable(i) | |
416 | 416 | func constructor (factoryAddressStr) = { | |
417 | 417 | let checkCaller = mustManager(i) | |
418 | 418 | if ((checkCaller == checkCaller)) | |
419 | 419 | then [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
420 | 420 | else throw("Strict value is not equal to itself.") | |
421 | 421 | } | |
422 | 422 | ||
423 | 423 | ||
424 | 424 | ||
425 | 425 | @Callable(i) | |
426 | 426 | func constructorV2 (votingEmissionContract) = { | |
427 | 427 | let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit)) | |
428 | 428 | then true | |
429 | 429 | else "invalid voting emission contract address"] | |
430 | 430 | if ((cheks == cheks)) | |
431 | 431 | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)] | |
432 | 432 | else throw("Strict value is not equal to itself.") | |
433 | 433 | } | |
434 | 434 | ||
435 | 435 | ||
436 | 436 | ||
437 | 437 | @Callable(i) | |
438 | 438 | func setManager (pendingManagerPublicKey) = { | |
439 | 439 | let checkCaller = mustManager(i) | |
440 | 440 | if ((checkCaller == checkCaller)) | |
441 | 441 | then { | |
442 | 442 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
443 | 443 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
444 | 444 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
445 | 445 | else throw("Strict value is not equal to itself.") | |
446 | 446 | } | |
447 | 447 | else throw("Strict value is not equal to itself.") | |
448 | 448 | } | |
449 | 449 | ||
450 | 450 | ||
451 | 451 | ||
452 | 452 | @Callable(i) | |
453 | 453 | func confirmManager () = { | |
454 | 454 | let pm = pendingManagerPublicKeyOrUnit() | |
455 | 455 | let hasPM = if (isDefined(pm)) | |
456 | 456 | then true | |
457 | 457 | else throw("No pending manager") | |
458 | 458 | if ((hasPM == hasPM)) | |
459 | 459 | then { | |
460 | 460 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
461 | 461 | then true | |
462 | 462 | else throw("You are not pending manager") | |
463 | 463 | if ((checkPM == checkPM)) | |
464 | 464 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
465 | 465 | else throw("Strict value is not equal to itself.") | |
466 | 466 | } | |
467 | 467 | else throw("Strict value is not equal to itself.") | |
468 | 468 | } | |
469 | 469 | ||
470 | 470 | ||
471 | 471 | ||
472 | 472 | @Callable(i) | |
473 | 473 | func stake () = if ((size(i.payments) != 1)) | |
474 | 474 | then throw("invalid payment - exact one payment must be attached") | |
475 | 475 | else { | |
476 | 476 | let pmt = i.payments[0] | |
477 | 477 | let lpAssetId = value(pmt.assetId) | |
478 | 478 | let lpAssetIdStr = toBase58String(lpAssetId) | |
479 | 479 | let amount = pmt.amount | |
480 | 480 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
481 | 481 | let callerStr = toString(i.caller) | |
482 | 482 | let userAddressStr = if ((callerStr == poolAddressStr)) | |
483 | 483 | then toString(i.originCaller) | |
484 | 484 | else callerStr | |
485 | 485 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
486 | 486 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
487 | 487 | let stakedByUser = readStaked(stakedByUserKEY) | |
488 | 488 | let stakedTotal = readStaked(stakedTotalKEY) | |
489 | 489 | let $t01883218949 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
490 | 490 | let wxToClaimUserNew = $t01883218949._1 | |
491 | 491 | let integralSTATE = $t01883218949._2 | |
492 | 492 | let debug = $t01883218949._3 | |
493 | 493 | let listName = getUsersListName(lpAssetIdStr) | |
494 | 494 | let listActions = if (containsNode(listName, userAddressStr)) | |
495 | 495 | then nil | |
496 | 496 | else insertNodeActions(listName, userAddressStr) | |
497 | 497 | (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
498 | 498 | } | |
499 | 499 | ||
500 | 500 | ||
501 | 501 | ||
502 | 502 | @Callable(i) | |
503 | 503 | func unstake (lpAssetIdStr,amount) = { | |
504 | 504 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
505 | 505 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
506 | 506 | let poolAddon = valueOrElse(getString(addressFromStringValue(poolAddressStr), keyAddonAddr()), poolAddressStr) | |
507 | 507 | let callerStr = toString(i.caller) | |
508 | 508 | let userAddressStr = if (if ((callerStr == poolAddressStr)) | |
509 | 509 | then true | |
510 | 510 | else (callerStr == poolAddon)) | |
511 | 511 | then toString(i.originCaller) | |
512 | 512 | else callerStr | |
513 | 513 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
514 | 514 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
515 | 515 | let stakedByUser = readStaked(stakedByUserKEY) | |
516 | 516 | let stakedTotal = readStaked(stakedTotalKEY) | |
517 | 517 | let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2 | |
518 | 518 | let listName = getUsersListName(lpAssetIdStr) | |
519 | 519 | let listActions = if (if (containsNode(listName, userAddressStr)) | |
520 | 520 | then (amount == stakedByUser) | |
521 | 521 | else false) | |
522 | 522 | then deleteNodeActions(listName, userAddressStr) | |
523 | 523 | else nil | |
524 | 524 | let claimedByUser = getBigIntFromStringOrZero(this, keyClaimedByUser(lpAssetIdStr, userAddressStr)) | |
525 | 525 | let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
526 | 526 | let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddress, 0)._1 | |
527 | 527 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
528 | 528 | let r = if ((availableToClaim > zeroBigInt)) | |
529 | 529 | then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil) | |
530 | 530 | else unit | |
531 | 531 | if ((r == r)) | |
532 | 532 | then if ((amount > stakedByUser)) | |
533 | 533 | then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY)) | |
534 | 534 | else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
535 | 535 | else throw("Strict value is not equal to itself.") | |
536 | 536 | } | |
537 | 537 | ||
538 | 538 | ||
539 | 539 | ||
540 | 540 | @Callable(i) | |
541 | 541 | func claimWx (lpAssetIdStr) = { | |
542 | 542 | let userAddressStr = toString(i.caller) | |
543 | 543 | let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil) | |
544 | 544 | $Tuple2(nil, result) | |
545 | 545 | } | |
546 | 546 | ||
547 | 547 | ||
548 | 548 | ||
549 | 549 | @Callable(i) | |
550 | 550 | func claimWxINTERNAL (lpAssetIdStr,userAddressStr) = { | |
551 | 551 | let checkCaller = mustThis(i) | |
552 | 552 | if ((checkCaller == checkCaller)) | |
553 | 553 | then { | |
554 | 554 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address") | |
555 | 555 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
556 | 556 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
557 | 557 | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
558 | 558 | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
559 | 559 | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
560 | 560 | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
561 | 561 | let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY) | |
562 | 562 | let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY) | |
563 | 563 | let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY) | |
564 | 564 | let $t02278722899 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
565 | 565 | let wxToClaimUserNew = $t02278722899._1 | |
566 | 566 | let integralSTATE = $t02278722899._2 | |
567 | 567 | let debug = $t02278722899._3 | |
568 | 568 | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
569 | 569 | if ((zeroBigInt >= availableToClaim)) | |
570 | 570 | then throw("nothing to claim") | |
571 | 571 | else { | |
572 | 572 | let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0]) | |
573 | 573 | let minRewardPart = availableToClaim | |
574 | 574 | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
575 | - | let totalReward = (minRewardPart + boostRewardPart) | |
576 | 575 | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
577 | 576 | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
578 | 577 | if ((emitBoost == emitBoost)) | |
579 | 578 | then { | |
580 | 579 | let claimedByUserValue = (claimedByUser + availableToClaim) | |
581 | 580 | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
582 | 581 | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
583 | 582 | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
584 | - | ||
583 | + | [StringEntry(claimedByUserKEY, toString(claimedByUserValue)), StringEntry(claimedByUserMinRewardKEY, toString(claimedByUserMinRewardPlusPart)), StringEntry(claimedByUserBoostRewardKEY, toString(claimedByUserBoostRewardPlusBoostRewardPart)), StringEntry(claimedTotalKEY, toString(claimedTotalPlusAvailableToClaim)), ScriptTransfer(userAddress, toInt(minRewardPart), wxAssetId), ScriptTransfer(userAddress, toInt(boostRewardPart), wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, toInt(availableToClaim), i.transactionId)] | |
585 | 584 | } | |
586 | 585 | else throw("Strict value is not equal to itself.") | |
587 | 586 | } | |
588 | 587 | } | |
589 | 588 | else throw("Strict value is not equal to itself.") | |
590 | 589 | } | |
591 | 590 | ||
592 | 591 | ||
593 | 592 | ||
594 | 593 | @Callable(i) | |
595 | 594 | func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds))) | |
596 | 595 | then $Tuple2(nil, resAcc) | |
597 | 596 | else { | |
598 | 597 | let lpAssetId = lpAssetIds[currentIter] | |
599 | 598 | let info = split({ | |
600 | 599 | let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil) | |
601 | 600 | if ($isInstanceOf(@, "String")) | |
602 | 601 | then @ | |
603 | 602 | else throw(($getType(@) + " couldn't be cast to String")) | |
604 | 603 | }, SEP) | |
605 | 604 | let unclaimed = info[3] | |
606 | 605 | let claimed = info[4] | |
607 | 606 | let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP)) | |
608 | 607 | let inv = { | |
609 | 608 | let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil) | |
610 | 609 | if ($isInstanceOf(@, "List[Any]")) | |
611 | 610 | then @ | |
612 | 611 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
613 | 612 | } | |
614 | 613 | if ((inv == inv)) | |
615 | 614 | then $Tuple2(nil, inv) | |
616 | 615 | else throw("Strict value is not equal to itself.") | |
617 | 616 | } | |
618 | 617 | ||
619 | 618 | ||
620 | 619 | ||
621 | 620 | @Callable(i) | |
622 | 621 | func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = { | |
623 | 622 | let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil) | |
624 | 623 | $Tuple2(nil, res) | |
625 | 624 | } | |
626 | 625 | ||
627 | 626 | ||
628 | 627 | ||
629 | 628 | @Callable(i) | |
630 | 629 | func claimWxREADONLY (lpAssetIdStr,userAddressStr) = { | |
631 | 630 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
632 | 631 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
633 | 632 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
634 | 633 | let stakedByUser = readStaked(stakedByUserKEY) | |
635 | 634 | let stakedTotal = readStaked(stakedTotalKEY) | |
636 | 635 | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
637 | 636 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
638 | 637 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
639 | 638 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
640 | 639 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
641 | 640 | let passedBlocks = if ((emissionStartBlock > height)) | |
642 | 641 | then 0 | |
643 | 642 | else (height - emissionStartBlock) | |
644 | 643 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
645 | 644 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
646 | - | let $ | |
647 | - | let wxToClaimUserNew = $ | |
648 | - | let integralSTATE = $ | |
649 | - | let debug = $ | |
645 | + | let $t02635726469 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
646 | + | let wxToClaimUserNew = $t02635726469._1 | |
647 | + | let integralSTATE = $t02635726469._2 | |
648 | + | let debug = $t02635726469._3 | |
650 | 649 | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
651 | 650 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
652 | 651 | let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0]) | |
653 | 652 | let boostDebug = asString(boostInvResult[1]) | |
654 | 653 | let minRewardPart = availableToClaim | |
655 | 654 | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
656 | 655 | let totalReward = (minRewardPart + boostRewardPart) | |
657 | 656 | $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP)) | |
658 | - | } | |
659 | - | ||
660 | - | ||
661 | - | ||
662 | - | @Callable(i) | |
663 | - | func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = { | |
664 | - | let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0) | |
665 | - | $Tuple2(nil, stakedByUser) | |
666 | 657 | } | |
667 | 658 | ||
668 | 659 | ||
669 | 660 | ||
670 | 661 | @Callable(i) | |
671 | 662 | func usersListTraversal (lpAssetId) = { | |
672 | 663 | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
673 | 664 | then true | |
674 | 665 | else mustManager(i) | |
675 | 666 | if ((checkCaller == checkCaller)) | |
676 | 667 | then { | |
677 | 668 | let listName = getUsersListName(lpAssetId) | |
678 | 669 | let userOrUnit = getString(keyNextUser(lpAssetId)) | |
679 | 670 | let headOrUnit = getString(keyListHead(listName)) | |
680 | 671 | match userOrUnit { | |
681 | 672 | case _: Unit => | |
682 | 673 | match headOrUnit { | |
683 | 674 | case _: Unit => | |
684 | 675 | $Tuple2(nil, false) | |
685 | 676 | case head: String => | |
686 | 677 | $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true) | |
687 | 678 | case _ => | |
688 | 679 | throw("Match error") | |
689 | 680 | } | |
690 | 681 | case userAddress: String => | |
691 | 682 | let claimedByUser = getBigIntFromStringOrZero(this, keyClaimedByUser(lpAssetId, userAddress)) | |
692 | 683 | let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
693 | 684 | let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1 | |
694 | 685 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
695 | 686 | let r = if ((availableToClaim > zeroBigInt)) | |
696 | 687 | then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil) | |
697 | 688 | else unit | |
698 | 689 | if ((r == r)) | |
699 | 690 | then { | |
700 | 691 | let nextUserOrUnit = getString(keyListNext(listName, userAddress)) | |
701 | 692 | match nextUserOrUnit { | |
702 | 693 | case _: Unit => | |
703 | 694 | $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false) | |
704 | 695 | case nextUser: String => | |
705 | 696 | $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true) | |
706 | 697 | case _ => | |
707 | 698 | throw("Match error") | |
708 | 699 | } | |
709 | 700 | } | |
710 | 701 | else throw("Strict value is not equal to itself.") | |
711 | 702 | case _ => | |
712 | 703 | throw("Match error") | |
713 | 704 | } | |
714 | 705 | } | |
715 | 706 | else throw("Strict value is not equal to itself.") | |
716 | 707 | } | |
717 | 708 | ||
718 | 709 | ||
719 | 710 | ||
720 | 711 | @Callable(i) | |
721 | 712 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
722 | 713 | then throw("permissions denied") | |
723 | 714 | else { | |
724 | - | let $ | |
725 | - | let wxPerLpIntegralNew = $ | |
726 | - | let poolIntegralSTATE = $ | |
727 | - | let poolDEBUG = $ | |
715 | + | let $t02876928879 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
716 | + | let wxPerLpIntegralNew = $t02876928879._1 | |
717 | + | let poolIntegralSTATE = $t02876928879._2 | |
718 | + | let poolDEBUG = $t02876928879._3 | |
728 | 719 | poolIntegralSTATE | |
729 | 720 | } | |
730 | 721 | ||
731 | 722 | ||
732 | 723 | @Verifier(tx) | |
733 | 724 | func verify () = { | |
734 | 725 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
735 | 726 | case pk: ByteVector => | |
736 | 727 | pk | |
737 | 728 | case _: Unit => | |
738 | 729 | tx.senderPublicKey | |
739 | 730 | case _ => | |
740 | 731 | throw("Match error") | |
741 | 732 | } | |
742 | 733 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
743 | 734 | } | |
744 | 735 |
github/deemru/w8io/fabc49c 81.32 ms ◑