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:BgJdCAISBQoDCAgEEgUKAwgYARIHCgURCBgBARIGCgQICAgIEgYKBAgICAISBQoDCAgEEgYKBAgIAQESBAoCCBgSAwoBCBIAEgQKAggIEgMKAQgSBAoCCAgSAwoBCBIAHgAJc2VwYXJhdG9yAgJfXwEMa2V5V3hBc3NldElkAAkAuQkCCQDMCAICAiVzCQDMCAICCXd4QXNzZXRJZAUDbmlsBQlzZXBhcmF0b3IAE2tleUJhY2tlbmRQdWJsaWNLZXkJALkJAgkAzAgCAgIlcwkAzAgCAhBiYWNrZW5kUHVibGljS2V5BQNuaWwFCXNlcGFyYXRvcgEba2V5RXhpc3RzUmVmZXJyZXJUb1JlZmVycmFsAwtwcm9ncmFtTmFtZQ9yZWZlcnJlckFkZHJlc3MPcmVmZXJyYWxBZGRyZXNzCQC5CQIJAMwIAgIIJXMlcyVzJXMJAMwIAgIYZXhpc3RzUmVmZXJyZXJUb1JlZmVycmFsCQDMCAIFC3Byb2dyYW1OYW1lCQDMCAIFD3JlZmVycmVyQWRkcmVzcwkAzAgCBQ9yZWZlcnJhbEFkZHJlc3MFA25pbAUJc2VwYXJhdG9yARJrZ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ib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXngHGFI", "chainId": 84, "height": 2270704, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G8n6rox5LycvVVH6jAwZciynRyPk4FYCGbtBqBM8p7PF Next: BiJNx6Hva7vMyef9rFF1c7Sdf61hGefjSV28PPDGNb4c Diff:
Old | New | Differences | |
---|---|---|---|
62 | 62 | func keyAllRefferalPrograms (address) = makeString(["%s%s", "allReferralPrograms", address], separator) | |
63 | 63 | ||
64 | 64 | ||
65 | - | func keyClaimedTotalProgram (programName) = makeString(["%s%s", "claimedTotalProgram", programName], separator) | |
66 | - | ||
67 | - | ||
68 | - | func keyUnclaimedTotal (address) = makeString(["%s%s", "unclaimedTotalAddress", address], separator) | |
69 | - | ||
70 | - | ||
71 | 65 | func keyLastBulkClaimCallBlock (address) = makeString(["%s%s", "lastBulkClaimCallBlock", address], separator) | |
72 | 66 | ||
73 | 67 | ||
130 | 124 | else throwErr("program does not exist") | |
131 | 125 | if ((checkProgramExists == checkProgramExists)) | |
132 | 126 | then { | |
133 | - | let $ | |
127 | + | let $t042475184 = if (isImplementationContract) | |
134 | 128 | 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")) | |
135 | 129 | 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 = $ | |
137 | - | let claimerUnclaimed = $ | |
138 | - | let keyClaimed = $ | |
139 | - | let keyUnclaimed = $ | |
140 | - | let claimHistoryKey = $ | |
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 | |
141 | 135 | let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0) | |
142 | 136 | let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName))))) | |
143 | 137 | let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName)))) | |
392 | 386 | ||
393 | 387 | @Callable(i) | |
394 | 388 | 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 | + | } | |
404 | 406 | ||
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]) | |
412 | 414 | ||
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") | |
416 | 418 | ||
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)))) | |
429 | 431 | [ScriptTransfer(treasuryContract, resAmount, rewardAssetId)] | |
432 | + | } | |
433 | + | else throw("Strict value is not equal to itself.") | |
430 | 434 | } | |
431 | 435 | else throw("Strict value is not equal to itself.") | |
432 | 436 | } | |
456 | 460 | ||
457 | 461 | @Callable(i) | |
458 | 462 | func claimBulk () = { | |
463 | + | let callerAddress = toString(i.caller) | |
459 | 464 | 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)) | |
464 | 466 | then true | |
465 | - | else throwErr( | |
466 | - | if (( | |
467 | + | else throwErr("no referral programs") | |
468 | + | if ((programsExists == programsExists)) | |
467 | 469 | 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) | |
479 | 474 | else throw("Strict value is not equal to itself.") | |
480 | 475 | } | |
481 | 476 | else throw("Strict value is not equal to itself.") | |
497 | 492 | let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimer)), 0) | |
498 | 493 | let uncleimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimer)), 0) | |
499 | 494 | $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) | |
500 | 508 | } | |
501 | 509 | ||
502 | 510 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | func keyWxAssetId () = makeString(["%s", "wxAssetId"], separator) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | let keyBackendPublicKey = makeString(["%s", "backendPublicKey"], separator) | |
10 | 10 | ||
11 | 11 | func keyExistsReferrerToReferral (programName,referrerAddress,referralAddress) = makeString(["%s%s%s%s", "existsReferrerToReferral", programName, referrerAddress, referralAddress], separator) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func keyClaimedReferrer (programName,claimerAddress) = makeString(["%s%s%s", "claimedReferrer", programName, claimerAddress], separator) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func keyClaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "claimedReferral", programName, claimerAddress], separator) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func keyUnclaimedReferrer (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferrer", programName, claimerAddress], separator) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func keyUnclaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferral", programName, claimerAddress], separator) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func keyReferrer (programName,referralAddress) = makeString(["%s%s%s", "referrer", programName, referralAddress], separator) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func keyProgramName (programName) = makeString(["%s%s", "programName", programName], separator) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func keyTotalReferralCount (programName,referrerAddress) = makeString(["%s%s%s", "totalReferralCount", programName, referrerAddress], separator) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func keyActiveReferralCount (programName,referrerAddress) = makeString(["%s%s%s", "activeReferralCount", programName, referrerAddress], separator) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func keyIsReferralActive (programName,referralAddress) = makeString(["%s%s%s", "activeReferral", programName, referralAddress], separator) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func keyClaimedTotalAddress (address) = makeString(["%s%s", "claimedTotalAddress", address], separator) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func keyUnclaimedTotalAddress (address) = makeString(["%s%s", "unclaimedTotalAddress", address], separator) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func keyClaimedTotal (programName) = makeString(["%s%s", "claimedTotal", programName], separator) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyRewardsTotal (programName) = makeString(["%s%s", "rewardsTotal", programName], separator) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func keyRewardAssetId (programName) = makeString(["%s%s", "rewardAssetId", programName], separator) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func keyTreasuryContract (programName) = makeString(["%s%s", "treasuryContract", programName], separator) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func keyImplementationContract (programName) = makeString(["%s%s", "implementationContract", programName], separator) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func keyAllRefferalPrograms (address) = makeString(["%s%s", "allReferralPrograms", address], separator) | |
63 | 63 | ||
64 | 64 | ||
65 | - | func keyClaimedTotalProgram (programName) = makeString(["%s%s", "claimedTotalProgram", programName], separator) | |
66 | - | ||
67 | - | ||
68 | - | func keyUnclaimedTotal (address) = makeString(["%s%s", "unclaimedTotalAddress", address], separator) | |
69 | - | ||
70 | - | ||
71 | 65 | func keyLastBulkClaimCallBlock (address) = makeString(["%s%s", "lastBulkClaimCallBlock", address], separator) | |
72 | 66 | ||
73 | 67 | ||
74 | 68 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
75 | 69 | ||
76 | 70 | ||
77 | 71 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
78 | 72 | ||
79 | 73 | ||
80 | 74 | func keyClaimHistory (programName,userAddress,transactionId,type) = makeString(["%s%s%s%s%s", "history", type, programName, userAddress, transactionId], separator) | |
81 | 75 | ||
82 | 76 | ||
83 | 77 | func formatClaimHistory (amount) = makeString(["%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], separator) | |
84 | 78 | ||
85 | 79 | ||
86 | 80 | func throwErr (msg) = throw(makeString(["referral.ride:", msg], " ")) | |
87 | 81 | ||
88 | 82 | ||
89 | 83 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
90 | 84 | case s: String => | |
91 | 85 | fromBase58String(s) | |
92 | 86 | case _: Unit => | |
93 | 87 | unit | |
94 | 88 | case _ => | |
95 | 89 | throw("Match error") | |
96 | 90 | } | |
97 | 91 | ||
98 | 92 | ||
99 | 93 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
100 | 94 | case s: String => | |
101 | 95 | fromBase58String(s) | |
102 | 96 | case _: Unit => | |
103 | 97 | unit | |
104 | 98 | case _ => | |
105 | 99 | throw("Match error") | |
106 | 100 | } | |
107 | 101 | ||
108 | 102 | ||
109 | 103 | func mustManager (i) = { | |
110 | 104 | let pd = throwErr("permission denied") | |
111 | 105 | match managerPublicKeyOrUnit() { | |
112 | 106 | case pk: ByteVector => | |
113 | 107 | if ((i.callerPublicKey == pk)) | |
114 | 108 | then true | |
115 | 109 | else pd | |
116 | 110 | case _: Unit => | |
117 | 111 | if ((i.caller == this)) | |
118 | 112 | then true | |
119 | 113 | else pd | |
120 | 114 | case _ => | |
121 | 115 | throw("Match error") | |
122 | 116 | } | |
123 | 117 | } | |
124 | 118 | ||
125 | 119 | ||
126 | 120 | @Callable(i) | |
127 | 121 | func claimInternal (programName,claimerAddress,isImplementationContract) = { | |
128 | 122 | let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false)) | |
129 | 123 | then true | |
130 | 124 | else throwErr("program does not exist") | |
131 | 125 | if ((checkProgramExists == checkProgramExists)) | |
132 | 126 | then { | |
133 | - | let $ | |
127 | + | let $t042475184 = if (isImplementationContract) | |
134 | 128 | 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")) | |
135 | 129 | 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 = $ | |
137 | - | let claimerUnclaimed = $ | |
138 | - | let keyClaimed = $ | |
139 | - | let keyUnclaimed = $ | |
140 | - | let claimHistoryKey = $ | |
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 | |
141 | 135 | let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0) | |
142 | 136 | let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName))))) | |
143 | 137 | let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName)))) | |
144 | 138 | let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimerAddress)), 0) | |
145 | 139 | let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimerAddress)), 0) | |
146 | 140 | if (if (isImplementationContract) | |
147 | 141 | then (claimerUnclaimed == 0) | |
148 | 142 | else false) | |
149 | 143 | then $Tuple2(nil, 0) | |
150 | 144 | else { | |
151 | 145 | let checkCanClaim = if ((claimerUnclaimed > 0)) | |
152 | 146 | then true | |
153 | 147 | else throwErr("nothing to claim") | |
154 | 148 | if ((checkCanClaim == checkCanClaim)) | |
155 | 149 | then { | |
156 | 150 | let newClaimerClaimed = (claimerClaimed + claimerUnclaimed) | |
157 | 151 | let newClaimedTotal = (claimedTotal + claimerUnclaimed) | |
158 | 152 | let newClaimedTotalAddress = (claimedTotalAddress + claimerUnclaimed) | |
159 | 153 | let newUnclaimedTotalAddress = (unclaimedTotalAddress - claimerUnclaimed) | |
160 | 154 | let balanceBefore = value(assetBalance(this, rewardAssetId)) | |
161 | 155 | if ((balanceBefore == balanceBefore)) | |
162 | 156 | then { | |
163 | 157 | let res = invoke(treasuryContract, "withdrawReferralReward", [claimerUnclaimed], nil) | |
164 | 158 | if ((res == res)) | |
165 | 159 | then { | |
166 | 160 | let balanceAfter = value(assetBalance(this, rewardAssetId)) | |
167 | 161 | if ((balanceAfter == balanceAfter)) | |
168 | 162 | then { | |
169 | 163 | let balanceDiff = (balanceAfter - balanceBefore) | |
170 | 164 | if ((balanceDiff == balanceDiff)) | |
171 | 165 | then { | |
172 | 166 | let checkBalance = if ((balanceDiff == claimerUnclaimed)) | |
173 | 167 | then true | |
174 | 168 | else throwErr("insufficient balance on referral contract") | |
175 | 169 | if ((checkBalance == checkBalance)) | |
176 | 170 | 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) | |
177 | 171 | else throw("Strict value is not equal to itself.") | |
178 | 172 | } | |
179 | 173 | else throw("Strict value is not equal to itself.") | |
180 | 174 | } | |
181 | 175 | else throw("Strict value is not equal to itself.") | |
182 | 176 | } | |
183 | 177 | else throw("Strict value is not equal to itself.") | |
184 | 178 | } | |
185 | 179 | else throw("Strict value is not equal to itself.") | |
186 | 180 | } | |
187 | 181 | else throw("Strict value is not equal to itself.") | |
188 | 182 | } | |
189 | 183 | } | |
190 | 184 | else throw("Strict value is not equal to itself.") | |
191 | 185 | } | |
192 | 186 | ||
193 | 187 | ||
194 | 188 | ||
195 | 189 | @Callable(i) | |
196 | 190 | func claimBulkInternal (claimer,programNames,currentIter) = { | |
197 | 191 | let checkCaller = if ((i.caller == this)) | |
198 | 192 | then true | |
199 | 193 | else throwErr("permission denied") | |
200 | 194 | if ((checkCaller == checkCaller)) | |
201 | 195 | then if ((currentIter == size(programNames))) | |
202 | 196 | then nil | |
203 | 197 | else { | |
204 | 198 | let programName = programNames[currentIter] | |
205 | 199 | let programUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0) | |
206 | 200 | let claimHistoryKey = keyClaimHistory(programName, claimer, toBase58String(i.transactionId), "claimBulk") | |
207 | 201 | let claimBulkInternal = invoke(this, "claimBulkInternal", [claimer, programNames, (currentIter + 1)], nil) | |
208 | 202 | if ((claimBulkInternal == claimBulkInternal)) | |
209 | 203 | then { | |
210 | 204 | let claimInternal = invoke(this, "claimInternal", [programName, claimer, false], nil) | |
211 | 205 | if ((claimInternal == claimInternal)) | |
212 | 206 | then $Tuple2(nil, [claimBulkInternal, claimInternal]) | |
213 | 207 | else throw("Strict value is not equal to itself.") | |
214 | 208 | } | |
215 | 209 | else throw("Strict value is not equal to itself.") | |
216 | 210 | } | |
217 | 211 | else throw("Strict value is not equal to itself.") | |
218 | 212 | } | |
219 | 213 | ||
220 | 214 | ||
221 | 215 | ||
222 | 216 | @Callable(i) | |
223 | 217 | func incUnclaimedWithPaymentInternal (paymentAmounts,programName,referrerAddresses,currentIter,resAmount) = { | |
224 | 218 | let checkCaller = if ((i.caller == this)) | |
225 | 219 | then true | |
226 | 220 | else throwErr("permission denied") | |
227 | 221 | if ((checkCaller == checkCaller)) | |
228 | 222 | then { | |
229 | 223 | let argsComparison = (size(paymentAmounts) == size(referrerAddresses)) | |
230 | 224 | let check = if (argsComparison) | |
231 | 225 | then true | |
232 | 226 | else throwErr("lists in args must be same size") | |
233 | 227 | if ((check == check)) | |
234 | 228 | then if ((currentIter == size(paymentAmounts))) | |
235 | 229 | then $Tuple2(nil, resAmount) | |
236 | 230 | else { | |
237 | 231 | let referrerAddress = referrerAddresses[currentIter] | |
238 | 232 | let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0) | |
239 | 233 | let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0) | |
240 | 234 | let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0) | |
241 | 235 | let newUnclaimedTotalAddress = (unclaimedTotalAddress + paymentAmounts[currentIter]) | |
242 | 236 | let newReferrerUnclaimed = (referrerUnclaimed + paymentAmounts[currentIter]) | |
243 | 237 | let newResAmount = (resAmount + paymentAmounts[currentIter]) | |
244 | 238 | let inv = invoke(this, "incUnclaimedWithPaymentInternal", [paymentAmounts, programName, referrerAddresses, (currentIter + 1), newResAmount], nil) | |
245 | 239 | if ((inv == inv)) | |
246 | 240 | then $Tuple2([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalAddress), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyRewardsTotal(programName), (rewardsTotal + paymentAmounts[currentIter]))], inv) | |
247 | 241 | else throw("Strict value is not equal to itself.") | |
248 | 242 | } | |
249 | 243 | else throw("Strict value is not equal to itself.") | |
250 | 244 | } | |
251 | 245 | else throw("Strict value is not equal to itself.") | |
252 | 246 | } | |
253 | 247 | ||
254 | 248 | ||
255 | 249 | ||
256 | 250 | @Callable(i) | |
257 | 251 | func createReferralProgram (programName,treasuryContract,implementationContract,rewardAssetId) = { | |
258 | 252 | let checkCaller = mustManager(i) | |
259 | 253 | if ((checkCaller == checkCaller)) | |
260 | 254 | then { | |
261 | 255 | let checkProgramName = if ((getBoolean(keyProgramName(programName)) == unit)) | |
262 | 256 | then true | |
263 | 257 | else throwErr("program name already exists") | |
264 | 258 | if ((checkProgramName == checkProgramName)) | |
265 | 259 | then { | |
266 | 260 | let programNameIsValid = if (!(contains(programName, separator))) | |
267 | 261 | then !(contains(programName, " ")) | |
268 | 262 | else false | |
269 | 263 | let checkProgramExists = if (programNameIsValid) | |
270 | 264 | then true | |
271 | 265 | else throwErr("invalid program name") | |
272 | 266 | if ((checkProgramExists == checkProgramExists)) | |
273 | 267 | then { | |
274 | 268 | let checkRewardAsset = if ((assetInfo(fromBase58String(rewardAssetId)) != unit)) | |
275 | 269 | then true | |
276 | 270 | else throwErr("invalid reward asset id") | |
277 | 271 | if ((checkRewardAsset == checkRewardAsset)) | |
278 | 272 | then $Tuple2([BooleanEntry(keyProgramName(programName), true), StringEntry(keyTreasuryContract(programName), treasuryContract), StringEntry(keyImplementationContract(programName), implementationContract), StringEntry(keyRewardAssetId(programName), rewardAssetId), IntegerEntry(keyRewardsTotal(programName), 0)], unit) | |
279 | 273 | else throw("Strict value is not equal to itself.") | |
280 | 274 | } | |
281 | 275 | else throw("Strict value is not equal to itself.") | |
282 | 276 | } | |
283 | 277 | else throw("Strict value is not equal to itself.") | |
284 | 278 | } | |
285 | 279 | else throw("Strict value is not equal to itself.") | |
286 | 280 | } | |
287 | 281 | ||
288 | 282 | ||
289 | 283 | ||
290 | 284 | @Callable(i) | |
291 | 285 | func createPair (programName,referrerAddress,referralAddress,signature) = { | |
292 | 286 | let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false)) | |
293 | 287 | then true | |
294 | 288 | else throwErr("program does not exist") | |
295 | 289 | if ((checkProgramExists == checkProgramExists)) | |
296 | 290 | then { | |
297 | 291 | let pairReferrerToReferralExistCheck = if ((getBoolean(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress)) == unit)) | |
298 | 292 | then true | |
299 | 293 | else throwErr("pair already exists") | |
300 | 294 | if ((pairReferrerToReferralExistCheck == pairReferrerToReferralExistCheck)) | |
301 | 295 | then { | |
302 | 296 | let noRefSelf = if ((referrerAddress != referralAddress)) | |
303 | 297 | then true | |
304 | 298 | else throwErr("cannot refer to self") | |
305 | 299 | if ((noRefSelf == noRefSelf)) | |
306 | 300 | then { | |
307 | 301 | let pair = toBytes(makeString([programName, referrerAddress, referralAddress], ":")) | |
308 | 302 | let backendPublicKey = fromBase58String(value(getString(keyBackendPublicKey))) | |
309 | 303 | let validateSignature = if (sigVerify(pair, signature, backendPublicKey)) | |
310 | 304 | then true | |
311 | 305 | else throwErr("bad signature") | |
312 | 306 | if ((validateSignature == validateSignature)) | |
313 | 307 | then { | |
314 | 308 | let totalReferralCount = valueOrElse(getInteger(keyTotalReferralCount(programName, referrerAddress)), 0) | |
315 | 309 | let newTotalReferralCount = (totalReferralCount + 1) | |
316 | 310 | let allReferrerPrograms = valueOrElse(getString(keyAllRefferalPrograms(referrerAddress)), "") | |
317 | 311 | let newAllReferrerPrograms = if ((allReferrerPrograms == "")) | |
318 | 312 | then programName | |
319 | 313 | else makeString([allReferrerPrograms, programName], separator) | |
320 | 314 | let allReferralPrograms = valueOrElse(getString(keyAllRefferalPrograms(referralAddress)), "") | |
321 | 315 | let newAllReferralPrograms = if ((allReferralPrograms == "")) | |
322 | 316 | then programName | |
323 | 317 | else makeString([allReferralPrograms, programName], separator) | |
324 | 318 | $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) | |
325 | 319 | } | |
326 | 320 | else throw("Strict value is not equal to itself.") | |
327 | 321 | } | |
328 | 322 | else throw("Strict value is not equal to itself.") | |
329 | 323 | } | |
330 | 324 | else throw("Strict value is not equal to itself.") | |
331 | 325 | } | |
332 | 326 | else throw("Strict value is not equal to itself.") | |
333 | 327 | } | |
334 | 328 | ||
335 | 329 | ||
336 | 330 | ||
337 | 331 | @Callable(i) | |
338 | 332 | func updateReferralActivity (programName,referralAddress,isActive) = { | |
339 | 333 | let implementationContract = value(getString(keyImplementationContract(programName))) | |
340 | 334 | let isReferralActive = (getBoolean(keyIsReferralActive(programName, referralAddress)) != unit) | |
341 | 335 | let referrerAddress = value(getString(keyReferrer(programName, referralAddress))) | |
342 | 336 | let checkCaller = if ((toString(i.caller) == implementationContract)) | |
343 | 337 | then true | |
344 | 338 | else throwErr("permission denied") | |
345 | 339 | if ((checkCaller == checkCaller)) | |
346 | 340 | then { | |
347 | 341 | let update = if ((isReferralActive == isActive)) | |
348 | 342 | then $Tuple2(nil, unit) | |
349 | 343 | else { | |
350 | 344 | let update = if ((isActive == true)) | |
351 | 345 | then { | |
352 | 346 | let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) + 1) | |
353 | 347 | $Tuple2([BooleanEntry(keyIsReferralActive(programName, referralAddress), true), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit) | |
354 | 348 | } | |
355 | 349 | else { | |
356 | 350 | let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) - 1) | |
357 | 351 | $Tuple2([DeleteEntry(keyIsReferralActive(programName, referralAddress)), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit) | |
358 | 352 | } | |
359 | 353 | update | |
360 | 354 | } | |
361 | 355 | update | |
362 | 356 | } | |
363 | 357 | else throw("Strict value is not equal to itself.") | |
364 | 358 | } | |
365 | 359 | ||
366 | 360 | ||
367 | 361 | ||
368 | 362 | @Callable(i) | |
369 | 363 | func incUnclaimed (programName,referralAddress,referrerReward,referralReward) = { | |
370 | 364 | let implementationContract = value(getString(keyImplementationContract(programName))) | |
371 | 365 | let checkCaller = if ((toString(i.caller) == implementationContract)) | |
372 | 366 | then true | |
373 | 367 | else throwErr("permission denied") | |
374 | 368 | if ((checkCaller == checkCaller)) | |
375 | 369 | then { | |
376 | 370 | let referrerAddress = value(getString(keyReferrer(programName, referralAddress))) | |
377 | 371 | let unclaimedTotalReferrer = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0) | |
378 | 372 | let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0) | |
379 | 373 | let unclaimedTotalReferral = valueOrElse(getInteger(keyUnclaimedTotalAddress(referralAddress)), 0) | |
380 | 374 | let referralUnclaimed = valueOrElse(getInteger(keyUnclaimedReferral(programName, referralAddress)), 0) | |
381 | 375 | let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0) | |
382 | 376 | let newUnclaimedTotalReferrer = (unclaimedTotalReferrer + referrerReward) | |
383 | 377 | let newReferrerUnclaimed = (referrerUnclaimed + referrerReward) | |
384 | 378 | let newUnclaimedTotalReferral = (unclaimedTotalReferral + referralReward) | |
385 | 379 | let newReferralUnclaimed = (referralUnclaimed + referralReward) | |
386 | 380 | $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) | |
387 | 381 | } | |
388 | 382 | else throw("Strict value is not equal to itself.") | |
389 | 383 | } | |
390 | 384 | ||
391 | 385 | ||
392 | 386 | ||
393 | 387 | @Callable(i) | |
394 | 388 | 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 | + | } | |
404 | 406 | ||
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]) | |
412 | 414 | ||
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") | |
416 | 418 | ||
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)))) | |
429 | 431 | [ScriptTransfer(treasuryContract, resAmount, rewardAssetId)] | |
432 | + | } | |
433 | + | else throw("Strict value is not equal to itself.") | |
430 | 434 | } | |
431 | 435 | else throw("Strict value is not equal to itself.") | |
432 | 436 | } | |
433 | 437 | ||
434 | 438 | ||
435 | 439 | ||
436 | 440 | @Callable(i) | |
437 | 441 | func claim (programName) = { | |
438 | 442 | let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false)) | |
439 | 443 | then true | |
440 | 444 | else throwErr("program does not exist") | |
441 | 445 | if ((checkProgramExists == checkProgramExists)) | |
442 | 446 | then { | |
443 | 447 | let isImplementationContract = (toString(i.caller) == value(getString(keyImplementationContract(programName)))) | |
444 | 448 | let claimerAddress = if (isImplementationContract) | |
445 | 449 | then toString(i.originCaller) | |
446 | 450 | else toString(i.caller) | |
447 | 451 | let claimInternal = invoke(this, "claimInternal", [programName, claimerAddress, isImplementationContract], nil) | |
448 | 452 | if ((claimInternal == claimInternal)) | |
449 | 453 | then $Tuple2(nil, claimInternal) | |
450 | 454 | else throw("Strict value is not equal to itself.") | |
451 | 455 | } | |
452 | 456 | else throw("Strict value is not equal to itself.") | |
453 | 457 | } | |
454 | 458 | ||
455 | 459 | ||
456 | 460 | ||
457 | 461 | @Callable(i) | |
458 | 462 | func claimBulk () = { | |
463 | + | let callerAddress = toString(i.caller) | |
459 | 464 | 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)) | |
464 | 466 | then true | |
465 | - | else throwErr( | |
466 | - | if (( | |
467 | + | else throwErr("no referral programs") | |
468 | + | if ((programsExists == programsExists)) | |
467 | 469 | 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) | |
479 | 474 | else throw("Strict value is not equal to itself.") | |
480 | 475 | } | |
481 | 476 | else throw("Strict value is not equal to itself.") | |
482 | 477 | } | |
483 | 478 | ||
484 | 479 | ||
485 | 480 | ||
486 | 481 | @Callable(i) | |
487 | 482 | func claimREADONLY (programName,userAddress) = { | |
488 | 483 | let claimerClaimed = valueOrElse(getInteger(keyClaimedReferrer(programName, userAddress)), 0) | |
489 | 484 | let claimerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, userAddress)), 0) | |
490 | 485 | $Tuple2(nil, [claimerUnclaimed, claimerClaimed]) | |
491 | 486 | } | |
492 | 487 | ||
493 | 488 | ||
494 | 489 | ||
495 | 490 | @Callable(i) | |
496 | 491 | func claimBulkREADONLY (claimer) = { | |
497 | 492 | let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimer)), 0) | |
498 | 493 | let uncleimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimer)), 0) | |
499 | 494 | $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) | |
500 | 508 | } | |
501 | 509 | ||
502 | 510 | ||
503 | 511 | ||
504 | 512 | @Callable(i) | |
505 | 513 | func setManager (pendingManagerPublicKey) = { | |
506 | 514 | let checkCaller = mustManager(i) | |
507 | 515 | if ((checkCaller == checkCaller)) | |
508 | 516 | then { | |
509 | 517 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
510 | 518 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
511 | 519 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
512 | 520 | else throw("Strict value is not equal to itself.") | |
513 | 521 | } | |
514 | 522 | else throw("Strict value is not equal to itself.") | |
515 | 523 | } | |
516 | 524 | ||
517 | 525 | ||
518 | 526 | ||
519 | 527 | @Callable(i) | |
520 | 528 | func confirmManager () = { | |
521 | 529 | let pm = pendingManagerPublicKeyOrUnit() | |
522 | 530 | let hasPM = if (isDefined(pm)) | |
523 | 531 | then true | |
524 | 532 | else throwErr("no pending manager") | |
525 | 533 | if ((hasPM == hasPM)) | |
526 | 534 | then { | |
527 | 535 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
528 | 536 | then true | |
529 | 537 | else throwErr("you are not pending manager") | |
530 | 538 | if ((checkPM == checkPM)) | |
531 | 539 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
532 | 540 | else throw("Strict value is not equal to itself.") | |
533 | 541 | } | |
534 | 542 | else throw("Strict value is not equal to itself.") | |
535 | 543 | } | |
536 | 544 | ||
537 | 545 | ||
538 | 546 | @Verifier(tx) | |
539 | 547 | func verify () = { | |
540 | 548 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
541 | 549 | case pk: ByteVector => | |
542 | 550 | pk | |
543 | 551 | case _: Unit => | |
544 | 552 | tx.senderPublicKey | |
545 | 553 | case _ => | |
546 | 554 | throw("Match error") | |
547 | 555 | } | |
548 | 556 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
549 | 557 | } | |
550 | 558 |
github/deemru/w8io/169f3d6 70.39 ms ◑