tx · 87aS6GpgyBQVTPRGk5LL7ZKpzG3Fzov9mSvDpFp4kwcU 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz: -0.02200000 Waves 2023.01.10 13:18 [2398717] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves
{ "type": 13, "id": "87aS6GpgyBQVTPRGk5LL7ZKpzG3Fzov9mSvDpFp4kwcU", "fee": 2200000, "feeAssetId": null, "timestamp": 1673345862839, "version": 1, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "52y3tgRVTBHWmtnXZBR13qc3VJ3i2nToyLNJqRfLyhTSksRzf5ZaT3QnkgAk5A3jE4E9dX1as2j24uK2FQRWsbXT" ], "script": "base64:BgL7HggCEgMKAQgSAwoBCBIDCgEIEgASABIECgIIARIDCgEIEgQKAggIEgYKBAEYCBgSBAoCGAgSBAoCCAgSBAoCCAgSAwoBCBIECgIICCIGU0NBTEU4IgVNVUxUOCIHU0NBTEUxOCIGTVVMVDE4IgNTRVAiDlBPT0xXRUlHSFRNVUxUIgp6ZXJvQmlnSW50IglvbmVCaWdJbnQiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgVhc0ludCIGdmFsSW50Ighhc1N0cmluZyIGdmFsU3RyIgxhc0J5dGVWZWN0b3IiBnZhbEJpbiIPZ2V0U3RyaW5nT3JGYWlsIgdhZGRyZXNzIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIMZ2V0SW50T3JaZXJvIg9nZXRJbnRPckRlZmF1bHQiCmRlZmF1bHRWYWwiDGdldEludE9yRmFpbCIZZ2V0QmlnSW50RnJvbVN0cmluZ09yWmVybyIcZ2V0QmlnSW50RnJvbVN0cmluZ09yRGVmYXVsdCIBcyIFdG9YMTgiB29yaWdWYWwiD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GVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmRzCWJvZHlCeXRlcwkAkQMCCAUCZHMGcHJvb2ZzAAAFAmR1kZKhHQ==", "chainId": 84, "height": 2398717, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ETUDMX2UmsuzDk47Kg64MXgki9cLjMo4ThXuaX3cmT5T Next: 3Adz2Z3Gx2wiayttL1ZbLMg9FNLVhfsZuk637xtAiAjq 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) | |
575 | 576 | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
576 | 577 | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
577 | 578 | if ((emitBoost == emitBoost)) | |
580 | 581 | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
581 | 582 | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
582 | 583 | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
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)] | |
584 | + | $Tuple2([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)], totalReward) | |
584 | 585 | } | |
585 | 586 | else throw("Strict value is not equal to itself.") | |
586 | 587 | } | |
642 | 643 | else (height - emissionStartBlock) | |
643 | 644 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
644 | 645 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
645 | - | let $ | |
646 | - | let wxToClaimUserNew = $ | |
647 | - | let integralSTATE = $ | |
648 | - | let debug = $ | |
646 | + | let $t02644426556 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
647 | + | let wxToClaimUserNew = $t02644426556._1 | |
648 | + | let integralSTATE = $t02644426556._2 | |
649 | + | let debug = $t02644426556._3 | |
649 | 650 | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
650 | 651 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
651 | 652 | let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0]) | |
654 | 655 | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
655 | 656 | let totalReward = (minRewardPart + boostRewardPart) | |
656 | 657 | $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) | |
657 | 666 | } | |
658 | 667 | ||
659 | 668 | ||
712 | 721 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
713 | 722 | then throw("permissions denied") | |
714 | 723 | else { | |
715 | - | let $ | |
716 | - | let wxPerLpIntegralNew = $ | |
717 | - | let poolIntegralSTATE = $ | |
718 | - | let poolDEBUG = $ | |
724 | + | let $t02906429174 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
725 | + | let wxPerLpIntegralNew = $t02906429174._1 | |
726 | + | let poolIntegralSTATE = $t02906429174._2 | |
727 | + | let poolDEBUG = $t02906429174._3 | |
719 | 728 | poolIntegralSTATE | |
720 | 729 | } | |
721 | 730 |
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) | |
575 | 576 | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
576 | 577 | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
577 | 578 | if ((emitBoost == emitBoost)) | |
578 | 579 | then { | |
579 | 580 | let claimedByUserValue = (claimedByUser + availableToClaim) | |
580 | 581 | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
581 | 582 | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
582 | 583 | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
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)] | |
584 | + | $Tuple2([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)], totalReward) | |
584 | 585 | } | |
585 | 586 | else throw("Strict value is not equal to itself.") | |
586 | 587 | } | |
587 | 588 | } | |
588 | 589 | else throw("Strict value is not equal to itself.") | |
589 | 590 | } | |
590 | 591 | ||
591 | 592 | ||
592 | 593 | ||
593 | 594 | @Callable(i) | |
594 | 595 | func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds))) | |
595 | 596 | then $Tuple2(nil, resAcc) | |
596 | 597 | else { | |
597 | 598 | let lpAssetId = lpAssetIds[currentIter] | |
598 | 599 | let info = split({ | |
599 | 600 | let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil) | |
600 | 601 | if ($isInstanceOf(@, "String")) | |
601 | 602 | then @ | |
602 | 603 | else throw(($getType(@) + " couldn't be cast to String")) | |
603 | 604 | }, SEP) | |
604 | 605 | let unclaimed = info[3] | |
605 | 606 | let claimed = info[4] | |
606 | 607 | let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP)) | |
607 | 608 | let inv = { | |
608 | 609 | let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil) | |
609 | 610 | if ($isInstanceOf(@, "List[Any]")) | |
610 | 611 | then @ | |
611 | 612 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
612 | 613 | } | |
613 | 614 | if ((inv == inv)) | |
614 | 615 | then $Tuple2(nil, inv) | |
615 | 616 | else throw("Strict value is not equal to itself.") | |
616 | 617 | } | |
617 | 618 | ||
618 | 619 | ||
619 | 620 | ||
620 | 621 | @Callable(i) | |
621 | 622 | func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = { | |
622 | 623 | let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil) | |
623 | 624 | $Tuple2(nil, res) | |
624 | 625 | } | |
625 | 626 | ||
626 | 627 | ||
627 | 628 | ||
628 | 629 | @Callable(i) | |
629 | 630 | func claimWxREADONLY (lpAssetIdStr,userAddressStr) = { | |
630 | 631 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
631 | 632 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
632 | 633 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
633 | 634 | let stakedByUser = readStaked(stakedByUserKEY) | |
634 | 635 | let stakedTotal = readStaked(stakedTotalKEY) | |
635 | 636 | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
636 | 637 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
637 | 638 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
638 | 639 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
639 | 640 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
640 | 641 | let passedBlocks = if ((emissionStartBlock > height)) | |
641 | 642 | then 0 | |
642 | 643 | else (height - emissionStartBlock) | |
643 | 644 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
644 | 645 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
645 | - | let $ | |
646 | - | let wxToClaimUserNew = $ | |
647 | - | let integralSTATE = $ | |
648 | - | let debug = $ | |
646 | + | let $t02644426556 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
647 | + | let wxToClaimUserNew = $t02644426556._1 | |
648 | + | let integralSTATE = $t02644426556._2 | |
649 | + | let debug = $t02644426556._3 | |
649 | 650 | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
650 | 651 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
651 | 652 | let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0]) | |
652 | 653 | let boostDebug = asString(boostInvResult[1]) | |
653 | 654 | let minRewardPart = availableToClaim | |
654 | 655 | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
655 | 656 | let totalReward = (minRewardPart + boostRewardPart) | |
656 | 657 | $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) | |
657 | 666 | } | |
658 | 667 | ||
659 | 668 | ||
660 | 669 | ||
661 | 670 | @Callable(i) | |
662 | 671 | func usersListTraversal (lpAssetId) = { | |
663 | 672 | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
664 | 673 | then true | |
665 | 674 | else mustManager(i) | |
666 | 675 | if ((checkCaller == checkCaller)) | |
667 | 676 | then { | |
668 | 677 | let listName = getUsersListName(lpAssetId) | |
669 | 678 | let userOrUnit = getString(keyNextUser(lpAssetId)) | |
670 | 679 | let headOrUnit = getString(keyListHead(listName)) | |
671 | 680 | match userOrUnit { | |
672 | 681 | case _: Unit => | |
673 | 682 | match headOrUnit { | |
674 | 683 | case _: Unit => | |
675 | 684 | $Tuple2(nil, false) | |
676 | 685 | case head: String => | |
677 | 686 | $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true) | |
678 | 687 | case _ => | |
679 | 688 | throw("Match error") | |
680 | 689 | } | |
681 | 690 | case userAddress: String => | |
682 | 691 | let claimedByUser = getBigIntFromStringOrZero(this, keyClaimedByUser(lpAssetId, userAddress)) | |
683 | 692 | let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
684 | 693 | let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1 | |
685 | 694 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
686 | 695 | let r = if ((availableToClaim > zeroBigInt)) | |
687 | 696 | then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil) | |
688 | 697 | else unit | |
689 | 698 | if ((r == r)) | |
690 | 699 | then { | |
691 | 700 | let nextUserOrUnit = getString(keyListNext(listName, userAddress)) | |
692 | 701 | match nextUserOrUnit { | |
693 | 702 | case _: Unit => | |
694 | 703 | $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false) | |
695 | 704 | case nextUser: String => | |
696 | 705 | $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true) | |
697 | 706 | case _ => | |
698 | 707 | throw("Match error") | |
699 | 708 | } | |
700 | 709 | } | |
701 | 710 | else throw("Strict value is not equal to itself.") | |
702 | 711 | case _ => | |
703 | 712 | throw("Match error") | |
704 | 713 | } | |
705 | 714 | } | |
706 | 715 | else throw("Strict value is not equal to itself.") | |
707 | 716 | } | |
708 | 717 | ||
709 | 718 | ||
710 | 719 | ||
711 | 720 | @Callable(i) | |
712 | 721 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
713 | 722 | then throw("permissions denied") | |
714 | 723 | else { | |
715 | - | let $ | |
716 | - | let wxPerLpIntegralNew = $ | |
717 | - | let poolIntegralSTATE = $ | |
718 | - | let poolDEBUG = $ | |
724 | + | let $t02906429174 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
725 | + | let wxPerLpIntegralNew = $t02906429174._1 | |
726 | + | let poolIntegralSTATE = $t02906429174._2 | |
727 | + | let poolDEBUG = $t02906429174._3 | |
719 | 728 | poolIntegralSTATE | |
720 | 729 | } | |
721 | 730 | ||
722 | 731 | ||
723 | 732 | @Verifier(tx) | |
724 | 733 | func verify () = { | |
725 | 734 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
726 | 735 | case pk: ByteVector => | |
727 | 736 | pk | |
728 | 737 | case _: Unit => | |
729 | 738 | tx.senderPublicKey | |
730 | 739 | case _ => | |
731 | 740 | throw("Match error") | |
732 | 741 | } | |
733 | 742 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
734 | 743 | } | |
735 | 744 |
github/deemru/w8io/026f985 81.69 ms ◑