tx · BcSpEitptjueFL2gM1FA796wTpQMroztSG46yArVX2z5 3MuWBHccrEuDEvozJ8b7t5JdYrhqfyWePd6: -0.02500000 Waves 2023.05.04 13:13 [2562879] smart account 3MuWBHccrEuDEvozJ8b7t5JdYrhqfyWePd6 > SELF 0.00000000 Waves
{ "type": 13, "id": "BcSpEitptjueFL2gM1FA796wTpQMroztSG46yArVX2z5", "fee": 2500000, "feeAssetId": null, "timestamp": 1683195179318, "version": 2, "chainId": 84, "sender": "3MuWBHccrEuDEvozJ8b7t5JdYrhqfyWePd6", "senderPublicKey": "9RHv7r4mz9AqLab5WvSMeJe5cgGJqeG45LC9KbMaGKia", "proofs": [ "KhgCzWBYtyV47xeuV5PT6vSbm8EyDhfVBsa1fVfhSSSMVi2YJJeHoNza95Dd2D1F5s31hvoFSfcGtLRpsYNE6cg" ], "script": "base64:BgJWCAISBQoDCAgEEgUKAwgYARIHCgURCBgBARIGCgQICAgIEgYKBAgICAISBQoDCAgEEgYKBAgIAQESBAoCCBgSAwoBCBIAEgQKAggIEgMKAQgSBAoCCAgeAAlzZXBhcmF0b3ICAl9fAQxrZXlXeEFzc2V0SWQACQC5CQIJAMwIAgICJXMJAMwIAgIJd3hBc3NldElkBQNuaWwFCXNlcGFyYXRvcgATa2V5QmFja2VuZFB1YmxpY0tleQkAuQkCCQDMCAICAiVzCQDMCAICEGJhY2tlbmRQdWJsaWNLZXkFA25pbAUJc2VwYXJhdG9yARtrZXlFeGlzdHNSZWZlcnJlclRvUmVmZXJyYWwDC3Byb2dyYW1OYW1lD3JlZmVycmVyQWRkcmVzcw9yZWZlcnJhbEFkZHJlc3MJALkJAgkAzAgCAgglcyVzJXMlcwkAzAgCAhhleGlzdHNSZWZlcnJlclRvUmVmZXJyYWwJAMwIAgULcHJvZ3JhbU5hbWUJAMwIAgUPcmVmZXJyZXJBZGRyZXNzCQDMCAIFD3JlZmVycmFsQWRkcmVzcwUDbmlsBQlzZXBhcmF0b3IBEmtleUNsYWltZWRSZWZlc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yZXIJAQt2YWx1ZU9yRWxzZQIJAJ8IAQkBFGtleVVuY2xhaW1lZFJlZmVycmVyAgULcHJvZ3JhbU5hbWUFB2FkZHJlc3MAAAQRdW5jbGFpbWVkUmVmZXJyYWwJAQt2YWx1ZU9yRWxzZQIJAJ8IAQkBFGtleVVuY2xhaW1lZFJlZmVycmFsAgULcHJvZ3JhbU5hbWUFB2FkZHJlc3MAAAQTY2xhaW1lZFRvdGFsQWRkcmVzcwkAZAIFD2NsYWltZWRSZWZlcnJlcgUPY2xhaW1lZFJlZmVycmFsBBV1bmNsYWltZWRUb3RhbEFkZHJlc3MJAGQCBRF1bmNsYWltZWRSZWZlcnJlcgURdW5jbGFpbWVkUmVmZXJyYWwJAJQKAgkAzAgCCQEMSW50ZWdlckVudHJ5AgkBFmtleUNsYWltZWRUb3RhbEFkZHJlc3MBBQdhZGRyZXNzBRNjbGFpbWVkVG90YWxBZGRyZXNzCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEYa2V5VW5jbGFpbWVkVG90YWxBZGRyZXNzAQUHYWRkcmVzcwUVdW5jbGFpbWVkVG90YWxBZGRyZXNzBQNuaWwFBHVuaXQBAnR4AQZ2ZXJpZnkABA90YXJnZXRQdWJsaWNLZXkEByRtYXRjaDAJARZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXlOLAaL", "height": 2562879, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3u9veMhkm3g1N8gKqfnrNCnQMGoF4EMZC5UwtiPWxDoG Next: none Diff:
Old | New | Differences | |
---|---|---|---|
65 | 65 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
66 | 66 | ||
67 | 67 | ||
68 | - | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
68 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
69 | + | ||
70 | + | ||
71 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
69 | 72 | ||
70 | 73 | ||
71 | 74 | func keyClaimHistory (programName,userAddress,transactionId,type) = makeString(["%s%s%s%s%s", "history", type, programName, userAddress, transactionId], separator) | |
77 | 80 | func throwErr (msg) = throw(makeString(["referral.ride:", msg], " ")) | |
78 | 81 | ||
79 | 82 | ||
80 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
81 | - | case s: String => | |
82 | - | fromBase58String(s) | |
83 | - | case _: Unit => | |
84 | - | unit | |
85 | - | case _ => | |
86 | - | throw("Match error") | |
87 | - | } | |
88 | - | ||
89 | - | ||
90 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
91 | - | case s: String => | |
92 | - | fromBase58String(s) | |
93 | - | case _: Unit => | |
94 | - | unit | |
95 | - | case _ => | |
96 | - | throw("Match error") | |
97 | - | } | |
83 | + | func managerPublicKeyOrUnit () = { | |
84 | + | let managerVaultAddress = getManagerAddressOrFail() | |
85 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
86 | + | case s: String => | |
87 | + | fromBase58String(s) | |
88 | + | case _: Unit => | |
89 | + | unit | |
90 | + | case _ => | |
91 | + | throw("Match error") | |
92 | + | } | |
93 | + | } | |
98 | 94 | ||
99 | 95 | ||
100 | 96 | func mustManager (i) = { | |
135 | 131 | else throwErr("program does not exist") | |
136 | 132 | if ((checkProgramExists == checkProgramExists)) | |
137 | 133 | then { | |
138 | - | let $ | |
134 | + | let $t047005637 = if (isImplementationContract) | |
139 | 135 | 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")) | |
140 | 136 | 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")) | |
141 | - | let claimerClaimed = $ | |
142 | - | let claimerUnclaimed = $ | |
143 | - | let keyClaimed = $ | |
144 | - | let keyUnclaimed = $ | |
145 | - | let claimHistoryKey = $ | |
137 | + | let claimerClaimed = $t047005637._1 | |
138 | + | let claimerUnclaimed = $t047005637._2 | |
139 | + | let keyClaimed = $t047005637._3 | |
140 | + | let keyUnclaimed = $t047005637._4 | |
141 | + | let claimHistoryKey = $t047005637._5 | |
146 | 142 | let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0) | |
147 | 143 | let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName))))) | |
148 | 144 | let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName)))) | |
537 | 533 | } | |
538 | 534 | ||
539 | 535 | ||
540 | - | ||
541 | - | @Callable(i) | |
542 | - | func setManager (pendingManagerPublicKey) = { | |
543 | - | let checkCaller = mustManager(i) | |
544 | - | if ((checkCaller == checkCaller)) | |
545 | - | then { | |
546 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
547 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
548 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
549 | - | else throw("Strict value is not equal to itself.") | |
550 | - | } | |
551 | - | else throw("Strict value is not equal to itself.") | |
552 | - | } | |
553 | - | ||
554 | - | ||
555 | - | ||
556 | - | @Callable(i) | |
557 | - | func confirmManager () = { | |
558 | - | let pm = pendingManagerPublicKeyOrUnit() | |
559 | - | let hasPM = if (isDefined(pm)) | |
560 | - | then true | |
561 | - | else throwErr("no pending manager") | |
562 | - | if ((hasPM == hasPM)) | |
563 | - | then { | |
564 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
565 | - | then true | |
566 | - | else throwErr("you are not pending manager") | |
567 | - | if ((checkPM == checkPM)) | |
568 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
569 | - | else throw("Strict value is not equal to itself.") | |
570 | - | } | |
571 | - | else throw("Strict value is not equal to itself.") | |
572 | - | } | |
573 | - | ||
574 | - | ||
575 | 536 | @Verifier(tx) | |
576 | 537 | func verify () = { | |
577 | 538 | let targetPublicKey = match managerPublicKeyOrUnit() { |
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 keyAllReferralPrograms (address) = makeString(["%s%s", "allReferralPrograms", address], separator) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
66 | 66 | ||
67 | 67 | ||
68 | - | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
68 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
69 | + | ||
70 | + | ||
71 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
69 | 72 | ||
70 | 73 | ||
71 | 74 | func keyClaimHistory (programName,userAddress,transactionId,type) = makeString(["%s%s%s%s%s", "history", type, programName, userAddress, transactionId], separator) | |
72 | 75 | ||
73 | 76 | ||
74 | 77 | func formatClaimHistory (amount) = makeString(["%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], separator) | |
75 | 78 | ||
76 | 79 | ||
77 | 80 | func throwErr (msg) = throw(makeString(["referral.ride:", msg], " ")) | |
78 | 81 | ||
79 | 82 | ||
80 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
81 | - | case s: String => | |
82 | - | fromBase58String(s) | |
83 | - | case _: Unit => | |
84 | - | unit | |
85 | - | case _ => | |
86 | - | throw("Match error") | |
87 | - | } | |
88 | - | ||
89 | - | ||
90 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
91 | - | case s: String => | |
92 | - | fromBase58String(s) | |
93 | - | case _: Unit => | |
94 | - | unit | |
95 | - | case _ => | |
96 | - | throw("Match error") | |
97 | - | } | |
83 | + | func managerPublicKeyOrUnit () = { | |
84 | + | let managerVaultAddress = getManagerAddressOrFail() | |
85 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
86 | + | case s: String => | |
87 | + | fromBase58String(s) | |
88 | + | case _: Unit => | |
89 | + | unit | |
90 | + | case _ => | |
91 | + | throw("Match error") | |
92 | + | } | |
93 | + | } | |
98 | 94 | ||
99 | 95 | ||
100 | 96 | func mustManager (i) = { | |
101 | 97 | let pd = throwErr("permission denied") | |
102 | 98 | match managerPublicKeyOrUnit() { | |
103 | 99 | case pk: ByteVector => | |
104 | 100 | if ((i.callerPublicKey == pk)) | |
105 | 101 | then true | |
106 | 102 | else pd | |
107 | 103 | case _: Unit => | |
108 | 104 | if ((i.caller == this)) | |
109 | 105 | then true | |
110 | 106 | else pd | |
111 | 107 | case _ => | |
112 | 108 | throw("Match error") | |
113 | 109 | } | |
114 | 110 | } | |
115 | 111 | ||
116 | 112 | ||
117 | 113 | func updateAllReferralPrograms (address,programName) = { | |
118 | 114 | let allReferralPrograms = valueOrElse(getString(keyAllReferralPrograms(address)), "") | |
119 | 115 | let updatedAllReferralPrograms = if (contains(allReferralPrograms, programName)) | |
120 | 116 | then nil | |
121 | 117 | else { | |
122 | 118 | let newAllReferralPrograms = if ((allReferralPrograms == "")) | |
123 | 119 | then programName | |
124 | 120 | else makeString([allReferralPrograms, programName], separator) | |
125 | 121 | [StringEntry(keyAllReferralPrograms(address), newAllReferralPrograms)] | |
126 | 122 | } | |
127 | 123 | updatedAllReferralPrograms | |
128 | 124 | } | |
129 | 125 | ||
130 | 126 | ||
131 | 127 | @Callable(i) | |
132 | 128 | func claimInternal (programName,claimerAddress,isImplementationContract) = { | |
133 | 129 | let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false)) | |
134 | 130 | then true | |
135 | 131 | else throwErr("program does not exist") | |
136 | 132 | if ((checkProgramExists == checkProgramExists)) | |
137 | 133 | then { | |
138 | - | let $ | |
134 | + | let $t047005637 = if (isImplementationContract) | |
139 | 135 | 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")) | |
140 | 136 | 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")) | |
141 | - | let claimerClaimed = $ | |
142 | - | let claimerUnclaimed = $ | |
143 | - | let keyClaimed = $ | |
144 | - | let keyUnclaimed = $ | |
145 | - | let claimHistoryKey = $ | |
137 | + | let claimerClaimed = $t047005637._1 | |
138 | + | let claimerUnclaimed = $t047005637._2 | |
139 | + | let keyClaimed = $t047005637._3 | |
140 | + | let keyUnclaimed = $t047005637._4 | |
141 | + | let claimHistoryKey = $t047005637._5 | |
146 | 142 | let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0) | |
147 | 143 | let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName))))) | |
148 | 144 | let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName)))) | |
149 | 145 | let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimerAddress)), 0) | |
150 | 146 | let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimerAddress)), 0) | |
151 | 147 | if (if (isImplementationContract) | |
152 | 148 | then (claimerUnclaimed == 0) | |
153 | 149 | else false) | |
154 | 150 | then $Tuple2(nil, 0) | |
155 | 151 | else { | |
156 | 152 | let checkCanClaim = if ((claimerUnclaimed > 0)) | |
157 | 153 | then true | |
158 | 154 | else throwErr("nothing to claim") | |
159 | 155 | if ((checkCanClaim == checkCanClaim)) | |
160 | 156 | then { | |
161 | 157 | let newClaimerClaimed = (claimerClaimed + claimerUnclaimed) | |
162 | 158 | let newClaimedTotal = (claimedTotal + claimerUnclaimed) | |
163 | 159 | let newClaimedTotalAddress = (claimedTotalAddress + claimerUnclaimed) | |
164 | 160 | let newUnclaimedTotalAddress = (unclaimedTotalAddress - claimerUnclaimed) | |
165 | 161 | let balanceBefore = value(assetBalance(this, rewardAssetId)) | |
166 | 162 | if ((balanceBefore == balanceBefore)) | |
167 | 163 | then { | |
168 | 164 | let res = invoke(treasuryContract, "withdrawReferralReward", [claimerUnclaimed], nil) | |
169 | 165 | if ((res == res)) | |
170 | 166 | then { | |
171 | 167 | let balanceAfter = value(assetBalance(this, rewardAssetId)) | |
172 | 168 | if ((balanceAfter == balanceAfter)) | |
173 | 169 | then { | |
174 | 170 | let balanceDiff = (balanceAfter - balanceBefore) | |
175 | 171 | if ((balanceDiff == balanceDiff)) | |
176 | 172 | then { | |
177 | 173 | let checkBalance = if ((balanceDiff == claimerUnclaimed)) | |
178 | 174 | then true | |
179 | 175 | else throwErr("insufficient balance on referral contract") | |
180 | 176 | if ((checkBalance == checkBalance)) | |
181 | 177 | 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) | |
182 | 178 | else throw("Strict value is not equal to itself.") | |
183 | 179 | } | |
184 | 180 | else throw("Strict value is not equal to itself.") | |
185 | 181 | } | |
186 | 182 | else throw("Strict value is not equal to itself.") | |
187 | 183 | } | |
188 | 184 | else throw("Strict value is not equal to itself.") | |
189 | 185 | } | |
190 | 186 | else throw("Strict value is not equal to itself.") | |
191 | 187 | } | |
192 | 188 | else throw("Strict value is not equal to itself.") | |
193 | 189 | } | |
194 | 190 | } | |
195 | 191 | else throw("Strict value is not equal to itself.") | |
196 | 192 | } | |
197 | 193 | ||
198 | 194 | ||
199 | 195 | ||
200 | 196 | @Callable(i) | |
201 | 197 | func claimBulkInternal (claimer,programNames,currentIter) = { | |
202 | 198 | let checkCaller = if ((i.caller == this)) | |
203 | 199 | then true | |
204 | 200 | else throwErr("permission denied") | |
205 | 201 | if ((checkCaller == checkCaller)) | |
206 | 202 | then if ((currentIter == size(programNames))) | |
207 | 203 | then nil | |
208 | 204 | else { | |
209 | 205 | let programName = programNames[currentIter] | |
210 | 206 | let programUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0) | |
211 | 207 | let claimHistoryKey = keyClaimHistory(programName, claimer, toBase58String(i.transactionId), "claimBulk") | |
212 | 208 | let claimBulkInternal = invoke(this, "claimBulkInternal", [claimer, programNames, (currentIter + 1)], nil) | |
213 | 209 | if ((claimBulkInternal == claimBulkInternal)) | |
214 | 210 | then { | |
215 | 211 | let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0) | |
216 | 212 | let claim = if ((unclaimedReferrer > 0)) | |
217 | 213 | then invoke(this, "claimInternal", [programName, claimer, false], nil) | |
218 | 214 | else unit | |
219 | 215 | if ((claim == claim)) | |
220 | 216 | then $Tuple2(nil, [claimBulkInternal, claim]) | |
221 | 217 | else throw("Strict value is not equal to itself.") | |
222 | 218 | } | |
223 | 219 | else throw("Strict value is not equal to itself.") | |
224 | 220 | } | |
225 | 221 | else throw("Strict value is not equal to itself.") | |
226 | 222 | } | |
227 | 223 | ||
228 | 224 | ||
229 | 225 | ||
230 | 226 | @Callable(i) | |
231 | 227 | func incUnclaimedWithPaymentInternal (paymentAmounts,programName,referrerAddresses,currentIter,resAmount) = { | |
232 | 228 | let checkCaller = if ((i.caller == this)) | |
233 | 229 | then true | |
234 | 230 | else throwErr("permission denied") | |
235 | 231 | if ((checkCaller == checkCaller)) | |
236 | 232 | then { | |
237 | 233 | let argsComparison = (size(paymentAmounts) == size(referrerAddresses)) | |
238 | 234 | let check = if (argsComparison) | |
239 | 235 | then true | |
240 | 236 | else throwErr("lists in args must be same size") | |
241 | 237 | if ((check == check)) | |
242 | 238 | then if ((currentIter == size(paymentAmounts))) | |
243 | 239 | then $Tuple2(nil, resAmount) | |
244 | 240 | else { | |
245 | 241 | let referrerAddress = referrerAddresses[currentIter] | |
246 | 242 | let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0) | |
247 | 243 | let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0) | |
248 | 244 | let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0) | |
249 | 245 | let newUnclaimedTotalAddress = (unclaimedTotalAddress + paymentAmounts[currentIter]) | |
250 | 246 | let newReferrerUnclaimed = (referrerUnclaimed + paymentAmounts[currentIter]) | |
251 | 247 | let newResAmount = (resAmount + paymentAmounts[currentIter]) | |
252 | 248 | let inv = invoke(this, "incUnclaimedWithPaymentInternal", [paymentAmounts, programName, referrerAddresses, (currentIter + 1), newResAmount], nil) | |
253 | 249 | if ((inv == inv)) | |
254 | 250 | then { | |
255 | 251 | let updatedAllReferrerPrograms = updateAllReferralPrograms(referrerAddress, programName) | |
256 | 252 | $Tuple2(([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalAddress), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyRewardsTotal(programName), (rewardsTotal + paymentAmounts[currentIter]))] ++ updatedAllReferrerPrograms), inv) | |
257 | 253 | } | |
258 | 254 | else throw("Strict value is not equal to itself.") | |
259 | 255 | } | |
260 | 256 | else throw("Strict value is not equal to itself.") | |
261 | 257 | } | |
262 | 258 | else throw("Strict value is not equal to itself.") | |
263 | 259 | } | |
264 | 260 | ||
265 | 261 | ||
266 | 262 | ||
267 | 263 | @Callable(i) | |
268 | 264 | func createReferralProgram (programName,treasuryContract,implementationContract,rewardAssetId) = { | |
269 | 265 | let checkCaller = mustManager(i) | |
270 | 266 | if ((checkCaller == checkCaller)) | |
271 | 267 | then { | |
272 | 268 | let checkProgramName = if ((getBoolean(keyProgramName(programName)) == unit)) | |
273 | 269 | then true | |
274 | 270 | else throwErr("program name already exists") | |
275 | 271 | if ((checkProgramName == checkProgramName)) | |
276 | 272 | then { | |
277 | 273 | let programNameIsValid = if (!(contains(programName, separator))) | |
278 | 274 | then !(contains(programName, " ")) | |
279 | 275 | else false | |
280 | 276 | let checkProgramExists = if (programNameIsValid) | |
281 | 277 | then true | |
282 | 278 | else throwErr("invalid program name") | |
283 | 279 | if ((checkProgramExists == checkProgramExists)) | |
284 | 280 | then { | |
285 | 281 | let checkRewardAsset = if ((assetInfo(fromBase58String(rewardAssetId)) != unit)) | |
286 | 282 | then true | |
287 | 283 | else throwErr("invalid reward asset id") | |
288 | 284 | if ((checkRewardAsset == checkRewardAsset)) | |
289 | 285 | then $Tuple2([BooleanEntry(keyProgramName(programName), true), StringEntry(keyTreasuryContract(programName), treasuryContract), StringEntry(keyImplementationContract(programName), implementationContract), StringEntry(keyRewardAssetId(programName), rewardAssetId), IntegerEntry(keyRewardsTotal(programName), 0)], unit) | |
290 | 286 | else throw("Strict value is not equal to itself.") | |
291 | 287 | } | |
292 | 288 | else throw("Strict value is not equal to itself.") | |
293 | 289 | } | |
294 | 290 | else throw("Strict value is not equal to itself.") | |
295 | 291 | } | |
296 | 292 | else throw("Strict value is not equal to itself.") | |
297 | 293 | } | |
298 | 294 | ||
299 | 295 | ||
300 | 296 | ||
301 | 297 | @Callable(i) | |
302 | 298 | func createPair (programName,referrerAddress,referralAddress,signature) = { | |
303 | 299 | let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false)) | |
304 | 300 | then true | |
305 | 301 | else throwErr("program does not exist") | |
306 | 302 | if ((checkProgramExists == checkProgramExists)) | |
307 | 303 | then { | |
308 | 304 | let pairReferrerToReferralExistCheck = if ((getBoolean(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress)) == unit)) | |
309 | 305 | then true | |
310 | 306 | else throwErr("pair already exists") | |
311 | 307 | if ((pairReferrerToReferralExistCheck == pairReferrerToReferralExistCheck)) | |
312 | 308 | then { | |
313 | 309 | let noRefSelf = if ((referrerAddress != referralAddress)) | |
314 | 310 | then true | |
315 | 311 | else throwErr("cannot refer to self") | |
316 | 312 | if ((noRefSelf == noRefSelf)) | |
317 | 313 | then { | |
318 | 314 | let pair = toBytes(makeString([programName, referrerAddress, referralAddress], ":")) | |
319 | 315 | let backendPublicKey = fromBase58String(value(getString(keyBackendPublicKey))) | |
320 | 316 | let validateSignature = if (sigVerify(pair, signature, backendPublicKey)) | |
321 | 317 | then true | |
322 | 318 | else throwErr("bad signature") | |
323 | 319 | if ((validateSignature == validateSignature)) | |
324 | 320 | then { | |
325 | 321 | let totalReferralCount = valueOrElse(getInteger(keyTotalReferralCount(programName, referrerAddress)), 0) | |
326 | 322 | let newTotalReferralCount = (totalReferralCount + 1) | |
327 | 323 | let updatedAllReferrerPrograms = updateAllReferralPrograms(referrerAddress, programName) | |
328 | 324 | let updatedAllReferralPrograms = updateAllReferralPrograms(referralAddress, programName) | |
329 | 325 | $Tuple2((([BooleanEntry(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress), true), IntegerEntry(keyTotalReferralCount(programName, referrerAddress), newTotalReferralCount), StringEntry(keyReferrer(programName, referralAddress), referrerAddress)] ++ updatedAllReferrerPrograms) ++ updatedAllReferralPrograms), unit) | |
330 | 326 | } | |
331 | 327 | else throw("Strict value is not equal to itself.") | |
332 | 328 | } | |
333 | 329 | else throw("Strict value is not equal to itself.") | |
334 | 330 | } | |
335 | 331 | else throw("Strict value is not equal to itself.") | |
336 | 332 | } | |
337 | 333 | else throw("Strict value is not equal to itself.") | |
338 | 334 | } | |
339 | 335 | ||
340 | 336 | ||
341 | 337 | ||
342 | 338 | @Callable(i) | |
343 | 339 | func updateReferralActivity (programName,referralAddress,isActive) = { | |
344 | 340 | let implementationContract = value(getString(keyImplementationContract(programName))) | |
345 | 341 | let isReferralActive = (getBoolean(keyIsReferralActive(programName, referralAddress)) != unit) | |
346 | 342 | let referrerAddress = value(getString(keyReferrer(programName, referralAddress))) | |
347 | 343 | let checkCaller = if ((toString(i.caller) == implementationContract)) | |
348 | 344 | then true | |
349 | 345 | else throwErr("permission denied") | |
350 | 346 | if ((checkCaller == checkCaller)) | |
351 | 347 | then { | |
352 | 348 | let update = if ((isReferralActive == isActive)) | |
353 | 349 | then $Tuple2(nil, unit) | |
354 | 350 | else { | |
355 | 351 | let update = if ((isActive == true)) | |
356 | 352 | then { | |
357 | 353 | let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) + 1) | |
358 | 354 | $Tuple2([BooleanEntry(keyIsReferralActive(programName, referralAddress), true), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit) | |
359 | 355 | } | |
360 | 356 | else { | |
361 | 357 | let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) - 1) | |
362 | 358 | $Tuple2([DeleteEntry(keyIsReferralActive(programName, referralAddress)), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit) | |
363 | 359 | } | |
364 | 360 | update | |
365 | 361 | } | |
366 | 362 | update | |
367 | 363 | } | |
368 | 364 | else throw("Strict value is not equal to itself.") | |
369 | 365 | } | |
370 | 366 | ||
371 | 367 | ||
372 | 368 | ||
373 | 369 | @Callable(i) | |
374 | 370 | func incUnclaimed (programName,referralAddress,referrerReward,referralReward) = { | |
375 | 371 | let implementationContract = value(getString(keyImplementationContract(programName))) | |
376 | 372 | let referrerAddress = value(getString(keyReferrer(programName, referralAddress))) | |
377 | 373 | let checkCaller = if ((toString(i.caller) == implementationContract)) | |
378 | 374 | then true | |
379 | 375 | else throwErr("permission denied") | |
380 | 376 | if ((checkCaller == checkCaller)) | |
381 | 377 | then { | |
382 | 378 | let checkProgram = if ((programName == "wxlock")) | |
383 | 379 | then true | |
384 | 380 | else throwErr("invalid program") | |
385 | 381 | if ((checkProgram == checkProgram)) | |
386 | 382 | then { | |
387 | 383 | let checkReferrerInProgram = if (contains(valueOrElse(getString(keyAllReferralPrograms(referrerAddress)), ""), programName)) | |
388 | 384 | then true | |
389 | 385 | else throwErr(((("referrer not in program=" + programName) + " addr=") + referrerAddress)) | |
390 | 386 | if ((checkReferrerInProgram == checkReferrerInProgram)) | |
391 | 387 | then { | |
392 | 388 | let checkReferralInProgram = if (contains(valueOrElse(getString(keyAllReferralPrograms(referralAddress)), ""), programName)) | |
393 | 389 | then true | |
394 | 390 | else throwErr(((("referral not in program=" + programName) + " addr=") + referralAddress)) | |
395 | 391 | if ((checkReferralInProgram == checkReferralInProgram)) | |
396 | 392 | then { | |
397 | 393 | let unclaimedTotalReferrer = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0) | |
398 | 394 | let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0) | |
399 | 395 | let unclaimedTotalReferral = valueOrElse(getInteger(keyUnclaimedTotalAddress(referralAddress)), 0) | |
400 | 396 | let referralUnclaimed = valueOrElse(getInteger(keyUnclaimedReferral(programName, referralAddress)), 0) | |
401 | 397 | let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0) | |
402 | 398 | let newUnclaimedTotalReferrer = (unclaimedTotalReferrer + referrerReward) | |
403 | 399 | let newReferrerUnclaimed = (referrerUnclaimed + referrerReward) | |
404 | 400 | let newUnclaimedTotalReferral = (unclaimedTotalReferral + referralReward) | |
405 | 401 | let newReferralUnclaimed = (referralUnclaimed + referralReward) | |
406 | 402 | $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) | |
407 | 403 | } | |
408 | 404 | else throw("Strict value is not equal to itself.") | |
409 | 405 | } | |
410 | 406 | else throw("Strict value is not equal to itself.") | |
411 | 407 | } | |
412 | 408 | else throw("Strict value is not equal to itself.") | |
413 | 409 | } | |
414 | 410 | else throw("Strict value is not equal to itself.") | |
415 | 411 | } | |
416 | 412 | ||
417 | 413 | ||
418 | 414 | ||
419 | 415 | @Callable(i) | |
420 | 416 | func incUnclaimedWithPayment (programName,referrerAddresses) = { | |
421 | 417 | let checkProgram = if ((programName == "wxSpotFee")) | |
422 | 418 | then true | |
423 | 419 | else throwErr("invalid program") | |
424 | 420 | if ((checkProgram == checkProgram)) | |
425 | 421 | then { | |
426 | 422 | func map (accum,next) = { | |
427 | 423 | let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName)))) | |
428 | 424 | let amountCheck = if (assetIdCheck) | |
429 | 425 | then true | |
430 | 426 | else throwErr("invalid asset id") | |
431 | 427 | if ((amountCheck == amountCheck)) | |
432 | 428 | then (accum :+ next.amount) | |
433 | 429 | else throw("Strict value is not equal to itself.") | |
434 | 430 | } | |
435 | 431 | ||
436 | 432 | let payments = { | |
437 | 433 | let $l = i.payments | |
438 | 434 | let $s = size($l) | |
439 | 435 | let $acc0 = nil | |
440 | 436 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
441 | 437 | then $a | |
442 | 438 | else map($a, $l[$i]) | |
443 | 439 | ||
444 | 440 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
445 | 441 | then $a | |
446 | 442 | else throw("List size exceeds 10") | |
447 | 443 | ||
448 | 444 | $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 | 445 | } | |
450 | 446 | let resAmount = { | |
451 | 447 | let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil) | |
452 | 448 | if ($isInstanceOf(@, "Int")) | |
453 | 449 | then @ | |
454 | 450 | else throw(($getType(@) + " couldn't be cast to Int")) | |
455 | 451 | } | |
456 | 452 | if ((resAmount == resAmount)) | |
457 | 453 | then { | |
458 | 454 | let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName)))) | |
459 | 455 | let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName)))) | |
460 | 456 | [ScriptTransfer(treasuryContract, resAmount, rewardAssetId)] | |
461 | 457 | } | |
462 | 458 | else throw("Strict value is not equal to itself.") | |
463 | 459 | } | |
464 | 460 | else throw("Strict value is not equal to itself.") | |
465 | 461 | } | |
466 | 462 | ||
467 | 463 | ||
468 | 464 | ||
469 | 465 | @Callable(i) | |
470 | 466 | func claim (programName) = { | |
471 | 467 | let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false)) | |
472 | 468 | then true | |
473 | 469 | else throwErr("program does not exist") | |
474 | 470 | if ((checkProgramExists == checkProgramExists)) | |
475 | 471 | then { | |
476 | 472 | let isImplementationContract = (toString(i.caller) == value(getString(keyImplementationContract(programName)))) | |
477 | 473 | let claimerAddress = if (isImplementationContract) | |
478 | 474 | then toString(i.originCaller) | |
479 | 475 | else toString(i.caller) | |
480 | 476 | let claimInternal = invoke(this, "claimInternal", [programName, claimerAddress, isImplementationContract], nil) | |
481 | 477 | if ((claimInternal == claimInternal)) | |
482 | 478 | then $Tuple2(nil, claimInternal) | |
483 | 479 | else throw("Strict value is not equal to itself.") | |
484 | 480 | } | |
485 | 481 | else throw("Strict value is not equal to itself.") | |
486 | 482 | } | |
487 | 483 | ||
488 | 484 | ||
489 | 485 | ||
490 | 486 | @Callable(i) | |
491 | 487 | func claimBulk () = { | |
492 | 488 | let callerAddress = toString(i.caller) | |
493 | 489 | let callerProgramsStr = getString(keyAllReferralPrograms(toString(i.caller))) | |
494 | 490 | let programsExists = if (isDefined(callerProgramsStr)) | |
495 | 491 | then true | |
496 | 492 | else throwErr("no referral programs") | |
497 | 493 | if ((programsExists == programsExists)) | |
498 | 494 | then { | |
499 | 495 | let callerPrograms = split(value(callerProgramsStr), "__") | |
500 | 496 | let bulkClaim = invoke(this, "claimBulkInternal", [callerAddress, callerPrograms, 0], nil) | |
501 | 497 | if ((bulkClaim == bulkClaim)) | |
502 | 498 | then $Tuple2(nil, bulkClaim) | |
503 | 499 | else throw("Strict value is not equal to itself.") | |
504 | 500 | } | |
505 | 501 | else throw("Strict value is not equal to itself.") | |
506 | 502 | } | |
507 | 503 | ||
508 | 504 | ||
509 | 505 | ||
510 | 506 | @Callable(i) | |
511 | 507 | func claimREADONLY (programName,userAddress) = { | |
512 | 508 | let claimerClaimed = valueOrElse(getInteger(keyClaimedReferrer(programName, userAddress)), 0) | |
513 | 509 | let claimerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, userAddress)), 0) | |
514 | 510 | $Tuple2(nil, [claimerUnclaimed, claimerClaimed]) | |
515 | 511 | } | |
516 | 512 | ||
517 | 513 | ||
518 | 514 | ||
519 | 515 | @Callable(i) | |
520 | 516 | func claimBulkREADONLY (claimer) = { | |
521 | 517 | let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimer)), 0) | |
522 | 518 | let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimer)), 0) | |
523 | 519 | $Tuple2(nil, [unclaimedTotalAddress, claimedTotalAddress]) | |
524 | 520 | } | |
525 | 521 | ||
526 | 522 | ||
527 | 523 | ||
528 | 524 | @Callable(i) | |
529 | 525 | func setTotalKeys (programName,address) = { | |
530 | 526 | let claimedReferrer = valueOrElse(getInteger(keyClaimedReferrer(programName, address)), 0) | |
531 | 527 | let claimedReferral = valueOrElse(getInteger(keyClaimedReferral(programName, address)), 0) | |
532 | 528 | let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, address)), 0) | |
533 | 529 | let unclaimedReferral = valueOrElse(getInteger(keyUnclaimedReferral(programName, address)), 0) | |
534 | 530 | let claimedTotalAddress = (claimedReferrer + claimedReferral) | |
535 | 531 | let unclaimedTotalAddress = (unclaimedReferrer + unclaimedReferral) | |
536 | 532 | $Tuple2([IntegerEntry(keyClaimedTotalAddress(address), claimedTotalAddress), IntegerEntry(keyUnclaimedTotalAddress(address), unclaimedTotalAddress)], unit) | |
537 | 533 | } | |
538 | 534 | ||
539 | 535 | ||
540 | - | ||
541 | - | @Callable(i) | |
542 | - | func setManager (pendingManagerPublicKey) = { | |
543 | - | let checkCaller = mustManager(i) | |
544 | - | if ((checkCaller == checkCaller)) | |
545 | - | then { | |
546 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
547 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
548 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
549 | - | else throw("Strict value is not equal to itself.") | |
550 | - | } | |
551 | - | else throw("Strict value is not equal to itself.") | |
552 | - | } | |
553 | - | ||
554 | - | ||
555 | - | ||
556 | - | @Callable(i) | |
557 | - | func confirmManager () = { | |
558 | - | let pm = pendingManagerPublicKeyOrUnit() | |
559 | - | let hasPM = if (isDefined(pm)) | |
560 | - | then true | |
561 | - | else throwErr("no pending manager") | |
562 | - | if ((hasPM == hasPM)) | |
563 | - | then { | |
564 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
565 | - | then true | |
566 | - | else throwErr("you are not pending manager") | |
567 | - | if ((checkPM == checkPM)) | |
568 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
569 | - | else throw("Strict value is not equal to itself.") | |
570 | - | } | |
571 | - | else throw("Strict value is not equal to itself.") | |
572 | - | } | |
573 | - | ||
574 | - | ||
575 | 536 | @Verifier(tx) | |
576 | 537 | func verify () = { | |
577 | 538 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
578 | 539 | case pk: ByteVector => | |
579 | 540 | pk | |
580 | 541 | case _: Unit => | |
581 | 542 | tx.senderPublicKey | |
582 | 543 | case _ => | |
583 | 544 | throw("Match error") | |
584 | 545 | } | |
585 | 546 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
586 | 547 | } | |
587 | 548 |
github/deemru/w8io/169f3d6 73.32 ms ◑