tx · AM4CJw4MDMfKEh2A6QJx5BF8PwCGTvh2KuWNsEpvw2Zc

3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE:  -0.01500000 Waves

2023.08.08 16:18 [2701664] smart account 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE > SELF 0.00000000 Waves

{ "type": 13, "id": "AM4CJw4MDMfKEh2A6QJx5BF8PwCGTvh2KuWNsEpvw2Zc", "fee": 1500000, "feeAssetId": null, "timestamp": 1691500738052, "version": 2, "chainId": 84, "sender": "3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE", "senderPublicKey": "G349Uq3FTox7dRNLeAfAQeoACvwZ9iEnVSaHcEYn6j8J", "proofs": [ "2qGZqaFsUUxgrkLHfw7H3hwGkE9rvMabKgpdC1mXgu1t8CM4j8PEFaJ5J45JTg4uTLEFFmDk2GnQBaEsotRNDEYw" ], "script": "base64:BgKFFQgCEgMKAQISBgoEARgRARIECgIIARIAEgASAwoBCBIAEgQKAhgREgASAwoBCCIDU0VQIgVTQ0FMRSIFTVVMVDgiB01VTFQ4QkkiCnplcm9CaWdJbnQiFHByb2Nlc3NpbmdTdGFnZVRvdGFsIhVwcm9jZXNzaW5nU3RhZ2VTaGFyZXMiBk1VTFQxOCIITVVMVDE4QkkiC3dhdmVzU3RyaW5nIg5nZXROdW1iZXJCeUtleSIDa2V5Ig9nZXROdW1iZXJPckZhaWwiDmdldFN0cmluZ0J5S2V5Ig9nZXRTdHJpbmdPckZhaWwiDHBhcnNlQXNzZXRJZCIFaW5wdXQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiA2FicyIDdmFsIglhYnNCaWdJbnQiC2tleU1heERlcHRoIg9tYXhEZXB0aERlZmF1bHQiCG1heERlcHRoIhFrZXlGYWN0b3J5QWRkcmVzcyIRZmFjdG9yeUFkZHJlc3NTdHIiD2ZhY3RvcnlDb250cmFjdCISa2V5RW1pc3Npb25BZGRyZXNzIhlrZXlWb3RpbmdFbWlzc2lvbkNvbnRyYWN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QJiQQUCYkEEAmJCCQD8BwQFBHRoaXMCE3RyYWRlUmV3YXJkSW50ZXJuYWwJAMwIAgUCYlcJAMwIAgUCYngJAMwIAgUCYnkJAMwIAgAABQNuaWwFA25pbAMJAAACBQJiQgUCYkIJAJQKAgUDbmlsBQJiQgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgJhQwESY2xhaW1UcmFkaW5nUmV3YXJkAAQCYUUIBQJhQwZjYWxsZXIEAmJYCQClCAEFAmFFBAJiWQkBAmJhAQUCYlgDCQBmAgUCYlkAAAkAlAoCCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFAmFFBQJiWQUCYWoJAMwIAgkBDEludGVnZXJFbnRyeQIJAQJhRAEFAmJYAAAFA25pbAUCYlkJAQF0AQIQbm90aGluZyB0byBjbGFpbQJhQwEaY2xhaW1UcmFkaW5nUmV3YXJkUkVBRE9OTFkBAmFFCQCUCgIFA25pbAkBAmJhAQUCYUUBAmJaAQJjYQAEAmNiBAJhTwkBAmFRAAMJAAECBQJhTwIKQnl0ZVZlY3RvcgQCYVUFAmFPBQJhVQMJAAECBQJhTwIEVW5pdAgFAmJaD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJiWglib2R5Qnl0ZXMJAJEDAggFAmJaBnByb29mcwAABQJjYpN3w5k=", "height": 2701664, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9zo1J28X6gnXZXw5PmvdzWGFXxG6N2quZEoyMsQegPw2 Next: APBEZEcYLZdwadZipwgJVCVNUhpr4gd6YV5ezYcrQqYK Diff:
OldNewDifferences
66 let SCALE = 1000
77
88 let MULT8 = 100000000
9+
10+let MULT8BI = toBigInt(MULT8)
911
1012 let zeroBigInt = toBigInt(0)
1113
274276 else throw(($getType(@) + " couldn't be cast to Int"))
275277 }
276278 let dh = toBigInt((height - rewardPerGwxIntegralLastHeight))
277- let rewardPerGwxIntegral = (rewardPerGwxIntegralPrevious + fraction(dh, ((toBigInt(emissionRate) * toBigInt(gwxHoldersRewardCurrent)) * MULT18BI), toBigInt(gwxAmountTotal)))
279+ let rewardPerGwxIntegral = (rewardPerGwxIntegralPrevious + fraction(dh, ((toBigInt(emissionRate) * toBigInt(gwxHoldersRewardCurrent)) * MULT18BI), (toBigInt(gwxAmountTotal) * MULT8BI)))
278280 $Tuple2([IntegerEntry(keyGwxRewardEmissionStartHeight(), height), StringEntry(keyRewardPerGwxIntegral(), toString(rewardPerGwxIntegral))], rewardPerGwxIntegral)
279281 }
280282
293295 }, zeroBigInt)
294296 let userIdxOrFail = getUserIndexByAddress(toString(boostingContractOrFail()), toString(userAddress))
295297 let userUnclaimed = valueOrElse(getInteger(keyUserUnclaimed(userIdxOrFail)), 0)
296- let $t01030410521 = _refreshRewardPerGwxIntegral()
297- let rewardPerGwxIntegralActions = $t01030410521._1
298- let rewardPerGwxIntegral = $t01030410521._2
298+ let $t01034510562 = _refreshRewardPerGwxIntegral()
299+ let rewardPerGwxIntegralActions = $t01034510562._1
300+ let rewardPerGwxIntegral = $t01034510562._2
299301 let userGwxAmount = {
300302 let @ = invoke(boostingContractOrFail(), "getUserGwxAmount", [toString(userAddress)], nil)
301303 if ($isInstanceOf(@, "Int"))
367369 let cfgArray = readConfigArrayOrFail()
368370 let userAddress = i.caller
369371 let userAddressStr = toString(userAddress)
370- let $t01283212889 = commonClaimReward(userAddressStr)
371- let amount = $t01283212889._1
372- let actions = $t01283212889._2
372+ let $t01287312930 = commonClaimReward(userAddressStr)
373+ let amount = $t01287312930._1
374+ let actions = $t01287312930._2
373375 let checkAmount = if ((amount > 0))
374376 then true
375377 else throw("nothing to claim")
422424
423425 @Callable(i)
424426 func claimRewardREADONLY (address) = {
425- let $t01421614266 = commonClaimReward(address)
426- let amount = $t01421614266._1
427- let actions = $t01421614266._2
427+ let $t01425714307 = commonClaimReward(address)
428+ let amount = $t01425714307._1
429+ let actions = $t01425714307._2
428430 let referralUnclaimed = valueOrElse(getInteger(referralsContractAddressOrFail, keyUnclaimedReferral(referralProgramName, address)), 0)
429431 let totalAmount = (amount + referralUnclaimed)
430432 $Tuple2(nil, totalAmount)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let SCALE = 1000
77
88 let MULT8 = 100000000
9+
10+let MULT8BI = toBigInt(MULT8)
911
1012 let zeroBigInt = toBigInt(0)
1113
1214 let processingStageTotal = 0
1315
1416 let processingStageShares = 1
1517
1618 let MULT18 = 1000000000000000000
1719
1820 let MULT18BI = toBigInt(MULT18)
1921
2022 let wavesString = "WAVES"
2123
2224 func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0)
2325
2426
2527 func getNumberOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("mandatory this." + key) + " is not defined"))
2628
2729
2830 func getStringByKey (key) = valueOrElse(getString(this, key), "")
2931
3032
3133 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("mandatory this." + key) + " is not defined"))
3234
3335
3436 func parseAssetId (input) = if ((input == wavesString))
3537 then unit
3638 else fromBase58String(input)
3739
3840
3941 func wrapErr (msg) = makeString(["gwx_reward.ride:", msg], " ")
4042
4143
4244 func throwErr (msg) = throw(wrapErr(msg))
4345
4446
4547 func abs (val) = if ((0 > val))
4648 then -(val)
4749 else val
4850
4951
5052 func absBigInt (val) = if ((zeroBigInt > val))
5153 then -(val)
5254 else val
5355
5456
5557 let keyMaxDepth = "%s__maxDepth"
5658
5759 let maxDepthDefault = 30
5860
5961 let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault)
6062
6163 func keyFactoryAddress () = "%s%s__config__factoryAddress"
6264
6365
6466 let factoryAddressStr = getStringOrFail(keyFactoryAddress())
6567
6668 let factoryContract = addressFromStringValue(factoryAddressStr)
6769
6870 func keyEmissionAddress () = "%s%s__config__emissionAddress"
6971
7072
7173 func keyVotingEmissionContract () = makeString(["%s", "votingEmissionContract"], SEP)
7274
7375
7476 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract()))
7577
7678 func keyNumToUserMapping (num) = makeString(["%s%s%s", "mapping", "num2user", toString(num)], SEP)
7779
7880
7981 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
8082
8183 let referralProgramNameDefault = "wxlock"
8284
8385 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
8486
8587 let keyReferralMinGWxAmount = makeString(["%s%s", "referral", "minGWxAmount"], SEP)
8688
8789 let referralMinGWxAmountDefault = (500 * MULT8)
8890
8991 let referralMinGWxAmount = valueOrElse(getInteger(this, keyReferralMinGWxAmount), referralMinGWxAmountDefault)
9092
9193 let keyReferrerRewardPermille = makeString(["%s%s", "referral", "referrerRewardPermille"], SEP)
9294
9395 let referrerRewardPermilleDefault = 50
9496
9597 let referrerRewardPermille = valueOrElse(getInteger(this, keyReferrerRewardPermille), referrerRewardPermilleDefault)
9698
9799 let keyReferralRewardPermille = makeString(["%s%s", "referral", "referralRewardPermille"], SEP)
98100
99101 let referralRewardPermilleDefault = 50
100102
101103 let referralRewardPermille = valueOrElse(getInteger(this, keyReferralRewardPermille), referralRewardPermilleDefault)
102104
103105 func keyReferrer (referralAddress) = makeString(["%s%s%s", "referrer", referralProgramName, referralAddress], SEP)
104106
105107
106108 func keyUnclaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferral", programName, claimerAddress], SEP)
107109
108110
109111 let emissionAddressStr = getStringOrFail(keyEmissionAddress())
110112
111113 let emissionContract = addressFromStringValue(emissionAddressStr)
112114
113115 let IdxCfgAssetId = 1
114116
115117 let IdxCfgPacemakerAddress = 2
116118
117119 let IdxCfgBoostingContract = 3
118120
119121 let IdxCfgMaxDepth = 4
120122
121123 func keyConfig () = "%s__config"
122124
123125
124126 func getEmissionAddress () = addressFromStringValue(valueOrErrorMessage(getString(this, keyEmissionAddress()), (("mandatory this." + keyEmissionAddress()) + " is not defined")))
125127
126128
127129 let emissionAddress = getEmissionAddress()
128130
129131 let wxAssetIdStr = split(value(getString(emissionAddress, keyConfig())), SEP)[1]
130132
131133 let wxAssetId = fromBase58String(wxAssetIdStr)
132134
133135 func readConfigArrayOrFail () = split(getStringOrFail(keyConfig()), SEP)
134136
135137
136138 func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = makeString(["%s%s%s%d", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, toString(maxDepth)], SEP)
137139
138140
139141 func boostingContractOrFail () = {
140142 let cfgArray = readConfigArrayOrFail()
141143 valueOrErrorMessage(addressFromString(cfgArray[IdxCfgBoostingContract]), "boosting contract address is not defined")
142144 }
143145
144146
145147 func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight"
146148
147149
148150 func keyUsersCount () = "%s__nextUserNum"
149151
150152
151153 func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
152154
153155
154156 func keyGwxHoldersRewardCurrent () = "%s%s__gwxHoldersReward__current"
155157
156158
157159 func keyGwxHoldersRewardNext () = "%s%s__gwxHoldersReward__next"
158160
159161
160162 func keyPoolWeightVirtual () = "%s%s__poolWeight__GWXvirtualPOOL"
161163
162164
163165 func keyUserUnclaimed (userIndex) = makeString(["%s%d", "userUnclaimed", toString(userIndex)], SEP)
164166
165167
166168 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
167169
168170
169171 let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(keyReferralsContractAddress()))
170172
171173 func keyTradingRewardHistory (user,i) = makeString(["%s%s%s%s", "tradingReward", "history", user, toBase58String(i.transactionId)], SEP)
172174
173175
174176 func keyTradingReward (userAddress) = makeString(["%s%s", "tradingReward", userAddress], SEP)
175177
176178
177179 func keyMaxRecipients () = makeString(["%s", "maxRecipients"], SEP)
178180
179181
180182 func HistoryEntry (type,user,amount,i) = {
181183 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
182184 let historyDATA = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], SEP)
183185 StringEntry(historyKEY, historyDATA)
184186 }
185187
186188
187189 func keyManagerPublicKey () = "%s__managerPublicKey"
188190
189191
190192 func keyManagerVaultAddress () = "%s__managerVaultAddress"
191193
192194
193195 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
194196 case s: String =>
195197 addressFromStringValue(s)
196198 case _ =>
197199 this
198200 }
199201
200202
201203 func managerPublicKeyOrUnit () = {
202204 let managerVaultAddress = getManagerVaultAddressOrThis()
203205 match getString(managerVaultAddress, keyManagerPublicKey()) {
204206 case s: String =>
205207 fromBase58String(s)
206208 case _: Unit =>
207209 unit
208210 case _ =>
209211 throw("Match error")
210212 }
211213 }
212214
213215
214216 func mustManager (i) = {
215217 let pd = throw("Permission denied")
216218 match managerPublicKeyOrUnit() {
217219 case pk: ByteVector =>
218220 if ((i.callerPublicKey == pk))
219221 then true
220222 else pd
221223 case _: Unit =>
222224 if ((i.caller == this))
223225 then true
224226 else pd
225227 case _ =>
226228 throw("Match error")
227229 }
228230 }
229231
230232
231233 func getUserIndexByAddress (boostingContractAddressStr,userAddress) = {
232234 let key = makeString(["%s%s%s", "mapping", "user2num", userAddress], SEP)
233235 parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(boostingContractAddressStr)), key), ((("User address " + userAddress) + " is not found in boosting contract data, key=") + key)))
234236 }
235237
236238
237239 func commonClaimReward (userAddress) = {
238240 let cfgArray = readConfigArrayOrFail()
239241 let userIdx = getUserIndexByAddress(cfgArray[IdxCfgBoostingContract], userAddress)
240242 let userUnclaimedOption = getInteger(keyUserUnclaimed(userIdx))
241243 match userUnclaimedOption {
242244 case _: Unit =>
243245 $Tuple2(0, nil)
244246 case u: Int =>
245247 $Tuple2(u, [IntegerEntry(keyUserUnclaimed(userIdx), 0)])
246248 case _ =>
247249 throw("Match error")
248250 }
249251 }
250252
251253
252254 func getTradingReward (userAddress) = valueOrElse(getInteger(this, keyTradingReward(userAddress)), 0)
253255
254256
255257 func keyRewardPerGwxIntegral () = makeString(["%s", "rewardPerGwxIntegral"], SEP)
256258
257259
258260 func _refreshRewardPerGwxIntegral () = {
259261 let rewardPerGwxIntegralPrevious = valueOrElse( match getString(this, keyRewardPerGwxIntegral()) {
260262 case s: String =>
261263 parseBigInt(s)
262264 case _: Unit =>
263265 unit
264266 case _ =>
265267 throw("Match error")
266268 }, zeroBigInt)
267269 let rewardPerGwxIntegralLastHeight = valueOrErrorMessage(getInteger(this, keyGwxRewardEmissionStartHeight()), wrapErr(("invalid " + keyGwxRewardEmissionStartHeight())))
268270 let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), wrapErr(("invalid " + keyRatePerBlockCurrent())))
269271 let gwxHoldersRewardCurrent = valueOrElse(getInteger(emissionContract, keyGwxHoldersRewardCurrent()), 0)
270272 let gwxAmountTotal = {
271273 let @ = invoke(boostingContractOrFail(), "getGwxTotalREADONLY", nil, nil)
272274 if ($isInstanceOf(@, "Int"))
273275 then @
274276 else throw(($getType(@) + " couldn't be cast to Int"))
275277 }
276278 let dh = toBigInt((height - rewardPerGwxIntegralLastHeight))
277- let rewardPerGwxIntegral = (rewardPerGwxIntegralPrevious + fraction(dh, ((toBigInt(emissionRate) * toBigInt(gwxHoldersRewardCurrent)) * MULT18BI), toBigInt(gwxAmountTotal)))
279+ let rewardPerGwxIntegral = (rewardPerGwxIntegralPrevious + fraction(dh, ((toBigInt(emissionRate) * toBigInt(gwxHoldersRewardCurrent)) * MULT18BI), (toBigInt(gwxAmountTotal) * MULT8BI)))
278280 $Tuple2([IntegerEntry(keyGwxRewardEmissionStartHeight(), height), StringEntry(keyRewardPerGwxIntegral(), toString(rewardPerGwxIntegral))], rewardPerGwxIntegral)
279281 }
280282
281283
282284 func keyRewardPerGwxIntegralUserLast (userAddress) = makeString(["%s%s", "rewardPerGwxIntegralUserLast", toString(userAddress)], SEP)
283285
284286
285287 func _refreshUserReward (userAddress) = {
286288 let rewardPerGwxIntegralUserLast = valueOrElse( match getString(this, keyRewardPerGwxIntegralUserLast(userAddress)) {
287289 case s: String =>
288290 parseBigInt(s)
289291 case _: Unit =>
290292 unit
291293 case _ =>
292294 throw("Match error")
293295 }, zeroBigInt)
294296 let userIdxOrFail = getUserIndexByAddress(toString(boostingContractOrFail()), toString(userAddress))
295297 let userUnclaimed = valueOrElse(getInteger(keyUserUnclaimed(userIdxOrFail)), 0)
296- let $t01030410521 = _refreshRewardPerGwxIntegral()
297- let rewardPerGwxIntegralActions = $t01030410521._1
298- let rewardPerGwxIntegral = $t01030410521._2
298+ let $t01034510562 = _refreshRewardPerGwxIntegral()
299+ let rewardPerGwxIntegralActions = $t01034510562._1
300+ let rewardPerGwxIntegral = $t01034510562._2
299301 let userGwxAmount = {
300302 let @ = invoke(boostingContractOrFail(), "getUserGwxAmount", [toString(userAddress)], nil)
301303 if ($isInstanceOf(@, "Int"))
302304 then @
303305 else throw(($getType(@) + " couldn't be cast to Int"))
304306 }
305307 let userReward = (toInt(fraction(toBigInt(userGwxAmount), (rewardPerGwxIntegral - rewardPerGwxIntegralUserLast), MULT18BI)) + userUnclaimed)
306308 $Tuple2(([StringEntry(keyRewardPerGwxIntegralUserLast(userAddress), toString(rewardPerGwxIntegral))] ++ rewardPerGwxIntegralActions), userReward)
307309 }
308310
309311
310312 @Callable(i)
311313 func refreshUserReward (userAddressBytes) = {
312314 let checkCaller = if ((i.caller == boostingContractOrFail()))
313315 then true
314316 else throwErr("permission denied")
315317 if ((checkCaller == checkCaller))
316318 then _refreshUserReward(Address(userAddressBytes))
317319 else throw("Strict value is not equal to itself.")
318320 }
319321
320322
321323
322324 @Callable(i)
323325 func tradeRewardInternal (paymentAmountLeftOver,userAddresses,rewards,currentIter) = if ((currentIter == size(userAddresses)))
324326 then nil
325327 else {
326328 let checks = [if ((i.caller == this))
327329 then true
328330 else throwErr("Permission denied"), if ((paymentAmountLeftOver >= rewards[currentIter]))
329331 then true
330332 else throwErr("insufficient payment assetId")]
331333 if ((checks == checks))
332334 then {
333335 let tradeRewardInternal = invoke(this, "tradeRewardInternal", [(paymentAmountLeftOver - rewards[currentIter]), userAddresses, rewards, (currentIter + 1)], nil)
334336 if ((tradeRewardInternal == tradeRewardInternal))
335337 then {
336338 let tradingRewardHistoryKey = keyTradingRewardHistory(userAddresses[currentIter], i)
337339 let userAddress = addressFromStringValue(userAddresses[currentIter])
338340 $Tuple2([IntegerEntry(tradingRewardHistoryKey, rewards[currentIter]), IntegerEntry(keyTradingReward(userAddresses[currentIter]), rewards[currentIter])], tradeRewardInternal)
339341 }
340342 else throw("Strict value is not equal to itself.")
341343 }
342344 else throw("Strict value is not equal to itself.")
343345 }
344346
345347
346348
347349 @Callable(i)
348350 func updateReferralActivity (userAddress,gWxAmountStart) = {
349351 let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress))
350352 let activeReferralInv = if ((referrer == unit))
351353 then unit
352354 else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (gWxAmountStart >= referralMinGWxAmount)], nil)
353355 if ((activeReferralInv == activeReferralInv))
354356 then $Tuple2(nil, unit)
355357 else throw("Strict value is not equal to itself.")
356358 }
357359
358360
359361
360362 @Callable(i)
361363 func processPendingPeriodsAndUsers () = $Tuple2(nil, throwErr("deprecated"))
362364
363365
364366
365367 @Callable(i)
366368 func claimReward () = {
367369 let cfgArray = readConfigArrayOrFail()
368370 let userAddress = i.caller
369371 let userAddressStr = toString(userAddress)
370- let $t01283212889 = commonClaimReward(userAddressStr)
371- let amount = $t01283212889._1
372- let actions = $t01283212889._2
372+ let $t01287312930 = commonClaimReward(userAddressStr)
373+ let amount = $t01287312930._1
374+ let actions = $t01287312930._2
373375 let checkAmount = if ((amount > 0))
374376 then true
375377 else throw("nothing to claim")
376378 if ((checkAmount == checkAmount))
377379 then {
378380 let userGwxAmount = {
379381 let @ = invoke(boostingContractOrFail(), "getUserGwxAmount", [userAddressStr], nil)
380382 if ($isInstanceOf(@, "Int"))
381383 then @
382384 else throw(($getType(@) + " couldn't be cast to Int"))
383385 }
384386 let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddressStr))
385387 let activeReferralInv = if ((referrer == unit))
386388 then unit
387389 else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (userGwxAmount >= referralMinGWxAmount)], nil)
388390 if ((activeReferralInv == activeReferralInv))
389391 then {
390392 let referralInv = if (if ((referrer == unit))
391393 then true
392394 else (referralMinGWxAmount > userGwxAmount))
393395 then unit
394396 else {
395397 let referrerReward = fraction(amount, referrerRewardPermille, SCALE)
396398 let referralReward = fraction(amount, referralRewardPermille, SCALE)
397399 invoke(referralsContractAddressOrFail, "incUnclaimed", [referralProgramName, userAddress, referrerReward, referralReward], nil)
398400 }
399401 if ((referralInv == referralInv))
400402 then {
401403 let claimedReferral = {
402404 let @ = invoke(referralsContractAddressOrFail, "claim", [referralProgramName], nil)
403405 if ($isInstanceOf(@, "Int"))
404406 then @
405407 else throw(($getType(@) + " couldn't be cast to Int"))
406408 }
407409 if ((claimedReferral == claimedReferral))
408410 then {
409411 let totalAmount = (amount + claimedReferral)
410412 $Tuple2(([ScriptTransfer(i.caller, amount, fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", userAddressStr, totalAmount, i)] ++ actions), totalAmount)
411413 }
412414 else throw("Strict value is not equal to itself.")
413415 }
414416 else throw("Strict value is not equal to itself.")
415417 }
416418 else throw("Strict value is not equal to itself.")
417419 }
418420 else throw("Strict value is not equal to itself.")
419421 }
420422
421423
422424
423425 @Callable(i)
424426 func claimRewardREADONLY (address) = {
425- let $t01421614266 = commonClaimReward(address)
426- let amount = $t01421614266._1
427- let actions = $t01421614266._2
427+ let $t01425714307 = commonClaimReward(address)
428+ let amount = $t01425714307._1
429+ let actions = $t01425714307._2
428430 let referralUnclaimed = valueOrElse(getInteger(referralsContractAddressOrFail, keyUnclaimedReferral(referralProgramName, address)), 0)
429431 let totalAmount = (amount + referralUnclaimed)
430432 $Tuple2(nil, totalAmount)
431433 }
432434
433435
434436
435437 @Callable(i)
436438 func onEmissionForGwxStart () = if ((i.caller != factoryContract))
437439 then throw("permissions denied")
438440 else [IntegerEntry(keyGwxRewardEmissionStartHeight(), height)]
439441
440442
441443
442444 @Callable(i)
443445 func tradeReward (userAddresses,rewards) = {
444446 let argsComparison = (size(userAddresses) == size(rewards))
445447 let maxRecipients = valueOrElse(getInteger(keyMaxRecipients()), 0)
446448 let payment = i.payments[0]
447449 let paymentAssetId = payment.assetId
448450 let paymentAmount = payment.amount
449451 let checks = [if ((maxRecipients >= size(userAddresses)))
450452 then true
451453 else throwErr("Too many recipients"), if (argsComparison)
452454 then true
453455 else throwErr("Arguments size mismatch"), if ((paymentAssetId == wxAssetId))
454456 then true
455457 else throwErr("Wrong asset payment")]
456458 if ((checks == checks))
457459 then {
458460 let tradeRewardInternal = invoke(this, "tradeRewardInternal", [paymentAmount, userAddresses, rewards, 0], nil)
459461 if ((tradeRewardInternal == tradeRewardInternal))
460462 then $Tuple2(nil, tradeRewardInternal)
461463 else throw("Strict value is not equal to itself.")
462464 }
463465 else throw("Strict value is not equal to itself.")
464466 }
465467
466468
467469
468470 @Callable(i)
469471 func claimTradingReward () = {
470472 let userAddress = i.caller
471473 let userAddressString = toString(userAddress)
472474 let reward = getTradingReward(userAddressString)
473475 if ((reward > 0))
474476 then $Tuple2([ScriptTransfer(userAddress, reward, wxAssetId), IntegerEntry(keyTradingReward(userAddressString), 0)], reward)
475477 else throwErr("nothing to claim")
476478 }
477479
478480
479481
480482 @Callable(i)
481483 func claimTradingRewardREADONLY (userAddress) = $Tuple2(nil, getTradingReward(userAddress))
482484
483485
484486 @Verifier(tx)
485487 func verify () = {
486488 let targetPublicKey = match managerPublicKeyOrUnit() {
487489 case pk: ByteVector =>
488490 pk
489491 case _: Unit =>
490492 tx.senderPublicKey
491493 case _ =>
492494 throw("Match error")
493495 }
494496 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
495497 }
496498

github/deemru/w8io/026f985 
57.20 ms