tx · 3w5fMivBRZeY46AN91sL18eDv5NzibAxhB9Z67QywU7v

3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy:  -0.02300000 Waves

2022.12.02 18:16 [2342895] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves

{ "type": 13, "id": "3w5fMivBRZeY46AN91sL18eDv5NzibAxhB9Z67QywU7v", "fee": 2300000, "feeAssetId": null, "timestamp": 1669994279771, "version": 1, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "Edc2CnpMe1KxeLEkBPt2T7R1vcET22spLeYYfyyfxuArT5v18NoP4tAi14S868bVE6zLddDhQhfggJ2cD6wKSWa" ], "script": "base64:BgLVJQgCEggKBggIAQEBCBIFCgMBCAISAwoBARIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIECgIIARIAEgMKAQgSACIDU0VQIgZTQ0FMRTgiBU1VTFQ4Ig5QT09MV0VJR0hUTVVMVCIEc3RyZiIHYWRkcmVzcyIDa2V5IgNpb3oiA2lvZCIKZGVmYXVsdFZhbCIDaW9mIgNhYnMiA3ZhbCIDYWFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgJhaSIGdmFsSW50IhtrZXlSZWZlcnJhbHNDb250cmFjdEFkZHJlc3MiHnJlZmVycmFsc0NvbnRyYWN0QWRkcmVzc09yRmFpbCIWa2V5UmVmZXJyYWxQcm9ncmFtTmFtZSIacmVmZXJyYWxQcm9ncmFtTmFtZURlZmF1bHQiE3JlZmVycmFsUHJvZ3JhbU5hbWUiEWtleUZhY3RvcnlBZGRyZXNzIhhJZHhGYWN0b3J5Q2ZnU3Rha2luZ0RhcHAiGUlkeEZhY3RvcnlDZmdCb29zdGluZ0RhcHAiFElkeEZhY3RvcnlDZmdJZG9EYXBwIhVJZHhGYWN0b3J5Q2ZnVGVhbUR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nkBCQECYWQABQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAmVwAQJlcQAEAmVyBAFvCQECYXoAAwkAAQIFAW8CCkJ5dGVWZWN0b3IEAmFGBQFvBQJhRgMJAAECBQFvAgRVbml0CAUCZXAPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmVwCWJvZHlCeXRlcwkAkQMCCAUCZXAGcHJvb2ZzAAAFAmVyrUwe1w==", "chainId": 84, "height": 2342895, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HV6rgNS8CSqUWPrvUQ8CFGXWCdxf6Q3KjYog82DcSQte Next: GL9kJKSTJswuHRxcWnZuSZikRskFLmDWWaxfsobkfGYv Diff:
OldNewDifferences
295295 func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective"
296296
297297
298-func getTotalCachedGwx () = {
299- let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0)
300- let corrective = valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0)
301- max([0, (totalCachedGwxRaw + corrective)])
302- }
303-
304-
305298 let factoryContract = readFactoryAddressOrFail()
306299
307300 let factoryCfg = readFactoryCfgOrFail(factoryContract)
311304 let stakingContract = getStakingAddressOrFail(factoryCfg)
312305
313306 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
307+
308+func getTotalCachedGwx () = {
309+ let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
310+ let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
311+ let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
312+ let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi)
313+ let keyTargetEpoch = makeString(["%s", "totalCachedGwxCorrection__activationEpoch"], SEP)
314+ let targetEpochOption = getInteger(this, keyTargetEpoch)
315+ let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0)
316+ let isCorrectionActivated = if (isDefined(targetEpochOption))
317+ then (currentEpochUi >= value(targetEpochOption))
318+ else false
319+ let corrective = if (isCorrectionActivated)
320+ then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0)
321+ else 0
322+ max([0, (totalCachedGwxRaw + corrective)])
323+ }
324+
314325
315326 func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = {
316327 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
390401 let userNumStr = userRecordArray[IdxLockUserNum]
391402 let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0)
392403 let EMPTYSTR = "empty"
393- let $t01428014848 = if ((lpAssetIdStr != EMPTYSTR))
404+ let $t01493615504 = if ((lpAssetIdStr != EMPTYSTR))
394405 then {
395406 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
396407 let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
400411 else if (readOnly)
401412 then $Tuple2(0, 0)
402413 else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
403- let poolWeight0 = $t01428014848._1
404- let poolWeight1 = $t01428014848._2
414+ let poolWeight0 = $t01493615504._1
415+ let poolWeight1 = $t01493615504._2
405416 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
406417 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
407418 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
544555
545556 @Callable(i)
546557 func lockRef (duration,referrerAddress,signature) = {
547- let $t02313823203 = lockActions(i, duration)
548- let lockActionsResult = $t02313823203._1
549- let gWxAmountStart = $t02313823203._2
558+ let $t02379423859 = lockActions(i, duration)
559+ let lockActionsResult = $t02379423859._1
560+ let gWxAmountStart = $t02379423859._2
550561 let referralAddress = toString(i.caller)
551562 let refInv = if (if ((referrerAddress == ""))
552563 then true
567578
568579 @Callable(i)
569580 func lock (duration) = {
570- let $t02366123726 = lockActions(i, duration)
571- let lockActionsResult = $t02366123726._1
572- let gWxAmountStart = $t02366123726._2
581+ let $t02431724382 = lockActions(i, duration)
582+ let lockActionsResult = $t02431724382._1
583+ let gWxAmountStart = $t02431724382._2
573584 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
574585 if ((updateRefActivity == updateRefActivity))
575586 then $Tuple2(lockActionsResult, unit)
657668 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
658669 then throw("permissions denied")
659670 else {
660- let $t02863128733 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
661- let userBoostAvailable = $t02863128733._1
662- let dataState = $t02863128733._2
663- let debug = $t02863128733._3
671+ let $t02928729389 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
672+ let userBoostAvailable = $t02928729389._1
673+ let dataState = $t02928729389._2
674+ let debug = $t02928729389._3
664675 $Tuple2(dataState, [userBoostAvailable])
665676 }
666677
668679
669680 @Callable(i)
670681 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
671- let $t02886528966 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
672- let userBoostAvailable = $t02886528966._1
673- let dataState = $t02886528966._2
674- let debug = $t02886528966._3
682+ let $t02952129622 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
683+ let userBoostAvailable = $t02952129622._1
684+ let dataState = $t02952129622._2
685+ let debug = $t02952129622._3
675686 $Tuple2(nil, [userBoostAvailable, debug])
676687 }
677688
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let SCALE8 = 8
77
88 let MULT8 = 100000000
99
1010 let POOLWEIGHTMULT = MULT8
1111
1212 func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
1313
1414
1515 func ioz (address,key) = valueOrElse(getInteger(address, key), 0)
1616
1717
1818 func iod (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
1919
2020
2121 func iof (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
2222
2323
2424 func abs (val) = if ((0 > val))
2525 then -(val)
2626 else val
2727
2828
2929 func aal (val) = match val {
3030 case valAnyLyst: List[Any] =>
3131 valAnyLyst
3232 case _ =>
3333 throw("fail to cast into List[Any]")
3434 }
3535
3636
3737 func ai (val) = match val {
3838 case valInt: Int =>
3939 valInt
4040 case _ =>
4141 throw("fail to cast into Int")
4242 }
4343
4444
4545 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
4646
4747
4848 let referralsContractAddressOrFail = addressFromStringValue(strf(this, keyReferralsContractAddress()))
4949
5050 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
5151
5252 let referralProgramNameDefault = "wxlock"
5353
5454 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
5555
5656 func keyFactoryAddress () = "%s%s__config__factoryAddress"
5757
5858
5959 let IdxFactoryCfgStakingDapp = 1
6060
6161 let IdxFactoryCfgBoostingDapp = 2
6262
6363 let IdxFactoryCfgIdoDapp = 3
6464
6565 let IdxFactoryCfgTeamDapp = 4
6666
6767 let IdxFactoryCfgEmissionDapp = 5
6868
6969 let IdxFactoryCfgRestDapp = 6
7070
7171 let IdxFactoryCfgSlippageDapp = 7
7272
7373 let IdxFactoryCfgDaoDapp = 8
7474
7575 let IdxFactoryCfgMarketingDapp = 9
7676
7777 let IdxFactoryCfgGwxRewardDapp = 10
7878
7979 let IdxFactoryCfgBirdsDapp = 11
8080
8181 func keyFactoryCfg () = "%s__factoryConfig"
8282
8383
8484 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
8585
8686
8787 func keyFactoryLpList () = "%s__lpTokensList"
8888
8989
9090 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9191
9292
9393 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
9494
9595
9696 func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num))
9797
9898
9999 func readFactoryAddressOrFail () = addressFromStringValue(strf(this, keyFactoryAddress()))
100100
101101
102102 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
103103
104104
105105 func readFactoryCfgOrFail (factory) = split(strf(factory, keyFactoryCfg()), SEP)
106106
107107
108108 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
109109
110110
111111 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
112112
113113
114114 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
115115
116116
117117 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
118118
119119
120120 func keyManagerPublicKey () = "%s__managerPublicKey"
121121
122122
123123 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
124124
125125
126126 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
127127
128128
129129 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
130130
131131
132132 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
133133
134134
135135 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
136136
137137
138138 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
139139
140140
141141 func keyNextPeriod () = "%s__nextPeriod"
142142
143143
144144 func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight"
145145
146146
147147 let IdxCfgAssetId = 1
148148
149149 let IdxCfgMinLockAmount = 2
150150
151151 let IdxCfgMinLockDuration = 3
152152
153153 let IdxCfgMaxLockDuration = 4
154154
155155 let IdxCfgMathContract = 5
156156
157157 func keyConfig () = "%s__config"
158158
159159
160160 func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP)
161161
162162
163163 let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract])
164164
165165 func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP)
166166
167167
168168 func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract)
169169
170170
171171 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
172172 case s: String =>
173173 fromBase58String(s)
174174 case _: Unit =>
175175 unit
176176 case _ =>
177177 throw("Match error")
178178 }
179179
180180
181181 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
182182 case s: String =>
183183 fromBase58String(s)
184184 case _: Unit =>
185185 unit
186186 case _ =>
187187 throw("Match error")
188188 }
189189
190190
191191 func mustManager (i) = {
192192 let pd = throw("Permission denied")
193193 match managerPublicKeyOrUnit() {
194194 case pk: ByteVector =>
195195 if ((i.callerPublicKey == pk))
196196 then true
197197 else pd
198198 case _: Unit =>
199199 if ((i.caller == this))
200200 then true
201201 else pd
202202 case _ =>
203203 throw("Match error")
204204 }
205205 }
206206
207207
208208 let IdxLockUserNum = 1
209209
210210 let IdxLockAmount = 2
211211
212212 let IdxLockStart = 3
213213
214214 let IdxLockDuration = 4
215215
216216 let IdxLockParamK = 5
217217
218218 let IdxLockParamB = 6
219219
220220 func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP)
221221
222222
223223 func readLockParamsRecordOrFail (userAddress) = split(strf(this, keyLockParamsRecord(userAddress)), SEP)
224224
225225
226226 func formatLockParamsRecordS (userNum,amount,start,duration,paramK,paramB,lastUpdTimestamp,gwxAmount) = makeString(["%d%d%d%d%d%d%d%d", userNum, amount, start, duration, paramK, paramB, lastUpdTimestamp, gwxAmount], SEP)
227227
228228
229229 func formatLockParamsRecord (userNum,amount,start,duration,paramK,paramB,gwxAmount) = formatLockParamsRecordS(userNum, toString(amount), toString(start), toString(duration), toString(paramK), toString(paramB), toString(lastBlock.timestamp), toString(gwxAmount))
230230
231231
232232 func keyNextUserNum () = "%s__nextUserNum"
233233
234234
235235 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
236236
237237
238238 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
239239
240240
241241 func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP)
242242
243243
244244 func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP)
245245
246246
247247 func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP)
248248
249249
250250 func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP)
251251
252252
253253 func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP)
254254
255255
256256 func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP)
257257
258258
259259 func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP)
260260
261261
262262 func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
263263
264264
265265 func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
266266
267267
268268 func keyStatsLocksCount () = "%s%s__stats__locksCount"
269269
270270
271271 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
272272
273273
274274 func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP)
275275
276276
277277 func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastInt", userNum, lpAssetId], SEP)
278278
279279
280280 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP)
281281
282282
283283 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
284284
285285
286286 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP)
287287
288288
289289 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP)
290290
291291
292292 func keyTotalCachedGwx () = "%s%s__gwxCached__total"
293293
294294
295295 func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective"
296296
297297
298-func getTotalCachedGwx () = {
299- let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0)
300- let corrective = valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0)
301- max([0, (totalCachedGwxRaw + corrective)])
302- }
303-
304-
305298 let factoryContract = readFactoryAddressOrFail()
306299
307300 let factoryCfg = readFactoryCfgOrFail(factoryContract)
308301
309302 let emissionContract = getEmissionAddressOrFail(factoryCfg)
310303
311304 let stakingContract = getStakingAddressOrFail(factoryCfg)
312305
313306 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
307+
308+func getTotalCachedGwx () = {
309+ let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
310+ let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
311+ let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
312+ let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi)
313+ let keyTargetEpoch = makeString(["%s", "totalCachedGwxCorrection__activationEpoch"], SEP)
314+ let targetEpochOption = getInteger(this, keyTargetEpoch)
315+ let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0)
316+ let isCorrectionActivated = if (isDefined(targetEpochOption))
317+ then (currentEpochUi >= value(targetEpochOption))
318+ else false
319+ let corrective = if (isCorrectionActivated)
320+ then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0)
321+ else 0
322+ max([0, (totalCachedGwxRaw + corrective)])
323+ }
324+
314325
315326 func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = {
316327 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
317328 let historyDATA = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount), toString(lockStart), toString(duration), toString(k), toString(b)], SEP)
318329 StringEntry(historyKEY, historyDATA)
319330 }
320331
321332
322333 func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
323334 let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
324335 let locksCountKEY = keyStatsLocksCount()
325336 let usersCountKEY = keyStatsUsersCount()
326337 let totalAmountKEY = keyLockParamTotalAmount()
327338 let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY)
328339 let locksCount = ioz(this, locksCountKEY)
329340 let usersCount = ioz(this, usersCountKEY)
330341 let totalAmount = ioz(this, totalAmountKEY)
331342 [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
332343 }
333344
334345
335346 func calcGwxAmount (kRaw,bRaw,h) = {
336347 let SCALE = 1000
337348 (((kRaw * h) + bRaw) / SCALE)
338349 }
339350
340351
341352 func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = {
342353 let userAmountKEY = keyLockParamUserAmount(userNum)
343354 let startBlockKEY = keyLockParamStartBlock(userNum)
344355 let durationKEY = keyLockParamDuration(userNum)
345356 let kKEY = keyLockParamK(userNum)
346357 let bKEY = keyLockParamB(userNum)
347358 let kByPeriodKEY = keyLockParamByPeriodK(userNum, period)
348359 let bByPeriodKEY = keyLockParamByPeriodB(userNum, period)
349360 let gwxAmount = calcGwxAmount(k, b, height)
350361 [IntegerEntry(userAmountKEY, amount), IntegerEntry(startBlockKEY, start), IntegerEntry(durationKEY, duration), IntegerEntry(kKEY, k), IntegerEntry(bKEY, b), IntegerEntry(kByPeriodKEY, k), IntegerEntry(bByPeriodKEY, b), StringEntry(keyLockParamsRecord(userAddress), formatLockParamsRecord(userNum, amount, start, duration, k, b, gwxAmount))]
351362 }
352363
353364
354365 func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
355366 then throw("only one payment is allowed")
356367 else if ((size(i.payments) == 0))
357368 then 0
358369 else {
359370 let pmt = i.payments[0]
360371 if ((value(pmt.assetId) != expectedAssetId))
361372 then throw("invalid asset id in payment")
362373 else pmt.amount
363374 }
364375
365376
366377 func calcUserGwxAmountAtHeight (userAddress,targetHeight) = {
367378 let EMPTY = "empty"
368379 let user2NumMappingKEY = keyUser2NumMapping(userAddress)
369380 let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY)
370381 let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0)
371382 let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0)
372383 let gwxAmountCalc = calcGwxAmount(k, b, targetHeight)
373384 let gwxAmount = if ((0 > gwxAmountCalc))
374385 then 0
375386 else gwxAmountCalc
376387 gwxAmount
377388 }
378389
379390
380391 func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height)
381392
382393
383394 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
384395 let EMPTY = "EMPTY"
385396 let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY)
386397 if ((userRecordOrEmpty == EMPTY))
387398 then $Tuple3(0, nil, "userRecord::is::empty")
388399 else {
389400 let userRecordArray = split(userRecordOrEmpty, SEP)
390401 let userNumStr = userRecordArray[IdxLockUserNum]
391402 let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0)
392403 let EMPTYSTR = "empty"
393- let $t01428014848 = if ((lpAssetIdStr != EMPTYSTR))
404+ let $t01493615504 = if ((lpAssetIdStr != EMPTYSTR))
394405 then {
395406 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
396407 let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
397408 let pw0 = valueOrElse(getInteger(factoryContract, keyFactoryPoolWeightHistory(poolAddressStr, 0)), pw1)
398409 $Tuple2(pw0, pw1)
399410 }
400411 else if (readOnly)
401412 then $Tuple2(0, 0)
402413 else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
403- let poolWeight0 = $t01428014848._1
404- let poolWeight1 = $t01428014848._2
414+ let poolWeight0 = $t01493615504._1
415+ let poolWeight1 = $t01493615504._2
405416 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
406417 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
407418 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
408419 let h = if ((height > emissionEnd))
409420 then emissionEnd
410421 else height
411422 let dh = max([(h - emissionStart), 0])
412423 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr)
413424 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
414425 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY))
415426 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
416427 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
417428 let udh = fraction(userBoostEmissionIntegral, 3, (2 * wxEmissionPerBlock))
418429 let uLastH = (h - udh)
419430 let udh0 = max([(gwxRewardEmissionStartHeight - uLastH), 0])
420431 let udh1 = ((h - uLastH) - udh0)
421432 if (if (if ((0 > uLastH))
422433 then true
423434 else (0 > udh1))
424435 then true
425436 else (abs(((udh0 + udh1) - udh)) >= 1))
426437 then throw(((((((("invalid udh calc: udh=" + toString(udh)) + " uLastH=") + toString(uLastH)) + " udh0=") + toString(udh0)) + " udh1=") + toString(udh1)))
427438 else if ((0 > userBoostEmissionIntegral))
428439 then throw("wrong calculations")
429440 else {
430441 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
431442 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
432443 let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
433444 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
434445 let totalCachedGwx = getTotalCachedGwx()
435446 let userCurrGwx = calcCurrentGwxAmount(userAddressStr)
436447 let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
437448 let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
438449 let userBoostEmissionIntegral0 = if ((udh == 0))
439450 then 0
440451 else fraction(userBoostEmissionIntegral, udh0, udh)
441452 let userBoostEmissionIntegral1 = if ((udh == 0))
442453 then 0
443454 else fraction(userBoostEmissionIntegral, udh1, udh)
444455 let poolUserBoostEmissionIntegral0 = fraction(userBoostEmissionIntegral0, poolWeight0, POOLWEIGHTMULT)
445456 let poolUserBoostEmissionIntegral1 = fraction(userBoostEmissionIntegral1, poolWeight1, POOLWEIGHTMULT)
446457 let userBoostAvaliableToClaimTotalNew0 = if ((totalCachedGwx == 0))
447458 then 0
448459 else fraction(poolUserBoostEmissionIntegral0, userCurrGwx, totalCachedGwx)
449460 let userBoostAvaliableToClaimTotalNew1 = if ((totalCachedGwx == 0))
450461 then 0
451462 else fraction(poolUserBoostEmissionIntegral1, userCurrGwx, totalCachedGwx)
452463 let userBoostAvaliableToClaimTotalNew = (userBoostAvaliableToClaimTotalNew0 + userBoostAvaliableToClaimTotalNew1)
453464 let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr)
454465 let userBoostClaimed = ioz(this, userBoostClaimedKEY)
455466 let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed)
456467 let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)]
457468 let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(userBoostClaimed), toString(userBoostAvailable), toString(poolWeight0), toString(poolWeight1), toString(h), toString(udh), toString(uLastH), toString(udh0), toString(udh1), toString(userCurrGwx), toString(totalCachedGwx)], ":")
458469 $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
459470 }
460471 }
461472 }
462473
463474
464475 func lockActions (i,duration) = {
465476 let cfgArray = readConfigArrayOrFail()
466477 let assetIdStr = cfgArray[IdxCfgAssetId]
467478 let assetId = fromBase58String(assetIdStr)
468479 let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount])
469480 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
470481 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
471482 if ((size(i.payments) != 1))
472483 then throw("invalid payment - exact one payment must be attached")
473484 else {
474485 let pmt = i.payments[0]
475486 let pmtAmount = pmt.amount
476487 if ((assetId != value(pmt.assetId)))
477488 then throw((("invalid asset is in payment - " + assetIdStr) + " is expected"))
478489 else {
479490 let nextUserNumKEY = keyNextUserNum()
480491 let userAddressStr = toString(i.caller)
481492 let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
482493 let userNumStr = if (userIsExisting)
483494 then value(getString(keyUser2NumMapping(userAddressStr)))
484495 else toString(iof(this, nextUserNumKEY))
485496 let userNum = parseIntValue(userNumStr)
486497 let lockStart = height
487498 let startBlockKEY = keyLockParamStartBlock(userNumStr)
488499 let durationKEY = keyLockParamDuration(userNumStr)
489500 let userAmountKEY = keyLockParamUserAmount(userNumStr)
490501 if ((minLockAmount > pmtAmount))
491502 then throw(("amount is less then minLockAmount=" + toString(minLockAmount)))
492503 else if ((minLockDuration > duration))
493504 then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration)))
494505 else if ((duration > maxLockDuration))
495506 then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration)))
496507 else if (if (userIsExisting)
497508 then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart)
498509 else false)
499510 then throw("there is an active lock - consider to use increaseLock")
500511 else if ((ioz(this, userAmountKEY) > 0))
501512 then throw(("there are locked WXs - consider to use increaseLock " + userAmountKEY))
502513 else {
503514 let coeffX8 = fraction(duration, MULT8, maxLockDuration)
504515 let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8)
505516 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil))
506517 let k = ai(gWxParamsResultList[0])
507518 let b = ai(gWxParamsResultList[1])
508519 let period = toString(ai(gWxParamsResultList[2]))
509520 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
510521 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
511522 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
512523 let h = if ((height > emissionEnd))
513524 then emissionEnd
514525 else height
515526 let dh = max([(h - emissionStart), 0])
516527 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
517528 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
518529 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
519530 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
520531 let userMaxBoostInt = ((gWxAmountStart * duration) / 2)
521532 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
522533 let totalCachedGwx = getTotalCachedGwx()
523534 let arr = if (userIsExisting)
524535 then nil
525536 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
526537 $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
527538 then 0
528539 else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyTotalCachedGwx(), (totalCachedGwx + gWxAmountStart))]), gWxAmountStart)
529540 }
530541 }
531542 }
532543 }
533544
534545
535546 @Callable(i)
536547 func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = {
537548 let checkCaller = mustManager(i)
538549 if ((checkCaller == checkCaller))
539550 then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0))
540551 else throw("Strict value is not equal to itself.")
541552 }
542553
543554
544555
545556 @Callable(i)
546557 func lockRef (duration,referrerAddress,signature) = {
547- let $t02313823203 = lockActions(i, duration)
548- let lockActionsResult = $t02313823203._1
549- let gWxAmountStart = $t02313823203._2
558+ let $t02379423859 = lockActions(i, duration)
559+ let lockActionsResult = $t02379423859._1
560+ let gWxAmountStart = $t02379423859._2
550561 let referralAddress = toString(i.caller)
551562 let refInv = if (if ((referrerAddress == ""))
552563 then true
553564 else (signature == base58''))
554565 then unit
555566 else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil)
556567 if ((refInv == refInv))
557568 then {
558569 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
559570 if ((updateRefActivity == updateRefActivity))
560571 then $Tuple2(lockActionsResult, unit)
561572 else throw("Strict value is not equal to itself.")
562573 }
563574 else throw("Strict value is not equal to itself.")
564575 }
565576
566577
567578
568579 @Callable(i)
569580 func lock (duration) = {
570- let $t02366123726 = lockActions(i, duration)
571- let lockActionsResult = $t02366123726._1
572- let gWxAmountStart = $t02366123726._2
581+ let $t02431724382 = lockActions(i, duration)
582+ let lockActionsResult = $t02431724382._1
583+ let gWxAmountStart = $t02431724382._2
573584 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
574585 if ((updateRefActivity == updateRefActivity))
575586 then $Tuple2(lockActionsResult, unit)
576587 else throw("Strict value is not equal to itself.")
577588 }
578589
579590
580591
581592 @Callable(i)
582593 func increaseLock (deltaDuration) = {
583594 let cfgArray = readConfigArrayOrFail()
584595 let assetIdStr = cfgArray[IdxCfgAssetId]
585596 let assetId = fromBase58String(assetIdStr)
586597 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
587598 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
588599 let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId)
589600 let userAddressStr = toString(i.caller)
590601 let userRecordArray = readLockParamsRecordOrFail(userAddressStr)
591602 let userNumStr = userRecordArray[IdxLockUserNum]
592603 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
593604 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
594605 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
595606 let lockEnd = (lockStart + lockDuration)
596607 let remainingDuration = max([(lockEnd - height), 0])
597608 let userAmountNew = (userAmount + pmtAmount)
598609 let lockDurationNew = (remainingDuration + deltaDuration)
599610 if ((0 > deltaDuration))
600611 then throw("duration is less then zero")
601612 else if ((minLockDuration > lockDurationNew))
602613 then throw(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration)))
603614 else if ((lockDurationNew > maxLockDuration))
604615 then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration)))
605616 else {
606617 let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration)
607618 let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8)
608619 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
609620 if ((updateRefActivity == updateRefActivity))
610621 then {
611622 let lockStartNew = height
612623 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil))
613624 let k = ai(gWxParamsResultList[0])
614625 let b = ai(gWxParamsResultList[1])
615626 let period = toString(ai(gWxParamsResultList[2]))
616627 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
617628 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
618629 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
619630 let h = if ((height > emissionEnd))
620631 then emissionEnd
621632 else height
622633 let dh = max([(h - emissionStart), 0])
623634 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
624635 let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY)
625636 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
626637 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
627638 if ((0 > userBoostEmissionIntegral))
628639 then throw("wrong calculations")
629640 else {
630641 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
631642 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
632643 let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
633644 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
634645 let currUserGwx = calcCurrentGwxAmount(userAddressStr)
635646 let gwxDiff = (gWxAmountStart - currUserGwx)
636647 if ((0 > gwxDiff))
637648 then throw(("gwxDiff is less then 0: " + toString(gwxDiff)))
638649 else {
639650 let totalCachedGwx = getTotalCachedGwx()
640651 let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
641652 let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
642653 let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwx)
643654 let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2)
644655 let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2)
645656 let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt)
646657 (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(keyTotalCachedGwx(), (totalCachedGwx + gwxDiff))])
647658 }
648659 }
649660 }
650661 else throw("Strict value is not equal to itself.")
651662 }
652663 }
653664
654665
655666
656667 @Callable(i)
657668 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
658669 then throw("permissions denied")
659670 else {
660- let $t02863128733 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
661- let userBoostAvailable = $t02863128733._1
662- let dataState = $t02863128733._2
663- let debug = $t02863128733._3
671+ let $t02928729389 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
672+ let userBoostAvailable = $t02928729389._1
673+ let dataState = $t02928729389._2
674+ let debug = $t02928729389._3
664675 $Tuple2(dataState, [userBoostAvailable])
665676 }
666677
667678
668679
669680 @Callable(i)
670681 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
671- let $t02886528966 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
672- let userBoostAvailable = $t02886528966._1
673- let dataState = $t02886528966._2
674- let debug = $t02886528966._3
682+ let $t02952129622 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
683+ let userBoostAvailable = $t02952129622._1
684+ let dataState = $t02952129622._2
685+ let debug = $t02952129622._3
675686 $Tuple2(nil, [userBoostAvailable, debug])
676687 }
677688
678689
679690
680691 @Callable(i)
681692 func unlock (userAddress) = {
682693 let userRecordArray = readLockParamsRecordOrFail(userAddress)
683694 let userNumStr = userRecordArray[IdxLockUserNum]
684695 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
685696 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
686697 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
687698 let lockEnd = (lockStart + lockDuration)
688699 let cfgArray = readConfigArrayOrFail()
689700 let assetId = fromBase58String(cfgArray[IdxCfgAssetId])
690701 if ((lockEnd >= height))
691702 then throw((("wait " + toString(lockEnd)) + " to unlock"))
692703 else if ((0 >= userAmount))
693704 then throw("nothing to unlock")
694705 else {
695706 let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0)
696707 (((LockParamsEntry(userAddress, userNumStr, 0, lockStart, lockDuration, 0, 0, toString(period)) ++ StatsEntry(-(userAmount), 0, 0, -1)) :+ HistoryEntry("unlock", userAddress, userAmount, lockStart, lockDuration, 0, 0, i)) :+ ScriptTransfer(addressFromStringValue(userAddress), userAmount, assetId))
697708 }
698709 }
699710
700711
701712
702713 @Callable(i)
703714 func gwxUserInfoREADONLY (userAddress) = {
704715 let gwxAmount = calcCurrentGwxAmount(userAddress)
705716 $Tuple2(nil, [gwxAmount])
706717 }
707718
708719
709720
710721 @Callable(i)
711722 func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = {
712723 let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight)
713724 $Tuple2(nil, gwxAmount)
714725 }
715726
716727
717728
718729 @Callable(i)
719730 func getTotalCachedGwxREADONLY () = $Tuple2(nil, getTotalCachedGwx())
720731
721732
722733
723734 @Callable(i)
724735 func setManager (pendingManagerPublicKey) = {
725736 let checkCaller = mustManager(i)
726737 if ((checkCaller == checkCaller))
727738 then {
728739 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
729740 if ((checkManagerPublicKey == checkManagerPublicKey))
730741 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
731742 else throw("Strict value is not equal to itself.")
732743 }
733744 else throw("Strict value is not equal to itself.")
734745 }
735746
736747
737748
738749 @Callable(i)
739750 func confirmManager () = {
740751 let pm = pendingManagerPublicKeyOrUnit()
741752 let hasPM = if (isDefined(pm))
742753 then true
743754 else throw("No pending manager")
744755 if ((hasPM == hasPM))
745756 then {
746757 let checkPM = if ((i.callerPublicKey == value(pm)))
747758 then true
748759 else throw("You are not pending manager")
749760 if ((checkPM == checkPM))
750761 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
751762 else throw("Strict value is not equal to itself.")
752763 }
753764 else throw("Strict value is not equal to itself.")
754765 }
755766
756767
757768 @Verifier(tx)
758769 func verify () = {
759770 let targetPublicKey = match managerPublicKeyOrUnit() {
760771 case pk: ByteVector =>
761772 pk
762773 case _: Unit =>
763774 tx.senderPublicKey
764775 case _ =>
765776 throw("Match error")
766777 }
767778 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
768779 }
769780

github/deemru/w8io/026f985 
134.28 ms