tx · 72W8fZGPGKWhpTMcctoAmgKWS81Vzk7kpU6S4457fidV 3N9Q1fto4gNiBzBhunuF57xU7chekeJBzJb: -0.01000000 Waves 2021.11.24 01:25 [1804275] smart account 3N9Q1fto4gNiBzBhunuF57xU7chekeJBzJb > SELF 0.00000000 Waves
{ "type": 13, "id": "72W8fZGPGKWhpTMcctoAmgKWS81Vzk7kpU6S4457fidV", "fee": 1000000, "feeAssetId": null, "timestamp": 1637706412678, "version": 1, "sender": "3N9Q1fto4gNiBzBhunuF57xU7chekeJBzJb", "senderPublicKey": "5LCbyfeLnA6WFFq4M6L7AEzy8ktT8sL9A5JXoyuaxCCJ", "proofs": [ "3zM6k9pBbmDmEZCncRQ3HS43n8uzQLsiDK1fzWGqVnoHJd4oE9CwMhPh6wVNJuUeLdDi3PuNYPaP9XL3JeAtJvke" ], "script": "base64:AAIFAAAAAAAAABoIAhIDCgEIEgASBAoCCAESAwoBCBIECgIICAAAADoAAAAABlNDQUxFOAAAAAAAAAAACAAAAAAFTVVMVDgAAAAAAAX14QAAAAAAB1NDQUxFMTgAAAAAAAAAABIAAAAABk1VTFQxOAkAATYAAAABAA3gtrOnZAAAAAAAAANTRVACAAAAAl9fAAAAAA5QT09MV0VJR0hUTVVMVAUAAAAFTVVMVDgBAAAAD2dldFN0cmluZ09yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQiAAAAAQUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgIAAAAPbWFuZGF0b3J5IHRoaXMuBQAAAANrZXkCAAAADyBpcyBub3QgZGVmaW5lZAEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzT3JGYWlsAAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAptYW5kYX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b2NrcwMJAABmAAAAAgUAAAASZW1pc3Npb25TdGFydEJsb2NrBQAAAAZoZWlnaHQAAAAAAAAAAAAJAABlAAAAAgUAAAAGaGVpZ2h0BQAAABJlbWlzc2lvblN0YXJ0QmxvY2sEAAAADnBvb2xXeEVtaXNzaW9uCQAAawAAAAMJAABoAAAAAgUAAAASd3hFbWlzc2lvblBlckJsb2NrBQAAAAxwYXNzZWRCbG9ja3MFAAAACnBvb2xXZWlnaHQFAAAADnBvb2xXZWlnaHRNdWx0BAAAAAx1c2VyV3hSZXdhcmQJAABrAAAAAwUAAAAOcG9vbFd4RW1pc3Npb24FAAAADHN0YWtlZEJ5VXNlcgUAAAALc3Rha2VkVG90YWwEAAAADSR0MDE3MTE2MTcyMzMJAQAAABVyZWZyZXNoSW50ZWdyYWxWYWx1ZXMAAAAEBQAAAAxscEFzc2V0SWRTdHIFAAAADnVzZXJBZGRyZXNzU3RyBQAAAA5wb29sQWRkcmVzc1N0cgAAAAAAAAAAAAQAAAAQd3hUb0NsYWltVXNlck5ldwgFAAAADSR0MDE3MTE2MTcyMzMAAAACXzEEAAAADWludGVncmFsU3RhdGUIBQAAAA0kdDAxNzExNjE3MjMzAAAAAl8yBAAAAAVkZWJ1ZwgFAAAADSR0MDE3MTE2MTcyMzMAAAACXzMJAAUUAAAAAgUAAAADbmlsCQAEuQAAAAIJAARMAAAAAgIAAAAKJXMlcyVkJWQlcwkABEwAAAACBQAAAAxscEFzc2V0SWRTdHIJAARMAAAAAgUAAAAOdXNlckFkZHJlc3NTdHIJAARMAAAAAgkAAaQAAAABBQAAAAx1c2VyV3hSZXdhcmQJAARMAAAAAgIAAAABMAkABEwAAAACBQAAAAVkZWJ1ZwUAAAADbmlsBQAAAANTRVAAAAAARXxPnQ==", "chainId": 84, "height": 1804275, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6Ff3wkdLMLwHxMVPVNanDmQnHDHEXEF13UYoBnQkaggv Next: B7jw4ffAMNnYp6gZvdY82ZezFCAikLNkxK5GVLb5QJSD Diff:
Old | New | Differences | |
---|---|---|---|
153 | 153 | ||
154 | 154 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
155 | 155 | ||
156 | + | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0)) | |
157 | + | then (stakedByUser > 0) | |
158 | + | else false) | |
159 | + | then 0 | |
160 | + | else if ((stakedByUser == 0)) | |
161 | + | then wxPerLpIntegralNew | |
162 | + | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0)) | |
163 | + | then (stakedByUser > 0) | |
164 | + | else false) | |
165 | + | then getIntOrFail(this, wxPerLpIntegralUserLastKEY) | |
166 | + | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
167 | + | ||
168 | + | ||
169 | + | func refreshIntegralValues (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
170 | + | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
171 | + | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
172 | + | let stakedByUser = readStaked(stakedByUserKEY) | |
173 | + | let stakedTotal = readStaked(stakedTotalKEY) | |
174 | + | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
175 | + | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
176 | + | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
177 | + | let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, (POOLWEIGHTMULT * 3)) | |
178 | + | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
179 | + | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
180 | + | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
181 | + | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
182 | + | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
183 | + | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
184 | + | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
185 | + | let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY) | |
186 | + | let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY) | |
187 | + | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
188 | + | let wxPerLpOrZero = getIntOrZero(this, wxPerLpKEY) | |
189 | + | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
190 | + | let wxPerLp = if ((wxPerLpOrZero != 0)) | |
191 | + | then wxPerLpOrZero | |
192 | + | else fraction(poolWxEmissionPerBlock, MULT8, stakedTotal) | |
193 | + | let stakedTotalNew = (stakedTotal + lpDeltaAmount) | |
194 | + | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLp * dh)) | |
195 | + | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
196 | + | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, MULT8)) | |
197 | + | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
198 | + | let wxPerLpNew = (poolWxEmissionPerBlock / stakedTotalNew) | |
199 | + | let wxPerLpIntegralLastUpdHeightNew = height | |
200 | + | 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)], "::") | |
202 | + | $Tuple3(wxToClaimUserNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)], debug) | |
203 | + | } | |
204 | + | ||
205 | + | ||
156 | 206 | @Callable(i) | |
157 | 207 | func constructor (factoryAddressStr) = if ((i.caller != this)) | |
158 | 208 | then throw("not authorized") | |
259 | 309 | else (height - emissionStartBlock) | |
260 | 310 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, poolWeightMult) | |
261 | 311 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
262 | - | let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, POOLWEIGHTMULT) | |
263 | - | let amount = 0 | |
264 | - | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
265 | - | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
266 | - | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
267 | - | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
268 | - | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
269 | - | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
270 | - | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
271 | - | let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY) | |
272 | - | let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY) | |
273 | - | let wxPerLpIntegralUserLastUpdHeight = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
274 | - | let wxPerLpOrZero = getIntOrZero(this, wxPerLpKEY) | |
275 | - | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
276 | - | let wxPerLp = if ((wxPerLpOrZero != 0)) | |
277 | - | then wxPerLpOrZero | |
278 | - | else fraction(poolWxEmissionPerBlock, MULT8, stakedTotal) | |
279 | - | let stakedTotalNew = (stakedTotal + amount) | |
280 | - | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLp * dh)) | |
281 | - | let wxPerLpIntegralUserLast = if (if ((wxPerLpIntegralUserLastUpdHeight == 0)) | |
282 | - | then (stakedByUser > 0) | |
283 | - | else false) | |
284 | - | then 0 | |
285 | - | else if ((stakedByUser == 0)) | |
286 | - | then wxPerLpIntegralNew | |
287 | - | else if (if ((wxPerLpIntegralUserLastUpdHeight > 0)) | |
288 | - | then (stakedByUser > 0) | |
289 | - | else false) | |
290 | - | then getIntOrFail(this, wxPerLpIntegralUserLastKEY) | |
291 | - | else throw("Invalid condition") | |
292 | - | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, MULT8)) | |
293 | - | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
294 | - | let wxPerLpNew = (poolWxEmissionPerBlock / stakedTotalNew) | |
295 | - | let wxPerLpIntegralLastUpdHeightNew = height | |
296 | - | let wxPerLpIntegralUserLastUpdHeightNew = height | |
297 | - | let debug = ((((((((((((((((((toString(wxToClaimUserNew) + "::") + toString(wxPerLpIntegralNew)) + "::") + toString(wxPerLpIntegralUserLast)) + "::") + toString(stakedByUser)) + "::") + toString(dh)) + "::") + toString(wxPerLp)) + "::") + toString(stakedTotal)) + "::") + toString(poolWxEmissionPerBlock)) + "::") + toString(wxEmissionPerBlock)) + "::") + toString(poolWeight)) | |
298 | - | $Tuple2(nil, makeString(["%s%s%d%s", lpAssetIdStr, userAddressStr, toString(userWxReward), "0", debug], SEP)) | |
312 | + | let $t01711617233 = refreshIntegralValues(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
313 | + | let wxToClaimUserNew = $t01711617233._1 | |
314 | + | let integralState = $t01711617233._2 | |
315 | + | let debug = $t01711617233._3 | |
316 | + | $Tuple2(nil, makeString(["%s%s%d%d%s", lpAssetIdStr, userAddressStr, toString(userWxReward), "0", debug], SEP)) | |
299 | 317 | } | |
300 | 318 | ||
301 | 319 |
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 getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | let IdxFactoryCfgStakingDapp = 1 | |
35 | 35 | ||
36 | 36 | let IdxFactoryCfgBoostingDapp = 2 | |
37 | 37 | ||
38 | 38 | let IdxFactoryCfgIdoDapp = 3 | |
39 | 39 | ||
40 | 40 | let IdxFactoryCfgTeamDapp = 4 | |
41 | 41 | ||
42 | 42 | let IdxFactoryCfgEmissionDapp = 5 | |
43 | 43 | ||
44 | 44 | let IdxFactoryCfgRestDapp = 6 | |
45 | 45 | ||
46 | 46 | let IdxFactoryCfgSlippageDapp = 7 | |
47 | 47 | ||
48 | 48 | func keyFactoryCfg () = "%s__factoryConfig" | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func keyFactoryLpList () = "%s__lpTokensList" | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress())) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | let factoryContract = readFactoryAddressOrFail() | |
151 | 151 | ||
152 | 152 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
153 | 153 | ||
154 | 154 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
155 | 155 | ||
156 | + | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0)) | |
157 | + | then (stakedByUser > 0) | |
158 | + | else false) | |
159 | + | then 0 | |
160 | + | else if ((stakedByUser == 0)) | |
161 | + | then wxPerLpIntegralNew | |
162 | + | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0)) | |
163 | + | then (stakedByUser > 0) | |
164 | + | else false) | |
165 | + | then getIntOrFail(this, wxPerLpIntegralUserLastKEY) | |
166 | + | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
167 | + | ||
168 | + | ||
169 | + | func refreshIntegralValues (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
170 | + | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
171 | + | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
172 | + | let stakedByUser = readStaked(stakedByUserKEY) | |
173 | + | let stakedTotal = readStaked(stakedTotalKEY) | |
174 | + | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
175 | + | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
176 | + | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
177 | + | let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, (POOLWEIGHTMULT * 3)) | |
178 | + | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
179 | + | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
180 | + | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
181 | + | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
182 | + | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
183 | + | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
184 | + | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
185 | + | let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY) | |
186 | + | let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY) | |
187 | + | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
188 | + | let wxPerLpOrZero = getIntOrZero(this, wxPerLpKEY) | |
189 | + | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
190 | + | let wxPerLp = if ((wxPerLpOrZero != 0)) | |
191 | + | then wxPerLpOrZero | |
192 | + | else fraction(poolWxEmissionPerBlock, MULT8, stakedTotal) | |
193 | + | let stakedTotalNew = (stakedTotal + lpDeltaAmount) | |
194 | + | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLp * dh)) | |
195 | + | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
196 | + | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, MULT8)) | |
197 | + | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
198 | + | let wxPerLpNew = (poolWxEmissionPerBlock / stakedTotalNew) | |
199 | + | let wxPerLpIntegralLastUpdHeightNew = height | |
200 | + | 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)], "::") | |
202 | + | $Tuple3(wxToClaimUserNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)], debug) | |
203 | + | } | |
204 | + | ||
205 | + | ||
156 | 206 | @Callable(i) | |
157 | 207 | func constructor (factoryAddressStr) = if ((i.caller != this)) | |
158 | 208 | then throw("not authorized") | |
159 | 209 | else [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
160 | 210 | ||
161 | 211 | ||
162 | 212 | ||
163 | 213 | @Callable(i) | |
164 | 214 | func stake () = if ((size(i.payments) != 1)) | |
165 | 215 | then throw("invalid payment - exact one payment must be attached") | |
166 | 216 | else { | |
167 | 217 | let pmt = i.payments[0] | |
168 | 218 | let lpAssetId = value(pmt.assetId) | |
169 | 219 | let lpAssetIdStr = toBase58String(lpAssetId) | |
170 | 220 | let amount = pmt.amount | |
171 | 221 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
172 | 222 | let callerStr = toString(i.caller) | |
173 | 223 | let userAddressStr = if ((callerStr == poolAddressStr)) | |
174 | 224 | then toString(i.originCaller) | |
175 | 225 | else callerStr | |
176 | 226 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
177 | 227 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
178 | 228 | let stakedByUser = readStaked(stakedByUserKEY) | |
179 | 229 | let stakedTotal = readStaked(stakedTotalKEY) | |
180 | 230 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
181 | 231 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
182 | 232 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
183 | 233 | let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, (POOLWEIGHTMULT * 3)) | |
184 | 234 | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
185 | 235 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
186 | 236 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
187 | 237 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
188 | 238 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
189 | 239 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
190 | 240 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
191 | 241 | let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY) | |
192 | 242 | let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY) | |
193 | 243 | let wxPerLpIntegralUserLastUpdHeight = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
194 | 244 | let wxPerLpOrZero = getIntOrZero(this, wxPerLpKEY) | |
195 | 245 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
196 | 246 | let wxPerLp = if ((wxPerLpOrZero != 0)) | |
197 | 247 | then wxPerLpOrZero | |
198 | 248 | else (poolWxEmissionPerBlock / stakedTotal) | |
199 | 249 | let stakedTotalNew = (stakedTotal + amount) | |
200 | 250 | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLp * dh)) | |
201 | 251 | let wxPerLpIntegralUserLast = if (if ((wxPerLpIntegralUserLastUpdHeight == 0)) | |
202 | 252 | then (stakedByUser > 0) | |
203 | 253 | else false) | |
204 | 254 | then 0 | |
205 | 255 | else if ((stakedByUser == 0)) | |
206 | 256 | then wxPerLpIntegralNew | |
207 | 257 | else if (if ((wxPerLpIntegralUserLastUpdHeight > 0)) | |
208 | 258 | then (stakedByUser > 0) | |
209 | 259 | else false) | |
210 | 260 | then getIntOrFail(this, wxPerLpIntegralUserLastKEY) | |
211 | 261 | else throw("Invalid condition") | |
212 | 262 | let wxToClaimUserNew = (wxToClaimUser + ((wxPerLpIntegralNew - wxPerLpIntegralUserLast) * stakedByUser)) | |
213 | 263 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
214 | 264 | let wxPerLpNew = (poolWxEmissionPerBlock / stakedTotalNew) | |
215 | 265 | let wxPerLpIntegralLastUpdHeightNew = height | |
216 | 266 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
217 | 267 | [IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, stakedTotalNew), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] | |
218 | 268 | } | |
219 | 269 | ||
220 | 270 | ||
221 | 271 | ||
222 | 272 | @Callable(i) | |
223 | 273 | func unstake (lpAssetIdStr,amount) = { | |
224 | 274 | let userAddressStr = toString(i.caller) | |
225 | 275 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
226 | 276 | if (!(isDefined(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr))))) | |
227 | 277 | then throw(("unsupported lp asset " + lpAssetIdStr)) | |
228 | 278 | else { | |
229 | 279 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
230 | 280 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
231 | 281 | let stakedByUser = readStaked(stakedByUserKEY) | |
232 | 282 | let stakedTotal = readStaked(stakedTotalKEY) | |
233 | 283 | if ((amount > stakedByUser)) | |
234 | 284 | then throw("passed amount is less then available") | |
235 | 285 | else [IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] | |
236 | 286 | } | |
237 | 287 | } | |
238 | 288 | ||
239 | 289 | ||
240 | 290 | ||
241 | 291 | @Callable(i) | |
242 | 292 | func claimWx (lpAssetIdStr) = throw("temporary disabled") | |
243 | 293 | ||
244 | 294 | ||
245 | 295 | ||
246 | 296 | @Callable(i) | |
247 | 297 | func claimWxREADONLY (lpAssetIdStr,userAddressStr) = { | |
248 | 298 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
249 | 299 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
250 | 300 | let stakedByUser = readStaked(stakedByUserKEY) | |
251 | 301 | let stakedTotal = readStaked(stakedTotalKEY) | |
252 | 302 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
253 | 303 | let poolWeightMult = MULT8 | |
254 | 304 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
255 | 305 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
256 | 306 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
257 | 307 | let passedBlocks = if ((emissionStartBlock > height)) | |
258 | 308 | then 0 | |
259 | 309 | else (height - emissionStartBlock) | |
260 | 310 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, poolWeightMult) | |
261 | 311 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
262 | - | let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, POOLWEIGHTMULT) | |
263 | - | let amount = 0 | |
264 | - | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
265 | - | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
266 | - | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
267 | - | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
268 | - | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
269 | - | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
270 | - | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
271 | - | let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY) | |
272 | - | let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY) | |
273 | - | let wxPerLpIntegralUserLastUpdHeight = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
274 | - | let wxPerLpOrZero = getIntOrZero(this, wxPerLpKEY) | |
275 | - | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
276 | - | let wxPerLp = if ((wxPerLpOrZero != 0)) | |
277 | - | then wxPerLpOrZero | |
278 | - | else fraction(poolWxEmissionPerBlock, MULT8, stakedTotal) | |
279 | - | let stakedTotalNew = (stakedTotal + amount) | |
280 | - | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLp * dh)) | |
281 | - | let wxPerLpIntegralUserLast = if (if ((wxPerLpIntegralUserLastUpdHeight == 0)) | |
282 | - | then (stakedByUser > 0) | |
283 | - | else false) | |
284 | - | then 0 | |
285 | - | else if ((stakedByUser == 0)) | |
286 | - | then wxPerLpIntegralNew | |
287 | - | else if (if ((wxPerLpIntegralUserLastUpdHeight > 0)) | |
288 | - | then (stakedByUser > 0) | |
289 | - | else false) | |
290 | - | then getIntOrFail(this, wxPerLpIntegralUserLastKEY) | |
291 | - | else throw("Invalid condition") | |
292 | - | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, MULT8)) | |
293 | - | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
294 | - | let wxPerLpNew = (poolWxEmissionPerBlock / stakedTotalNew) | |
295 | - | let wxPerLpIntegralLastUpdHeightNew = height | |
296 | - | let wxPerLpIntegralUserLastUpdHeightNew = height | |
297 | - | let debug = ((((((((((((((((((toString(wxToClaimUserNew) + "::") + toString(wxPerLpIntegralNew)) + "::") + toString(wxPerLpIntegralUserLast)) + "::") + toString(stakedByUser)) + "::") + toString(dh)) + "::") + toString(wxPerLp)) + "::") + toString(stakedTotal)) + "::") + toString(poolWxEmissionPerBlock)) + "::") + toString(wxEmissionPerBlock)) + "::") + toString(poolWeight)) | |
298 | - | $Tuple2(nil, makeString(["%s%s%d%s", lpAssetIdStr, userAddressStr, toString(userWxReward), "0", debug], SEP)) | |
312 | + | let $t01711617233 = refreshIntegralValues(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
313 | + | let wxToClaimUserNew = $t01711617233._1 | |
314 | + | let integralState = $t01711617233._2 | |
315 | + | let debug = $t01711617233._3 | |
316 | + | $Tuple2(nil, makeString(["%s%s%d%d%s", lpAssetIdStr, userAddressStr, toString(userWxReward), "0", debug], SEP)) | |
299 | 317 | } | |
300 | 318 | ||
301 | 319 |
github/deemru/w8io/026f985 42.37 ms ◑