tx · FVGFexPdz6tRJnWb5YCRvfP7Y9Fnhw1fzA5DhEQq8deA

3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh:  -0.01800000 Waves

2022.10.25 14:17 [2288021] smart account 3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh > SELF 0.00000000 Waves

{ "type": 13, "id": "FVGFexPdz6tRJnWb5YCRvfP7Y9Fnhw1fzA5DhEQq8deA", "fee": 1800000, "feeAssetId": null, "timestamp": 1666707491092, "version": 1, "sender": "3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh", "senderPublicKey": "33fpjdpM9FMu87RZKePniPardKqQXM96sm7VhAk3JEVQ", "proofs": [ "5zo8hM41qWYyJvSVB1bzVisgtVi7Azp7qT77TLoBdfbU78eRJ8gAHggcx1ZzCc2Utq9oydcVFkGcahwzRvV5pG1" ], "script": "base64:BgLnEwgCEgUKAwgIBBIFCgMIGAESBwoFEQgYAQESBgoECAgICBIGCgQICAgCEgUKAwgIBBIGCgQICAEBEgQKAggYEgMKAQgSABIECgIICBIDCgEIEgQKAggIEgMKAQgSACIJc2VwYXJhdG9yIgxrZXlXeEFzc2V0SWQiE2tleUJhY2tlbmRQdWJsaWNLZXkiG2tleUV4aXN0c1JlZmVycmVyVG9SZWZlcnJhbCILcHJvZ3JhbU5hbWUiD3JlZmVycmVyQWRkcmVzcyIPcmVmZXJyYWxBZGRyZXNzIhJrZXlDbGFpbWVkUmVmZXJyZXIiDmNsYWltZXJBZGRyZXNzIhJrZXlDbGFpbWVkUmVmZXJyYWwiFGtleVVuY2xhaW1lZFJlZmVycmVyIhRrZXlVbmNsYWltZWRSZWZlcnJhbCILa2V5UmVmZXJyZXIiDmtleVByb2dyYW1OYW1lIhVrZXlUb3RhbFJlZmVycmFsQ291bnQiFmtleUFjdGl2ZVJlZmVycmFsQ291bnQiE2tleUlzUmVmZXJyYWxBY3RpdmUiFmtleUNsYWltZWRUb3RhbEFkZHJlc3MiB2FkZHJlc3MiGGt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JiUAkA2QQBBQJiTwMJAAACBQJiUAUCYlAJAMwIAgkBC1N0cmluZ0VudHJ5AgkBAUMABQJiTwUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAVEBDmNvbmZpcm1NYW5hZ2VyAAQCYlEJAQFPAAQCYlIDCQEJaXNEZWZpbmVkAQUCYlEGCQEBSgECEm5vIHBlbmRpbmcgbWFuYWdlcgMJAAACBQJiUgUCYlIEAmJTAwkAAAIIBQFRD2NhbGxlclB1YmxpY0tleQkBBXZhbHVlAQUCYlEGCQEBSgECG3lvdSBhcmUgbm90IHBlbmRpbmcgbWFuYWdlcgMJAAACBQJiUwUCYlMJAMwIAgkBC1N0cmluZ0VudHJ5AgkBAUIACQDYBAEJAQV2YWx1ZQEFAmJRCQDMCAIJAQtEZWxldGVFbnRyeQEJAQFDAAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJiVAECYlUABAJiVgQBTQkBAUwAAwkAAQIFAU0CCkJ5dGVWZWN0b3IEAVMFAU0FAVMDCQABAgUBTQIEVW5pdAgFAmJUD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJiVAlib2R5Qnl0ZXMJAJEDAggFAmJUBnByb29mcwAABQJiVpTNQYA=", "chainId": 84, "height": 2288021, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3xhLHtSSwxKaEY6jERqmZaQF4p1gJwzcCnFoG8Z5tSvd Next: F85abB5RAhaDewZHwtxKQE7YZRptbphgTcgBMJcqZbKX Diff:
OldNewDifferences
255255 let inv = invoke(this, "incUnclaimedWithPaymentInternal", [paymentAmounts, programName, referrerAddresses, (currentIter + 1), newResAmount], nil)
256256 if ((inv == inv))
257257 then {
258- let allReferrerPrograms = valueOrElse(getString(keyAllReferralPrograms(referrerAddress)), "")
259- let newAllReferrerPrograms = if ((allReferrerPrograms == ""))
260- then programName
261- else makeString([allReferrerPrograms, programName], separator)
262- $Tuple2([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalAddress), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyRewardsTotal(programName), (rewardsTotal + paymentAmounts[currentIter])), StringEntry(keyAllReferralPrograms(referrerAddress), newAllReferrerPrograms)], inv)
258+ let updatedAllReferrerPrograms = updateAllReferralPrograms(referrerAddress, programName)
259+ $Tuple2(([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalAddress), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyRewardsTotal(programName), (rewardsTotal + paymentAmounts[currentIter]))] ++ updatedAllReferrerPrograms), inv)
263260 }
264261 else throw("Strict value is not equal to itself.")
265262 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 func keyWxAssetId () = makeString(["%s", "wxAssetId"], separator)
77
88
99 let keyBackendPublicKey = makeString(["%s", "backendPublicKey"], separator)
1010
1111 func keyExistsReferrerToReferral (programName,referrerAddress,referralAddress) = makeString(["%s%s%s%s", "existsReferrerToReferral", programName, referrerAddress, referralAddress], separator)
1212
1313
1414 func keyClaimedReferrer (programName,claimerAddress) = makeString(["%s%s%s", "claimedReferrer", programName, claimerAddress], separator)
1515
1616
1717 func keyClaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "claimedReferral", programName, claimerAddress], separator)
1818
1919
2020 func keyUnclaimedReferrer (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferrer", programName, claimerAddress], separator)
2121
2222
2323 func keyUnclaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferral", programName, claimerAddress], separator)
2424
2525
2626 func keyReferrer (programName,referralAddress) = makeString(["%s%s%s", "referrer", programName, referralAddress], separator)
2727
2828
2929 func keyProgramName (programName) = makeString(["%s%s", "programName", programName], separator)
3030
3131
3232 func keyTotalReferralCount (programName,referrerAddress) = makeString(["%s%s%s", "totalReferralCount", programName, referrerAddress], separator)
3333
3434
3535 func keyActiveReferralCount (programName,referrerAddress) = makeString(["%s%s%s", "activeReferralCount", programName, referrerAddress], separator)
3636
3737
3838 func keyIsReferralActive (programName,referralAddress) = makeString(["%s%s%s", "activeReferral", programName, referralAddress], separator)
3939
4040
4141 func keyClaimedTotalAddress (address) = makeString(["%s%s", "claimedTotalAddress", address], separator)
4242
4343
4444 func keyUnclaimedTotalAddress (address) = makeString(["%s%s", "unclaimedTotalAddress", address], separator)
4545
4646
4747 func keyClaimedTotal (programName) = makeString(["%s%s", "claimedTotal", programName], separator)
4848
4949
5050 func keyRewardsTotal (programName) = makeString(["%s%s", "rewardsTotal", programName], separator)
5151
5252
5353 func keyRewardAssetId (programName) = makeString(["%s%s", "rewardAssetId", programName], separator)
5454
5555
5656 func keyTreasuryContract (programName) = makeString(["%s%s", "treasuryContract", programName], separator)
5757
5858
5959 func keyImplementationContract (programName) = makeString(["%s%s", "implementationContract", programName], separator)
6060
6161
6262 func keyAllReferralPrograms (address) = makeString(["%s%s", "allReferralPrograms", address], separator)
6363
6464
6565 func keyLastIncUnclaimedWithPaymentCallBlock (address) = makeString(["%s%s", "lastIncUnclaimedWithPaymentCallBlock", address], separator)
6666
6767
6868 func keyManagerPublicKey () = "%s__managerPublicKey"
6969
7070
7171 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
7272
7373
7474 func keyClaimHistory (programName,userAddress,transactionId,type) = makeString(["%s%s%s%s%s", "history", type, programName, userAddress, transactionId], separator)
7575
7676
7777 func formatClaimHistory (amount) = makeString(["%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], separator)
7878
7979
8080 func throwErr (msg) = throw(makeString(["referral.ride:", msg], " "))
8181
8282
8383 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
8484 case s: String =>
8585 fromBase58String(s)
8686 case _: Unit =>
8787 unit
8888 case _ =>
8989 throw("Match error")
9090 }
9191
9292
9393 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
9494 case s: String =>
9595 fromBase58String(s)
9696 case _: Unit =>
9797 unit
9898 case _ =>
9999 throw("Match error")
100100 }
101101
102102
103103 func mustManager (i) = {
104104 let pd = throwErr("permission denied")
105105 match managerPublicKeyOrUnit() {
106106 case pk: ByteVector =>
107107 if ((i.callerPublicKey == pk))
108108 then true
109109 else pd
110110 case _: Unit =>
111111 if ((i.caller == this))
112112 then true
113113 else pd
114114 case _ =>
115115 throw("Match error")
116116 }
117117 }
118118
119119
120120 func updateAllReferralPrograms (address,programName) = {
121121 let allReferralPrograms = valueOrElse(getString(keyAllReferralPrograms(address)), "")
122122 let updatedAllReferralPrograms = if (contains(allReferralPrograms, programName))
123123 then nil
124124 else {
125125 let newAllReferralPrograms = if ((allReferralPrograms == ""))
126126 then programName
127127 else makeString([allReferralPrograms, programName], separator)
128128 [StringEntry(keyAllReferralPrograms(address), newAllReferralPrograms)]
129129 }
130130 updatedAllReferralPrograms
131131 }
132132
133133
134134 @Callable(i)
135135 func claimInternal (programName,claimerAddress,isImplementationContract) = {
136136 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
137137 then true
138138 else throwErr("program does not exist")
139139 if ((checkProgramExists == checkProgramExists))
140140 then {
141141 let $t048215758 = if (isImplementationContract)
142142 then $Tuple5(valueOrElse(getInteger(keyClaimedReferral(programName, claimerAddress)), 0), valueOrElse(getInteger(keyUnclaimedReferral(programName, claimerAddress)), 0), keyClaimedReferral(programName, claimerAddress), keyUnclaimedReferral(programName, claimerAddress), keyClaimHistory(programName, claimerAddress, toBase58String(i.transactionId), "claimReferral"))
143143 else $Tuple5(valueOrElse(getInteger(keyClaimedReferrer(programName, claimerAddress)), 0), valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimerAddress)), 0), keyClaimedReferrer(programName, claimerAddress), keyUnclaimedReferrer(programName, claimerAddress), keyClaimHistory(programName, claimerAddress, toBase58String(i.transactionId), "claimReferrer"))
144144 let claimerClaimed = $t048215758._1
145145 let claimerUnclaimed = $t048215758._2
146146 let keyClaimed = $t048215758._3
147147 let keyUnclaimed = $t048215758._4
148148 let claimHistoryKey = $t048215758._5
149149 let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0)
150150 let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName)))))
151151 let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
152152 let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimerAddress)), 0)
153153 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimerAddress)), 0)
154154 if (if (isImplementationContract)
155155 then (claimerUnclaimed == 0)
156156 else false)
157157 then $Tuple2(nil, 0)
158158 else {
159159 let checkCanClaim = if ((claimerUnclaimed > 0))
160160 then true
161161 else throwErr("nothing to claim")
162162 if ((checkCanClaim == checkCanClaim))
163163 then {
164164 let newClaimerClaimed = (claimerClaimed + claimerUnclaimed)
165165 let newClaimedTotal = (claimedTotal + claimerUnclaimed)
166166 let newClaimedTotalAddress = (claimedTotalAddress + claimerUnclaimed)
167167 let newUnclaimedTotalAddress = (unclaimedTotalAddress - claimerUnclaimed)
168168 let balanceBefore = value(assetBalance(this, rewardAssetId))
169169 if ((balanceBefore == balanceBefore))
170170 then {
171171 let res = invoke(treasuryContract, "withdrawReferralReward", [claimerUnclaimed], nil)
172172 if ((res == res))
173173 then {
174174 let balanceAfter = value(assetBalance(this, rewardAssetId))
175175 if ((balanceAfter == balanceAfter))
176176 then {
177177 let balanceDiff = (balanceAfter - balanceBefore)
178178 if ((balanceDiff == balanceDiff))
179179 then {
180180 let checkBalance = if ((balanceDiff == claimerUnclaimed))
181181 then true
182182 else throwErr("insufficient balance on referral contract")
183183 if ((checkBalance == checkBalance))
184184 then $Tuple2([IntegerEntry(keyClaimed, newClaimerClaimed), IntegerEntry(keyUnclaimed, 0), IntegerEntry(keyClaimedTotal(programName), newClaimedTotal), IntegerEntry(keyClaimedTotalAddress(claimerAddress), newClaimedTotalAddress), IntegerEntry(keyUnclaimedTotalAddress(claimerAddress), newUnclaimedTotalAddress), ScriptTransfer(addressFromStringValue(claimerAddress), claimerUnclaimed, rewardAssetId), StringEntry(claimHistoryKey, formatClaimHistory(claimerUnclaimed))], claimerUnclaimed)
185185 else throw("Strict value is not equal to itself.")
186186 }
187187 else throw("Strict value is not equal to itself.")
188188 }
189189 else throw("Strict value is not equal to itself.")
190190 }
191191 else throw("Strict value is not equal to itself.")
192192 }
193193 else throw("Strict value is not equal to itself.")
194194 }
195195 else throw("Strict value is not equal to itself.")
196196 }
197197 }
198198 else throw("Strict value is not equal to itself.")
199199 }
200200
201201
202202
203203 @Callable(i)
204204 func claimBulkInternal (claimer,programNames,currentIter) = {
205205 let checkCaller = if ((i.caller == this))
206206 then true
207207 else throwErr("permission denied")
208208 if ((checkCaller == checkCaller))
209209 then if ((currentIter == size(programNames)))
210210 then nil
211211 else {
212212 let programName = programNames[currentIter]
213213 let programUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0)
214214 let claimHistoryKey = keyClaimHistory(programName, claimer, toBase58String(i.transactionId), "claimBulk")
215215 let claimBulkInternal = invoke(this, "claimBulkInternal", [claimer, programNames, (currentIter + 1)], nil)
216216 if ((claimBulkInternal == claimBulkInternal))
217217 then {
218218 let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0)
219219 let claim = if ((unclaimedReferrer > 0))
220220 then invoke(this, "claimInternal", [programName, claimer, false], nil)
221221 else unit
222222 if ((claim == claim))
223223 then $Tuple2(nil, [claimBulkInternal, claim])
224224 else throw("Strict value is not equal to itself.")
225225 }
226226 else throw("Strict value is not equal to itself.")
227227 }
228228 else throw("Strict value is not equal to itself.")
229229 }
230230
231231
232232
233233 @Callable(i)
234234 func incUnclaimedWithPaymentInternal (paymentAmounts,programName,referrerAddresses,currentIter,resAmount) = {
235235 let checkCaller = if ((i.caller == this))
236236 then true
237237 else throwErr("permission denied")
238238 if ((checkCaller == checkCaller))
239239 then {
240240 let argsComparison = (size(paymentAmounts) == size(referrerAddresses))
241241 let check = if (argsComparison)
242242 then true
243243 else throwErr("lists in args must be same size")
244244 if ((check == check))
245245 then if ((currentIter == size(paymentAmounts)))
246246 then $Tuple2(nil, resAmount)
247247 else {
248248 let referrerAddress = referrerAddresses[currentIter]
249249 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0)
250250 let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0)
251251 let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0)
252252 let newUnclaimedTotalAddress = (unclaimedTotalAddress + paymentAmounts[currentIter])
253253 let newReferrerUnclaimed = (referrerUnclaimed + paymentAmounts[currentIter])
254254 let newResAmount = (resAmount + paymentAmounts[currentIter])
255255 let inv = invoke(this, "incUnclaimedWithPaymentInternal", [paymentAmounts, programName, referrerAddresses, (currentIter + 1), newResAmount], nil)
256256 if ((inv == inv))
257257 then {
258- let allReferrerPrograms = valueOrElse(getString(keyAllReferralPrograms(referrerAddress)), "")
259- let newAllReferrerPrograms = if ((allReferrerPrograms == ""))
260- then programName
261- else makeString([allReferrerPrograms, programName], separator)
262- $Tuple2([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalAddress), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyRewardsTotal(programName), (rewardsTotal + paymentAmounts[currentIter])), StringEntry(keyAllReferralPrograms(referrerAddress), newAllReferrerPrograms)], inv)
258+ let updatedAllReferrerPrograms = updateAllReferralPrograms(referrerAddress, programName)
259+ $Tuple2(([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalAddress), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyRewardsTotal(programName), (rewardsTotal + paymentAmounts[currentIter]))] ++ updatedAllReferrerPrograms), inv)
263260 }
264261 else throw("Strict value is not equal to itself.")
265262 }
266263 else throw("Strict value is not equal to itself.")
267264 }
268265 else throw("Strict value is not equal to itself.")
269266 }
270267
271268
272269
273270 @Callable(i)
274271 func createReferralProgram (programName,treasuryContract,implementationContract,rewardAssetId) = {
275272 let checkCaller = mustManager(i)
276273 if ((checkCaller == checkCaller))
277274 then {
278275 let checkProgramName = if ((getBoolean(keyProgramName(programName)) == unit))
279276 then true
280277 else throwErr("program name already exists")
281278 if ((checkProgramName == checkProgramName))
282279 then {
283280 let programNameIsValid = if (!(contains(programName, separator)))
284281 then !(contains(programName, " "))
285282 else false
286283 let checkProgramExists = if (programNameIsValid)
287284 then true
288285 else throwErr("invalid program name")
289286 if ((checkProgramExists == checkProgramExists))
290287 then {
291288 let checkRewardAsset = if ((assetInfo(fromBase58String(rewardAssetId)) != unit))
292289 then true
293290 else throwErr("invalid reward asset id")
294291 if ((checkRewardAsset == checkRewardAsset))
295292 then $Tuple2([BooleanEntry(keyProgramName(programName), true), StringEntry(keyTreasuryContract(programName), treasuryContract), StringEntry(keyImplementationContract(programName), implementationContract), StringEntry(keyRewardAssetId(programName), rewardAssetId), IntegerEntry(keyRewardsTotal(programName), 0)], unit)
296293 else throw("Strict value is not equal to itself.")
297294 }
298295 else throw("Strict value is not equal to itself.")
299296 }
300297 else throw("Strict value is not equal to itself.")
301298 }
302299 else throw("Strict value is not equal to itself.")
303300 }
304301
305302
306303
307304 @Callable(i)
308305 func createPair (programName,referrerAddress,referralAddress,signature) = {
309306 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
310307 then true
311308 else throwErr("program does not exist")
312309 if ((checkProgramExists == checkProgramExists))
313310 then {
314311 let pairReferrerToReferralExistCheck = if ((getBoolean(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress)) == unit))
315312 then true
316313 else throwErr("pair already exists")
317314 if ((pairReferrerToReferralExistCheck == pairReferrerToReferralExistCheck))
318315 then {
319316 let noRefSelf = if ((referrerAddress != referralAddress))
320317 then true
321318 else throwErr("cannot refer to self")
322319 if ((noRefSelf == noRefSelf))
323320 then {
324321 let pair = toBytes(makeString([programName, referrerAddress, referralAddress], ":"))
325322 let backendPublicKey = fromBase58String(value(getString(keyBackendPublicKey)))
326323 let validateSignature = if (sigVerify(pair, signature, backendPublicKey))
327324 then true
328325 else throwErr("bad signature")
329326 if ((validateSignature == validateSignature))
330327 then {
331328 let totalReferralCount = valueOrElse(getInteger(keyTotalReferralCount(programName, referrerAddress)), 0)
332329 let newTotalReferralCount = (totalReferralCount + 1)
333330 let updatedAllReferrerPrograms = updateAllReferralPrograms(referrerAddress, programName)
334331 let updatedAllReferralPrograms = updateAllReferralPrograms(referralAddress, programName)
335332 $Tuple2((([BooleanEntry(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress), true), IntegerEntry(keyTotalReferralCount(programName, referrerAddress), newTotalReferralCount), StringEntry(keyReferrer(programName, referralAddress), referrerAddress)] ++ updatedAllReferrerPrograms) ++ updatedAllReferralPrograms), unit)
336333 }
337334 else throw("Strict value is not equal to itself.")
338335 }
339336 else throw("Strict value is not equal to itself.")
340337 }
341338 else throw("Strict value is not equal to itself.")
342339 }
343340 else throw("Strict value is not equal to itself.")
344341 }
345342
346343
347344
348345 @Callable(i)
349346 func updateReferralActivity (programName,referralAddress,isActive) = {
350347 let implementationContract = value(getString(keyImplementationContract(programName)))
351348 let isReferralActive = (getBoolean(keyIsReferralActive(programName, referralAddress)) != unit)
352349 let referrerAddress = value(getString(keyReferrer(programName, referralAddress)))
353350 let checkCaller = if ((toString(i.caller) == implementationContract))
354351 then true
355352 else throwErr("permission denied")
356353 if ((checkCaller == checkCaller))
357354 then {
358355 let update = if ((isReferralActive == isActive))
359356 then $Tuple2(nil, unit)
360357 else {
361358 let update = if ((isActive == true))
362359 then {
363360 let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) + 1)
364361 $Tuple2([BooleanEntry(keyIsReferralActive(programName, referralAddress), true), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit)
365362 }
366363 else {
367364 let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) - 1)
368365 $Tuple2([DeleteEntry(keyIsReferralActive(programName, referralAddress)), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit)
369366 }
370367 update
371368 }
372369 update
373370 }
374371 else throw("Strict value is not equal to itself.")
375372 }
376373
377374
378375
379376 @Callable(i)
380377 func incUnclaimed (programName,referralAddress,referrerReward,referralReward) = {
381378 let implementationContract = value(getString(keyImplementationContract(programName)))
382379 let referrerAddress = value(getString(keyReferrer(programName, referralAddress)))
383380 let checkCaller = if ((toString(i.caller) == implementationContract))
384381 then true
385382 else throwErr("permission denied")
386383 if ((checkCaller == checkCaller))
387384 then {
388385 let checkProgram = if ((programName == "wxlock"))
389386 then true
390387 else throwErr("invalid program")
391388 if ((checkProgram == checkProgram))
392389 then {
393390 let checkReferrerInProgram = if (contains(valueOrElse(getString(keyAllReferralPrograms(referrerAddress)), ""), programName))
394391 then true
395392 else throwErr("referrer not in program")
396393 if ((checkReferrerInProgram == checkReferrerInProgram))
397394 then {
398395 let checkReferralInProgram = if (contains(valueOrElse(getString(keyAllReferralPrograms(referralAddress)), ""), programName))
399396 then true
400397 else throwErr("referral not in program")
401398 if ((checkReferralInProgram == checkReferralInProgram))
402399 then {
403400 let unclaimedTotalReferrer = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0)
404401 let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0)
405402 let unclaimedTotalReferral = valueOrElse(getInteger(keyUnclaimedTotalAddress(referralAddress)), 0)
406403 let referralUnclaimed = valueOrElse(getInteger(keyUnclaimedReferral(programName, referralAddress)), 0)
407404 let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0)
408405 let newUnclaimedTotalReferrer = (unclaimedTotalReferrer + referrerReward)
409406 let newReferrerUnclaimed = (referrerUnclaimed + referrerReward)
410407 let newUnclaimedTotalReferral = (unclaimedTotalReferral + referralReward)
411408 let newReferralUnclaimed = (referralUnclaimed + referralReward)
412409 $Tuple2([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalReferrer), IntegerEntry(keyUnclaimedTotalAddress(referralAddress), newUnclaimedTotalReferral), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyUnclaimedReferral(programName, referralAddress), newReferralUnclaimed), IntegerEntry(keyRewardsTotal(programName), ((rewardsTotal + referrerReward) + referralReward))], unit)
413410 }
414411 else throw("Strict value is not equal to itself.")
415412 }
416413 else throw("Strict value is not equal to itself.")
417414 }
418415 else throw("Strict value is not equal to itself.")
419416 }
420417 else throw("Strict value is not equal to itself.")
421418 }
422419
423420
424421
425422 @Callable(i)
426423 func incUnclaimedWithPayment (programName,referrerAddresses) = {
427424 let checkProgram = if ((programName == "wxSpotFee"))
428425 then true
429426 else throwErr("invalid program")
430427 if ((checkProgram == checkProgram))
431428 then {
432429 let callerAddress = toString(i.caller)
433430 let lastCall = valueOrElse(getInteger(keyLastIncUnclaimedWithPaymentCallBlock(callerAddress)), 0)
434431 let waitBlocks = ((lastCall - height) + 3)
435432 let lastCallCheck = if (((height - 3) > lastCall))
436433 then true
437434 else throwErr(makeString(["wait", toString(waitBlocks), "blocks"], " "))
438435 if ((lastCallCheck == lastCallCheck))
439436 then {
440437 func map (accum,next) = {
441438 let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
442439 let amountCheck = if (assetIdCheck)
443440 then true
444441 else throwErr("invalid asset id")
445442 if ((amountCheck == amountCheck))
446443 then (accum :+ next.amount)
447444 else throw("Strict value is not equal to itself.")
448445 }
449446
450447 let payments = {
451448 let $l = i.payments
452449 let $s = size($l)
453450 let $acc0 = nil
454451 func $f0_1 ($a,$i) = if (($i >= $s))
455452 then $a
456453 else map($a, $l[$i])
457454
458455 func $f0_2 ($a,$i) = if (($i >= $s))
459456 then $a
460457 else throw("List size exceeds 10")
461458
462459 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
463460 }
464461 let resAmount = {
465462 let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
466463 if ($isInstanceOf(@, "Int"))
467464 then @
468465 else throw(($getType(@) + " couldn't be cast to Int"))
469466 }
470467 if ((resAmount == resAmount))
471468 then {
472469 let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
473470 let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
474471 [ScriptTransfer(treasuryContract, resAmount, rewardAssetId), IntegerEntry(keyLastIncUnclaimedWithPaymentCallBlock(callerAddress), height)]
475472 }
476473 else throw("Strict value is not equal to itself.")
477474 }
478475 else throw("Strict value is not equal to itself.")
479476 }
480477 else throw("Strict value is not equal to itself.")
481478 }
482479
483480
484481
485482 @Callable(i)
486483 func claim (programName) = {
487484 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
488485 then true
489486 else throwErr("program does not exist")
490487 if ((checkProgramExists == checkProgramExists))
491488 then {
492489 let isImplementationContract = (toString(i.caller) == value(getString(keyImplementationContract(programName))))
493490 let claimerAddress = if (isImplementationContract)
494491 then toString(i.originCaller)
495492 else toString(i.caller)
496493 let claimInternal = invoke(this, "claimInternal", [programName, claimerAddress, isImplementationContract], nil)
497494 if ((claimInternal == claimInternal))
498495 then $Tuple2(nil, claimInternal)
499496 else throw("Strict value is not equal to itself.")
500497 }
501498 else throw("Strict value is not equal to itself.")
502499 }
503500
504501
505502
506503 @Callable(i)
507504 func claimBulk () = {
508505 let callerAddress = toString(i.caller)
509506 let callerProgramsStr = getString(keyAllReferralPrograms(toString(i.caller)))
510507 let programsExists = if (isDefined(callerProgramsStr))
511508 then true
512509 else throwErr("no referral programs")
513510 if ((programsExists == programsExists))
514511 then {
515512 let callerPrograms = split(value(callerProgramsStr), "__")
516513 let bulkClaim = invoke(this, "claimBulkInternal", [callerAddress, callerPrograms, 0], nil)
517514 if ((bulkClaim == bulkClaim))
518515 then $Tuple2(nil, bulkClaim)
519516 else throw("Strict value is not equal to itself.")
520517 }
521518 else throw("Strict value is not equal to itself.")
522519 }
523520
524521
525522
526523 @Callable(i)
527524 func claimREADONLY (programName,userAddress) = {
528525 let claimerClaimed = valueOrElse(getInteger(keyClaimedReferrer(programName, userAddress)), 0)
529526 let claimerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, userAddress)), 0)
530527 $Tuple2(nil, [claimerUnclaimed, claimerClaimed])
531528 }
532529
533530
534531
535532 @Callable(i)
536533 func claimBulkREADONLY (claimer) = {
537534 let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimer)), 0)
538535 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimer)), 0)
539536 $Tuple2(nil, [unclaimedTotalAddress, claimedTotalAddress])
540537 }
541538
542539
543540
544541 @Callable(i)
545542 func setTotalKeys (programName,address) = {
546543 let claimedReferrer = valueOrElse(getInteger(keyClaimedReferrer(programName, address)), 0)
547544 let claimedReferral = valueOrElse(getInteger(keyClaimedReferral(programName, address)), 0)
548545 let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, address)), 0)
549546 let unclaimedReferral = valueOrElse(getInteger(keyUnclaimedReferral(programName, address)), 0)
550547 let claimedTotalAddress = (claimedReferrer + claimedReferral)
551548 let unclaimedTotalAddress = (unclaimedReferrer + unclaimedReferral)
552549 $Tuple2([IntegerEntry(keyClaimedTotalAddress(address), claimedTotalAddress), IntegerEntry(keyUnclaimedTotalAddress(address), unclaimedTotalAddress)], unit)
553550 }
554551
555552
556553
557554 @Callable(i)
558555 func setManager (pendingManagerPublicKey) = {
559556 let checkCaller = mustManager(i)
560557 if ((checkCaller == checkCaller))
561558 then {
562559 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
563560 if ((checkManagerPublicKey == checkManagerPublicKey))
564561 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
565562 else throw("Strict value is not equal to itself.")
566563 }
567564 else throw("Strict value is not equal to itself.")
568565 }
569566
570567
571568
572569 @Callable(i)
573570 func confirmManager () = {
574571 let pm = pendingManagerPublicKeyOrUnit()
575572 let hasPM = if (isDefined(pm))
576573 then true
577574 else throwErr("no pending manager")
578575 if ((hasPM == hasPM))
579576 then {
580577 let checkPM = if ((i.callerPublicKey == value(pm)))
581578 then true
582579 else throwErr("you are not pending manager")
583580 if ((checkPM == checkPM))
584581 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
585582 else throw("Strict value is not equal to itself.")
586583 }
587584 else throw("Strict value is not equal to itself.")
588585 }
589586
590587
591588 @Verifier(tx)
592589 func verify () = {
593590 let targetPublicKey = match managerPublicKeyOrUnit() {
594591 case pk: ByteVector =>
595592 pk
596593 case _: Unit =>
597594 tx.senderPublicKey
598595 case _ =>
599596 throw("Match error")
600597 }
601598 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
602599 }
603600

github/deemru/w8io/169f3d6 
63.49 ms