tx · bU4sQQwQSRJuv1UbBqTZ3pybQGGyNFRYV5UPwQui7t4 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz: -0.01400000 Waves 2021.12.17 12:53 [1838098] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves
{ "type": 13, "id": "bU4sQQwQSRJuv1UbBqTZ3pybQGGyNFRYV5UPwQui7t4", "fee": 1400000, "feeAssetId": null, "timestamp": 1639734803240, "version": 1, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "4gdHUxJK8gEAUg3x37ExgsXUeaBTSNU2ESGw3RiNcSQarDaSQgExpudquC7XzxXcVRfV3wPXCULBURrd3pWn2hEW" ], "script": "base64:AAIFAAAAAAAAACAIAhIDCgEIEgASBAoCCAESAwoBCBIECgIICBIECgIICAAAAEcAAAAABlNDQUxFOAAAAAAAAAAACAAAAAAFTVVMVDgAAAAAAAX14QAAAAAAB1NDQUxFMTgAAAAAAAAAABIAAAAABk1VTFQxOAkAATYAAAABAA3gtrOnZAAAAAAAAANTRVACAAAAAl9fAAAAAA5QT09MV0VJR0hUTVVMVAUAAAAFTVVMVDgBAAAACWFzQW55TGlzdAAAAAEAAAADdmFsBAAAAAckbWF0Y2gwBQAAAAN2YWwDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACUxpc3RbQW55XQQAAAAKdmFsQW55THlzdAUAAAAHJG1hdGNoMAUAAAAKdmFsQW55THlzdAkAAAIAAAABAgAAABtmYWlsIHRvIGNhc3QgaW50byBMaXN0W0FueV0BAAAABWFzSW50AAAAAQAAAAN2YWwEAAAAByRtYXRjaDAFAAAAA3ZhbAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAZ2YWxJbnQFAAAAByRtYXRjaDAFAAAABnZhbEludAkAAAIAAAABAgAAABVmYW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TdHIAAAAAAAAAAAAEAAAAEnd4UGVyTHBJbnRlZ3JhbE5ldwgFAAAADSR0MDE4NjMyMTg3NDIAAAACXzEEAAAAEXBvb2xJbnRlZ3JhbFNUQVRFCAUAAAANJHQwMTg2MzIxODc0MgAAAAJfMgQAAAAJcG9vbERFQlVHCAUAAAANJHQwMTg2MzIxODc0MgAAAAJfMwUAAAARcG9vbEludGVncmFsU1RBVEUAAAAAmiPaPg==", "chainId": 84, "height": 1838098, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DUV2LNSVwddMRoXf18Tz3WYJzSB49Yf14x7CnWpp1dhc Next: BDFdJTnCymCGtZioUho11u4WiBSAJ6hqEALiyuN736Cf Diff:
Old | New | Differences | |
---|---|---|---|
304 | 304 | ||
305 | 305 | @Callable(i) | |
306 | 306 | func unstake (lpAssetIdStr,amount) = { | |
307 | - | let userAddressStr = toString(i.caller) | |
308 | 307 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
309 | 308 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
309 | + | let callerStr = toString(i.caller) | |
310 | + | let userAddressStr = if ((callerStr == poolAddressStr)) | |
311 | + | then toString(i.originCaller) | |
312 | + | else callerStr | |
310 | 313 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
311 | 314 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
312 | 315 | let stakedByUser = readStaked(stakedByUserKEY) | |
313 | 316 | let stakedTotal = readStaked(stakedTotalKEY) | |
314 | - | let $ | |
315 | - | let wxToClaimUserNew = $ | |
316 | - | let integralSTATE = $ | |
317 | - | let debug = $ | |
317 | + | let $t01401814136 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
318 | + | let wxToClaimUserNew = $t01401814136._1 | |
319 | + | let integralSTATE = $t01401814136._2 | |
320 | + | let debug = $t01401814136._3 | |
318 | 321 | if ((amount > stakedByUser)) | |
319 | 322 | then throw("passed amount is less then available") | |
320 | 323 | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
335 | 338 | let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY) | |
336 | 339 | let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY) | |
337 | 340 | let claimedTotal = getIntOrZero(this, claimedTotalKEY) | |
338 | - | let $ | |
339 | - | let wxToClaimUserNew = $ | |
340 | - | let integralSTATE = $ | |
341 | - | let debug = $ | |
341 | + | let $t01532815440 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
342 | + | let wxToClaimUserNew = $t01532815440._1 | |
343 | + | let integralSTATE = $t01532815440._2 | |
344 | + | let debug = $t01532815440._3 | |
342 | 345 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
343 | 346 | if ((0 >= availableToClaim)) | |
344 | 347 | then throw("nothing to claim") | |
373 | 376 | else (height - emissionStartBlock) | |
374 | 377 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
375 | 378 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
376 | - | let $ | |
377 | - | let wxToClaimUserNew = $ | |
378 | - | let integralSTATE = $ | |
379 | - | let debug = $ | |
379 | + | let $t01764017752 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
380 | + | let wxToClaimUserNew = $t01764017752._1 | |
381 | + | let integralSTATE = $t01764017752._2 | |
382 | + | let debug = $t01764017752._3 | |
380 | 383 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
381 | 384 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
382 | 385 | let wxAmountBoostTotal = asInt(boostInvResult[0]) | |
393 | 396 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
394 | 397 | then throw("permissions denied") | |
395 | 398 | else { | |
396 | - | let $ | |
397 | - | let wxPerLpIntegralNew = $ | |
398 | - | let poolIntegralSTATE = $ | |
399 | - | let poolDEBUG = $ | |
399 | + | let $t01863218742 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
400 | + | let wxPerLpIntegralNew = $t01863218742._1 | |
401 | + | let poolIntegralSTATE = $t01863218742._2 | |
402 | + | let poolDEBUG = $t01863218742._3 | |
400 | 403 | poolIntegralSTATE | |
401 | 404 | } | |
402 | 405 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
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 | func asAnyList (val) = match val { | |
17 | 17 | case valAnyLyst: List[Any] => | |
18 | 18 | valAnyLyst | |
19 | 19 | case _ => | |
20 | 20 | throw("fail to cast into List[Any]") | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func asInt (val) = match val { | |
25 | 25 | case valInt: Int => | |
26 | 26 | valInt | |
27 | 27 | case _ => | |
28 | 28 | throw("fail to cast into Int") | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func asString (val) = match val { | |
33 | 33 | case valStr: String => | |
34 | 34 | valStr | |
35 | 35 | case _ => | |
36 | 36 | throw("fail to cast into Int") | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func asByteVector (val) = match val { | |
41 | 41 | case valBin: ByteVector => | |
42 | 42 | valBin | |
43 | 43 | case _ => | |
44 | 44 | throw("fail to cast into Int") | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | let IdxFactoryCfgStakingDapp = 1 | |
73 | 73 | ||
74 | 74 | let IdxFactoryCfgBoostingDapp = 2 | |
75 | 75 | ||
76 | 76 | let IdxFactoryCfgIdoDapp = 3 | |
77 | 77 | ||
78 | 78 | let IdxFactoryCfgTeamDapp = 4 | |
79 | 79 | ||
80 | 80 | let IdxFactoryCfgEmissionDapp = 5 | |
81 | 81 | ||
82 | 82 | let IdxFactoryCfgRestDapp = 6 | |
83 | 83 | ||
84 | 84 | let IdxFactoryCfgSlippageDapp = 7 | |
85 | 85 | ||
86 | 86 | func keyFactoryCfg () = "%s__factoryConfig" | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func keyFactoryLpList () = "%s__lpTokensList" | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed", "total", lpAssetIdStr], SEP) | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP) | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP) | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP) | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP) | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP) | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP) | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP) | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP) | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP) | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP) | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP) | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | let factoryAddress = getStringOrFail(keyFactoryAddress()) | |
201 | 201 | ||
202 | 202 | let factoryContract = addressFromStringValue(factoryAddress) | |
203 | 203 | ||
204 | 204 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
205 | 205 | ||
206 | 206 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
207 | 207 | ||
208 | 208 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
209 | 209 | ||
210 | 210 | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0)) | |
211 | 211 | then (stakedByUser > 0) | |
212 | 212 | else false) | |
213 | 213 | then 0 | |
214 | 214 | else if ((stakedByUser == 0)) | |
215 | 215 | then wxPerLpIntegralNew | |
216 | 216 | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0)) | |
217 | 217 | then (stakedByUser > 0) | |
218 | 218 | else false) | |
219 | 219 | then getIntOrFail(this, wxPerLpIntegralUserLastKEY) | |
220 | 220 | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = { | |
224 | 224 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
225 | 225 | let stakedTotal = readStaked(stakedTotalKEY) | |
226 | 226 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
227 | 227 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
228 | 228 | let MULT3 = 1000 | |
229 | 229 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3) | |
230 | 230 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
231 | 231 | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
232 | 232 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
233 | 233 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
234 | 234 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
235 | 235 | let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY) | |
236 | 236 | let wxPerLpOrZeroX3 = 0 | |
237 | 237 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
238 | 238 | let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0)) | |
239 | 239 | then wxPerLpOrZeroX3 | |
240 | 240 | else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
241 | 241 | let stakedTotalNew = (stakedTotal + lpDeltaAmount) | |
242 | 242 | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh)) | |
243 | 243 | let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew) | |
244 | 244 | let wxPerLpIntegralLastUpdHeightNew = height | |
245 | 245 | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
246 | 246 | $Tuple3(wxPerLpIntegralNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpX3New)], debug) | |
247 | 247 | } | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
251 | 251 | let $t01032310445 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
252 | 252 | let wxPerLpIntegralNew = $t01032310445._1 | |
253 | 253 | let poolIntegralSTATE = $t01032310445._2 | |
254 | 254 | let poolDEBUG = $t01032310445._3 | |
255 | 255 | let MULT3 = 1000 | |
256 | 256 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
257 | 257 | let stakedByUser = readStaked(stakedByUserKEY) | |
258 | 258 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
259 | 259 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
260 | 260 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
261 | 261 | let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY) | |
262 | 262 | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
263 | 263 | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
264 | 264 | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3))) | |
265 | 265 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
266 | 266 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
267 | 267 | let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
268 | 268 | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)]), debug) | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | @Callable(i) | |
273 | 273 | func constructor (factoryAddressStr) = if ((i.caller != this)) | |
274 | 274 | then throw("not authorized") | |
275 | 275 | else [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | ||
279 | 279 | @Callable(i) | |
280 | 280 | func stake () = if ((size(i.payments) != 1)) | |
281 | 281 | then throw("invalid payment - exact one payment must be attached") | |
282 | 282 | else { | |
283 | 283 | let pmt = i.payments[0] | |
284 | 284 | let lpAssetId = value(pmt.assetId) | |
285 | 285 | let lpAssetIdStr = toBase58String(lpAssetId) | |
286 | 286 | let amount = pmt.amount | |
287 | 287 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
288 | 288 | let callerStr = toString(i.caller) | |
289 | 289 | let userAddressStr = if ((callerStr == poolAddressStr)) | |
290 | 290 | then toString(i.originCaller) | |
291 | 291 | else callerStr | |
292 | 292 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
293 | 293 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
294 | 294 | let stakedByUser = readStaked(stakedByUserKEY) | |
295 | 295 | let stakedTotal = readStaked(stakedTotalKEY) | |
296 | 296 | let $t01298813105 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
297 | 297 | let wxToClaimUserNew = $t01298813105._1 | |
298 | 298 | let integralSTATE = $t01298813105._2 | |
299 | 299 | let debug = $t01298813105._3 | |
300 | 300 | ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
301 | 301 | } | |
302 | 302 | ||
303 | 303 | ||
304 | 304 | ||
305 | 305 | @Callable(i) | |
306 | 306 | func unstake (lpAssetIdStr,amount) = { | |
307 | - | let userAddressStr = toString(i.caller) | |
308 | 307 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
309 | 308 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
309 | + | let callerStr = toString(i.caller) | |
310 | + | let userAddressStr = if ((callerStr == poolAddressStr)) | |
311 | + | then toString(i.originCaller) | |
312 | + | else callerStr | |
310 | 313 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
311 | 314 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
312 | 315 | let stakedByUser = readStaked(stakedByUserKEY) | |
313 | 316 | let stakedTotal = readStaked(stakedTotalKEY) | |
314 | - | let $ | |
315 | - | let wxToClaimUserNew = $ | |
316 | - | let integralSTATE = $ | |
317 | - | let debug = $ | |
317 | + | let $t01401814136 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
318 | + | let wxToClaimUserNew = $t01401814136._1 | |
319 | + | let integralSTATE = $t01401814136._2 | |
320 | + | let debug = $t01401814136._3 | |
318 | 321 | if ((amount > stakedByUser)) | |
319 | 322 | then throw("passed amount is less then available") | |
320 | 323 | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
321 | 324 | } | |
322 | 325 | ||
323 | 326 | ||
324 | 327 | ||
325 | 328 | @Callable(i) | |
326 | 329 | func claimWx (lpAssetIdStr) = { | |
327 | 330 | let userAddress = i.caller | |
328 | 331 | let userAddressStr = toString(i.caller) | |
329 | 332 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
330 | 333 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
331 | 334 | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
332 | 335 | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
333 | 336 | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
334 | 337 | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
335 | 338 | let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY) | |
336 | 339 | let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY) | |
337 | 340 | let claimedTotal = getIntOrZero(this, claimedTotalKEY) | |
338 | - | let $ | |
339 | - | let wxToClaimUserNew = $ | |
340 | - | let integralSTATE = $ | |
341 | - | let debug = $ | |
341 | + | let $t01532815440 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
342 | + | let wxToClaimUserNew = $t01532815440._1 | |
343 | + | let integralSTATE = $t01532815440._2 | |
344 | + | let debug = $t01532815440._3 | |
342 | 345 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
343 | 346 | if ((0 >= availableToClaim)) | |
344 | 347 | then throw("nothing to claim") | |
345 | 348 | else { | |
346 | 349 | let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]) | |
347 | 350 | let minRewardPart = availableToClaim | |
348 | 351 | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
349 | 352 | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0]) | |
350 | 353 | let emitBoost = asAnyList(invoke(emissionContract, "emit", [boostRewardPart], nil)) | |
351 | 354 | if ((emitBoost == emitBoost)) | |
352 | 355 | then [IntegerEntry(claimedByUserKEY, (claimedByUser + availableToClaim)), IntegerEntry(claimedByUserMinRewardKEY, (claimedByUserMinReward + minRewardPart)), IntegerEntry(claimedByUserBoostRewardKEY, (claimedByUserBoostReward + boostRewardPart)), IntegerEntry(claimedTotalKEY, (claimedTotal + availableToClaim)), ScriptTransfer(userAddress, minRewardPart, wxAssetId), ScriptTransfer(userAddress, boostRewardPart, wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, availableToClaim, i.transactionId)] | |
353 | 356 | else throw("Strict value is not equal to itself.") | |
354 | 357 | } | |
355 | 358 | } | |
356 | 359 | ||
357 | 360 | ||
358 | 361 | ||
359 | 362 | @Callable(i) | |
360 | 363 | func claimWxREADONLY (lpAssetIdStr,userAddressStr) = { | |
361 | 364 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
362 | 365 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
363 | 366 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
364 | 367 | let stakedByUser = readStaked(stakedByUserKEY) | |
365 | 368 | let stakedTotal = readStaked(stakedTotalKEY) | |
366 | 369 | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
367 | 370 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
368 | 371 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
369 | 372 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
370 | 373 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
371 | 374 | let passedBlocks = if ((emissionStartBlock > height)) | |
372 | 375 | then 0 | |
373 | 376 | else (height - emissionStartBlock) | |
374 | 377 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
375 | 378 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
376 | - | let $ | |
377 | - | let wxToClaimUserNew = $ | |
378 | - | let integralSTATE = $ | |
379 | - | let debug = $ | |
379 | + | let $t01764017752 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
380 | + | let wxToClaimUserNew = $t01764017752._1 | |
381 | + | let integralSTATE = $t01764017752._2 | |
382 | + | let debug = $t01764017752._3 | |
380 | 383 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
381 | 384 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
382 | 385 | let wxAmountBoostTotal = asInt(boostInvResult[0]) | |
383 | 386 | let boostDebug = asString(boostInvResult[1]) | |
384 | 387 | let minRewardPart = availableToClaim | |
385 | 388 | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
386 | 389 | let totalReward = (minRewardPart + boostRewardPart) | |
387 | 390 | $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), ((((debug + "::") + toString(userWxReward)) + "::BOOSTDEBUG::") + boostDebug)], SEP)) | |
388 | 391 | } | |
389 | 392 | ||
390 | 393 | ||
391 | 394 | ||
392 | 395 | @Callable(i) | |
393 | 396 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
394 | 397 | then throw("permissions denied") | |
395 | 398 | else { | |
396 | - | let $ | |
397 | - | let wxPerLpIntegralNew = $ | |
398 | - | let poolIntegralSTATE = $ | |
399 | - | let poolDEBUG = $ | |
399 | + | let $t01863218742 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
400 | + | let wxPerLpIntegralNew = $t01863218742._1 | |
401 | + | let poolIntegralSTATE = $t01863218742._2 | |
402 | + | let poolDEBUG = $t01863218742._3 | |
400 | 403 | poolIntegralSTATE | |
401 | 404 | } | |
402 | 405 | ||
403 | 406 |
github/deemru/w8io/fabc49c 68.73 ms ◑