tx · H3BrL4hndd6dN9Ku7ih6gApYseb2NixTAVyF8tcNK72Y

3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh:  -0.02500000 Waves

2022.10.13 17:25 [2270704] smart account 3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh > SELF 0.00000000 Waves

{ "type": 13, "id": "H3BrL4hndd6dN9Ku7ih6gApYseb2NixTAVyF8tcNK72Y", "fee": 2500000, "feeAssetId": null, "timestamp": 1665671184314, "version": 1, "sender": "3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh", "senderPublicKey": "33fpjdpM9FMu87RZKePniPardKqQXM96sm7VhAk3JEVQ", "proofs": [ "3xt9U796mAjxXgNaza7MqBxAh5nPyhizpsM5Rr8SDadSdKejh217iMgueAFjtKWYTaCrpxzxzX8jnAi39qhLfVNo" ], "script": "base64:BgJdCAISBQoDCAgEEgUKAwgYARIHCgURCBgBARIGCgQICAgIEgYKBAgICAISBQoDCAgEEgYKBAgIAQESBAoCCBgSAwoBCBIAEgQKAggIEgMKAQgSBAoCCAgSAwoBCBIAHgAJc2VwYXJhdG9yAgJfXwEMa2V5V3hBc3NldElkAAkAuQkCCQDMCAICAiVzCQDMCAICCXd4QXNzZXRJZAUDbmlsBQlzZXBhcmF0b3IAE2tleUJhY2tlbmRQdWJsaWNLZXkJALkJAgkAzAgCAgIlcwkAzAgCAhBiYWNrZW5kUHVibGljS2V5BQNuaWwFCXNlcGFyYXRvcgEba2V5RXhpc3RzUmVmZXJyZXJUb1JlZmVycmFsAwtwcm9ncmFtTmFtZQ9yZWZlcnJlckFkZHJlc3MPcmVmZXJyYWxBZGRyZXNzCQC5CQIJAMwIAgIIJXMlcyVzJXMJAMwIAgIYZXhpc3RzUmVmZXJyZXJUb1JlZmVycmFsCQDMCAIFC3Byb2dyYW1OYW1lCQDMCAIFD3JlZmVycmVyQWRkcmVzcwkAzAgCBQ9yZWZlcnJhbEFkZHJlc3MFA25pbAUJc2VwYXJhdG9yARJr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lib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXngHGFI", "chainId": 84, "height": 2270704, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G8n6rox5LycvVVH6jAwZciynRyPk4FYCGbtBqBM8p7PF Next: BiJNx6Hva7vMyef9rFF1c7Sdf61hGefjSV28PPDGNb4c Diff:
OldNewDifferences
6262 func keyAllRefferalPrograms (address) = makeString(["%s%s", "allReferralPrograms", address], separator)
6363
6464
65-func keyClaimedTotalProgram (programName) = makeString(["%s%s", "claimedTotalProgram", programName], separator)
66-
67-
68-func keyUnclaimedTotal (address) = makeString(["%s%s", "unclaimedTotalAddress", address], separator)
69-
70-
7165 func keyLastBulkClaimCallBlock (address) = makeString(["%s%s", "lastBulkClaimCallBlock", address], separator)
7266
7367
130124 else throwErr("program does not exist")
131125 if ((checkProgramExists == checkProgramExists))
132126 then {
133- let $t044725409 = if (isImplementationContract)
127+ let $t042475184 = if (isImplementationContract)
134128 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"))
135129 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"))
136- let claimerClaimed = $t044725409._1
137- let claimerUnclaimed = $t044725409._2
138- let keyClaimed = $t044725409._3
139- let keyUnclaimed = $t044725409._4
140- let claimHistoryKey = $t044725409._5
130+ let claimerClaimed = $t042475184._1
131+ let claimerUnclaimed = $t042475184._2
132+ let keyClaimed = $t042475184._3
133+ let keyUnclaimed = $t042475184._4
134+ let claimHistoryKey = $t042475184._5
141135 let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0)
142136 let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName)))))
143137 let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
392386
393387 @Callable(i)
394388 func incUnclaimedWithPayment (programName,referrerAddresses) = {
395- func map (accum,next) = {
396- let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
397- let amountCheck = if (assetIdCheck)
398- then true
399- else throwErr("invalid asset id")
400- if ((amountCheck == amountCheck))
401- then (accum :+ next.amount)
402- else throw("Strict value is not equal to itself.")
403- }
389+ let callerAddress = toString(i.caller)
390+ let lastCall = valueOrElse(getInteger(keyLastBulkClaimCallBlock(callerAddress)), 0)
391+ let waitBlocks = ((lastCall - height) + 3)
392+ let lastCallCheck = if (((height - 3) > lastCall))
393+ then true
394+ else throwErr(makeString(["wait", toString(waitBlocks), "blocks"], " "))
395+ if ((lastCallCheck == lastCallCheck))
396+ then {
397+ func map (accum,next) = {
398+ let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
399+ let amountCheck = if (assetIdCheck)
400+ then true
401+ else throwErr("invalid asset id")
402+ if ((amountCheck == amountCheck))
403+ then (accum :+ next.amount)
404+ else throw("Strict value is not equal to itself.")
405+ }
404406
405- let payments = {
406- let $l = i.payments
407- let $s = size($l)
408- let $acc0 = nil
409- func $f0_1 ($a,$i) = if (($i >= $s))
410- then $a
411- else map($a, $l[$i])
407+ let payments = {
408+ let $l = i.payments
409+ let $s = size($l)
410+ let $acc0 = nil
411+ func $f0_1 ($a,$i) = if (($i >= $s))
412+ then $a
413+ else map($a, $l[$i])
412414
413- func $f0_2 ($a,$i) = if (($i >= $s))
414- then $a
415- else throw("List size exceeds 10")
415+ func $f0_2 ($a,$i) = if (($i >= $s))
416+ then $a
417+ else throw("List size exceeds 10")
416418
417- $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)
418- }
419- let resAmount = {
420- let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
421- if ($isInstanceOf(@, "Int"))
422- then @
423- else throw(($getType(@) + " couldn't be cast to Int"))
424- }
425- if ((resAmount == resAmount))
426- then {
427- let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
428- let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
419+ $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)
420+ }
421+ let resAmount = {
422+ let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
423+ if ($isInstanceOf(@, "Int"))
424+ then @
425+ else throw(($getType(@) + " couldn't be cast to Int"))
426+ }
427+ if ((resAmount == resAmount))
428+ then {
429+ let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
430+ let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
429431 [ScriptTransfer(treasuryContract, resAmount, rewardAssetId)]
432+ }
433+ else throw("Strict value is not equal to itself.")
430434 }
431435 else throw("Strict value is not equal to itself.")
432436 }
456460
457461 @Callable(i)
458462 func claimBulk () = {
463+ let callerAddress = toString(i.caller)
459464 let callerProgramsStr = getString(keyAllRefferalPrograms(toString(i.caller)))
460- let callerAddress = toString(i.caller)
461- let lastCall = valueOrElse(getInteger(keyLastBulkClaimCallBlock(callerAddress)), height)
462- let waitBlocks = ((height - lastCall) - 3)
463- let lastCallCheck = if ((lastCall > (height - 3)))
465+ let programsExists = if (isDefined(callerProgramsStr))
464466 then true
465- else throwErr(makeString(["wait", toString(waitBlocks), "blocks"], " "))
466- if ((lastCallCheck == lastCallCheck))
467+ else throwErr("no referral programs")
468+ if ((programsExists == programsExists))
467469 then {
468- let programsExists = if (isDefined(callerProgramsStr))
469- then true
470- else throwErr("no referral programs")
471- if ((programsExists == programsExists))
472- then {
473- let callerPrograms = split(value(callerProgramsStr), "__")
474- let bulkClaim = invoke(this, "claimBulkInternal", [callerAddress, callerPrograms, 0], nil)
475- if ((bulkClaim == bulkClaim))
476- then $Tuple2([IntegerEntry(keyLastBulkClaimCallBlock(callerAddress), height)], bulkClaim)
477- else throw("Strict value is not equal to itself.")
478- }
470+ let callerPrograms = split(value(callerProgramsStr), "__")
471+ let bulkClaim = invoke(this, "claimBulkInternal", [callerAddress, callerPrograms, 0], nil)
472+ if ((bulkClaim == bulkClaim))
473+ then $Tuple2([IntegerEntry(keyLastBulkClaimCallBlock(callerAddress), height)], bulkClaim)
479474 else throw("Strict value is not equal to itself.")
480475 }
481476 else throw("Strict value is not equal to itself.")
497492 let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimer)), 0)
498493 let uncleimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimer)), 0)
499494 $Tuple2(nil, [uncleimedTotalAddress, claimedTotalAddress])
495+ }
496+
497+
498+
499+@Callable(i)
500+func setTotalKeys (programName,address) = {
501+ let claimedReferrer = valueOrElse(getInteger(keyClaimedReferrer(programName, address)), 0)
502+ let claimedReferral = valueOrElse(getInteger(keyClaimedReferral(programName, address)), 0)
503+ let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, address)), 0)
504+ let unclaimedReferral = valueOrElse(getInteger(keyUnclaimedReferral(programName, address)), 0)
505+ let claimedTotalAddress = (claimedReferrer + claimedReferral)
506+ let unclaimedTotalAddress = (unclaimedReferrer + unclaimedReferral)
507+ $Tuple2([IntegerEntry(keyClaimedTotalAddress(address), claimedTotalAddress), IntegerEntry(keyUnclaimedTotalAddress(address), unclaimedTotalAddress)], unit)
500508 }
501509
502510
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 keyAllRefferalPrograms (address) = makeString(["%s%s", "allReferralPrograms", address], separator)
6363
6464
65-func keyClaimedTotalProgram (programName) = makeString(["%s%s", "claimedTotalProgram", programName], separator)
66-
67-
68-func keyUnclaimedTotal (address) = makeString(["%s%s", "unclaimedTotalAddress", address], separator)
69-
70-
7165 func keyLastBulkClaimCallBlock (address) = makeString(["%s%s", "lastBulkClaimCallBlock", address], separator)
7266
7367
7468 func keyManagerPublicKey () = "%s__managerPublicKey"
7569
7670
7771 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
7872
7973
8074 func keyClaimHistory (programName,userAddress,transactionId,type) = makeString(["%s%s%s%s%s", "history", type, programName, userAddress, transactionId], separator)
8175
8276
8377 func formatClaimHistory (amount) = makeString(["%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], separator)
8478
8579
8680 func throwErr (msg) = throw(makeString(["referral.ride:", msg], " "))
8781
8882
8983 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
9084 case s: String =>
9185 fromBase58String(s)
9286 case _: Unit =>
9387 unit
9488 case _ =>
9589 throw("Match error")
9690 }
9791
9892
9993 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
10094 case s: String =>
10195 fromBase58String(s)
10296 case _: Unit =>
10397 unit
10498 case _ =>
10599 throw("Match error")
106100 }
107101
108102
109103 func mustManager (i) = {
110104 let pd = throwErr("permission denied")
111105 match managerPublicKeyOrUnit() {
112106 case pk: ByteVector =>
113107 if ((i.callerPublicKey == pk))
114108 then true
115109 else pd
116110 case _: Unit =>
117111 if ((i.caller == this))
118112 then true
119113 else pd
120114 case _ =>
121115 throw("Match error")
122116 }
123117 }
124118
125119
126120 @Callable(i)
127121 func claimInternal (programName,claimerAddress,isImplementationContract) = {
128122 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
129123 then true
130124 else throwErr("program does not exist")
131125 if ((checkProgramExists == checkProgramExists))
132126 then {
133- let $t044725409 = if (isImplementationContract)
127+ let $t042475184 = if (isImplementationContract)
134128 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"))
135129 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"))
136- let claimerClaimed = $t044725409._1
137- let claimerUnclaimed = $t044725409._2
138- let keyClaimed = $t044725409._3
139- let keyUnclaimed = $t044725409._4
140- let claimHistoryKey = $t044725409._5
130+ let claimerClaimed = $t042475184._1
131+ let claimerUnclaimed = $t042475184._2
132+ let keyClaimed = $t042475184._3
133+ let keyUnclaimed = $t042475184._4
134+ let claimHistoryKey = $t042475184._5
141135 let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0)
142136 let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName)))))
143137 let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
144138 let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimerAddress)), 0)
145139 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimerAddress)), 0)
146140 if (if (isImplementationContract)
147141 then (claimerUnclaimed == 0)
148142 else false)
149143 then $Tuple2(nil, 0)
150144 else {
151145 let checkCanClaim = if ((claimerUnclaimed > 0))
152146 then true
153147 else throwErr("nothing to claim")
154148 if ((checkCanClaim == checkCanClaim))
155149 then {
156150 let newClaimerClaimed = (claimerClaimed + claimerUnclaimed)
157151 let newClaimedTotal = (claimedTotal + claimerUnclaimed)
158152 let newClaimedTotalAddress = (claimedTotalAddress + claimerUnclaimed)
159153 let newUnclaimedTotalAddress = (unclaimedTotalAddress - claimerUnclaimed)
160154 let balanceBefore = value(assetBalance(this, rewardAssetId))
161155 if ((balanceBefore == balanceBefore))
162156 then {
163157 let res = invoke(treasuryContract, "withdrawReferralReward", [claimerUnclaimed], nil)
164158 if ((res == res))
165159 then {
166160 let balanceAfter = value(assetBalance(this, rewardAssetId))
167161 if ((balanceAfter == balanceAfter))
168162 then {
169163 let balanceDiff = (balanceAfter - balanceBefore)
170164 if ((balanceDiff == balanceDiff))
171165 then {
172166 let checkBalance = if ((balanceDiff == claimerUnclaimed))
173167 then true
174168 else throwErr("insufficient balance on referral contract")
175169 if ((checkBalance == checkBalance))
176170 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)
177171 else throw("Strict value is not equal to itself.")
178172 }
179173 else throw("Strict value is not equal to itself.")
180174 }
181175 else throw("Strict value is not equal to itself.")
182176 }
183177 else throw("Strict value is not equal to itself.")
184178 }
185179 else throw("Strict value is not equal to itself.")
186180 }
187181 else throw("Strict value is not equal to itself.")
188182 }
189183 }
190184 else throw("Strict value is not equal to itself.")
191185 }
192186
193187
194188
195189 @Callable(i)
196190 func claimBulkInternal (claimer,programNames,currentIter) = {
197191 let checkCaller = if ((i.caller == this))
198192 then true
199193 else throwErr("permission denied")
200194 if ((checkCaller == checkCaller))
201195 then if ((currentIter == size(programNames)))
202196 then nil
203197 else {
204198 let programName = programNames[currentIter]
205199 let programUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0)
206200 let claimHistoryKey = keyClaimHistory(programName, claimer, toBase58String(i.transactionId), "claimBulk")
207201 let claimBulkInternal = invoke(this, "claimBulkInternal", [claimer, programNames, (currentIter + 1)], nil)
208202 if ((claimBulkInternal == claimBulkInternal))
209203 then {
210204 let claimInternal = invoke(this, "claimInternal", [programName, claimer, false], nil)
211205 if ((claimInternal == claimInternal))
212206 then $Tuple2(nil, [claimBulkInternal, claimInternal])
213207 else throw("Strict value is not equal to itself.")
214208 }
215209 else throw("Strict value is not equal to itself.")
216210 }
217211 else throw("Strict value is not equal to itself.")
218212 }
219213
220214
221215
222216 @Callable(i)
223217 func incUnclaimedWithPaymentInternal (paymentAmounts,programName,referrerAddresses,currentIter,resAmount) = {
224218 let checkCaller = if ((i.caller == this))
225219 then true
226220 else throwErr("permission denied")
227221 if ((checkCaller == checkCaller))
228222 then {
229223 let argsComparison = (size(paymentAmounts) == size(referrerAddresses))
230224 let check = if (argsComparison)
231225 then true
232226 else throwErr("lists in args must be same size")
233227 if ((check == check))
234228 then if ((currentIter == size(paymentAmounts)))
235229 then $Tuple2(nil, resAmount)
236230 else {
237231 let referrerAddress = referrerAddresses[currentIter]
238232 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0)
239233 let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0)
240234 let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0)
241235 let newUnclaimedTotalAddress = (unclaimedTotalAddress + paymentAmounts[currentIter])
242236 let newReferrerUnclaimed = (referrerUnclaimed + paymentAmounts[currentIter])
243237 let newResAmount = (resAmount + paymentAmounts[currentIter])
244238 let inv = invoke(this, "incUnclaimedWithPaymentInternal", [paymentAmounts, programName, referrerAddresses, (currentIter + 1), newResAmount], nil)
245239 if ((inv == inv))
246240 then $Tuple2([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalAddress), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyRewardsTotal(programName), (rewardsTotal + paymentAmounts[currentIter]))], inv)
247241 else throw("Strict value is not equal to itself.")
248242 }
249243 else throw("Strict value is not equal to itself.")
250244 }
251245 else throw("Strict value is not equal to itself.")
252246 }
253247
254248
255249
256250 @Callable(i)
257251 func createReferralProgram (programName,treasuryContract,implementationContract,rewardAssetId) = {
258252 let checkCaller = mustManager(i)
259253 if ((checkCaller == checkCaller))
260254 then {
261255 let checkProgramName = if ((getBoolean(keyProgramName(programName)) == unit))
262256 then true
263257 else throwErr("program name already exists")
264258 if ((checkProgramName == checkProgramName))
265259 then {
266260 let programNameIsValid = if (!(contains(programName, separator)))
267261 then !(contains(programName, " "))
268262 else false
269263 let checkProgramExists = if (programNameIsValid)
270264 then true
271265 else throwErr("invalid program name")
272266 if ((checkProgramExists == checkProgramExists))
273267 then {
274268 let checkRewardAsset = if ((assetInfo(fromBase58String(rewardAssetId)) != unit))
275269 then true
276270 else throwErr("invalid reward asset id")
277271 if ((checkRewardAsset == checkRewardAsset))
278272 then $Tuple2([BooleanEntry(keyProgramName(programName), true), StringEntry(keyTreasuryContract(programName), treasuryContract), StringEntry(keyImplementationContract(programName), implementationContract), StringEntry(keyRewardAssetId(programName), rewardAssetId), IntegerEntry(keyRewardsTotal(programName), 0)], unit)
279273 else throw("Strict value is not equal to itself.")
280274 }
281275 else throw("Strict value is not equal to itself.")
282276 }
283277 else throw("Strict value is not equal to itself.")
284278 }
285279 else throw("Strict value is not equal to itself.")
286280 }
287281
288282
289283
290284 @Callable(i)
291285 func createPair (programName,referrerAddress,referralAddress,signature) = {
292286 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
293287 then true
294288 else throwErr("program does not exist")
295289 if ((checkProgramExists == checkProgramExists))
296290 then {
297291 let pairReferrerToReferralExistCheck = if ((getBoolean(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress)) == unit))
298292 then true
299293 else throwErr("pair already exists")
300294 if ((pairReferrerToReferralExistCheck == pairReferrerToReferralExistCheck))
301295 then {
302296 let noRefSelf = if ((referrerAddress != referralAddress))
303297 then true
304298 else throwErr("cannot refer to self")
305299 if ((noRefSelf == noRefSelf))
306300 then {
307301 let pair = toBytes(makeString([programName, referrerAddress, referralAddress], ":"))
308302 let backendPublicKey = fromBase58String(value(getString(keyBackendPublicKey)))
309303 let validateSignature = if (sigVerify(pair, signature, backendPublicKey))
310304 then true
311305 else throwErr("bad signature")
312306 if ((validateSignature == validateSignature))
313307 then {
314308 let totalReferralCount = valueOrElse(getInteger(keyTotalReferralCount(programName, referrerAddress)), 0)
315309 let newTotalReferralCount = (totalReferralCount + 1)
316310 let allReferrerPrograms = valueOrElse(getString(keyAllRefferalPrograms(referrerAddress)), "")
317311 let newAllReferrerPrograms = if ((allReferrerPrograms == ""))
318312 then programName
319313 else makeString([allReferrerPrograms, programName], separator)
320314 let allReferralPrograms = valueOrElse(getString(keyAllRefferalPrograms(referralAddress)), "")
321315 let newAllReferralPrograms = if ((allReferralPrograms == ""))
322316 then programName
323317 else makeString([allReferralPrograms, programName], separator)
324318 $Tuple2([BooleanEntry(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress), true), IntegerEntry(keyTotalReferralCount(programName, referrerAddress), newTotalReferralCount), StringEntry(keyReferrer(programName, referralAddress), referrerAddress), StringEntry(keyAllRefferalPrograms(referrerAddress), newAllReferrerPrograms), StringEntry(keyAllRefferalPrograms(referralAddress), newAllReferralPrograms)], unit)
325319 }
326320 else throw("Strict value is not equal to itself.")
327321 }
328322 else throw("Strict value is not equal to itself.")
329323 }
330324 else throw("Strict value is not equal to itself.")
331325 }
332326 else throw("Strict value is not equal to itself.")
333327 }
334328
335329
336330
337331 @Callable(i)
338332 func updateReferralActivity (programName,referralAddress,isActive) = {
339333 let implementationContract = value(getString(keyImplementationContract(programName)))
340334 let isReferralActive = (getBoolean(keyIsReferralActive(programName, referralAddress)) != unit)
341335 let referrerAddress = value(getString(keyReferrer(programName, referralAddress)))
342336 let checkCaller = if ((toString(i.caller) == implementationContract))
343337 then true
344338 else throwErr("permission denied")
345339 if ((checkCaller == checkCaller))
346340 then {
347341 let update = if ((isReferralActive == isActive))
348342 then $Tuple2(nil, unit)
349343 else {
350344 let update = if ((isActive == true))
351345 then {
352346 let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) + 1)
353347 $Tuple2([BooleanEntry(keyIsReferralActive(programName, referralAddress), true), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit)
354348 }
355349 else {
356350 let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) - 1)
357351 $Tuple2([DeleteEntry(keyIsReferralActive(programName, referralAddress)), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit)
358352 }
359353 update
360354 }
361355 update
362356 }
363357 else throw("Strict value is not equal to itself.")
364358 }
365359
366360
367361
368362 @Callable(i)
369363 func incUnclaimed (programName,referralAddress,referrerReward,referralReward) = {
370364 let implementationContract = value(getString(keyImplementationContract(programName)))
371365 let checkCaller = if ((toString(i.caller) == implementationContract))
372366 then true
373367 else throwErr("permission denied")
374368 if ((checkCaller == checkCaller))
375369 then {
376370 let referrerAddress = value(getString(keyReferrer(programName, referralAddress)))
377371 let unclaimedTotalReferrer = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0)
378372 let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0)
379373 let unclaimedTotalReferral = valueOrElse(getInteger(keyUnclaimedTotalAddress(referralAddress)), 0)
380374 let referralUnclaimed = valueOrElse(getInteger(keyUnclaimedReferral(programName, referralAddress)), 0)
381375 let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0)
382376 let newUnclaimedTotalReferrer = (unclaimedTotalReferrer + referrerReward)
383377 let newReferrerUnclaimed = (referrerUnclaimed + referrerReward)
384378 let newUnclaimedTotalReferral = (unclaimedTotalReferral + referralReward)
385379 let newReferralUnclaimed = (referralUnclaimed + referralReward)
386380 $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)
387381 }
388382 else throw("Strict value is not equal to itself.")
389383 }
390384
391385
392386
393387 @Callable(i)
394388 func incUnclaimedWithPayment (programName,referrerAddresses) = {
395- func map (accum,next) = {
396- let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
397- let amountCheck = if (assetIdCheck)
398- then true
399- else throwErr("invalid asset id")
400- if ((amountCheck == amountCheck))
401- then (accum :+ next.amount)
402- else throw("Strict value is not equal to itself.")
403- }
389+ let callerAddress = toString(i.caller)
390+ let lastCall = valueOrElse(getInteger(keyLastBulkClaimCallBlock(callerAddress)), 0)
391+ let waitBlocks = ((lastCall - height) + 3)
392+ let lastCallCheck = if (((height - 3) > lastCall))
393+ then true
394+ else throwErr(makeString(["wait", toString(waitBlocks), "blocks"], " "))
395+ if ((lastCallCheck == lastCallCheck))
396+ then {
397+ func map (accum,next) = {
398+ let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
399+ let amountCheck = if (assetIdCheck)
400+ then true
401+ else throwErr("invalid asset id")
402+ if ((amountCheck == amountCheck))
403+ then (accum :+ next.amount)
404+ else throw("Strict value is not equal to itself.")
405+ }
404406
405- let payments = {
406- let $l = i.payments
407- let $s = size($l)
408- let $acc0 = nil
409- func $f0_1 ($a,$i) = if (($i >= $s))
410- then $a
411- else map($a, $l[$i])
407+ let payments = {
408+ let $l = i.payments
409+ let $s = size($l)
410+ let $acc0 = nil
411+ func $f0_1 ($a,$i) = if (($i >= $s))
412+ then $a
413+ else map($a, $l[$i])
412414
413- func $f0_2 ($a,$i) = if (($i >= $s))
414- then $a
415- else throw("List size exceeds 10")
415+ func $f0_2 ($a,$i) = if (($i >= $s))
416+ then $a
417+ else throw("List size exceeds 10")
416418
417- $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)
418- }
419- let resAmount = {
420- let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
421- if ($isInstanceOf(@, "Int"))
422- then @
423- else throw(($getType(@) + " couldn't be cast to Int"))
424- }
425- if ((resAmount == resAmount))
426- then {
427- let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
428- let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
419+ $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)
420+ }
421+ let resAmount = {
422+ let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
423+ if ($isInstanceOf(@, "Int"))
424+ then @
425+ else throw(($getType(@) + " couldn't be cast to Int"))
426+ }
427+ if ((resAmount == resAmount))
428+ then {
429+ let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
430+ let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
429431 [ScriptTransfer(treasuryContract, resAmount, rewardAssetId)]
432+ }
433+ else throw("Strict value is not equal to itself.")
430434 }
431435 else throw("Strict value is not equal to itself.")
432436 }
433437
434438
435439
436440 @Callable(i)
437441 func claim (programName) = {
438442 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
439443 then true
440444 else throwErr("program does not exist")
441445 if ((checkProgramExists == checkProgramExists))
442446 then {
443447 let isImplementationContract = (toString(i.caller) == value(getString(keyImplementationContract(programName))))
444448 let claimerAddress = if (isImplementationContract)
445449 then toString(i.originCaller)
446450 else toString(i.caller)
447451 let claimInternal = invoke(this, "claimInternal", [programName, claimerAddress, isImplementationContract], nil)
448452 if ((claimInternal == claimInternal))
449453 then $Tuple2(nil, claimInternal)
450454 else throw("Strict value is not equal to itself.")
451455 }
452456 else throw("Strict value is not equal to itself.")
453457 }
454458
455459
456460
457461 @Callable(i)
458462 func claimBulk () = {
463+ let callerAddress = toString(i.caller)
459464 let callerProgramsStr = getString(keyAllRefferalPrograms(toString(i.caller)))
460- let callerAddress = toString(i.caller)
461- let lastCall = valueOrElse(getInteger(keyLastBulkClaimCallBlock(callerAddress)), height)
462- let waitBlocks = ((height - lastCall) - 3)
463- let lastCallCheck = if ((lastCall > (height - 3)))
465+ let programsExists = if (isDefined(callerProgramsStr))
464466 then true
465- else throwErr(makeString(["wait", toString(waitBlocks), "blocks"], " "))
466- if ((lastCallCheck == lastCallCheck))
467+ else throwErr("no referral programs")
468+ if ((programsExists == programsExists))
467469 then {
468- let programsExists = if (isDefined(callerProgramsStr))
469- then true
470- else throwErr("no referral programs")
471- if ((programsExists == programsExists))
472- then {
473- let callerPrograms = split(value(callerProgramsStr), "__")
474- let bulkClaim = invoke(this, "claimBulkInternal", [callerAddress, callerPrograms, 0], nil)
475- if ((bulkClaim == bulkClaim))
476- then $Tuple2([IntegerEntry(keyLastBulkClaimCallBlock(callerAddress), height)], bulkClaim)
477- else throw("Strict value is not equal to itself.")
478- }
470+ let callerPrograms = split(value(callerProgramsStr), "__")
471+ let bulkClaim = invoke(this, "claimBulkInternal", [callerAddress, callerPrograms, 0], nil)
472+ if ((bulkClaim == bulkClaim))
473+ then $Tuple2([IntegerEntry(keyLastBulkClaimCallBlock(callerAddress), height)], bulkClaim)
479474 else throw("Strict value is not equal to itself.")
480475 }
481476 else throw("Strict value is not equal to itself.")
482477 }
483478
484479
485480
486481 @Callable(i)
487482 func claimREADONLY (programName,userAddress) = {
488483 let claimerClaimed = valueOrElse(getInteger(keyClaimedReferrer(programName, userAddress)), 0)
489484 let claimerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, userAddress)), 0)
490485 $Tuple2(nil, [claimerUnclaimed, claimerClaimed])
491486 }
492487
493488
494489
495490 @Callable(i)
496491 func claimBulkREADONLY (claimer) = {
497492 let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimer)), 0)
498493 let uncleimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimer)), 0)
499494 $Tuple2(nil, [uncleimedTotalAddress, claimedTotalAddress])
495+ }
496+
497+
498+
499+@Callable(i)
500+func setTotalKeys (programName,address) = {
501+ let claimedReferrer = valueOrElse(getInteger(keyClaimedReferrer(programName, address)), 0)
502+ let claimedReferral = valueOrElse(getInteger(keyClaimedReferral(programName, address)), 0)
503+ let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, address)), 0)
504+ let unclaimedReferral = valueOrElse(getInteger(keyUnclaimedReferral(programName, address)), 0)
505+ let claimedTotalAddress = (claimedReferrer + claimedReferral)
506+ let unclaimedTotalAddress = (unclaimedReferrer + unclaimedReferral)
507+ $Tuple2([IntegerEntry(keyClaimedTotalAddress(address), claimedTotalAddress), IntegerEntry(keyUnclaimedTotalAddress(address), unclaimedTotalAddress)], unit)
500508 }
501509
502510
503511
504512 @Callable(i)
505513 func setManager (pendingManagerPublicKey) = {
506514 let checkCaller = mustManager(i)
507515 if ((checkCaller == checkCaller))
508516 then {
509517 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
510518 if ((checkManagerPublicKey == checkManagerPublicKey))
511519 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
512520 else throw("Strict value is not equal to itself.")
513521 }
514522 else throw("Strict value is not equal to itself.")
515523 }
516524
517525
518526
519527 @Callable(i)
520528 func confirmManager () = {
521529 let pm = pendingManagerPublicKeyOrUnit()
522530 let hasPM = if (isDefined(pm))
523531 then true
524532 else throwErr("no pending manager")
525533 if ((hasPM == hasPM))
526534 then {
527535 let checkPM = if ((i.callerPublicKey == value(pm)))
528536 then true
529537 else throwErr("you are not pending manager")
530538 if ((checkPM == checkPM))
531539 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
532540 else throw("Strict value is not equal to itself.")
533541 }
534542 else throw("Strict value is not equal to itself.")
535543 }
536544
537545
538546 @Verifier(tx)
539547 func verify () = {
540548 let targetPublicKey = match managerPublicKeyOrUnit() {
541549 case pk: ByteVector =>
542550 pk
543551 case _: Unit =>
544552 tx.senderPublicKey
545553 case _ =>
546554 throw("Match error")
547555 }
548556 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
549557 }
550558

github/deemru/w8io/169f3d6 
70.39 ms