tx · Gjz63djpWUXYbBDxcnjh4RF8QyWA24gxc11kDhg9FAhg 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy: -0.02500000 Waves 2023.08.08 14:04 [2701539] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves
{ "type": 13, "id": "Gjz63djpWUXYbBDxcnjh4RF8QyWA24gxc11kDhg9FAhg", "fee": 2500000, "feeAssetId": null, "timestamp": 1691492726675, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "4GheJ6ByP6cRZq9zTC9BaGso11GTJw4bBihdjtiG2LaDA9ARAKtsg2MPzF1pYcGvaQ43HJcVuHb4B7kvDjG2Q7f9" ], "script": "base64:BgK4LQgCEggKBggIAQEBCBIFCgMBCAISAwoBARIECgIICBIECgIICBIECgIIARIDCgEIEgMKAQgSBAoCCAESAwoBCBIAEgASBQoDCAgEEgMKAQgSAwoBCBIECgIICBIECgIICCIDU0VQIgZTQ0FMRTgiBU1VTFQ4Ig5QT09MV0VJR0hUTVVMVCIQY29udHJhY3RGaWxlbmFtZSIHU0NBTEUxOCIGTVVMVDE4IghNVUxUMThCSSILYmxvY2tzSW5EYXkiDWJsb2Nrc0luTW9udGgiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiD2dldFN0cmluZ09yRmFpbCIHYWRkcmVzcyIDa2V5IgxnZXRJbnRPclplcm8iD2dldEludE9yRGVmYXVsdCIKZGVmYXVsdFZhbCIMZ2V0SW50T3JGYWlsIgNhYnMiA3ZhbCIOZW5zdXJlUG9zaXRpdmUiAXYiAW0iG2tleVJlZmVycmFsc0NvbnRyYWN0QWRkcmVzcyIecmVmZXJyYWxzQ29udHJhY3RBZGRyZXNzT3JGYWlsIhZrZXlSZWZlcnJhbFByb2dyYW1OYW1lIhpyZWZlcnJhbF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3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4CYU0BHWdldFZvdGluZ1Jlc3VsdFN0YWtlZFJFQURPTkxZAQJiRQkAlAoCBQNuaWwJAQJjVAEFAmJFAmFNASVnZXRWb3RpbmdSZXN1bHRTdGFrZWRJbnRlZ3JhbFJFQURPTkxZAQJiRQkAlAoCBQNuaWwJAQJjWAEFAmJFAmFNARxnZXRVc2VyVm90ZUZpbmFsaXplZFJFQURPTkxZAgJiRQJiTQkAlAoCBQNuaWwJAQJjTQIFAmJFBQJiTQJhTQEhZ2V0VXNlclZvdGVTdGFrZWRJbnRlZ3JhbFJFQURPTkxZAgJiRQJiTQkAlAoCBQNuaWwJAQJkaAIFAmJFBQJiTQECZVYBAmVXAAQCZVgEAmFICQECYUoAAwkAAQIFAmFIAgpCeXRlVmVjdG9yBAJhTwUCYUgFAmFPAwkAAQIFAmFIAgRVbml0CAUCZVYPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmVWCWJvZHlCeXRlcwkAkQMCCAUCZVYGcHJvb2ZzAAAFAmVY0KQODg==", "height": 2701539, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8RBfG2uJi94M48pCKJYYiCGC9TGUwvDGEB9Jup7AN1Ny Next: 8dZDzjnyYEhMN7CVUMtf2KonyGqArDMYEYLTeUUensyZ Diff:
Old | New | Differences | |
---|---|---|---|
773 | 773 | let userAddressStr = toString(userAddress) | |
774 | 774 | let txId = fromBase58String(txIdStr) | |
775 | 775 | let userRecordArray = readLockParamsRecordOrFail(userAddress, if ((txIdStr == "")) | |
776 | - | then | |
777 | - | else | |
776 | + | then unit | |
777 | + | else txId) | |
778 | 778 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
779 | 779 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
780 | 780 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let SCALE8 = 8 | |
7 | 7 | ||
8 | 8 | let MULT8 = 100000000 | |
9 | 9 | ||
10 | 10 | let POOLWEIGHTMULT = MULT8 | |
11 | 11 | ||
12 | 12 | let contractFilename = "boosting.ride" | |
13 | 13 | ||
14 | 14 | let SCALE18 = 18 | |
15 | 15 | ||
16 | 16 | let MULT18 = 1000000000000000000 | |
17 | 17 | ||
18 | 18 | let MULT18BI = toBigInt(MULT18) | |
19 | 19 | ||
20 | 20 | let blocksInDay = 1440 | |
21 | 21 | ||
22 | 22 | let blocksInMonth = 43800 | |
23 | 23 | ||
24 | 24 | func wrapErr (msg) = makeString([contractFilename, ": ", msg], "") | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func throwErr (msg) = throw(wrapErr(msg)) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined"))) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined"))) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func abs (val) = if ((0 > val)) | |
43 | 43 | then -(val) | |
44 | 44 | else val | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func ensurePositive (v,m) = if ((v >= 0)) | |
48 | 48 | then v | |
49 | 49 | else throwErr((valueOrElse(m, "value") + " should be positive")) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(this, keyReferralsContractAddress())) | |
56 | 56 | ||
57 | 57 | let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP) | |
58 | 58 | ||
59 | 59 | let referralProgramNameDefault = "wxlock" | |
60 | 60 | ||
61 | 61 | let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault) | |
62 | 62 | ||
63 | 63 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | let IdxFactoryCfgStakingDapp = 1 | |
67 | 67 | ||
68 | 68 | let IdxFactoryCfgBoostingDapp = 2 | |
69 | 69 | ||
70 | 70 | let IdxFactoryCfgIdoDapp = 3 | |
71 | 71 | ||
72 | 72 | let IdxFactoryCfgTeamDapp = 4 | |
73 | 73 | ||
74 | 74 | let IdxFactoryCfgEmissionDapp = 5 | |
75 | 75 | ||
76 | 76 | let IdxFactoryCfgRestDapp = 6 | |
77 | 77 | ||
78 | 78 | let IdxFactoryCfgSlippageDapp = 7 | |
79 | 79 | ||
80 | 80 | let IdxFactoryCfgDaoDapp = 8 | |
81 | 81 | ||
82 | 82 | let IdxFactoryCfgMarketingDapp = 9 | |
83 | 83 | ||
84 | 84 | let IdxFactoryCfgGwxRewardDapp = 10 | |
85 | 85 | ||
86 | 86 | let IdxFactoryCfgBirdsDapp = 11 | |
87 | 87 | ||
88 | 88 | func keyFactoryCfg () = "%s__factoryConfig" | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress())) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func keyBoostingV2LastUpdateHeight () = "%s%s__boostingV2__startBlock" | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func keyBoostingV2Integral () = "%s%s__boostingV2__integral" | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func keyNextPergetIntOrDefault () = "%s__nextPeriod" | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight" | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | let IdxCfgAssetId = 1 | |
152 | 152 | ||
153 | 153 | let IdxCfgMinLockAmount = 2 | |
154 | 154 | ||
155 | 155 | let IdxCfgMinLockDuration = 3 | |
156 | 156 | ||
157 | 157 | let IdxCfgMaxLockDuration = 4 | |
158 | 158 | ||
159 | 159 | let IdxCfgMathContract = 5 | |
160 | 160 | ||
161 | 161 | func keyConfig () = "%s__config" | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | func readConfigArrayOrFail () = split(getStringOrFail(this, keyConfig()), SEP) | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | let cfgArray = readConfigArrayOrFail() | |
168 | 168 | ||
169 | 169 | let assetId = fromBase58String(cfgArray[IdxCfgAssetId]) | |
170 | 170 | ||
171 | 171 | let minLockAmount = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMinLockAmount]), wrapErr("invalid min lock amount")) | |
172 | 172 | ||
173 | 173 | let minLockDuration = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMinLockDuration]), wrapErr("invalid min lock duration")) | |
174 | 174 | ||
175 | 175 | let maxLockDuration = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMaxLockDuration]), wrapErr("invalid max lock duration")) | |
176 | 176 | ||
177 | 177 | let mathContract = valueOrErrorMessage(addressFromString(cfgArray[IdxCfgMathContract]), wrapErr("invalid math contract address")) | |
178 | 178 | ||
179 | 179 | func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d%s", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract) | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
186 | 186 | case s: String => | |
187 | 187 | addressFromStringValue(s) | |
188 | 188 | case _ => | |
189 | 189 | this | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func managerPublicKeyOrUnit () = { | |
194 | 194 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
195 | 195 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
196 | 196 | case s: String => | |
197 | 197 | fromBase58String(s) | |
198 | 198 | case _: Unit => | |
199 | 199 | unit | |
200 | 200 | case _ => | |
201 | 201 | throw("Match error") | |
202 | 202 | } | |
203 | 203 | } | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | func mustManager (i) = { | |
207 | 207 | let pd = throwErr("Permission denied") | |
208 | 208 | match managerPublicKeyOrUnit() { | |
209 | 209 | case pk: ByteVector => | |
210 | 210 | if ((i.callerPublicKey == pk)) | |
211 | 211 | then true | |
212 | 212 | else pd | |
213 | 213 | case _: Unit => | |
214 | 214 | if ((i.caller == this)) | |
215 | 215 | then true | |
216 | 216 | else pd | |
217 | 217 | case _ => | |
218 | 218 | throw("Match error") | |
219 | 219 | } | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | let IdxLockAmount = 1 | |
224 | 224 | ||
225 | 225 | let IdxLockStart = 2 | |
226 | 226 | ||
227 | 227 | let IdxLockDuration = 3 | |
228 | 228 | ||
229 | 229 | let IdxLockLastUpdateTimestamp = 4 | |
230 | 230 | ||
231 | 231 | let IdxLockGwxAmount = 5 | |
232 | 232 | ||
233 | 233 | let IdxLockWxClaimed = 6 | |
234 | 234 | ||
235 | 235 | func keyLockParamsRecord (userAddress,txId) = makeString(["%s%s%s__lock", toString(userAddress), match txId { | |
236 | 236 | case b: ByteVector => | |
237 | 237 | toBase58String(b) | |
238 | 238 | case _: Unit => | |
239 | 239 | "legacy" | |
240 | 240 | case _ => | |
241 | 241 | throw("Match error") | |
242 | 242 | }], SEP) | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | func readLockParamsRecordOrFail (userAddress,txId) = split(getStringOrFail(this, keyLockParamsRecord(userAddress, txId)), SEP) | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func keyUserGwxAmountTotal (userAddress) = makeString(["%s%s__gwxAmountTotal", toString(userAddress)], SEP) | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func formatLockParamsRecord (amount,start,duration,gwxAmount,wxClaimed) = makeString(["%d%d%d%d%d%d%d", toString(amount), toString(start), toString(duration), toString(lastBlock.timestamp), toString(gwxAmount), toString(wxClaimed)], SEP) | |
252 | 252 | ||
253 | 253 | ||
254 | 254 | func keyNextUserNum () = "%s__nextUserNum" | |
255 | 255 | ||
256 | 256 | ||
257 | 257 | func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP) | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP) | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked" | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks" | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func keyStatsLocksCount () = "%s%s__stats__locksCount" | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func keyStatsUsersCount () = "%s%s__stats__activeUsersCount" | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum)], SEP) | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum), lpAssetId], SEP) | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", toString(userNum)], SEP) | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total" | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", toString(userNum)], SEP) | |
288 | 288 | ||
289 | 289 | ||
290 | 290 | func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", toString(userNum)], SEP) | |
291 | 291 | ||
292 | 292 | ||
293 | 293 | func keyGwxTotal () = "%s%s__gwx__total" | |
294 | 294 | ||
295 | 295 | ||
296 | 296 | func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP) | |
297 | 297 | ||
298 | 298 | ||
299 | 299 | func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP) | |
300 | 300 | ||
301 | 301 | ||
302 | 302 | func keyCurrentEpochUi () = makeString(["%s", "currentEpochUi"], SEP) | |
303 | 303 | ||
304 | 304 | ||
305 | 305 | func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP) | |
306 | 306 | ||
307 | 307 | ||
308 | 308 | func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP) | |
309 | 309 | ||
310 | 310 | ||
311 | 311 | func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP) | |
312 | 312 | ||
313 | 313 | ||
314 | 314 | func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
315 | 315 | ||
316 | 316 | ||
317 | 317 | func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
321 | 321 | ||
322 | 322 | ||
323 | 323 | func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
324 | 324 | ||
325 | 325 | ||
326 | 326 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP) | |
327 | 327 | ||
328 | 328 | ||
329 | 329 | let factoryContract = readFactoryAddressOrFail() | |
330 | 330 | ||
331 | 331 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
332 | 332 | ||
333 | 333 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
334 | 334 | ||
335 | 335 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
336 | 336 | ||
337 | 337 | let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg) | |
338 | 338 | ||
339 | 339 | let lpStakingPoolsContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], SEP)), wrapErr("lp_staking_pools contract address is undefined"))), wrapErr("invalid lp_staking_pools contract address")) | |
340 | 340 | ||
341 | 341 | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP) | |
342 | 342 | ||
343 | 343 | let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract)) | |
344 | 344 | ||
345 | 345 | let keyVotingEmissionRateContract = makeString(["%s", "votingEmissionRateContract"], SEP) | |
346 | 346 | ||
347 | 347 | let boostCoeff = { | |
348 | 348 | let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil) | |
349 | 349 | if ($isInstanceOf(@, "Int")) | |
350 | 350 | then @ | |
351 | 351 | else throw(($getType(@) + " couldn't be cast to Int")) | |
352 | 352 | } | |
353 | 353 | ||
354 | 354 | func userNumberByAddressOrFail (userAddress) = match getString(this, keyUser2NumMapping(toString(userAddress))) { | |
355 | 355 | case s: String => | |
356 | 356 | valueOrErrorMessage(parseInt(s), wrapErr("invalid user number")) | |
357 | 357 | case _: Unit => | |
358 | 358 | throwErr("invalid user") | |
359 | 359 | case _ => | |
360 | 360 | throw("Match error") | |
361 | 361 | } | |
362 | 362 | ||
363 | 363 | ||
364 | 364 | func getGwxAmountTotal () = valueOrElse(getInteger(this, keyGwxTotal()), 0) | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | func getLockedGwxAmount (userAddress) = { | |
368 | 368 | let functionName = "getLockedGwxAmount" | |
369 | 369 | let votingEmissionRateContract = valueOrErrorMessage( match getString(votingEmissionContract, keyVotingEmissionRateContract) { | |
370 | 370 | case _: Unit => | |
371 | 371 | unit | |
372 | 372 | case s: String => | |
373 | 373 | addressFromString(s) | |
374 | 374 | case _ => | |
375 | 375 | throw("Match error") | |
376 | 376 | }, wrapErr("invalid voting emission rate address")) | |
377 | 377 | let lockedVotingEmissionRate = { | |
378 | 378 | let @ = invoke(votingEmissionContract, functionName, [toString(userAddress)], nil) | |
379 | 379 | if ($isInstanceOf(@, "Int")) | |
380 | 380 | then @ | |
381 | 381 | else throw(($getType(@) + " couldn't be cast to Int")) | |
382 | 382 | } | |
383 | 383 | let lockedVotingEmission = { | |
384 | 384 | let @ = invoke(votingEmissionRateContract, functionName, [toString(userAddress)], nil) | |
385 | 385 | if ($isInstanceOf(@, "Int")) | |
386 | 386 | then @ | |
387 | 387 | else throw(($getType(@) + " couldn't be cast to Int")) | |
388 | 388 | } | |
389 | 389 | let locked = max([lockedVotingEmissionRate, lockedVotingEmission]) | |
390 | 390 | locked | |
391 | 391 | } | |
392 | 392 | ||
393 | 393 | ||
394 | 394 | func HistoryEntry (type,user,amount,lockStart,duration,gwxAmount,i) = { | |
395 | 395 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
396 | 396 | let historyDATA = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount), toString(lockStart), toString(duration), toString(gwxAmount)], SEP) | |
397 | 397 | StringEntry(historyKEY, historyDATA) | |
398 | 398 | } | |
399 | 399 | ||
400 | 400 | ||
401 | 401 | func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = { | |
402 | 402 | let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks() | |
403 | 403 | let locksCountKEY = keyStatsLocksCount() | |
404 | 404 | let usersCountKEY = keyStatsUsersCount() | |
405 | 405 | let totalAmountKEY = keyLockParamTotalAmount() | |
406 | 406 | let locksDurationSumInBlocks = getIntOrZero(this, locksDurationSumInBlocksKEY) | |
407 | 407 | let locksCount = getIntOrZero(this, locksCountKEY) | |
408 | 408 | let usersCount = getIntOrZero(this, usersCountKEY) | |
409 | 409 | let totalAmount = getIntOrZero(this, totalAmountKEY) | |
410 | 410 | [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))] | |
411 | 411 | } | |
412 | 412 | ||
413 | 413 | ||
414 | 414 | func LockParamsEntry (userAddress,txId,amount,start,duration,gwxAmount,wxClaimed) = [StringEntry(keyLockParamsRecord(userAddress, txId), formatLockParamsRecord(amount, start, duration, gwxAmount, wxClaimed))] | |
415 | 415 | ||
416 | 416 | ||
417 | 417 | func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1)) | |
418 | 418 | then throwErr("only one payment is allowed") | |
419 | 419 | else if ((size(i.payments) == 0)) | |
420 | 420 | then 0 | |
421 | 421 | else { | |
422 | 422 | let pmt = i.payments[0] | |
423 | 423 | if ((value(pmt.assetId) != expectedAssetId)) | |
424 | 424 | then throwErr("invalid asset id in payment") | |
425 | 425 | else pmt.amount | |
426 | 426 | } | |
427 | 427 | ||
428 | 428 | ||
429 | 429 | func getUserGwxAmountTotal (userAddress) = valueOrElse(getInteger(this, keyUserGwxAmountTotal(userAddress)), 0) | |
430 | 430 | ||
431 | 431 | ||
432 | 432 | func getVotingEmissionEpochInfo () = { | |
433 | 433 | let $t01499515285 = { | |
434 | 434 | let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi())) | |
435 | 435 | let lastFinalizedEpoch = (currentEpochUi - 1) | |
436 | 436 | if ((0 > lastFinalizedEpoch)) | |
437 | 437 | then throwErr("invalid epoch") | |
438 | 438 | else $Tuple2(currentEpochUi, lastFinalizedEpoch) | |
439 | 439 | } | |
440 | 440 | let currentEpochUi = $t01499515285._1 | |
441 | 441 | let lastFinalizedEpoch = $t01499515285._2 | |
442 | 442 | let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi))) | |
443 | 443 | $Tuple2(lastFinalizedEpoch, currentEpochStartHeight) | |
444 | 444 | } | |
445 | 445 | ||
446 | 446 | ||
447 | 447 | func getPoolAssetsByLpAssetId (lpAssetIdStr) = { | |
448 | 448 | let idxAmountAssetId = 4 | |
449 | 449 | let idxPriceAssetId = 5 | |
450 | 450 | let poolCfg = { | |
451 | 451 | let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil) | |
452 | 452 | if ($isInstanceOf(@, "List[Any]")) | |
453 | 453 | then @ | |
454 | 454 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
455 | 455 | } | |
456 | 456 | let amountAssetId = { | |
457 | 457 | let @ = poolCfg[idxAmountAssetId] | |
458 | 458 | if ($isInstanceOf(@, "String")) | |
459 | 459 | then @ | |
460 | 460 | else throw(($getType(@) + " couldn't be cast to String")) | |
461 | 461 | } | |
462 | 462 | let priceAssetId = { | |
463 | 463 | let @ = poolCfg[idxPriceAssetId] | |
464 | 464 | if ($isInstanceOf(@, "String")) | |
465 | 465 | then @ | |
466 | 466 | else throw(($getType(@) + " couldn't be cast to String")) | |
467 | 467 | } | |
468 | 468 | $Tuple2(amountAssetId, priceAssetId) | |
469 | 469 | } | |
470 | 470 | ||
471 | 471 | ||
472 | 472 | func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = { | |
473 | 473 | let userAddress = addressFromStringValue(userAddressStr) | |
474 | 474 | let $t01597616056 = getVotingEmissionEpochInfo() | |
475 | 475 | let lastFinalizedEpoch = $t01597616056._1 | |
476 | 476 | let currentEpochStartHeight = $t01597616056._2 | |
477 | 477 | let $t01605916134 = getPoolAssetsByLpAssetId(lpAssetIdStr) | |
478 | 478 | let amountAssetId = $t01605916134._1 | |
479 | 479 | let priceAssetId = $t01605916134._2 | |
480 | 480 | let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch) | |
481 | 481 | let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0) | |
482 | 482 | userVote | |
483 | 483 | } | |
484 | 484 | ||
485 | 485 | ||
486 | 486 | func getUserVoteStaked (lpAssetIdStr,userAddressStr) = { | |
487 | 487 | let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0) | |
488 | 488 | let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr) | |
489 | 489 | if ((stakedByUser == 0)) | |
490 | 490 | then 0 | |
491 | 491 | else userVote | |
492 | 492 | } | |
493 | 493 | ||
494 | 494 | ||
495 | 495 | func getVotingResultStaked (lpAssetIdStr) = { | |
496 | 496 | let $t01667816758 = getVotingEmissionEpochInfo() | |
497 | 497 | let lastFinalizedEpoch = $t01667816758._1 | |
498 | 498 | let currentEpochStartHeight = $t01667816758._2 | |
499 | 499 | let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
500 | 500 | let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart) | |
501 | 501 | votingResultStaked | |
502 | 502 | } | |
503 | 503 | ||
504 | 504 | ||
505 | 505 | func getVotingResultStakedIntegral (lpAssetIdStr) = { | |
506 | 506 | let $t01712017200 = getVotingEmissionEpochInfo() | |
507 | 507 | let lastFinalizedEpoch = $t01712017200._1 | |
508 | 508 | let currentEpochStartHeight = $t01712017200._2 | |
509 | 509 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
510 | 510 | let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
511 | 511 | let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight) | |
512 | 512 | let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight) | |
513 | 513 | let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev) | |
514 | 514 | votingResultStakedIntegral | |
515 | 515 | } | |
516 | 516 | ||
517 | 517 | ||
518 | 518 | func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = { | |
519 | 519 | let $t01803718117 = getVotingEmissionEpochInfo() | |
520 | 520 | let lastFinalizedEpoch = $t01803718117._1 | |
521 | 521 | let currentEpochStartHeight = $t01803718117._2 | |
522 | 522 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
523 | 523 | let votingResultStakedNew = (votingResultStaked + stakedVoteDelta) | |
524 | 524 | let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr) | |
525 | 525 | [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedNew), IntegerEntry(keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch), height), IntegerEntry(keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedIntegral)] | |
526 | 526 | } | |
527 | 527 | ||
528 | 528 | ||
529 | 529 | func getUserVoteStakedIntegral (lpAssetIdStr,userAddressStr) = { | |
530 | 530 | let $t01872818808 = getVotingEmissionEpochInfo() | |
531 | 531 | let lastFinalizedEpoch = $t01872818808._1 | |
532 | 532 | let currentEpochStartHeight = $t01872818808._2 | |
533 | 533 | let userAddress = addressFromStringValue(userAddressStr) | |
534 | 534 | let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr) | |
535 | 535 | let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0) | |
536 | 536 | let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight) | |
537 | 537 | let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight) | |
538 | 538 | let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev) | |
539 | 539 | userVoteStakedIntegral | |
540 | 540 | } | |
541 | 541 | ||
542 | 542 | ||
543 | 543 | func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = { | |
544 | 544 | let $t01959619676 = getVotingEmissionEpochInfo() | |
545 | 545 | let lastFinalizedEpoch = $t01959619676._1 | |
546 | 546 | let currentEpochStartHeight = $t01959619676._2 | |
547 | 547 | let userAddress = addressFromStringValue(userAddressStr) | |
548 | 548 | let userVoteFinalized = getUserVoteFinalized(lpAssetIdStr, userAddressStr) | |
549 | 549 | let actions = if ((userVoteFinalized == 0)) | |
550 | 550 | then nil | |
551 | 551 | else { | |
552 | 552 | let stakedVoteDelta = if (edge) | |
553 | 553 | then userVoteFinalized | |
554 | 554 | else -(userVoteFinalized) | |
555 | 555 | let votingResultActions = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta) | |
556 | 556 | let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr) | |
557 | 557 | let voteActions = [IntegerEntry(keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch), height), IntegerEntry(keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch), userVoteStakedIntegral)] | |
558 | 558 | (votingResultActions ++ voteActions) | |
559 | 559 | } | |
560 | 560 | actions | |
561 | 561 | } | |
562 | 562 | ||
563 | 563 | ||
564 | 564 | func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = { | |
565 | 565 | let $t02053020610 = getVotingEmissionEpochInfo() | |
566 | 566 | let lastFinalizedEpoch = $t02053020610._1 | |
567 | 567 | let currentEpochStartHeight = $t02053020610._2 | |
568 | 568 | let userAddress = addressFromStringValue(userAddressStr) | |
569 | 569 | let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
570 | 570 | let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0) | |
571 | 571 | let votingResultStakedIntegralLastKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
572 | 572 | let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralLastKey), 0) | |
573 | 573 | let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr) | |
574 | 574 | let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr) | |
575 | 575 | let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast) | |
576 | 576 | let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast) | |
577 | 577 | $Tuple3([IntegerEntry(userVoteStakedIntegralLastKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralLastKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff) | |
578 | 578 | } | |
579 | 579 | ||
580 | 580 | ||
581 | 581 | func refreshBoostEmissionIntegral () = { | |
582 | 582 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
583 | 583 | let boostingV2LastUpdateHeightOption = getInteger(this, keyBoostingV2LastUpdateHeight()) | |
584 | 584 | let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral()) | |
585 | 585 | let emissionEnd = getIntOrFail(emissionContract, keyEmissionEndBlock()) | |
586 | 586 | let h = if ((height > emissionEnd)) | |
587 | 587 | then emissionEnd | |
588 | 588 | else height | |
589 | 589 | let dh = match boostingV2LastUpdateHeightOption { | |
590 | 590 | case lastUpdateHeight: Int => | |
591 | 591 | max([(h - lastUpdateHeight), 0]) | |
592 | 592 | case _: Unit => | |
593 | 593 | 0 | |
594 | 594 | case _ => | |
595 | 595 | throw("Match error") | |
596 | 596 | } | |
597 | 597 | let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff) | |
598 | 598 | let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0) | |
599 | 599 | let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev) | |
600 | 600 | $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral) | |
601 | 601 | } | |
602 | 602 | ||
603 | 603 | ||
604 | 604 | func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = { | |
605 | 605 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address")) | |
606 | 606 | let userNum = userNumberByAddressOrFail(userAddress) | |
607 | 607 | if ((userNum == userNum)) | |
608 | 608 | then { | |
609 | 609 | let EMPTYSTR = "empty" | |
610 | 610 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
611 | 611 | then { | |
612 | 612 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr))) | |
613 | 613 | getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
614 | 614 | } | |
615 | 615 | else if (readOnly) | |
616 | 616 | then 0 | |
617 | 617 | else throwErr(("not readonly mode: unsupported lp asset " + lpAssetIdStr)) | |
618 | 618 | let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNum, lpAssetIdStr) | |
619 | 619 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum) | |
620 | 620 | let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), getIntOrZero(this, userBoostEmissionLastIntegralKEY)) | |
621 | 621 | let boostEmissionIntegral = refreshBoostEmissionIntegral()._2 | |
622 | 622 | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
623 | 623 | if ((0 > userBoostEmissionIntegral)) | |
624 | 624 | then throwErr("wrong calculations") | |
625 | 625 | else { | |
626 | 626 | let $t02415224291 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr) | |
627 | 627 | let stakedVotesIntegralsActions = $t02415224291._1 | |
628 | 628 | let userVoteIntegralDiff = $t02415224291._2 | |
629 | 629 | let totalVotesIntegralDiff = $t02415224291._3 | |
630 | 630 | let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT) | |
631 | 631 | let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0)) | |
632 | 632 | then 0 | |
633 | 633 | else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff) | |
634 | 634 | let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions) | |
635 | 635 | let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":") | |
636 | 636 | $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug) | |
637 | 637 | } | |
638 | 638 | } | |
639 | 639 | else throw("Strict value is not equal to itself.") | |
640 | 640 | } | |
641 | 641 | ||
642 | 642 | ||
643 | 643 | func lockActions (i,durationMonths) = { | |
644 | 644 | let durationMonthsAllowed = [1, 3, 6, 12, 24, 48] | |
645 | 645 | if (!(containsElement(durationMonthsAllowed, durationMonths))) | |
646 | 646 | then throwErr("invalid duration") | |
647 | 647 | else { | |
648 | 648 | let duration = (durationMonths * blocksInMonth) | |
649 | 649 | let assetIdStr = toBase58String(assetId) | |
650 | 650 | if ((size(i.payments) != 1)) | |
651 | 651 | then throwErr("invalid payment - exact one payment must be attached") | |
652 | 652 | else { | |
653 | 653 | let pmt = i.payments[0] | |
654 | 654 | let pmtAmount = pmt.amount | |
655 | 655 | if ((assetId != value(pmt.assetId))) | |
656 | 656 | then throwErr((("invalid asset is in payment - " + assetIdStr) + " is expected")) | |
657 | 657 | else { | |
658 | 658 | let nextUserNumKEY = keyNextUserNum() | |
659 | 659 | let userAddress = i.caller | |
660 | 660 | let userAddressStr = toString(userAddress) | |
661 | 661 | let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr))) | |
662 | 662 | let userNumStr = if (userIsExisting) | |
663 | 663 | then value(getString(keyUser2NumMapping(userAddressStr))) | |
664 | 664 | else toString(getIntOrFail(this, nextUserNumKEY)) | |
665 | 665 | let userNum = parseIntValue(userNumStr) | |
666 | 666 | let lockStart = height | |
667 | 667 | if (if ((minLockAmount > pmtAmount)) | |
668 | 668 | then (userAddress != lpStakingPoolsContract) | |
669 | 669 | else false) | |
670 | 670 | then throwErr(("amount is less then minLockAmount=" + toString(minLockAmount))) | |
671 | 671 | else if ((minLockDuration > duration)) | |
672 | 672 | then throwErr(("passed duration is less then minLockDuration=" + toString(minLockDuration))) | |
673 | 673 | else if ((duration > maxLockDuration)) | |
674 | 674 | then throwErr(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
675 | 675 | else { | |
676 | 676 | let coeffX8 = fraction(duration, MULT8, maxLockDuration) | |
677 | 677 | let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8) | |
678 | 678 | let gwxAmountTotal = getGwxAmountTotal() | |
679 | 679 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum) | |
680 | 680 | let boostEmissionIntegral = refreshBoostEmissionIntegral()._2 | |
681 | 681 | let userGwxAmountTotal = getUserGwxAmountTotal(userAddress) | |
682 | 682 | let gwxRewardInv = invoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes], nil) | |
683 | 683 | if ((gwxRewardInv == gwxRewardInv)) | |
684 | 684 | then { | |
685 | 685 | let arr = if (userIsExisting) | |
686 | 686 | then nil | |
687 | 687 | else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)] | |
688 | 688 | $Tuple2(((((arr ++ LockParamsEntry(userAddress, i.transactionId, pmtAmount, lockStart, duration, gWxAmountStart, 0)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting) | |
689 | 689 | then 0 | |
690 | 690 | else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, gWxAmountStart, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyGwxTotal(), (gwxAmountTotal + gWxAmountStart)), IntegerEntry(keyUserGwxAmountTotal(userAddress), (userGwxAmountTotal + gWxAmountStart))]), gWxAmountStart) | |
691 | 691 | } | |
692 | 692 | else throw("Strict value is not equal to itself.") | |
693 | 693 | } | |
694 | 694 | } | |
695 | 695 | } | |
696 | 696 | } | |
697 | 697 | } | |
698 | 698 | ||
699 | 699 | ||
700 | 700 | @Callable(i) | |
701 | 701 | func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = { | |
702 | 702 | let checkCaller = mustManager(i) | |
703 | 703 | if ((checkCaller == checkCaller)) | |
704 | 704 | then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0)) | |
705 | 705 | else throw("Strict value is not equal to itself.") | |
706 | 706 | } | |
707 | 707 | ||
708 | 708 | ||
709 | 709 | ||
710 | 710 | @Callable(i) | |
711 | 711 | func lockRef (duration,referrerAddress,signature) = { | |
712 | 712 | let $t02826828333 = lockActions(i, duration) | |
713 | 713 | let lockActionsResult = $t02826828333._1 | |
714 | 714 | let gWxAmountStart = $t02826828333._2 | |
715 | 715 | let referralAddress = toString(i.caller) | |
716 | 716 | let refInv = if (if ((referrerAddress == "")) | |
717 | 717 | then true | |
718 | 718 | else (signature == base58'')) | |
719 | 719 | then unit | |
720 | 720 | else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil) | |
721 | 721 | if ((refInv == refInv)) | |
722 | 722 | then { | |
723 | 723 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
724 | 724 | if ((updateRefActivity == updateRefActivity)) | |
725 | 725 | then $Tuple2(lockActionsResult, unit) | |
726 | 726 | else throw("Strict value is not equal to itself.") | |
727 | 727 | } | |
728 | 728 | else throw("Strict value is not equal to itself.") | |
729 | 729 | } | |
730 | 730 | ||
731 | 731 | ||
732 | 732 | ||
733 | 733 | @Callable(i) | |
734 | 734 | func lock (duration) = { | |
735 | 735 | let $t02879128856 = lockActions(i, duration) | |
736 | 736 | let lockActionsResult = $t02879128856._1 | |
737 | 737 | let gWxAmountStart = $t02879128856._2 | |
738 | 738 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
739 | 739 | if ((updateRefActivity == updateRefActivity)) | |
740 | 740 | then $Tuple2(lockActionsResult, unit) | |
741 | 741 | else throw("Strict value is not equal to itself.") | |
742 | 742 | } | |
743 | 743 | ||
744 | 744 | ||
745 | 745 | ||
746 | 746 | @Callable(i) | |
747 | 747 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
748 | 748 | then throwErr("permissions denied") | |
749 | 749 | else { | |
750 | 750 | let $t02916629268 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
751 | 751 | let userBoostAvailable = $t02916629268._1 | |
752 | 752 | let dataState = $t02916629268._2 | |
753 | 753 | let debug = $t02916629268._3 | |
754 | 754 | $Tuple2(dataState, [userBoostAvailable]) | |
755 | 755 | } | |
756 | 756 | ||
757 | 757 | ||
758 | 758 | ||
759 | 759 | @Callable(i) | |
760 | 760 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
761 | 761 | let $t02940029501 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
762 | 762 | let userBoostAvailable = $t02940029501._1 | |
763 | 763 | let dataState = $t02940029501._2 | |
764 | 764 | let debug = $t02940029501._3 | |
765 | 765 | $Tuple2(nil, [userBoostAvailable, debug]) | |
766 | 766 | } | |
767 | 767 | ||
768 | 768 | ||
769 | 769 | ||
770 | 770 | @Callable(i) | |
771 | 771 | func unlock (txIdStr,amount) = { | |
772 | 772 | let userAddress = i.caller | |
773 | 773 | let userAddressStr = toString(userAddress) | |
774 | 774 | let txId = fromBase58String(txIdStr) | |
775 | 775 | let userRecordArray = readLockParamsRecordOrFail(userAddress, if ((txIdStr == "")) | |
776 | - | then | |
777 | - | else | |
776 | + | then unit | |
777 | + | else txId) | |
778 | 778 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
779 | 779 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
780 | 780 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
781 | 781 | let lockEnd = (lockStart + lockDuration) | |
782 | 782 | let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed]) | |
783 | 783 | let gwxAmount = parseIntValue(userRecordArray[IdxLockGwxAmount]) | |
784 | 784 | let t = ((height - lockStart) / blocksInDay) | |
785 | 785 | let exponent = fraction(toBigInt(t), (toBigInt((8 * blocksInDay)) * MULT18BI), toBigInt(lockDuration)) | |
786 | 786 | let wxWithdrawable = if ((height > lockEnd)) | |
787 | 787 | then (userAmount - wxClaimed) | |
788 | 788 | else toInt(fraction(toBigInt(userAmount), (MULT18BI - pow(toBigInt(5), 1, exponent, SCALE18, SCALE18, DOWN)), MULT18BI)) | |
789 | 789 | if ((amount > wxWithdrawable)) | |
790 | 790 | then throwErr(("maximum amount to unlock: " + toString(wxWithdrawable))) | |
791 | 791 | else { | |
792 | 792 | let gwxBurned = max([amount, fraction((t * blocksInDay), userAmount, maxLockDuration)]) | |
793 | 793 | let gwxRemaining = ensurePositive((gwxAmount - gwxBurned), "gwxRemaining") | |
794 | 794 | let lockedGwxAmount = getLockedGwxAmount(userAddress) | |
795 | 795 | if ((lockedGwxAmount > gwxRemaining)) | |
796 | 796 | then throwErr(("locked gwx amount: " + toString(lockedGwxAmount))) | |
797 | 797 | else if ((0 >= userAmount)) | |
798 | 798 | then throwErr("nothing to unlock") | |
799 | 799 | else { | |
800 | 800 | let gwxAmountTotal = getGwxAmountTotal() | |
801 | 801 | let userGwxAmountTotal = getUserGwxAmountTotal(userAddress) | |
802 | 802 | let gwxRewardInv = invoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes], nil) | |
803 | 803 | if ((gwxRewardInv == gwxRewardInv)) | |
804 | 804 | then ((((LockParamsEntry(userAddress, txId, userAmount, lockStart, lockDuration, gwxRemaining, (wxClaimed + amount)) ++ StatsEntry(-(userAmount), 0, 0, -1)) :+ HistoryEntry("unlock", userAddressStr, userAmount, lockStart, lockDuration, gwxBurned, i)) :+ ScriptTransfer(userAddress, userAmount, assetId)) ++ [IntegerEntry(keyGwxTotal(), ensurePositive((gwxAmountTotal - gwxBurned), "gwxTotal")), IntegerEntry(keyUserGwxAmountTotal(userAddress), ensurePositive((userGwxAmountTotal - gwxBurned), "userGwxAmountTotal"))]) | |
805 | 805 | else throw("Strict value is not equal to itself.") | |
806 | 806 | } | |
807 | 807 | } | |
808 | 808 | } | |
809 | 809 | ||
810 | 810 | ||
811 | 811 | ||
812 | 812 | @Callable(i) | |
813 | 813 | func gwxUserInfoREADONLY (userAddressStr) = { | |
814 | 814 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address")) | |
815 | 815 | let gwxAmount = getUserGwxAmountTotal(userAddress) | |
816 | 816 | $Tuple2(nil, [gwxAmount]) | |
817 | 817 | } | |
818 | 818 | ||
819 | 819 | ||
820 | 820 | ||
821 | 821 | @Callable(i) | |
822 | 822 | func userMaxDurationREADONLY (userAddressStr) = $Tuple2(nil, $Tuple2("increaseLock", maxLockDuration)) | |
823 | 823 | ||
824 | 824 | ||
825 | 825 | ||
826 | 826 | @Callable(i) | |
827 | 827 | func getUserGwxAmountAtHeightREADONLY (userAddressStr,targetHeight) = { | |
828 | 828 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address")) | |
829 | 829 | let gwxAmount = getUserGwxAmountTotal(userAddress) | |
830 | 830 | $Tuple2(nil, gwxAmount) | |
831 | 831 | } | |
832 | 832 | ||
833 | 833 | ||
834 | 834 | ||
835 | 835 | @Callable(i) | |
836 | 836 | func getUserGwxAmount (userAddressStr) = { | |
837 | 837 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address")) | |
838 | 838 | let gwxAmount = getUserGwxAmountTotal(userAddress) | |
839 | 839 | $Tuple2(nil, gwxAmount) | |
840 | 840 | } | |
841 | 841 | ||
842 | 842 | ||
843 | 843 | ||
844 | 844 | @Callable(i) | |
845 | 845 | func getGwxTotalREADONLY () = $Tuple2(nil, getGwxAmountTotal()) | |
846 | 846 | ||
847 | 847 | ||
848 | 848 | ||
849 | 849 | @Callable(i) | |
850 | 850 | func onBoostEmissionUpdate () = { | |
851 | 851 | let checkCaller = if ((i.caller == emissionContract)) | |
852 | 852 | then true | |
853 | 853 | else mustManager(i) | |
854 | 854 | if ((checkCaller == checkCaller)) | |
855 | 855 | then refreshBoostEmissionIntegral() | |
856 | 856 | else throw("Strict value is not equal to itself.") | |
857 | 857 | } | |
858 | 858 | ||
859 | 859 | ||
860 | 860 | ||
861 | 861 | @Callable(i) | |
862 | 862 | func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = { | |
863 | 863 | let checkCaller = if ((i.caller == stakingContract)) | |
864 | 864 | then true | |
865 | 865 | else mustManager(i) | |
866 | 866 | if ((checkCaller == checkCaller)) | |
867 | 867 | then { | |
868 | 868 | let actions = refreshVoteStakedIntegral(lpAssetIdStr, userAddressStr, edge) | |
869 | 869 | $Tuple2(actions, unit) | |
870 | 870 | } | |
871 | 871 | else throw("Strict value is not equal to itself.") | |
872 | 872 | } | |
873 | 873 | ||
874 | 874 | ||
875 | 875 | ||
876 | 876 | @Callable(i) | |
877 | 877 | func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr)) | |
878 | 878 | ||
879 | 879 | ||
880 | 880 | ||
881 | 881 | @Callable(i) | |
882 | 882 | func getVotingResultStakedIntegralREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStakedIntegral(lpAssetIdStr)) | |
883 | 883 | ||
884 | 884 | ||
885 | 885 | ||
886 | 886 | @Callable(i) | |
887 | 887 | func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr)) | |
888 | 888 | ||
889 | 889 | ||
890 | 890 | ||
891 | 891 | @Callable(i) | |
892 | 892 | func getUserVoteStakedIntegralREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)) | |
893 | 893 | ||
894 | 894 | ||
895 | 895 | @Verifier(tx) | |
896 | 896 | func verify () = { | |
897 | 897 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
898 | 898 | case pk: ByteVector => | |
899 | 899 | pk | |
900 | 900 | case _: Unit => | |
901 | 901 | tx.senderPublicKey | |
902 | 902 | case _ => | |
903 | 903 | throw("Match error") | |
904 | 904 | } | |
905 | 905 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
906 | 906 | } | |
907 | 907 |
github/deemru/w8io/026f985 97.67 ms ◑