tx · 99nmnPvBm2aSz1jRiN6CCR9cSowfAwT9a1CAF29HBeRQ

3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh:  -0.01800000 Waves

2023.01.16 12:49 [2407343] smart account 3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh > SELF 0.00000000 Waves

{ "type": 13, "id": "99nmnPvBm2aSz1jRiN6CCR9cSowfAwT9a1CAF29HBeRQ", "fee": 1800000, "feeAssetId": null, "timestamp": 1673862615752, "version": 1, "sender": "3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh", "senderPublicKey": "33fpjdpM9FMu87RZKePniPardKqQXM96sm7VhAk3JEVQ", "proofs": [ "2EqMepQGiN1jac4kNu7i1YD8gGYrLogs4hYpQATLjmzk2CqMKUnX934GrHkPtMd8aqxjissw8ubh4AFQy2aiqc64" ], "script": "base64:BgKZEwgCEgUKAwgIBBIFCgMIGAESBwoFEQgYAQESBgoECAgICBIGCgQICAgCEgUKAwgIBBIGCgQICAEBEgQKAggYEgMKAQgSABIECgIICBIDCgEIEgQKAggIEgMKAQgSACIJc2VwYXJhdG9yIgxrZXlXeEFzc2V0SWQiE2tleUJhY2tlbmRQdWJsaWNLZXkiG2tleUV4aXN0c1JlZmVycmVyVG9SZWZlcnJhbCILcHJvZ3JhbU5hbWUiD3JlZmVycmVyQWRkcmVzcyIPcmVmZXJyYWxBZGRyZXNzIhJrZXlDbGFpbWVkUmVmZXJyZXIiDmNsYWltZXJBZGRyZXNzIhJrZXlDbGFpbWVkUmVmZXJyYWwiFGtleVVuY2xhaW1lZFJlZmVycmVyIhRrZXlVbmNsYWltZWRSZWZlcnJhbCILa2V5UmVmZXJyZXIiDmtleVByb2dyYW1OYW1lIhVrZXlUb3RhbFJlZmVycmFsQ291bnQiFmtleUFjdGl2ZVJlZmVycmFsQ291bnQiE2tleUlzUmVmZXJyYWxBY3RpdmUiFmtleUNsYWltZWRUb3RhbEFkZHJlc3MiB2FkZHJlc3MiGGtleVVuY2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QUCYk0JAMwIAgkBC0RlbGV0ZUVudHJ5AQkBAUIABQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAmJQAQJiUQAEAmJSBAFMCQEBSwADCQABAgUBTAIKQnl0ZVZlY3RvcgQBUgUBTAUBUgMJAAECBQFMAgRVbml0CAUCYlAPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmJQCWJvZHlCeXRlcwkAkQMCCAUCYlAGcHJvb2ZzAAAFAmJSpph9nA==", "chainId": 84, "height": 2407343, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EPiqXdrakwq5NydtB98s9ydE91rgp4i8zkvyUeRVvp8v Next: BQe9nfNJPjetd98itdmwZ7wH52ELU2QD6JwE2sGDwv4F Diff:
OldNewDifferences
6060
6161
6262 func keyAllReferralPrograms (address) = makeString(["%s%s", "allReferralPrograms", address], separator)
63-
64-
65-func keyLastIncUnclaimedWithPaymentCallBlock (address) = makeString(["%s%s", "lastIncUnclaimedWithPaymentCallBlock", address], separator)
6663
6764
6865 func keyManagerPublicKey () = "%s__managerPublicKey"
138135 else throwErr("program does not exist")
139136 if ((checkProgramExists == checkProgramExists))
140137 then {
141- let $t048215758 = if (isImplementationContract)
138+ let $t046775614 = if (isImplementationContract)
142139 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"))
143140 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"))
144- let claimerClaimed = $t048215758._1
145- let claimerUnclaimed = $t048215758._2
146- let keyClaimed = $t048215758._3
147- let keyUnclaimed = $t048215758._4
148- let claimHistoryKey = $t048215758._5
141+ let claimerClaimed = $t046775614._1
142+ let claimerUnclaimed = $t046775614._2
143+ let keyClaimed = $t046775614._3
144+ let keyUnclaimed = $t046775614._4
145+ let claimHistoryKey = $t046775614._5
149146 let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0)
150147 let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName)))))
151148 let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
426423 else throwErr("invalid program")
427424 if ((checkProgram == checkProgram))
428425 then {
429- let callerAddress = toString(i.caller)
430- let lastCall = valueOrElse(getInteger(keyLastIncUnclaimedWithPaymentCallBlock(callerAddress)), 0)
431- let waitBlocks = ((lastCall - height) + 3)
432- let lastCallCheck = if (((height - 3) > lastCall))
433- then true
434- else throwErr(makeString(["wait", toString(waitBlocks), "blocks"], " "))
435- if ((lastCallCheck == lastCallCheck))
426+ func map (accum,next) = {
427+ let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
428+ let amountCheck = if (assetIdCheck)
429+ then true
430+ else throwErr("invalid asset id")
431+ if ((amountCheck == amountCheck))
432+ then (accum :+ next.amount)
433+ else throw("Strict value is not equal to itself.")
434+ }
435+
436+ let payments = {
437+ let $l = i.payments
438+ let $s = size($l)
439+ let $acc0 = nil
440+ func $f0_1 ($a,$i) = if (($i >= $s))
441+ then $a
442+ else map($a, $l[$i])
443+
444+ func $f0_2 ($a,$i) = if (($i >= $s))
445+ then $a
446+ else throw("List size exceeds 10")
447+
448+ $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)
449+ }
450+ let resAmount = {
451+ let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
452+ if ($isInstanceOf(@, "Int"))
453+ then @
454+ else throw(($getType(@) + " couldn't be cast to Int"))
455+ }
456+ if ((resAmount == resAmount))
436457 then {
437- func map (accum,next) = {
438- let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
439- let amountCheck = if (assetIdCheck)
440- then true
441- else throwErr("invalid asset id")
442- if ((amountCheck == amountCheck))
443- then (accum :+ next.amount)
444- else throw("Strict value is not equal to itself.")
445- }
446-
447- let payments = {
448- let $l = i.payments
449- let $s = size($l)
450- let $acc0 = nil
451- func $f0_1 ($a,$i) = if (($i >= $s))
452- then $a
453- else map($a, $l[$i])
454-
455- func $f0_2 ($a,$i) = if (($i >= $s))
456- then $a
457- else throw("List size exceeds 10")
458-
459- $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)
460- }
461- let resAmount = {
462- let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
463- if ($isInstanceOf(@, "Int"))
464- then @
465- else throw(($getType(@) + " couldn't be cast to Int"))
466- }
467- if ((resAmount == resAmount))
468- then {
469- let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
470- let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
471-[ScriptTransfer(treasuryContract, resAmount, rewardAssetId), IntegerEntry(keyLastIncUnclaimedWithPaymentCallBlock(callerAddress), height)]
472- }
473- else throw("Strict value is not equal to itself.")
458+ let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
459+ let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
460+[ScriptTransfer(treasuryContract, resAmount, rewardAssetId)]
474461 }
475462 else throw("Strict value is not equal to itself.")
476463 }
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)
63-
64-
65-func keyLastIncUnclaimedWithPaymentCallBlock (address) = makeString(["%s%s", "lastIncUnclaimedWithPaymentCallBlock", address], separator)
6663
6764
6865 func keyManagerPublicKey () = "%s__managerPublicKey"
6966
7067
7168 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
7269
7370
7471 func keyClaimHistory (programName,userAddress,transactionId,type) = makeString(["%s%s%s%s%s", "history", type, programName, userAddress, transactionId], separator)
7572
7673
7774 func formatClaimHistory (amount) = makeString(["%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], separator)
7875
7976
8077 func throwErr (msg) = throw(makeString(["referral.ride:", msg], " "))
8178
8279
8380 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
8481 case s: String =>
8582 fromBase58String(s)
8683 case _: Unit =>
8784 unit
8885 case _ =>
8986 throw("Match error")
9087 }
9188
9289
9390 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
9491 case s: String =>
9592 fromBase58String(s)
9693 case _: Unit =>
9794 unit
9895 case _ =>
9996 throw("Match error")
10097 }
10198
10299
103100 func mustManager (i) = {
104101 let pd = throwErr("permission denied")
105102 match managerPublicKeyOrUnit() {
106103 case pk: ByteVector =>
107104 if ((i.callerPublicKey == pk))
108105 then true
109106 else pd
110107 case _: Unit =>
111108 if ((i.caller == this))
112109 then true
113110 else pd
114111 case _ =>
115112 throw("Match error")
116113 }
117114 }
118115
119116
120117 func updateAllReferralPrograms (address,programName) = {
121118 let allReferralPrograms = valueOrElse(getString(keyAllReferralPrograms(address)), "")
122119 let updatedAllReferralPrograms = if (contains(allReferralPrograms, programName))
123120 then nil
124121 else {
125122 let newAllReferralPrograms = if ((allReferralPrograms == ""))
126123 then programName
127124 else makeString([allReferralPrograms, programName], separator)
128125 [StringEntry(keyAllReferralPrograms(address), newAllReferralPrograms)]
129126 }
130127 updatedAllReferralPrograms
131128 }
132129
133130
134131 @Callable(i)
135132 func claimInternal (programName,claimerAddress,isImplementationContract) = {
136133 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
137134 then true
138135 else throwErr("program does not exist")
139136 if ((checkProgramExists == checkProgramExists))
140137 then {
141- let $t048215758 = if (isImplementationContract)
138+ let $t046775614 = if (isImplementationContract)
142139 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"))
143140 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"))
144- let claimerClaimed = $t048215758._1
145- let claimerUnclaimed = $t048215758._2
146- let keyClaimed = $t048215758._3
147- let keyUnclaimed = $t048215758._4
148- let claimHistoryKey = $t048215758._5
141+ let claimerClaimed = $t046775614._1
142+ let claimerUnclaimed = $t046775614._2
143+ let keyClaimed = $t046775614._3
144+ let keyUnclaimed = $t046775614._4
145+ let claimHistoryKey = $t046775614._5
149146 let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0)
150147 let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName)))))
151148 let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
152149 let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimerAddress)), 0)
153150 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimerAddress)), 0)
154151 if (if (isImplementationContract)
155152 then (claimerUnclaimed == 0)
156153 else false)
157154 then $Tuple2(nil, 0)
158155 else {
159156 let checkCanClaim = if ((claimerUnclaimed > 0))
160157 then true
161158 else throwErr("nothing to claim")
162159 if ((checkCanClaim == checkCanClaim))
163160 then {
164161 let newClaimerClaimed = (claimerClaimed + claimerUnclaimed)
165162 let newClaimedTotal = (claimedTotal + claimerUnclaimed)
166163 let newClaimedTotalAddress = (claimedTotalAddress + claimerUnclaimed)
167164 let newUnclaimedTotalAddress = (unclaimedTotalAddress - claimerUnclaimed)
168165 let balanceBefore = value(assetBalance(this, rewardAssetId))
169166 if ((balanceBefore == balanceBefore))
170167 then {
171168 let res = invoke(treasuryContract, "withdrawReferralReward", [claimerUnclaimed], nil)
172169 if ((res == res))
173170 then {
174171 let balanceAfter = value(assetBalance(this, rewardAssetId))
175172 if ((balanceAfter == balanceAfter))
176173 then {
177174 let balanceDiff = (balanceAfter - balanceBefore)
178175 if ((balanceDiff == balanceDiff))
179176 then {
180177 let checkBalance = if ((balanceDiff == claimerUnclaimed))
181178 then true
182179 else throwErr("insufficient balance on referral contract")
183180 if ((checkBalance == checkBalance))
184181 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)
185182 else throw("Strict value is not equal to itself.")
186183 }
187184 else throw("Strict value is not equal to itself.")
188185 }
189186 else throw("Strict value is not equal to itself.")
190187 }
191188 else throw("Strict value is not equal to itself.")
192189 }
193190 else throw("Strict value is not equal to itself.")
194191 }
195192 else throw("Strict value is not equal to itself.")
196193 }
197194 }
198195 else throw("Strict value is not equal to itself.")
199196 }
200197
201198
202199
203200 @Callable(i)
204201 func claimBulkInternal (claimer,programNames,currentIter) = {
205202 let checkCaller = if ((i.caller == this))
206203 then true
207204 else throwErr("permission denied")
208205 if ((checkCaller == checkCaller))
209206 then if ((currentIter == size(programNames)))
210207 then nil
211208 else {
212209 let programName = programNames[currentIter]
213210 let programUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0)
214211 let claimHistoryKey = keyClaimHistory(programName, claimer, toBase58String(i.transactionId), "claimBulk")
215212 let claimBulkInternal = invoke(this, "claimBulkInternal", [claimer, programNames, (currentIter + 1)], nil)
216213 if ((claimBulkInternal == claimBulkInternal))
217214 then {
218215 let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0)
219216 let claim = if ((unclaimedReferrer > 0))
220217 then invoke(this, "claimInternal", [programName, claimer, false], nil)
221218 else unit
222219 if ((claim == claim))
223220 then $Tuple2(nil, [claimBulkInternal, claim])
224221 else throw("Strict value is not equal to itself.")
225222 }
226223 else throw("Strict value is not equal to itself.")
227224 }
228225 else throw("Strict value is not equal to itself.")
229226 }
230227
231228
232229
233230 @Callable(i)
234231 func incUnclaimedWithPaymentInternal (paymentAmounts,programName,referrerAddresses,currentIter,resAmount) = {
235232 let checkCaller = if ((i.caller == this))
236233 then true
237234 else throwErr("permission denied")
238235 if ((checkCaller == checkCaller))
239236 then {
240237 let argsComparison = (size(paymentAmounts) == size(referrerAddresses))
241238 let check = if (argsComparison)
242239 then true
243240 else throwErr("lists in args must be same size")
244241 if ((check == check))
245242 then if ((currentIter == size(paymentAmounts)))
246243 then $Tuple2(nil, resAmount)
247244 else {
248245 let referrerAddress = referrerAddresses[currentIter]
249246 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0)
250247 let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0)
251248 let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0)
252249 let newUnclaimedTotalAddress = (unclaimedTotalAddress + paymentAmounts[currentIter])
253250 let newReferrerUnclaimed = (referrerUnclaimed + paymentAmounts[currentIter])
254251 let newResAmount = (resAmount + paymentAmounts[currentIter])
255252 let inv = invoke(this, "incUnclaimedWithPaymentInternal", [paymentAmounts, programName, referrerAddresses, (currentIter + 1), newResAmount], nil)
256253 if ((inv == inv))
257254 then {
258255 let updatedAllReferrerPrograms = updateAllReferralPrograms(referrerAddress, programName)
259256 $Tuple2(([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalAddress), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyRewardsTotal(programName), (rewardsTotal + paymentAmounts[currentIter]))] ++ updatedAllReferrerPrograms), inv)
260257 }
261258 else throw("Strict value is not equal to itself.")
262259 }
263260 else throw("Strict value is not equal to itself.")
264261 }
265262 else throw("Strict value is not equal to itself.")
266263 }
267264
268265
269266
270267 @Callable(i)
271268 func createReferralProgram (programName,treasuryContract,implementationContract,rewardAssetId) = {
272269 let checkCaller = mustManager(i)
273270 if ((checkCaller == checkCaller))
274271 then {
275272 let checkProgramName = if ((getBoolean(keyProgramName(programName)) == unit))
276273 then true
277274 else throwErr("program name already exists")
278275 if ((checkProgramName == checkProgramName))
279276 then {
280277 let programNameIsValid = if (!(contains(programName, separator)))
281278 then !(contains(programName, " "))
282279 else false
283280 let checkProgramExists = if (programNameIsValid)
284281 then true
285282 else throwErr("invalid program name")
286283 if ((checkProgramExists == checkProgramExists))
287284 then {
288285 let checkRewardAsset = if ((assetInfo(fromBase58String(rewardAssetId)) != unit))
289286 then true
290287 else throwErr("invalid reward asset id")
291288 if ((checkRewardAsset == checkRewardAsset))
292289 then $Tuple2([BooleanEntry(keyProgramName(programName), true), StringEntry(keyTreasuryContract(programName), treasuryContract), StringEntry(keyImplementationContract(programName), implementationContract), StringEntry(keyRewardAssetId(programName), rewardAssetId), IntegerEntry(keyRewardsTotal(programName), 0)], unit)
293290 else throw("Strict value is not equal to itself.")
294291 }
295292 else throw("Strict value is not equal to itself.")
296293 }
297294 else throw("Strict value is not equal to itself.")
298295 }
299296 else throw("Strict value is not equal to itself.")
300297 }
301298
302299
303300
304301 @Callable(i)
305302 func createPair (programName,referrerAddress,referralAddress,signature) = {
306303 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
307304 then true
308305 else throwErr("program does not exist")
309306 if ((checkProgramExists == checkProgramExists))
310307 then {
311308 let pairReferrerToReferralExistCheck = if ((getBoolean(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress)) == unit))
312309 then true
313310 else throwErr("pair already exists")
314311 if ((pairReferrerToReferralExistCheck == pairReferrerToReferralExistCheck))
315312 then {
316313 let noRefSelf = if ((referrerAddress != referralAddress))
317314 then true
318315 else throwErr("cannot refer to self")
319316 if ((noRefSelf == noRefSelf))
320317 then {
321318 let pair = toBytes(makeString([programName, referrerAddress, referralAddress], ":"))
322319 let backendPublicKey = fromBase58String(value(getString(keyBackendPublicKey)))
323320 let validateSignature = if (sigVerify(pair, signature, backendPublicKey))
324321 then true
325322 else throwErr("bad signature")
326323 if ((validateSignature == validateSignature))
327324 then {
328325 let totalReferralCount = valueOrElse(getInteger(keyTotalReferralCount(programName, referrerAddress)), 0)
329326 let newTotalReferralCount = (totalReferralCount + 1)
330327 let updatedAllReferrerPrograms = updateAllReferralPrograms(referrerAddress, programName)
331328 let updatedAllReferralPrograms = updateAllReferralPrograms(referralAddress, programName)
332329 $Tuple2((([BooleanEntry(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress), true), IntegerEntry(keyTotalReferralCount(programName, referrerAddress), newTotalReferralCount), StringEntry(keyReferrer(programName, referralAddress), referrerAddress)] ++ updatedAllReferrerPrograms) ++ updatedAllReferralPrograms), unit)
333330 }
334331 else throw("Strict value is not equal to itself.")
335332 }
336333 else throw("Strict value is not equal to itself.")
337334 }
338335 else throw("Strict value is not equal to itself.")
339336 }
340337 else throw("Strict value is not equal to itself.")
341338 }
342339
343340
344341
345342 @Callable(i)
346343 func updateReferralActivity (programName,referralAddress,isActive) = {
347344 let implementationContract = value(getString(keyImplementationContract(programName)))
348345 let isReferralActive = (getBoolean(keyIsReferralActive(programName, referralAddress)) != unit)
349346 let referrerAddress = value(getString(keyReferrer(programName, referralAddress)))
350347 let checkCaller = if ((toString(i.caller) == implementationContract))
351348 then true
352349 else throwErr("permission denied")
353350 if ((checkCaller == checkCaller))
354351 then {
355352 let update = if ((isReferralActive == isActive))
356353 then $Tuple2(nil, unit)
357354 else {
358355 let update = if ((isActive == true))
359356 then {
360357 let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) + 1)
361358 $Tuple2([BooleanEntry(keyIsReferralActive(programName, referralAddress), true), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit)
362359 }
363360 else {
364361 let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) - 1)
365362 $Tuple2([DeleteEntry(keyIsReferralActive(programName, referralAddress)), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit)
366363 }
367364 update
368365 }
369366 update
370367 }
371368 else throw("Strict value is not equal to itself.")
372369 }
373370
374371
375372
376373 @Callable(i)
377374 func incUnclaimed (programName,referralAddress,referrerReward,referralReward) = {
378375 let implementationContract = value(getString(keyImplementationContract(programName)))
379376 let referrerAddress = value(getString(keyReferrer(programName, referralAddress)))
380377 let checkCaller = if ((toString(i.caller) == implementationContract))
381378 then true
382379 else throwErr("permission denied")
383380 if ((checkCaller == checkCaller))
384381 then {
385382 let checkProgram = if ((programName == "wxlock"))
386383 then true
387384 else throwErr("invalid program")
388385 if ((checkProgram == checkProgram))
389386 then {
390387 let checkReferrerInProgram = if (contains(valueOrElse(getString(keyAllReferralPrograms(referrerAddress)), ""), programName))
391388 then true
392389 else throwErr(((("referrer not in program=" + programName) + " addr=") + referrerAddress))
393390 if ((checkReferrerInProgram == checkReferrerInProgram))
394391 then {
395392 let checkReferralInProgram = if (contains(valueOrElse(getString(keyAllReferralPrograms(referralAddress)), ""), programName))
396393 then true
397394 else throwErr(((("referral not in program=" + programName) + " addr=") + referralAddress))
398395 if ((checkReferralInProgram == checkReferralInProgram))
399396 then {
400397 let unclaimedTotalReferrer = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0)
401398 let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0)
402399 let unclaimedTotalReferral = valueOrElse(getInteger(keyUnclaimedTotalAddress(referralAddress)), 0)
403400 let referralUnclaimed = valueOrElse(getInteger(keyUnclaimedReferral(programName, referralAddress)), 0)
404401 let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0)
405402 let newUnclaimedTotalReferrer = (unclaimedTotalReferrer + referrerReward)
406403 let newReferrerUnclaimed = (referrerUnclaimed + referrerReward)
407404 let newUnclaimedTotalReferral = (unclaimedTotalReferral + referralReward)
408405 let newReferralUnclaimed = (referralUnclaimed + referralReward)
409406 $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)
410407 }
411408 else throw("Strict value is not equal to itself.")
412409 }
413410 else throw("Strict value is not equal to itself.")
414411 }
415412 else throw("Strict value is not equal to itself.")
416413 }
417414 else throw("Strict value is not equal to itself.")
418415 }
419416
420417
421418
422419 @Callable(i)
423420 func incUnclaimedWithPayment (programName,referrerAddresses) = {
424421 let checkProgram = if ((programName == "wxSpotFee"))
425422 then true
426423 else throwErr("invalid program")
427424 if ((checkProgram == checkProgram))
428425 then {
429- let callerAddress = toString(i.caller)
430- let lastCall = valueOrElse(getInteger(keyLastIncUnclaimedWithPaymentCallBlock(callerAddress)), 0)
431- let waitBlocks = ((lastCall - height) + 3)
432- let lastCallCheck = if (((height - 3) > lastCall))
433- then true
434- else throwErr(makeString(["wait", toString(waitBlocks), "blocks"], " "))
435- if ((lastCallCheck == lastCallCheck))
426+ func map (accum,next) = {
427+ let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
428+ let amountCheck = if (assetIdCheck)
429+ then true
430+ else throwErr("invalid asset id")
431+ if ((amountCheck == amountCheck))
432+ then (accum :+ next.amount)
433+ else throw("Strict value is not equal to itself.")
434+ }
435+
436+ let payments = {
437+ let $l = i.payments
438+ let $s = size($l)
439+ let $acc0 = nil
440+ func $f0_1 ($a,$i) = if (($i >= $s))
441+ then $a
442+ else map($a, $l[$i])
443+
444+ func $f0_2 ($a,$i) = if (($i >= $s))
445+ then $a
446+ else throw("List size exceeds 10")
447+
448+ $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)
449+ }
450+ let resAmount = {
451+ let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
452+ if ($isInstanceOf(@, "Int"))
453+ then @
454+ else throw(($getType(@) + " couldn't be cast to Int"))
455+ }
456+ if ((resAmount == resAmount))
436457 then {
437- func map (accum,next) = {
438- let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
439- let amountCheck = if (assetIdCheck)
440- then true
441- else throwErr("invalid asset id")
442- if ((amountCheck == amountCheck))
443- then (accum :+ next.amount)
444- else throw("Strict value is not equal to itself.")
445- }
446-
447- let payments = {
448- let $l = i.payments
449- let $s = size($l)
450- let $acc0 = nil
451- func $f0_1 ($a,$i) = if (($i >= $s))
452- then $a
453- else map($a, $l[$i])
454-
455- func $f0_2 ($a,$i) = if (($i >= $s))
456- then $a
457- else throw("List size exceeds 10")
458-
459- $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)
460- }
461- let resAmount = {
462- let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
463- if ($isInstanceOf(@, "Int"))
464- then @
465- else throw(($getType(@) + " couldn't be cast to Int"))
466- }
467- if ((resAmount == resAmount))
468- then {
469- let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
470- let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
471-[ScriptTransfer(treasuryContract, resAmount, rewardAssetId), IntegerEntry(keyLastIncUnclaimedWithPaymentCallBlock(callerAddress), height)]
472- }
473- else throw("Strict value is not equal to itself.")
458+ let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
459+ let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
460+[ScriptTransfer(treasuryContract, resAmount, rewardAssetId)]
474461 }
475462 else throw("Strict value is not equal to itself.")
476463 }
477464 else throw("Strict value is not equal to itself.")
478465 }
479466
480467
481468
482469 @Callable(i)
483470 func claim (programName) = {
484471 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
485472 then true
486473 else throwErr("program does not exist")
487474 if ((checkProgramExists == checkProgramExists))
488475 then {
489476 let isImplementationContract = (toString(i.caller) == value(getString(keyImplementationContract(programName))))
490477 let claimerAddress = if (isImplementationContract)
491478 then toString(i.originCaller)
492479 else toString(i.caller)
493480 let claimInternal = invoke(this, "claimInternal", [programName, claimerAddress, isImplementationContract], nil)
494481 if ((claimInternal == claimInternal))
495482 then $Tuple2(nil, claimInternal)
496483 else throw("Strict value is not equal to itself.")
497484 }
498485 else throw("Strict value is not equal to itself.")
499486 }
500487
501488
502489
503490 @Callable(i)
504491 func claimBulk () = {
505492 let callerAddress = toString(i.caller)
506493 let callerProgramsStr = getString(keyAllReferralPrograms(toString(i.caller)))
507494 let programsExists = if (isDefined(callerProgramsStr))
508495 then true
509496 else throwErr("no referral programs")
510497 if ((programsExists == programsExists))
511498 then {
512499 let callerPrograms = split(value(callerProgramsStr), "__")
513500 let bulkClaim = invoke(this, "claimBulkInternal", [callerAddress, callerPrograms, 0], nil)
514501 if ((bulkClaim == bulkClaim))
515502 then $Tuple2(nil, bulkClaim)
516503 else throw("Strict value is not equal to itself.")
517504 }
518505 else throw("Strict value is not equal to itself.")
519506 }
520507
521508
522509
523510 @Callable(i)
524511 func claimREADONLY (programName,userAddress) = {
525512 let claimerClaimed = valueOrElse(getInteger(keyClaimedReferrer(programName, userAddress)), 0)
526513 let claimerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, userAddress)), 0)
527514 $Tuple2(nil, [claimerUnclaimed, claimerClaimed])
528515 }
529516
530517
531518
532519 @Callable(i)
533520 func claimBulkREADONLY (claimer) = {
534521 let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimer)), 0)
535522 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimer)), 0)
536523 $Tuple2(nil, [unclaimedTotalAddress, claimedTotalAddress])
537524 }
538525
539526
540527
541528 @Callable(i)
542529 func setTotalKeys (programName,address) = {
543530 let claimedReferrer = valueOrElse(getInteger(keyClaimedReferrer(programName, address)), 0)
544531 let claimedReferral = valueOrElse(getInteger(keyClaimedReferral(programName, address)), 0)
545532 let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, address)), 0)
546533 let unclaimedReferral = valueOrElse(getInteger(keyUnclaimedReferral(programName, address)), 0)
547534 let claimedTotalAddress = (claimedReferrer + claimedReferral)
548535 let unclaimedTotalAddress = (unclaimedReferrer + unclaimedReferral)
549536 $Tuple2([IntegerEntry(keyClaimedTotalAddress(address), claimedTotalAddress), IntegerEntry(keyUnclaimedTotalAddress(address), unclaimedTotalAddress)], unit)
550537 }
551538
552539
553540
554541 @Callable(i)
555542 func setManager (pendingManagerPublicKey) = {
556543 let checkCaller = mustManager(i)
557544 if ((checkCaller == checkCaller))
558545 then {
559546 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
560547 if ((checkManagerPublicKey == checkManagerPublicKey))
561548 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
562549 else throw("Strict value is not equal to itself.")
563550 }
564551 else throw("Strict value is not equal to itself.")
565552 }
566553
567554
568555
569556 @Callable(i)
570557 func confirmManager () = {
571558 let pm = pendingManagerPublicKeyOrUnit()
572559 let hasPM = if (isDefined(pm))
573560 then true
574561 else throwErr("no pending manager")
575562 if ((hasPM == hasPM))
576563 then {
577564 let checkPM = if ((i.callerPublicKey == value(pm)))
578565 then true
579566 else throwErr("you are not pending manager")
580567 if ((checkPM == checkPM))
581568 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
582569 else throw("Strict value is not equal to itself.")
583570 }
584571 else throw("Strict value is not equal to itself.")
585572 }
586573
587574
588575 @Verifier(tx)
589576 func verify () = {
590577 let targetPublicKey = match managerPublicKeyOrUnit() {
591578 case pk: ByteVector =>
592579 pk
593580 case _: Unit =>
594581 tx.senderPublicKey
595582 case _ =>
596583 throw("Match error")
597584 }
598585 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
599586 }
600587

github/deemru/w8io/169f3d6 
75.91 ms