tx · GGk1hvnsGMhTSEFzjow7a8MvGzs3unWsy2fUhy7ZAqZi

3N9Q1fto4gNiBzBhunuF57xU7chekeJBzJb:  -0.01000000 Waves

2021.11.24 02:07 [1804315] smart account 3N9Q1fto4gNiBzBhunuF57xU7chekeJBzJb > SELF 0.00000000 Waves

{ "type": 13, "id": "GGk1hvnsGMhTSEFzjow7a8MvGzs3unWsy2fUhy7ZAqZi", "fee": 1000000, "feeAssetId": null, "timestamp": 1637708829814, "version": 1, "sender": "3N9Q1fto4gNiBzBhunuF57xU7chekeJBzJb", "senderPublicKey": "5LCbyfeLnA6WFFq4M6L7AEzy8ktT8sL9A5JXoyuaxCCJ", "proofs": [ "5wffS3M33b4oWJcSkDbixKqwMrqfqMZcG1HVBXtqqnUVk2ntAYKWfzr6WXtwpZY6YQem68QD1eCQ7RKcWEnazcyH" ], "script": "base64:AAIFAAAAAAAAABoIAhIDCgEIEgASBAoCCAESAwoBCBIECgIICAAAADoAAAAABlNDQUxFOAAAAAAAAAAACAAAAAAFTVVMVDgAAAAAAAX14QAAAAAAB1NDQUxFMTgAAAAAAAAAABIAAAAABk1VTFQxOAkAATYAAAABAA3gtrOnZAAAAAAAAANTRVACAAAAAl9fAAAAAA5QT09MV0VJR0hUTVVMVAUAAAAFTVVMVDgBAAAAD2dldFN0cmluZ09yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQiAAAAAQUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgIAAAAPbWFuZGF0b3J5IHRoaXMuBQAAAANrZXkCAAAADyBpcyBub3QgZGVmaW5lZAEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzT3JGYWlsAAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAptY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QAEuQAAAAIJAARMAAAAAgIAAAAKJXMlcyVkJWQlcwkABEwAAAACBQAAAAxscEFzc2V0SWRTdHIJAARMAAAAAgUAAAAOdXNlckFkZHJlc3NTdHIJAARMAAAAAgkAAaQAAAABBQAAAAx1c2VyV3hSZXdhcmQJAARMAAAAAgIAAAABMAkABEwAAAACBQAAAAVkZWJ1ZwUAAAADbmlsBQAAAANTRVAAAAAAb3J07w==", "chainId": 84, "height": 1804315, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B7jw4ffAMNnYp6gZvdY82ZezFCAikLNkxK5GVLb5QJSD Next: 5bhc79hGkAVU7bQqQYphYdyAVRnAbFSiW4fWqKoeSp5Y Diff:
OldNewDifferences
166166 else throw("calcWxPerLpIntegralUserLast: unexpected state")
167167
168168
169-func refreshIntegralValues (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
169+func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
170170 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
171171 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
172172 let stakedByUser = readStaked(stakedByUserKEY)
198198 let wxPerLpNew = (poolWxEmissionPerBlock / stakedTotalNew)
199199 let wxPerLpIntegralLastUpdHeightNew = height
200200 let wxPerLpIntegralUserLastUpdHeightNew = height
201- let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), toString(dh), toString(wxPerLp), toString(stakedTotal), toString(poolWxEmissionPerBlock), toString(wxEmissionPerBlock), toString(poolWeight)], "::")
201+ let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), toString(dh), toString(wxPerLp), toString(stakedTotal), toString(poolWxEmissionPerBlock), toString(wxEmissionPerBlock), toString(poolWeight), toString(height)], "::")
202202 $Tuple3(wxToClaimUserNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)], debug)
203203 }
204204
227227 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
228228 let stakedByUser = readStaked(stakedByUserKEY)
229229 let stakedTotal = readStaked(stakedTotalKEY)
230- let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
231- let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
232- let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
233- let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, (POOLWEIGHTMULT * 3))
234- let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
235- let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
236- let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
237- let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
238- let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
239- let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
240- let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
241- let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY)
242- let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY)
243- let wxPerLpIntegralUserLastUpdHeight = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
244- let wxPerLpOrZero = getIntOrZero(this, wxPerLpKEY)
245- let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
246- let wxPerLp = if ((wxPerLpOrZero != 0))
247- then wxPerLpOrZero
248- else (poolWxEmissionPerBlock / stakedTotal)
249- let stakedTotalNew = (stakedTotal + amount)
250- let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLp * dh))
251- let wxPerLpIntegralUserLast = if (if ((wxPerLpIntegralUserLastUpdHeight == 0))
252- then (stakedByUser > 0)
253- else false)
254- then 0
255- else if ((stakedByUser == 0))
256- then wxPerLpIntegralNew
257- else if (if ((wxPerLpIntegralUserLastUpdHeight > 0))
258- then (stakedByUser > 0)
259- else false)
260- then getIntOrFail(this, wxPerLpIntegralUserLastKEY)
261- else throw("Invalid condition")
262- let wxToClaimUserNew = (wxToClaimUser + ((wxPerLpIntegralNew - wxPerLpIntegralUserLast) * stakedByUser))
263- let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
264- let wxPerLpNew = (poolWxEmissionPerBlock / stakedTotalNew)
265- let wxPerLpIntegralLastUpdHeightNew = height
266- let wxPerLpIntegralUserLastUpdHeightNew = height
267-[IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, stakedTotalNew), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)]
230+ let $t01103011147 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
231+ let wxToClaimUserNew = $t01103011147._1
232+ let integralSTATE = $t01103011147._2
233+ let debug = $t01103011147._3
234+ ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
268235 }
269236
270237
309276 else (height - emissionStartBlock)
310277 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, poolWeightMult)
311278 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
312- let $t01713817255 = refreshIntegralValues(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
313- let wxToClaimUserNew = $t01713817255._1
314- let integralState = $t01713817255._2
315- let debug = $t01713817255._3
279+ let $t01334013452 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
280+ let wxToClaimUserNew = $t01334013452._1
281+ let integralSTATE = $t01334013452._2
282+ let debug = $t01334013452._3
316283 $Tuple2(nil, makeString(["%s%s%d%d%s", lpAssetIdStr, userAddressStr, toString(userWxReward), "0", debug], SEP))
317284 }
318285
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
55
66 let MULT8 = 100000000
77
88 let SCALE18 = 18
99
1010 let MULT18 = toBigInt(1000000000000000000)
1111
1212 let SEP = "__"
1313
1414 let POOLWEIGHTMULT = MULT8
1515
1616 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
1717
1818
1919 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
2020
2121
2222 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
2323
2424
2525 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
2626
2727
2828 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
2929
3030
3131 func keyFactoryAddress () = "%s%s__config__factoryAddress"
3232
3333
3434 let IdxFactoryCfgStakingDapp = 1
3535
3636 let IdxFactoryCfgBoostingDapp = 2
3737
3838 let IdxFactoryCfgIdoDapp = 3
3939
4040 let IdxFactoryCfgTeamDapp = 4
4141
4242 let IdxFactoryCfgEmissionDapp = 5
4343
4444 let IdxFactoryCfgRestDapp = 6
4545
4646 let IdxFactoryCfgSlippageDapp = 7
4747
4848 func keyFactoryCfg () = "%s__factoryConfig"
4949
5050
5151 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
5252
5353
5454 func keyFactoryLpList () = "%s__lpTokensList"
5555
5656
5757 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
5858
5959
6060 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
6161
6262
6363 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress()))
6464
6565
6666 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
6767
6868
6969 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
7070
7171
7272 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
7373
7474
7575 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
7676
7777
7878 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
7979
8080
8181 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
8282
8383
8484 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
8585
8686
8787 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
8888
8989
9090 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
9191
9292
9393 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
9494
9595
9696 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
9797
9898
9999 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
100100
101101
102102 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
103103
104104
105105 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
106106
107107
108108 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
109109
110110
111111 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
112112
113113
114114 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
115115
116116
117117 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
118118
119119
120120 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
121121
122122
123123 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
124124
125125
126126 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
127127
128128
129129 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
130130
131131
132132 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
133133
134134
135135 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
136136
137137
138138 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
139139
140140
141141 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
142142
143143
144144 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
145145
146146
147147 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
148148
149149
150150 let factoryContract = readFactoryAddressOrFail()
151151
152152 let factoryCfg = readFactoryCfgOrFail(factoryContract)
153153
154154 let emissionContract = getEmissionAddressOrFail(factoryCfg)
155155
156156 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0))
157157 then (stakedByUser > 0)
158158 else false)
159159 then 0
160160 else if ((stakedByUser == 0))
161161 then wxPerLpIntegralNew
162162 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0))
163163 then (stakedByUser > 0)
164164 else false)
165165 then getIntOrFail(this, wxPerLpIntegralUserLastKEY)
166166 else throw("calcWxPerLpIntegralUserLast: unexpected state")
167167
168168
169-func refreshIntegralValues (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
169+func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
170170 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
171171 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
172172 let stakedByUser = readStaked(stakedByUserKEY)
173173 let stakedTotal = readStaked(stakedTotalKEY)
174174 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
175175 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
176176 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
177177 let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, POOLWEIGHTMULT)
178178 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
179179 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
180180 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
181181 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
182182 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
183183 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
184184 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
185185 let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY)
186186 let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY)
187187 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
188188 let wxPerLpOrZero = getIntOrZero(this, wxPerLpKEY)
189189 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
190190 let wxPerLp = if ((wxPerLpOrZero != 0))
191191 then wxPerLpOrZero
192192 else fraction(poolWxEmissionPerBlock, MULT8, stakedTotal)
193193 let stakedTotalNew = (stakedTotal + lpDeltaAmount)
194194 let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLp * dh))
195195 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
196196 let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, MULT8))
197197 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
198198 let wxPerLpNew = (poolWxEmissionPerBlock / stakedTotalNew)
199199 let wxPerLpIntegralLastUpdHeightNew = height
200200 let wxPerLpIntegralUserLastUpdHeightNew = height
201- let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), toString(dh), toString(wxPerLp), toString(stakedTotal), toString(poolWxEmissionPerBlock), toString(wxEmissionPerBlock), toString(poolWeight)], "::")
201+ let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), toString(dh), toString(wxPerLp), toString(stakedTotal), toString(poolWxEmissionPerBlock), toString(wxEmissionPerBlock), toString(poolWeight), toString(height)], "::")
202202 $Tuple3(wxToClaimUserNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)], debug)
203203 }
204204
205205
206206 @Callable(i)
207207 func constructor (factoryAddressStr) = if ((i.caller != this))
208208 then throw("not authorized")
209209 else [StringEntry(keyFactoryAddress(), factoryAddressStr)]
210210
211211
212212
213213 @Callable(i)
214214 func stake () = if ((size(i.payments) != 1))
215215 then throw("invalid payment - exact one payment must be attached")
216216 else {
217217 let pmt = i.payments[0]
218218 let lpAssetId = value(pmt.assetId)
219219 let lpAssetIdStr = toBase58String(lpAssetId)
220220 let amount = pmt.amount
221221 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
222222 let callerStr = toString(i.caller)
223223 let userAddressStr = if ((callerStr == poolAddressStr))
224224 then toString(i.originCaller)
225225 else callerStr
226226 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
227227 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
228228 let stakedByUser = readStaked(stakedByUserKEY)
229229 let stakedTotal = readStaked(stakedTotalKEY)
230- let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
231- let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
232- let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
233- let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, (POOLWEIGHTMULT * 3))
234- let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
235- let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
236- let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
237- let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
238- let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
239- let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
240- let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
241- let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY)
242- let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY)
243- let wxPerLpIntegralUserLastUpdHeight = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
244- let wxPerLpOrZero = getIntOrZero(this, wxPerLpKEY)
245- let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
246- let wxPerLp = if ((wxPerLpOrZero != 0))
247- then wxPerLpOrZero
248- else (poolWxEmissionPerBlock / stakedTotal)
249- let stakedTotalNew = (stakedTotal + amount)
250- let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLp * dh))
251- let wxPerLpIntegralUserLast = if (if ((wxPerLpIntegralUserLastUpdHeight == 0))
252- then (stakedByUser > 0)
253- else false)
254- then 0
255- else if ((stakedByUser == 0))
256- then wxPerLpIntegralNew
257- else if (if ((wxPerLpIntegralUserLastUpdHeight > 0))
258- then (stakedByUser > 0)
259- else false)
260- then getIntOrFail(this, wxPerLpIntegralUserLastKEY)
261- else throw("Invalid condition")
262- let wxToClaimUserNew = (wxToClaimUser + ((wxPerLpIntegralNew - wxPerLpIntegralUserLast) * stakedByUser))
263- let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
264- let wxPerLpNew = (poolWxEmissionPerBlock / stakedTotalNew)
265- let wxPerLpIntegralLastUpdHeightNew = height
266- let wxPerLpIntegralUserLastUpdHeightNew = height
267-[IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, stakedTotalNew), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)]
230+ let $t01103011147 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
231+ let wxToClaimUserNew = $t01103011147._1
232+ let integralSTATE = $t01103011147._2
233+ let debug = $t01103011147._3
234+ ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
268235 }
269236
270237
271238
272239 @Callable(i)
273240 func unstake (lpAssetIdStr,amount) = {
274241 let userAddressStr = toString(i.caller)
275242 let lpAssetId = fromBase58String(lpAssetIdStr)
276243 if (!(isDefined(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)))))
277244 then throw(("unsupported lp asset " + lpAssetIdStr))
278245 else {
279246 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
280247 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
281248 let stakedByUser = readStaked(stakedByUserKEY)
282249 let stakedTotal = readStaked(stakedTotalKEY)
283250 if ((amount > stakedByUser))
284251 then throw("passed amount is less then available")
285252 else [IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)]
286253 }
287254 }
288255
289256
290257
291258 @Callable(i)
292259 func claimWx (lpAssetIdStr) = throw("temporary disabled")
293260
294261
295262
296263 @Callable(i)
297264 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
298265 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
299266 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
300267 let stakedByUser = readStaked(stakedByUserKEY)
301268 let stakedTotal = readStaked(stakedTotalKEY)
302269 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
303270 let poolWeightMult = MULT8
304271 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
305272 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
306273 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
307274 let passedBlocks = if ((emissionStartBlock > height))
308275 then 0
309276 else (height - emissionStartBlock)
310277 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, poolWeightMult)
311278 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
312- let $t01713817255 = refreshIntegralValues(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
313- let wxToClaimUserNew = $t01713817255._1
314- let integralState = $t01713817255._2
315- let debug = $t01713817255._3
279+ let $t01334013452 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
280+ let wxToClaimUserNew = $t01334013452._1
281+ let integralSTATE = $t01334013452._2
282+ let debug = $t01334013452._3
316283 $Tuple2(nil, makeString(["%s%s%d%d%s", lpAssetIdStr, userAddressStr, toString(userWxReward), "0", debug], SEP))
317284 }
318285
319286

github/deemru/w8io/026f985 
37.74 ms